ControlInput
Bases: BaseModel
A Pydantic model representing the input control parameters for an operation, typically involving image processing.
This model includes parameters such as the operation mode, the image to be processed, an alternative raw image, and a strength parameter. It validates these parameters to ensure they meet specific criteria, such as the mode being one of the predefined valid modes and ensuring that both 'image' and 'image_raw' are not provided simultaneously.
Attributes:
Name | Type | Description |
---|---|---|
mode |
str
|
The operation mode, which must be one of the predefined valid modes. |
image |
LazyLoadingImage
|
An instance of LazyLoadingImage to be processed. Defaults to None. |
image_raw |
LazyLoadingImage
|
An alternative raw image instance of LazyLoadingImage. Defaults to None. |
strength |
float
|
A float value representing the strength of the operation, must be between 0 and 1000 (inclusive). Defaults to 1. |
Methods:
Name | Description |
---|---|
image_raw_validate |
Validates that either 'image' or 'image_raw' is provided, but not both. |
mode_validate |
Validates that the 'mode' attribute is one of the predefined valid modes in the configuration. |
Raises:
Type | Description |
---|---|
ValueError
|
Raised if both 'image' and 'image_raw' are specified, or if the 'mode' is not a valid mode. |