# Presets

## Create

`models.presets.create(strmodel_id, PresetCreateParams**kwargs)  -> PresetCreateResponse`

**post** `/models/{modelId}/presets`

Create a new preset for the given `modelId`

### Parameters

- `model_id: str`

- `inference_id: str`

  The inference ID used to generate new images

- `original_assets: Optional[bool]`

  If set to true, returns the original asset without transformation

- `project_id: Optional[str]`

  The projectId used for ownership resource management. Either to assert ownership or to set the owner of the resource(s)

- `is_default: Optional[bool]`

  Whether this preset should be the default preset for the model

### Returns

- `class PresetCreateResponse: …`

  - `preset: Preset`

    - `id: str`

      The preset ID (example: "eyVcnFJcR92BxBkz7N6g5w")

    - `author_id: str`

      The author user ID (example: "VFhihHKMRZyDDnZAJwLb2Q")

    - `created_at: str`

      The preset creation date as an ISO string (example: "2023-02-03T11:19:41.579Z")

    - `is_default: bool`

      Whether the preset is the default preset of the model (example: true)

    - `model_id: str`

      The model ID (example: "eyVcnFJcR92BxBkz7N6g5w")

    - `owner_id: str`

      The owner ID (example: "VFhihHKMRZyDDnZAJwLb2Q")

    - `parameters: PresetParameters`

      The inference parameters

      - `prompt: str`

        Full text prompt including the model placeholder. (example: "an illustration of phoenix in a fantasy world, flying over a mountain, 8k, bokeh effect")

      - `type: Literal["controlnet", "controlnet_img2img", "controlnet_inpaint", 15 more]`

        The type of inference to use. Example: txt2img, img2img, etc.

        Selecting the right type will condition the expected parameters.

        Note: for inpainting with models that support multiple base models, Scenario determines the best available `baseModel` for a given `modelId`.

        - `"controlnet"`

        - `"controlnet_img2img"`

        - `"controlnet_inpaint"`

        - `"controlnet_inpaint_ip_adapter"`

        - `"controlnet_ip_adapter"`

        - `"controlnet_reference"`

        - `"controlnet_texture"`

        - `"img2img"`

        - `"img2img_ip_adapter"`

        - `"img2img_texture"`

        - `"inpaint"`

        - `"inpaint_ip_adapter"`

        - `"outpaint"`

        - `"reference"`

        - `"reference_texture"`

        - `"txt2img"`

        - `"txt2img_ip_adapter"`

        - `"txt2img_texture"`

      - `aspect_ratio: Optional[Literal["16:9", "1:1", "21:9", 8 more]]`

        The aspect ratio of the generated images. Only used for the model flux.1.1-pro-ultra.
        The aspect ratio is a string formatted as "width:height" (example: "16:9").

        - `"16:9"`

        - `"1:1"`

        - `"21:9"`

        - `"2:3"`

        - `"3:2"`

        - `"3:4"`

        - `"4:3"`

        - `"4:5"`

        - `"5:4"`

        - `"9:16"`

        - `"9:21"`

      - `base_model_id: Optional[str]`

        The base model to use for the inference. Only Flux LoRA models can use this parameter.
        Allowed values are available in the model's attribute: `compliantModelIds`

      - `concepts: Optional[List[PresetParametersConcept]]`

        - `model_id: str`

          The model ID (example: "model_eyVcnFJcR92BxBkz7N6g5w")

        - `scale: float`

          The scale of the model (example: 1.0)
          For Flux Kontext Prompt Editing, the scale is between 0 and 2.

        - `model_epoch: Optional[str]`

          The epoch of the model (example: "000001")
          Only available for Flux Lora Trained models

      - `control_end: Optional[float]`

        Specifies how long the ControlNet guidance should be applied during the inference process.

        Only available for Flux.1-dev based models.

        The value represents the percentage of total inference steps where the ControlNet guidance is active.
        For example:

        - 1.0: ControlNet guidance is applied during all inference steps
        - 0.5: ControlNet guidance is only applied during the first half of inference steps

        Default values:

        - 0.5 for Canny modality
        - 0.6 for all other modalities

      - `control_image: Optional[str]`

        Signed URL to display the controlnet input image

      - `control_image_id: Optional[str]`

        Asset id of the controlnet input image

      - `control_start: Optional[float]`

        Specifies the starting point of the ControlNet guidance during the inference process.

        Only available for Flux.1-dev based models.

        The value represents the percentage of total inference steps where the ControlNet guidance starts.
        For example:

        - 0.0: ControlNet guidance starts at the beginning of the inference steps
        - 0.5: ControlNet guidance starts at the middle of the inference steps

      - `disable_merging: Optional[bool]`

        If set to true, the entire input image will likely change during inpainting. This results in faster inferences, but the output image will be harder to integrate if the input is just a small part of a larger image.

      - `disable_modality_detection: Optional[bool]`

        If false, the process uses the given image to detect the modality.
        If true (default), the process will not try to detect the modality of the given image.

        For example:
        with `pose` modality and `false` value, the process will detect the pose of people in the given image
        with `depth` modality and `false` value, the process will detect the depth of the given image
        with `scribble` modality and `true`value, the process will use the given image as a scribble

        ⚠️ For models of the FLUX schnell or dev families, this parameter is ignored. The modality detection is always disabled. ⚠️

      - `guidance: Optional[float]`

        Controls how closely the generated image follows the prompt. Higher values result in stronger adherence to the prompt. Default and allowed values depend on the model type:

        - For Flux dev models, the default is 3.5 and allowed values are within [0, 10]
        - For Flux pro models, the default is 3 and allowed values are within [2, 5]

      - `height: Optional[float]`

        The height of the generated images, must be a 8 multiple (within [64, 2048], default: 512)
        If model.type is `flux.1.1-pro-ultra`, you can use the aspectRatio parameter instead

      - `hide_results: Optional[bool]`

        If set, generated assets will be hidden and not returned in the list of images of the inference
        or when listing assets (default: false)

      - `image: Optional[str]`

        Signed URL to display the input image

      - `image_id: Optional[str]`

        Asset id of the input image

      - `intermediate_images: Optional[bool]`

        Enable or disable the intermediate images generation (default: false)

      - `ip_adapter_image: Optional[str]`

        Signed URL to display the IpAdapter image

      - `ip_adapter_image_id: Optional[str]`

        Asset id of the input IpAdapter image

      - `ip_adapter_image_ids: Optional[List[str]]`

        Asset id of the input IpAdapter images

      - `ip_adapter_images: Optional[List[str]]`

        Signed URL to display the IpAdapter images

      - `ip_adapter_scale: Optional[float]`

        IpAdapter scale factor (within [0.0, 1.0], default: 0.9).

      - `ip_adapter_scales: Optional[List[float]]`

        IpAdapter scale factors (within [0.0, 1.0], default: 0.9).

      - `ip_adapter_type: Optional[Literal["character", "style"]]`

        The type of IP Adapter model to use. Must be one of [`style`, `character`], default to `style``

        - `"character"`

        - `"style"`

      - `mask: Optional[str]`

        Signed URL to display the mask image

      - `mask_id: Optional[str]`

        Asset id of the mask image

      - `modality: Optional[str]`

        The modality associated with the control image used for the generation: it can either be an object with a combination of maximum

        For models of the FLUX schnell or dev families:

        - one modality from: `canny`, `tile`, `depth`, `blur`, `pose`, `gray`, `low-quality`

        Optionally, you can associate a value to these modalities or presets. The value must be within `]0.0, 1.0]`.

        Examples:

        - `canny`
        - `depth:0.5,pose:1.0`
        - `canny:0.5,depth:0.5,lines:0.3`
        - `landscape`
        - `character:0.5`
        - `illusion:1`

        Note: if you use a value that is not supported by the model family, this will result in an error.

      - `model_epoch: Optional[str]`

        The epoch of the model to use for the inference. Only available for Flux Lora Trained models.

      - `negative_prompt: Optional[str]`

        The prompt not to guide the image generation, ignored when guidance < 1 (example: "((ugly face))")
        For Flux based model (not Fast-Flux): requires negativePromptStrength > 0 and active only for inference types txt2img / img2img / controlnet.

      - `negative_prompt_strength: Optional[float]`

        Only applicable for flux-dev based models for `txt2img`, `img2img`, and `controlnet` inference types.

        Controls the influence of the negative prompt. Default 0 means the negative prompt has no effect. Higher values increase negative prompt influence.
        Must be > 0 if negativePrompt is provided.

      - `num_inference_steps: Optional[float]`

        The number of denoising steps for each image generation (within [1, 150], default: 30)

      - `num_samples: Optional[float]`

        The number of images to generate (within [1, 128], default: 4)

      - `reference_adain: Optional[bool]`

        Whether to use reference adain
        Only for "reference" inference type

      - `reference_attn: Optional[bool]`

        Whether to use reference query for self attention's context
        Only for "reference" inference type

      - `scheduler: Optional[Literal["DDIMScheduler", "DDPMScheduler", "DEISMultistepScheduler", 12 more]]`

        The scheduler to use to override the default configured for the model. See detailed documentation for more details.

        - `"DDIMScheduler"`

        - `"DDPMScheduler"`

        - `"DEISMultistepScheduler"`

        - `"DPMSolverMultistepScheduler"`

        - `"DPMSolverSinglestepScheduler"`

        - `"EulerAncestralDiscreteScheduler"`

        - `"EulerDiscreteScheduler"`

        - `"HeunDiscreteScheduler"`

        - `"KDPM2AncestralDiscreteScheduler"`

        - `"KDPM2DiscreteScheduler"`

        - `"LCMScheduler"`

        - `"LMSDiscreteScheduler"`

        - `"PNDMScheduler"`

        - `"TCDScheduler"`

        - `"UniPCMultistepScheduler"`

      - `seed: Optional[str]`

        Used to reproduce previous results. Default: randomly generated number.

      - `strength: Optional[float]`

        Controls the noise intensity introduced to the input image, where a value of 1.0 completely erases the original image's details. Available for img2img and inpainting. (within [0.01, 1.0], default: 0.75)

      - `style_fidelity: Optional[float]`

        If style_fidelity=1.0, control more important, else if style_fidelity=0.0, prompt more important, else balanced
        Only for "reference" inference type

      - `width: Optional[float]`

        The width of the generated images, must be a 8 multiple (within [64, 2048], default: 512)
        If model.type is `flux.1.1-pro-ultra`, you can use the aspectRatio parameter instead

    - `updated_at: str`

      The preset last update date as an ISO string (example: "2023-02-03T11:19:41.579Z")

### Example

```python
import os
from scenario_sdk import Scenario

client = Scenario(
    api_key=os.environ.get("SCENARIO_SDK_API_KEY"),  # This is the default and can be omitted
    api_secret=os.environ.get("SCENARIO_SDK_API_SECRET"),  # This is the default and can be omitted
)
preset = client.models.presets.create(
    model_id="modelId",
    inference_id="inferenceId",
)
print(preset.preset)
```

#### Response

```json
{
  "preset": {
    "id": "id",
    "authorId": "authorId",
    "createdAt": "createdAt",
    "isDefault": true,
    "modelId": "modelId",
    "ownerId": "ownerId",
    "parameters": {
      "prompt": "prompt",
      "type": "controlnet",
      "aspectRatio": "16:9",
      "baseModelId": "baseModelId",
      "concepts": [
        {
          "modelId": "modelId",
          "scale": -2,
          "modelEpoch": "modelEpoch"
        }
      ],
      "controlEnd": 0.1,
      "controlImage": "controlImage",
      "controlImageId": "controlImageId",
      "controlStart": 0,
      "disableMerging": true,
      "disableModalityDetection": true,
      "guidance": 0,
      "height": 64,
      "hideResults": true,
      "image": "image",
      "imageId": "imageId",
      "intermediateImages": true,
      "ipAdapterImage": "ipAdapterImage",
      "ipAdapterImageId": "ipAdapterImageId",
      "ipAdapterImageIds": [
        "string"
      ],
      "ipAdapterImages": [
        "string"
      ],
      "ipAdapterScale": 0,
      "ipAdapterScales": [
        0
      ],
      "ipAdapterType": "character",
      "mask": "mask",
      "maskId": "maskId",
      "modality": "modality",
      "modelEpoch": "modelEpoch",
      "negativePrompt": "negativePrompt",
      "negativePromptStrength": 0,
      "numInferenceSteps": 1,
      "numSamples": 1,
      "referenceAdain": true,
      "referenceAttn": true,
      "scheduler": "DDIMScheduler",
      "seed": "seed",
      "strength": 0.01,
      "styleFidelity": 0,
      "width": 64
    },
    "updatedAt": "updatedAt"
  }
}
```

## Delete

`models.presets.delete(strpreset_id, PresetDeleteParams**kwargs)  -> object`

**delete** `/models/{modelId}/presets/{presetId}`

Delete a preset for the given `modelId`

### Parameters

- `model_id: str`

- `preset_id: str`

- `project_id: Optional[str]`

  The projectId used for ownership resource management. Either to assert ownership or to set the owner of the resource(s)

### Returns

- `object`

### Example

```python
import os
from scenario_sdk import Scenario

client = Scenario(
    api_key=os.environ.get("SCENARIO_SDK_API_KEY"),  # This is the default and can be omitted
    api_secret=os.environ.get("SCENARIO_SDK_API_SECRET"),  # This is the default and can be omitted
)
preset = client.models.presets.delete(
    preset_id="presetId",
    model_id="modelId",
)
print(preset)
```

#### Response

```json
{}
```

## List

`models.presets.list(strmodel_id, PresetListParams**kwargs)  -> PresetListResponse`

**get** `/models/{modelId}/presets`

List all presets for the given `modelId`

### Parameters

- `model_id: str`

- `original_assets: Optional[bool]`

  If set to true, returns the original asset without transformation

- `project_id: Optional[str]`

  The projectId used for ownership resource management. Either to assert ownership or to set the owner of the resource(s)

### Returns

- `class PresetListResponse: …`

  - `presets: List[Preset]`

    - `id: str`

      The preset ID (example: "eyVcnFJcR92BxBkz7N6g5w")

    - `author_id: str`

      The author user ID (example: "VFhihHKMRZyDDnZAJwLb2Q")

    - `created_at: str`

      The preset creation date as an ISO string (example: "2023-02-03T11:19:41.579Z")

    - `is_default: bool`

      Whether the preset is the default preset of the model (example: true)

    - `model_id: str`

      The model ID (example: "eyVcnFJcR92BxBkz7N6g5w")

    - `owner_id: str`

      The owner ID (example: "VFhihHKMRZyDDnZAJwLb2Q")

    - `parameters: PresetParameters`

      The inference parameters

      - `prompt: str`

        Full text prompt including the model placeholder. (example: "an illustration of phoenix in a fantasy world, flying over a mountain, 8k, bokeh effect")

      - `type: Literal["controlnet", "controlnet_img2img", "controlnet_inpaint", 15 more]`

        The type of inference to use. Example: txt2img, img2img, etc.

        Selecting the right type will condition the expected parameters.

        Note: for inpainting with models that support multiple base models, Scenario determines the best available `baseModel` for a given `modelId`.

        - `"controlnet"`

        - `"controlnet_img2img"`

        - `"controlnet_inpaint"`

        - `"controlnet_inpaint_ip_adapter"`

        - `"controlnet_ip_adapter"`

        - `"controlnet_reference"`

        - `"controlnet_texture"`

        - `"img2img"`

        - `"img2img_ip_adapter"`

        - `"img2img_texture"`

        - `"inpaint"`

        - `"inpaint_ip_adapter"`

        - `"outpaint"`

        - `"reference"`

        - `"reference_texture"`

        - `"txt2img"`

        - `"txt2img_ip_adapter"`

        - `"txt2img_texture"`

      - `aspect_ratio: Optional[Literal["16:9", "1:1", "21:9", 8 more]]`

        The aspect ratio of the generated images. Only used for the model flux.1.1-pro-ultra.
        The aspect ratio is a string formatted as "width:height" (example: "16:9").

        - `"16:9"`

        - `"1:1"`

        - `"21:9"`

        - `"2:3"`

        - `"3:2"`

        - `"3:4"`

        - `"4:3"`

        - `"4:5"`

        - `"5:4"`

        - `"9:16"`

        - `"9:21"`

      - `base_model_id: Optional[str]`

        The base model to use for the inference. Only Flux LoRA models can use this parameter.
        Allowed values are available in the model's attribute: `compliantModelIds`

      - `concepts: Optional[List[PresetParametersConcept]]`

        - `model_id: str`

          The model ID (example: "model_eyVcnFJcR92BxBkz7N6g5w")

        - `scale: float`

          The scale of the model (example: 1.0)
          For Flux Kontext Prompt Editing, the scale is between 0 and 2.

        - `model_epoch: Optional[str]`

          The epoch of the model (example: "000001")
          Only available for Flux Lora Trained models

      - `control_end: Optional[float]`

        Specifies how long the ControlNet guidance should be applied during the inference process.

        Only available for Flux.1-dev based models.

        The value represents the percentage of total inference steps where the ControlNet guidance is active.
        For example:

        - 1.0: ControlNet guidance is applied during all inference steps
        - 0.5: ControlNet guidance is only applied during the first half of inference steps

        Default values:

        - 0.5 for Canny modality
        - 0.6 for all other modalities

      - `control_image: Optional[str]`

        Signed URL to display the controlnet input image

      - `control_image_id: Optional[str]`

        Asset id of the controlnet input image

      - `control_start: Optional[float]`

        Specifies the starting point of the ControlNet guidance during the inference process.

        Only available for Flux.1-dev based models.

        The value represents the percentage of total inference steps where the ControlNet guidance starts.
        For example:

        - 0.0: ControlNet guidance starts at the beginning of the inference steps
        - 0.5: ControlNet guidance starts at the middle of the inference steps

      - `disable_merging: Optional[bool]`

        If set to true, the entire input image will likely change during inpainting. This results in faster inferences, but the output image will be harder to integrate if the input is just a small part of a larger image.

      - `disable_modality_detection: Optional[bool]`

        If false, the process uses the given image to detect the modality.
        If true (default), the process will not try to detect the modality of the given image.

        For example:
        with `pose` modality and `false` value, the process will detect the pose of people in the given image
        with `depth` modality and `false` value, the process will detect the depth of the given image
        with `scribble` modality and `true`value, the process will use the given image as a scribble

        ⚠️ For models of the FLUX schnell or dev families, this parameter is ignored. The modality detection is always disabled. ⚠️

      - `guidance: Optional[float]`

        Controls how closely the generated image follows the prompt. Higher values result in stronger adherence to the prompt. Default and allowed values depend on the model type:

        - For Flux dev models, the default is 3.5 and allowed values are within [0, 10]
        - For Flux pro models, the default is 3 and allowed values are within [2, 5]

      - `height: Optional[float]`

        The height of the generated images, must be a 8 multiple (within [64, 2048], default: 512)
        If model.type is `flux.1.1-pro-ultra`, you can use the aspectRatio parameter instead

      - `hide_results: Optional[bool]`

        If set, generated assets will be hidden and not returned in the list of images of the inference
        or when listing assets (default: false)

      - `image: Optional[str]`

        Signed URL to display the input image

      - `image_id: Optional[str]`

        Asset id of the input image

      - `intermediate_images: Optional[bool]`

        Enable or disable the intermediate images generation (default: false)

      - `ip_adapter_image: Optional[str]`

        Signed URL to display the IpAdapter image

      - `ip_adapter_image_id: Optional[str]`

        Asset id of the input IpAdapter image

      - `ip_adapter_image_ids: Optional[List[str]]`

        Asset id of the input IpAdapter images

      - `ip_adapter_images: Optional[List[str]]`

        Signed URL to display the IpAdapter images

      - `ip_adapter_scale: Optional[float]`

        IpAdapter scale factor (within [0.0, 1.0], default: 0.9).

      - `ip_adapter_scales: Optional[List[float]]`

        IpAdapter scale factors (within [0.0, 1.0], default: 0.9).

      - `ip_adapter_type: Optional[Literal["character", "style"]]`

        The type of IP Adapter model to use. Must be one of [`style`, `character`], default to `style``

        - `"character"`

        - `"style"`

      - `mask: Optional[str]`

        Signed URL to display the mask image

      - `mask_id: Optional[str]`

        Asset id of the mask image

      - `modality: Optional[str]`

        The modality associated with the control image used for the generation: it can either be an object with a combination of maximum

        For models of the FLUX schnell or dev families:

        - one modality from: `canny`, `tile`, `depth`, `blur`, `pose`, `gray`, `low-quality`

        Optionally, you can associate a value to these modalities or presets. The value must be within `]0.0, 1.0]`.

        Examples:

        - `canny`
        - `depth:0.5,pose:1.0`
        - `canny:0.5,depth:0.5,lines:0.3`
        - `landscape`
        - `character:0.5`
        - `illusion:1`

        Note: if you use a value that is not supported by the model family, this will result in an error.

      - `model_epoch: Optional[str]`

        The epoch of the model to use for the inference. Only available for Flux Lora Trained models.

      - `negative_prompt: Optional[str]`

        The prompt not to guide the image generation, ignored when guidance < 1 (example: "((ugly face))")
        For Flux based model (not Fast-Flux): requires negativePromptStrength > 0 and active only for inference types txt2img / img2img / controlnet.

      - `negative_prompt_strength: Optional[float]`

        Only applicable for flux-dev based models for `txt2img`, `img2img`, and `controlnet` inference types.

        Controls the influence of the negative prompt. Default 0 means the negative prompt has no effect. Higher values increase negative prompt influence.
        Must be > 0 if negativePrompt is provided.

      - `num_inference_steps: Optional[float]`

        The number of denoising steps for each image generation (within [1, 150], default: 30)

      - `num_samples: Optional[float]`

        The number of images to generate (within [1, 128], default: 4)

      - `reference_adain: Optional[bool]`

        Whether to use reference adain
        Only for "reference" inference type

      - `reference_attn: Optional[bool]`

        Whether to use reference query for self attention's context
        Only for "reference" inference type

      - `scheduler: Optional[Literal["DDIMScheduler", "DDPMScheduler", "DEISMultistepScheduler", 12 more]]`

        The scheduler to use to override the default configured for the model. See detailed documentation for more details.

        - `"DDIMScheduler"`

        - `"DDPMScheduler"`

        - `"DEISMultistepScheduler"`

        - `"DPMSolverMultistepScheduler"`

        - `"DPMSolverSinglestepScheduler"`

        - `"EulerAncestralDiscreteScheduler"`

        - `"EulerDiscreteScheduler"`

        - `"HeunDiscreteScheduler"`

        - `"KDPM2AncestralDiscreteScheduler"`

        - `"KDPM2DiscreteScheduler"`

        - `"LCMScheduler"`

        - `"LMSDiscreteScheduler"`

        - `"PNDMScheduler"`

        - `"TCDScheduler"`

        - `"UniPCMultistepScheduler"`

      - `seed: Optional[str]`

        Used to reproduce previous results. Default: randomly generated number.

      - `strength: Optional[float]`

        Controls the noise intensity introduced to the input image, where a value of 1.0 completely erases the original image's details. Available for img2img and inpainting. (within [0.01, 1.0], default: 0.75)

      - `style_fidelity: Optional[float]`

        If style_fidelity=1.0, control more important, else if style_fidelity=0.0, prompt more important, else balanced
        Only for "reference" inference type

      - `width: Optional[float]`

        The width of the generated images, must be a 8 multiple (within [64, 2048], default: 512)
        If model.type is `flux.1.1-pro-ultra`, you can use the aspectRatio parameter instead

    - `updated_at: str`

      The preset last update date as an ISO string (example: "2023-02-03T11:19:41.579Z")

### Example

```python
import os
from scenario_sdk import Scenario

client = Scenario(
    api_key=os.environ.get("SCENARIO_SDK_API_KEY"),  # This is the default and can be omitted
    api_secret=os.environ.get("SCENARIO_SDK_API_SECRET"),  # This is the default and can be omitted
)
presets = client.models.presets.list(
    model_id="modelId",
)
print(presets.presets)
```

#### Response

```json
{
  "presets": [
    {
      "id": "id",
      "authorId": "authorId",
      "createdAt": "createdAt",
      "isDefault": true,
      "modelId": "modelId",
      "ownerId": "ownerId",
      "parameters": {
        "prompt": "prompt",
        "type": "controlnet",
        "aspectRatio": "16:9",
        "baseModelId": "baseModelId",
        "concepts": [
          {
            "modelId": "modelId",
            "scale": -2,
            "modelEpoch": "modelEpoch"
          }
        ],
        "controlEnd": 0.1,
        "controlImage": "controlImage",
        "controlImageId": "controlImageId",
        "controlStart": 0,
        "disableMerging": true,
        "disableModalityDetection": true,
        "guidance": 0,
        "height": 64,
        "hideResults": true,
        "image": "image",
        "imageId": "imageId",
        "intermediateImages": true,
        "ipAdapterImage": "ipAdapterImage",
        "ipAdapterImageId": "ipAdapterImageId",
        "ipAdapterImageIds": [
          "string"
        ],
        "ipAdapterImages": [
          "string"
        ],
        "ipAdapterScale": 0,
        "ipAdapterScales": [
          0
        ],
        "ipAdapterType": "character",
        "mask": "mask",
        "maskId": "maskId",
        "modality": "modality",
        "modelEpoch": "modelEpoch",
        "negativePrompt": "negativePrompt",
        "negativePromptStrength": 0,
        "numInferenceSteps": 1,
        "numSamples": 1,
        "referenceAdain": true,
        "referenceAttn": true,
        "scheduler": "DDIMScheduler",
        "seed": "seed",
        "strength": 0.01,
        "styleFidelity": 0,
        "width": 64
      },
      "updatedAt": "updatedAt"
    }
  ]
}
```

## Update

`models.presets.update(strpreset_id, PresetUpdateParams**kwargs)  -> PresetUpdateResponse`

**put** `/models/{modelId}/presets/{presetId}`

Modify the given `presetId`

### Parameters

- `model_id: str`

- `preset_id: str`

- `is_default: bool`

  Whether this preset should be the default preset for the model

- `original_assets: Optional[bool]`

  If set to true, returns the original asset without transformation

- `project_id: Optional[str]`

  The projectId used for ownership resource management. Either to assert ownership or to set the owner of the resource(s)

### Returns

- `class PresetUpdateResponse: …`

  - `preset: Preset`

    - `id: str`

      The preset ID (example: "eyVcnFJcR92BxBkz7N6g5w")

    - `author_id: str`

      The author user ID (example: "VFhihHKMRZyDDnZAJwLb2Q")

    - `created_at: str`

      The preset creation date as an ISO string (example: "2023-02-03T11:19:41.579Z")

    - `is_default: bool`

      Whether the preset is the default preset of the model (example: true)

    - `model_id: str`

      The model ID (example: "eyVcnFJcR92BxBkz7N6g5w")

    - `owner_id: str`

      The owner ID (example: "VFhihHKMRZyDDnZAJwLb2Q")

    - `parameters: PresetParameters`

      The inference parameters

      - `prompt: str`

        Full text prompt including the model placeholder. (example: "an illustration of phoenix in a fantasy world, flying over a mountain, 8k, bokeh effect")

      - `type: Literal["controlnet", "controlnet_img2img", "controlnet_inpaint", 15 more]`

        The type of inference to use. Example: txt2img, img2img, etc.

        Selecting the right type will condition the expected parameters.

        Note: for inpainting with models that support multiple base models, Scenario determines the best available `baseModel` for a given `modelId`.

        - `"controlnet"`

        - `"controlnet_img2img"`

        - `"controlnet_inpaint"`

        - `"controlnet_inpaint_ip_adapter"`

        - `"controlnet_ip_adapter"`

        - `"controlnet_reference"`

        - `"controlnet_texture"`

        - `"img2img"`

        - `"img2img_ip_adapter"`

        - `"img2img_texture"`

        - `"inpaint"`

        - `"inpaint_ip_adapter"`

        - `"outpaint"`

        - `"reference"`

        - `"reference_texture"`

        - `"txt2img"`

        - `"txt2img_ip_adapter"`

        - `"txt2img_texture"`

      - `aspect_ratio: Optional[Literal["16:9", "1:1", "21:9", 8 more]]`

        The aspect ratio of the generated images. Only used for the model flux.1.1-pro-ultra.
        The aspect ratio is a string formatted as "width:height" (example: "16:9").

        - `"16:9"`

        - `"1:1"`

        - `"21:9"`

        - `"2:3"`

        - `"3:2"`

        - `"3:4"`

        - `"4:3"`

        - `"4:5"`

        - `"5:4"`

        - `"9:16"`

        - `"9:21"`

      - `base_model_id: Optional[str]`

        The base model to use for the inference. Only Flux LoRA models can use this parameter.
        Allowed values are available in the model's attribute: `compliantModelIds`

      - `concepts: Optional[List[PresetParametersConcept]]`

        - `model_id: str`

          The model ID (example: "model_eyVcnFJcR92BxBkz7N6g5w")

        - `scale: float`

          The scale of the model (example: 1.0)
          For Flux Kontext Prompt Editing, the scale is between 0 and 2.

        - `model_epoch: Optional[str]`

          The epoch of the model (example: "000001")
          Only available for Flux Lora Trained models

      - `control_end: Optional[float]`

        Specifies how long the ControlNet guidance should be applied during the inference process.

        Only available for Flux.1-dev based models.

        The value represents the percentage of total inference steps where the ControlNet guidance is active.
        For example:

        - 1.0: ControlNet guidance is applied during all inference steps
        - 0.5: ControlNet guidance is only applied during the first half of inference steps

        Default values:

        - 0.5 for Canny modality
        - 0.6 for all other modalities

      - `control_image: Optional[str]`

        Signed URL to display the controlnet input image

      - `control_image_id: Optional[str]`

        Asset id of the controlnet input image

      - `control_start: Optional[float]`

        Specifies the starting point of the ControlNet guidance during the inference process.

        Only available for Flux.1-dev based models.

        The value represents the percentage of total inference steps where the ControlNet guidance starts.
        For example:

        - 0.0: ControlNet guidance starts at the beginning of the inference steps
        - 0.5: ControlNet guidance starts at the middle of the inference steps

      - `disable_merging: Optional[bool]`

        If set to true, the entire input image will likely change during inpainting. This results in faster inferences, but the output image will be harder to integrate if the input is just a small part of a larger image.

      - `disable_modality_detection: Optional[bool]`

        If false, the process uses the given image to detect the modality.
        If true (default), the process will not try to detect the modality of the given image.

        For example:
        with `pose` modality and `false` value, the process will detect the pose of people in the given image
        with `depth` modality and `false` value, the process will detect the depth of the given image
        with `scribble` modality and `true`value, the process will use the given image as a scribble

        ⚠️ For models of the FLUX schnell or dev families, this parameter is ignored. The modality detection is always disabled. ⚠️

      - `guidance: Optional[float]`

        Controls how closely the generated image follows the prompt. Higher values result in stronger adherence to the prompt. Default and allowed values depend on the model type:

        - For Flux dev models, the default is 3.5 and allowed values are within [0, 10]
        - For Flux pro models, the default is 3 and allowed values are within [2, 5]

      - `height: Optional[float]`

        The height of the generated images, must be a 8 multiple (within [64, 2048], default: 512)
        If model.type is `flux.1.1-pro-ultra`, you can use the aspectRatio parameter instead

      - `hide_results: Optional[bool]`

        If set, generated assets will be hidden and not returned in the list of images of the inference
        or when listing assets (default: false)

      - `image: Optional[str]`

        Signed URL to display the input image

      - `image_id: Optional[str]`

        Asset id of the input image

      - `intermediate_images: Optional[bool]`

        Enable or disable the intermediate images generation (default: false)

      - `ip_adapter_image: Optional[str]`

        Signed URL to display the IpAdapter image

      - `ip_adapter_image_id: Optional[str]`

        Asset id of the input IpAdapter image

      - `ip_adapter_image_ids: Optional[List[str]]`

        Asset id of the input IpAdapter images

      - `ip_adapter_images: Optional[List[str]]`

        Signed URL to display the IpAdapter images

      - `ip_adapter_scale: Optional[float]`

        IpAdapter scale factor (within [0.0, 1.0], default: 0.9).

      - `ip_adapter_scales: Optional[List[float]]`

        IpAdapter scale factors (within [0.0, 1.0], default: 0.9).

      - `ip_adapter_type: Optional[Literal["character", "style"]]`

        The type of IP Adapter model to use. Must be one of [`style`, `character`], default to `style``

        - `"character"`

        - `"style"`

      - `mask: Optional[str]`

        Signed URL to display the mask image

      - `mask_id: Optional[str]`

        Asset id of the mask image

      - `modality: Optional[str]`

        The modality associated with the control image used for the generation: it can either be an object with a combination of maximum

        For models of the FLUX schnell or dev families:

        - one modality from: `canny`, `tile`, `depth`, `blur`, `pose`, `gray`, `low-quality`

        Optionally, you can associate a value to these modalities or presets. The value must be within `]0.0, 1.0]`.

        Examples:

        - `canny`
        - `depth:0.5,pose:1.0`
        - `canny:0.5,depth:0.5,lines:0.3`
        - `landscape`
        - `character:0.5`
        - `illusion:1`

        Note: if you use a value that is not supported by the model family, this will result in an error.

      - `model_epoch: Optional[str]`

        The epoch of the model to use for the inference. Only available for Flux Lora Trained models.

      - `negative_prompt: Optional[str]`

        The prompt not to guide the image generation, ignored when guidance < 1 (example: "((ugly face))")
        For Flux based model (not Fast-Flux): requires negativePromptStrength > 0 and active only for inference types txt2img / img2img / controlnet.

      - `negative_prompt_strength: Optional[float]`

        Only applicable for flux-dev based models for `txt2img`, `img2img`, and `controlnet` inference types.

        Controls the influence of the negative prompt. Default 0 means the negative prompt has no effect. Higher values increase negative prompt influence.
        Must be > 0 if negativePrompt is provided.

      - `num_inference_steps: Optional[float]`

        The number of denoising steps for each image generation (within [1, 150], default: 30)

      - `num_samples: Optional[float]`

        The number of images to generate (within [1, 128], default: 4)

      - `reference_adain: Optional[bool]`

        Whether to use reference adain
        Only for "reference" inference type

      - `reference_attn: Optional[bool]`

        Whether to use reference query for self attention's context
        Only for "reference" inference type

      - `scheduler: Optional[Literal["DDIMScheduler", "DDPMScheduler", "DEISMultistepScheduler", 12 more]]`

        The scheduler to use to override the default configured for the model. See detailed documentation for more details.

        - `"DDIMScheduler"`

        - `"DDPMScheduler"`

        - `"DEISMultistepScheduler"`

        - `"DPMSolverMultistepScheduler"`

        - `"DPMSolverSinglestepScheduler"`

        - `"EulerAncestralDiscreteScheduler"`

        - `"EulerDiscreteScheduler"`

        - `"HeunDiscreteScheduler"`

        - `"KDPM2AncestralDiscreteScheduler"`

        - `"KDPM2DiscreteScheduler"`

        - `"LCMScheduler"`

        - `"LMSDiscreteScheduler"`

        - `"PNDMScheduler"`

        - `"TCDScheduler"`

        - `"UniPCMultistepScheduler"`

      - `seed: Optional[str]`

        Used to reproduce previous results. Default: randomly generated number.

      - `strength: Optional[float]`

        Controls the noise intensity introduced to the input image, where a value of 1.0 completely erases the original image's details. Available for img2img and inpainting. (within [0.01, 1.0], default: 0.75)

      - `style_fidelity: Optional[float]`

        If style_fidelity=1.0, control more important, else if style_fidelity=0.0, prompt more important, else balanced
        Only for "reference" inference type

      - `width: Optional[float]`

        The width of the generated images, must be a 8 multiple (within [64, 2048], default: 512)
        If model.type is `flux.1.1-pro-ultra`, you can use the aspectRatio parameter instead

    - `updated_at: str`

      The preset last update date as an ISO string (example: "2023-02-03T11:19:41.579Z")

### Example

```python
import os
from scenario_sdk import Scenario

client = Scenario(
    api_key=os.environ.get("SCENARIO_SDK_API_KEY"),  # This is the default and can be omitted
    api_secret=os.environ.get("SCENARIO_SDK_API_SECRET"),  # This is the default and can be omitted
)
preset = client.models.presets.update(
    preset_id="presetId",
    model_id="modelId",
    is_default=True,
)
print(preset.preset)
```

#### Response

```json
{
  "preset": {
    "id": "id",
    "authorId": "authorId",
    "createdAt": "createdAt",
    "isDefault": true,
    "modelId": "modelId",
    "ownerId": "ownerId",
    "parameters": {
      "prompt": "prompt",
      "type": "controlnet",
      "aspectRatio": "16:9",
      "baseModelId": "baseModelId",
      "concepts": [
        {
          "modelId": "modelId",
          "scale": -2,
          "modelEpoch": "modelEpoch"
        }
      ],
      "controlEnd": 0.1,
      "controlImage": "controlImage",
      "controlImageId": "controlImageId",
      "controlStart": 0,
      "disableMerging": true,
      "disableModalityDetection": true,
      "guidance": 0,
      "height": 64,
      "hideResults": true,
      "image": "image",
      "imageId": "imageId",
      "intermediateImages": true,
      "ipAdapterImage": "ipAdapterImage",
      "ipAdapterImageId": "ipAdapterImageId",
      "ipAdapterImageIds": [
        "string"
      ],
      "ipAdapterImages": [
        "string"
      ],
      "ipAdapterScale": 0,
      "ipAdapterScales": [
        0
      ],
      "ipAdapterType": "character",
      "mask": "mask",
      "maskId": "maskId",
      "modality": "modality",
      "modelEpoch": "modelEpoch",
      "negativePrompt": "negativePrompt",
      "negativePromptStrength": 0,
      "numInferenceSteps": 1,
      "numSamples": 1,
      "referenceAdain": true,
      "referenceAttn": true,
      "scheduler": "DDIMScheduler",
      "seed": "seed",
      "strength": 0.01,
      "styleFidelity": 0,
      "width": 64
    },
    "updatedAt": "updatedAt"
  }
}
```

## Domain Types

### Preset Create Response

- `class PresetCreateResponse: …`

  - `preset: Preset`

    - `id: str`

      The preset ID (example: "eyVcnFJcR92BxBkz7N6g5w")

    - `author_id: str`

      The author user ID (example: "VFhihHKMRZyDDnZAJwLb2Q")

    - `created_at: str`

      The preset creation date as an ISO string (example: "2023-02-03T11:19:41.579Z")

    - `is_default: bool`

      Whether the preset is the default preset of the model (example: true)

    - `model_id: str`

      The model ID (example: "eyVcnFJcR92BxBkz7N6g5w")

    - `owner_id: str`

      The owner ID (example: "VFhihHKMRZyDDnZAJwLb2Q")

    - `parameters: PresetParameters`

      The inference parameters

      - `prompt: str`

        Full text prompt including the model placeholder. (example: "an illustration of phoenix in a fantasy world, flying over a mountain, 8k, bokeh effect")

      - `type: Literal["controlnet", "controlnet_img2img", "controlnet_inpaint", 15 more]`

        The type of inference to use. Example: txt2img, img2img, etc.

        Selecting the right type will condition the expected parameters.

        Note: for inpainting with models that support multiple base models, Scenario determines the best available `baseModel` for a given `modelId`.

        - `"controlnet"`

        - `"controlnet_img2img"`

        - `"controlnet_inpaint"`

        - `"controlnet_inpaint_ip_adapter"`

        - `"controlnet_ip_adapter"`

        - `"controlnet_reference"`

        - `"controlnet_texture"`

        - `"img2img"`

        - `"img2img_ip_adapter"`

        - `"img2img_texture"`

        - `"inpaint"`

        - `"inpaint_ip_adapter"`

        - `"outpaint"`

        - `"reference"`

        - `"reference_texture"`

        - `"txt2img"`

        - `"txt2img_ip_adapter"`

        - `"txt2img_texture"`

      - `aspect_ratio: Optional[Literal["16:9", "1:1", "21:9", 8 more]]`

        The aspect ratio of the generated images. Only used for the model flux.1.1-pro-ultra.
        The aspect ratio is a string formatted as "width:height" (example: "16:9").

        - `"16:9"`

        - `"1:1"`

        - `"21:9"`

        - `"2:3"`

        - `"3:2"`

        - `"3:4"`

        - `"4:3"`

        - `"4:5"`

        - `"5:4"`

        - `"9:16"`

        - `"9:21"`

      - `base_model_id: Optional[str]`

        The base model to use for the inference. Only Flux LoRA models can use this parameter.
        Allowed values are available in the model's attribute: `compliantModelIds`

      - `concepts: Optional[List[PresetParametersConcept]]`

        - `model_id: str`

          The model ID (example: "model_eyVcnFJcR92BxBkz7N6g5w")

        - `scale: float`

          The scale of the model (example: 1.0)
          For Flux Kontext Prompt Editing, the scale is between 0 and 2.

        - `model_epoch: Optional[str]`

          The epoch of the model (example: "000001")
          Only available for Flux Lora Trained models

      - `control_end: Optional[float]`

        Specifies how long the ControlNet guidance should be applied during the inference process.

        Only available for Flux.1-dev based models.

        The value represents the percentage of total inference steps where the ControlNet guidance is active.
        For example:

        - 1.0: ControlNet guidance is applied during all inference steps
        - 0.5: ControlNet guidance is only applied during the first half of inference steps

        Default values:

        - 0.5 for Canny modality
        - 0.6 for all other modalities

      - `control_image: Optional[str]`

        Signed URL to display the controlnet input image

      - `control_image_id: Optional[str]`

        Asset id of the controlnet input image

      - `control_start: Optional[float]`

        Specifies the starting point of the ControlNet guidance during the inference process.

        Only available for Flux.1-dev based models.

        The value represents the percentage of total inference steps where the ControlNet guidance starts.
        For example:

        - 0.0: ControlNet guidance starts at the beginning of the inference steps
        - 0.5: ControlNet guidance starts at the middle of the inference steps

      - `disable_merging: Optional[bool]`

        If set to true, the entire input image will likely change during inpainting. This results in faster inferences, but the output image will be harder to integrate if the input is just a small part of a larger image.

      - `disable_modality_detection: Optional[bool]`

        If false, the process uses the given image to detect the modality.
        If true (default), the process will not try to detect the modality of the given image.

        For example:
        with `pose` modality and `false` value, the process will detect the pose of people in the given image
        with `depth` modality and `false` value, the process will detect the depth of the given image
        with `scribble` modality and `true`value, the process will use the given image as a scribble

        ⚠️ For models of the FLUX schnell or dev families, this parameter is ignored. The modality detection is always disabled. ⚠️

      - `guidance: Optional[float]`

        Controls how closely the generated image follows the prompt. Higher values result in stronger adherence to the prompt. Default and allowed values depend on the model type:

        - For Flux dev models, the default is 3.5 and allowed values are within [0, 10]
        - For Flux pro models, the default is 3 and allowed values are within [2, 5]

      - `height: Optional[float]`

        The height of the generated images, must be a 8 multiple (within [64, 2048], default: 512)
        If model.type is `flux.1.1-pro-ultra`, you can use the aspectRatio parameter instead

      - `hide_results: Optional[bool]`

        If set, generated assets will be hidden and not returned in the list of images of the inference
        or when listing assets (default: false)

      - `image: Optional[str]`

        Signed URL to display the input image

      - `image_id: Optional[str]`

        Asset id of the input image

      - `intermediate_images: Optional[bool]`

        Enable or disable the intermediate images generation (default: false)

      - `ip_adapter_image: Optional[str]`

        Signed URL to display the IpAdapter image

      - `ip_adapter_image_id: Optional[str]`

        Asset id of the input IpAdapter image

      - `ip_adapter_image_ids: Optional[List[str]]`

        Asset id of the input IpAdapter images

      - `ip_adapter_images: Optional[List[str]]`

        Signed URL to display the IpAdapter images

      - `ip_adapter_scale: Optional[float]`

        IpAdapter scale factor (within [0.0, 1.0], default: 0.9).

      - `ip_adapter_scales: Optional[List[float]]`

        IpAdapter scale factors (within [0.0, 1.0], default: 0.9).

      - `ip_adapter_type: Optional[Literal["character", "style"]]`

        The type of IP Adapter model to use. Must be one of [`style`, `character`], default to `style``

        - `"character"`

        - `"style"`

      - `mask: Optional[str]`

        Signed URL to display the mask image

      - `mask_id: Optional[str]`

        Asset id of the mask image

      - `modality: Optional[str]`

        The modality associated with the control image used for the generation: it can either be an object with a combination of maximum

        For models of the FLUX schnell or dev families:

        - one modality from: `canny`, `tile`, `depth`, `blur`, `pose`, `gray`, `low-quality`

        Optionally, you can associate a value to these modalities or presets. The value must be within `]0.0, 1.0]`.

        Examples:

        - `canny`
        - `depth:0.5,pose:1.0`
        - `canny:0.5,depth:0.5,lines:0.3`
        - `landscape`
        - `character:0.5`
        - `illusion:1`

        Note: if you use a value that is not supported by the model family, this will result in an error.

      - `model_epoch: Optional[str]`

        The epoch of the model to use for the inference. Only available for Flux Lora Trained models.

      - `negative_prompt: Optional[str]`

        The prompt not to guide the image generation, ignored when guidance < 1 (example: "((ugly face))")
        For Flux based model (not Fast-Flux): requires negativePromptStrength > 0 and active only for inference types txt2img / img2img / controlnet.

      - `negative_prompt_strength: Optional[float]`

        Only applicable for flux-dev based models for `txt2img`, `img2img`, and `controlnet` inference types.

        Controls the influence of the negative prompt. Default 0 means the negative prompt has no effect. Higher values increase negative prompt influence.
        Must be > 0 if negativePrompt is provided.

      - `num_inference_steps: Optional[float]`

        The number of denoising steps for each image generation (within [1, 150], default: 30)

      - `num_samples: Optional[float]`

        The number of images to generate (within [1, 128], default: 4)

      - `reference_adain: Optional[bool]`

        Whether to use reference adain
        Only for "reference" inference type

      - `reference_attn: Optional[bool]`

        Whether to use reference query for self attention's context
        Only for "reference" inference type

      - `scheduler: Optional[Literal["DDIMScheduler", "DDPMScheduler", "DEISMultistepScheduler", 12 more]]`

        The scheduler to use to override the default configured for the model. See detailed documentation for more details.

        - `"DDIMScheduler"`

        - `"DDPMScheduler"`

        - `"DEISMultistepScheduler"`

        - `"DPMSolverMultistepScheduler"`

        - `"DPMSolverSinglestepScheduler"`

        - `"EulerAncestralDiscreteScheduler"`

        - `"EulerDiscreteScheduler"`

        - `"HeunDiscreteScheduler"`

        - `"KDPM2AncestralDiscreteScheduler"`

        - `"KDPM2DiscreteScheduler"`

        - `"LCMScheduler"`

        - `"LMSDiscreteScheduler"`

        - `"PNDMScheduler"`

        - `"TCDScheduler"`

        - `"UniPCMultistepScheduler"`

      - `seed: Optional[str]`

        Used to reproduce previous results. Default: randomly generated number.

      - `strength: Optional[float]`

        Controls the noise intensity introduced to the input image, where a value of 1.0 completely erases the original image's details. Available for img2img and inpainting. (within [0.01, 1.0], default: 0.75)

      - `style_fidelity: Optional[float]`

        If style_fidelity=1.0, control more important, else if style_fidelity=0.0, prompt more important, else balanced
        Only for "reference" inference type

      - `width: Optional[float]`

        The width of the generated images, must be a 8 multiple (within [64, 2048], default: 512)
        If model.type is `flux.1.1-pro-ultra`, you can use the aspectRatio parameter instead

    - `updated_at: str`

      The preset last update date as an ISO string (example: "2023-02-03T11:19:41.579Z")

### Preset List Response

- `class PresetListResponse: …`

  - `presets: List[Preset]`

    - `id: str`

      The preset ID (example: "eyVcnFJcR92BxBkz7N6g5w")

    - `author_id: str`

      The author user ID (example: "VFhihHKMRZyDDnZAJwLb2Q")

    - `created_at: str`

      The preset creation date as an ISO string (example: "2023-02-03T11:19:41.579Z")

    - `is_default: bool`

      Whether the preset is the default preset of the model (example: true)

    - `model_id: str`

      The model ID (example: "eyVcnFJcR92BxBkz7N6g5w")

    - `owner_id: str`

      The owner ID (example: "VFhihHKMRZyDDnZAJwLb2Q")

    - `parameters: PresetParameters`

      The inference parameters

      - `prompt: str`

        Full text prompt including the model placeholder. (example: "an illustration of phoenix in a fantasy world, flying over a mountain, 8k, bokeh effect")

      - `type: Literal["controlnet", "controlnet_img2img", "controlnet_inpaint", 15 more]`

        The type of inference to use. Example: txt2img, img2img, etc.

        Selecting the right type will condition the expected parameters.

        Note: for inpainting with models that support multiple base models, Scenario determines the best available `baseModel` for a given `modelId`.

        - `"controlnet"`

        - `"controlnet_img2img"`

        - `"controlnet_inpaint"`

        - `"controlnet_inpaint_ip_adapter"`

        - `"controlnet_ip_adapter"`

        - `"controlnet_reference"`

        - `"controlnet_texture"`

        - `"img2img"`

        - `"img2img_ip_adapter"`

        - `"img2img_texture"`

        - `"inpaint"`

        - `"inpaint_ip_adapter"`

        - `"outpaint"`

        - `"reference"`

        - `"reference_texture"`

        - `"txt2img"`

        - `"txt2img_ip_adapter"`

        - `"txt2img_texture"`

      - `aspect_ratio: Optional[Literal["16:9", "1:1", "21:9", 8 more]]`

        The aspect ratio of the generated images. Only used for the model flux.1.1-pro-ultra.
        The aspect ratio is a string formatted as "width:height" (example: "16:9").

        - `"16:9"`

        - `"1:1"`

        - `"21:9"`

        - `"2:3"`

        - `"3:2"`

        - `"3:4"`

        - `"4:3"`

        - `"4:5"`

        - `"5:4"`

        - `"9:16"`

        - `"9:21"`

      - `base_model_id: Optional[str]`

        The base model to use for the inference. Only Flux LoRA models can use this parameter.
        Allowed values are available in the model's attribute: `compliantModelIds`

      - `concepts: Optional[List[PresetParametersConcept]]`

        - `model_id: str`

          The model ID (example: "model_eyVcnFJcR92BxBkz7N6g5w")

        - `scale: float`

          The scale of the model (example: 1.0)
          For Flux Kontext Prompt Editing, the scale is between 0 and 2.

        - `model_epoch: Optional[str]`

          The epoch of the model (example: "000001")
          Only available for Flux Lora Trained models

      - `control_end: Optional[float]`

        Specifies how long the ControlNet guidance should be applied during the inference process.

        Only available for Flux.1-dev based models.

        The value represents the percentage of total inference steps where the ControlNet guidance is active.
        For example:

        - 1.0: ControlNet guidance is applied during all inference steps
        - 0.5: ControlNet guidance is only applied during the first half of inference steps

        Default values:

        - 0.5 for Canny modality
        - 0.6 for all other modalities

      - `control_image: Optional[str]`

        Signed URL to display the controlnet input image

      - `control_image_id: Optional[str]`

        Asset id of the controlnet input image

      - `control_start: Optional[float]`

        Specifies the starting point of the ControlNet guidance during the inference process.

        Only available for Flux.1-dev based models.

        The value represents the percentage of total inference steps where the ControlNet guidance starts.
        For example:

        - 0.0: ControlNet guidance starts at the beginning of the inference steps
        - 0.5: ControlNet guidance starts at the middle of the inference steps

      - `disable_merging: Optional[bool]`

        If set to true, the entire input image will likely change during inpainting. This results in faster inferences, but the output image will be harder to integrate if the input is just a small part of a larger image.

      - `disable_modality_detection: Optional[bool]`

        If false, the process uses the given image to detect the modality.
        If true (default), the process will not try to detect the modality of the given image.

        For example:
        with `pose` modality and `false` value, the process will detect the pose of people in the given image
        with `depth` modality and `false` value, the process will detect the depth of the given image
        with `scribble` modality and `true`value, the process will use the given image as a scribble

        ⚠️ For models of the FLUX schnell or dev families, this parameter is ignored. The modality detection is always disabled. ⚠️

      - `guidance: Optional[float]`

        Controls how closely the generated image follows the prompt. Higher values result in stronger adherence to the prompt. Default and allowed values depend on the model type:

        - For Flux dev models, the default is 3.5 and allowed values are within [0, 10]
        - For Flux pro models, the default is 3 and allowed values are within [2, 5]

      - `height: Optional[float]`

        The height of the generated images, must be a 8 multiple (within [64, 2048], default: 512)
        If model.type is `flux.1.1-pro-ultra`, you can use the aspectRatio parameter instead

      - `hide_results: Optional[bool]`

        If set, generated assets will be hidden and not returned in the list of images of the inference
        or when listing assets (default: false)

      - `image: Optional[str]`

        Signed URL to display the input image

      - `image_id: Optional[str]`

        Asset id of the input image

      - `intermediate_images: Optional[bool]`

        Enable or disable the intermediate images generation (default: false)

      - `ip_adapter_image: Optional[str]`

        Signed URL to display the IpAdapter image

      - `ip_adapter_image_id: Optional[str]`

        Asset id of the input IpAdapter image

      - `ip_adapter_image_ids: Optional[List[str]]`

        Asset id of the input IpAdapter images

      - `ip_adapter_images: Optional[List[str]]`

        Signed URL to display the IpAdapter images

      - `ip_adapter_scale: Optional[float]`

        IpAdapter scale factor (within [0.0, 1.0], default: 0.9).

      - `ip_adapter_scales: Optional[List[float]]`

        IpAdapter scale factors (within [0.0, 1.0], default: 0.9).

      - `ip_adapter_type: Optional[Literal["character", "style"]]`

        The type of IP Adapter model to use. Must be one of [`style`, `character`], default to `style``

        - `"character"`

        - `"style"`

      - `mask: Optional[str]`

        Signed URL to display the mask image

      - `mask_id: Optional[str]`

        Asset id of the mask image

      - `modality: Optional[str]`

        The modality associated with the control image used for the generation: it can either be an object with a combination of maximum

        For models of the FLUX schnell or dev families:

        - one modality from: `canny`, `tile`, `depth`, `blur`, `pose`, `gray`, `low-quality`

        Optionally, you can associate a value to these modalities or presets. The value must be within `]0.0, 1.0]`.

        Examples:

        - `canny`
        - `depth:0.5,pose:1.0`
        - `canny:0.5,depth:0.5,lines:0.3`
        - `landscape`
        - `character:0.5`
        - `illusion:1`

        Note: if you use a value that is not supported by the model family, this will result in an error.

      - `model_epoch: Optional[str]`

        The epoch of the model to use for the inference. Only available for Flux Lora Trained models.

      - `negative_prompt: Optional[str]`

        The prompt not to guide the image generation, ignored when guidance < 1 (example: "((ugly face))")
        For Flux based model (not Fast-Flux): requires negativePromptStrength > 0 and active only for inference types txt2img / img2img / controlnet.

      - `negative_prompt_strength: Optional[float]`

        Only applicable for flux-dev based models for `txt2img`, `img2img`, and `controlnet` inference types.

        Controls the influence of the negative prompt. Default 0 means the negative prompt has no effect. Higher values increase negative prompt influence.
        Must be > 0 if negativePrompt is provided.

      - `num_inference_steps: Optional[float]`

        The number of denoising steps for each image generation (within [1, 150], default: 30)

      - `num_samples: Optional[float]`

        The number of images to generate (within [1, 128], default: 4)

      - `reference_adain: Optional[bool]`

        Whether to use reference adain
        Only for "reference" inference type

      - `reference_attn: Optional[bool]`

        Whether to use reference query for self attention's context
        Only for "reference" inference type

      - `scheduler: Optional[Literal["DDIMScheduler", "DDPMScheduler", "DEISMultistepScheduler", 12 more]]`

        The scheduler to use to override the default configured for the model. See detailed documentation for more details.

        - `"DDIMScheduler"`

        - `"DDPMScheduler"`

        - `"DEISMultistepScheduler"`

        - `"DPMSolverMultistepScheduler"`

        - `"DPMSolverSinglestepScheduler"`

        - `"EulerAncestralDiscreteScheduler"`

        - `"EulerDiscreteScheduler"`

        - `"HeunDiscreteScheduler"`

        - `"KDPM2AncestralDiscreteScheduler"`

        - `"KDPM2DiscreteScheduler"`

        - `"LCMScheduler"`

        - `"LMSDiscreteScheduler"`

        - `"PNDMScheduler"`

        - `"TCDScheduler"`

        - `"UniPCMultistepScheduler"`

      - `seed: Optional[str]`

        Used to reproduce previous results. Default: randomly generated number.

      - `strength: Optional[float]`

        Controls the noise intensity introduced to the input image, where a value of 1.0 completely erases the original image's details. Available for img2img and inpainting. (within [0.01, 1.0], default: 0.75)

      - `style_fidelity: Optional[float]`

        If style_fidelity=1.0, control more important, else if style_fidelity=0.0, prompt more important, else balanced
        Only for "reference" inference type

      - `width: Optional[float]`

        The width of the generated images, must be a 8 multiple (within [64, 2048], default: 512)
        If model.type is `flux.1.1-pro-ultra`, you can use the aspectRatio parameter instead

    - `updated_at: str`

      The preset last update date as an ISO string (example: "2023-02-03T11:19:41.579Z")

### Preset Update Response

- `class PresetUpdateResponse: …`

  - `preset: Preset`

    - `id: str`

      The preset ID (example: "eyVcnFJcR92BxBkz7N6g5w")

    - `author_id: str`

      The author user ID (example: "VFhihHKMRZyDDnZAJwLb2Q")

    - `created_at: str`

      The preset creation date as an ISO string (example: "2023-02-03T11:19:41.579Z")

    - `is_default: bool`

      Whether the preset is the default preset of the model (example: true)

    - `model_id: str`

      The model ID (example: "eyVcnFJcR92BxBkz7N6g5w")

    - `owner_id: str`

      The owner ID (example: "VFhihHKMRZyDDnZAJwLb2Q")

    - `parameters: PresetParameters`

      The inference parameters

      - `prompt: str`

        Full text prompt including the model placeholder. (example: "an illustration of phoenix in a fantasy world, flying over a mountain, 8k, bokeh effect")

      - `type: Literal["controlnet", "controlnet_img2img", "controlnet_inpaint", 15 more]`

        The type of inference to use. Example: txt2img, img2img, etc.

        Selecting the right type will condition the expected parameters.

        Note: for inpainting with models that support multiple base models, Scenario determines the best available `baseModel` for a given `modelId`.

        - `"controlnet"`

        - `"controlnet_img2img"`

        - `"controlnet_inpaint"`

        - `"controlnet_inpaint_ip_adapter"`

        - `"controlnet_ip_adapter"`

        - `"controlnet_reference"`

        - `"controlnet_texture"`

        - `"img2img"`

        - `"img2img_ip_adapter"`

        - `"img2img_texture"`

        - `"inpaint"`

        - `"inpaint_ip_adapter"`

        - `"outpaint"`

        - `"reference"`

        - `"reference_texture"`

        - `"txt2img"`

        - `"txt2img_ip_adapter"`

        - `"txt2img_texture"`

      - `aspect_ratio: Optional[Literal["16:9", "1:1", "21:9", 8 more]]`

        The aspect ratio of the generated images. Only used for the model flux.1.1-pro-ultra.
        The aspect ratio is a string formatted as "width:height" (example: "16:9").

        - `"16:9"`

        - `"1:1"`

        - `"21:9"`

        - `"2:3"`

        - `"3:2"`

        - `"3:4"`

        - `"4:3"`

        - `"4:5"`

        - `"5:4"`

        - `"9:16"`

        - `"9:21"`

      - `base_model_id: Optional[str]`

        The base model to use for the inference. Only Flux LoRA models can use this parameter.
        Allowed values are available in the model's attribute: `compliantModelIds`

      - `concepts: Optional[List[PresetParametersConcept]]`

        - `model_id: str`

          The model ID (example: "model_eyVcnFJcR92BxBkz7N6g5w")

        - `scale: float`

          The scale of the model (example: 1.0)
          For Flux Kontext Prompt Editing, the scale is between 0 and 2.

        - `model_epoch: Optional[str]`

          The epoch of the model (example: "000001")
          Only available for Flux Lora Trained models

      - `control_end: Optional[float]`

        Specifies how long the ControlNet guidance should be applied during the inference process.

        Only available for Flux.1-dev based models.

        The value represents the percentage of total inference steps where the ControlNet guidance is active.
        For example:

        - 1.0: ControlNet guidance is applied during all inference steps
        - 0.5: ControlNet guidance is only applied during the first half of inference steps

        Default values:

        - 0.5 for Canny modality
        - 0.6 for all other modalities

      - `control_image: Optional[str]`

        Signed URL to display the controlnet input image

      - `control_image_id: Optional[str]`

        Asset id of the controlnet input image

      - `control_start: Optional[float]`

        Specifies the starting point of the ControlNet guidance during the inference process.

        Only available for Flux.1-dev based models.

        The value represents the percentage of total inference steps where the ControlNet guidance starts.
        For example:

        - 0.0: ControlNet guidance starts at the beginning of the inference steps
        - 0.5: ControlNet guidance starts at the middle of the inference steps

      - `disable_merging: Optional[bool]`

        If set to true, the entire input image will likely change during inpainting. This results in faster inferences, but the output image will be harder to integrate if the input is just a small part of a larger image.

      - `disable_modality_detection: Optional[bool]`

        If false, the process uses the given image to detect the modality.
        If true (default), the process will not try to detect the modality of the given image.

        For example:
        with `pose` modality and `false` value, the process will detect the pose of people in the given image
        with `depth` modality and `false` value, the process will detect the depth of the given image
        with `scribble` modality and `true`value, the process will use the given image as a scribble

        ⚠️ For models of the FLUX schnell or dev families, this parameter is ignored. The modality detection is always disabled. ⚠️

      - `guidance: Optional[float]`

        Controls how closely the generated image follows the prompt. Higher values result in stronger adherence to the prompt. Default and allowed values depend on the model type:

        - For Flux dev models, the default is 3.5 and allowed values are within [0, 10]
        - For Flux pro models, the default is 3 and allowed values are within [2, 5]

      - `height: Optional[float]`

        The height of the generated images, must be a 8 multiple (within [64, 2048], default: 512)
        If model.type is `flux.1.1-pro-ultra`, you can use the aspectRatio parameter instead

      - `hide_results: Optional[bool]`

        If set, generated assets will be hidden and not returned in the list of images of the inference
        or when listing assets (default: false)

      - `image: Optional[str]`

        Signed URL to display the input image

      - `image_id: Optional[str]`

        Asset id of the input image

      - `intermediate_images: Optional[bool]`

        Enable or disable the intermediate images generation (default: false)

      - `ip_adapter_image: Optional[str]`

        Signed URL to display the IpAdapter image

      - `ip_adapter_image_id: Optional[str]`

        Asset id of the input IpAdapter image

      - `ip_adapter_image_ids: Optional[List[str]]`

        Asset id of the input IpAdapter images

      - `ip_adapter_images: Optional[List[str]]`

        Signed URL to display the IpAdapter images

      - `ip_adapter_scale: Optional[float]`

        IpAdapter scale factor (within [0.0, 1.0], default: 0.9).

      - `ip_adapter_scales: Optional[List[float]]`

        IpAdapter scale factors (within [0.0, 1.0], default: 0.9).

      - `ip_adapter_type: Optional[Literal["character", "style"]]`

        The type of IP Adapter model to use. Must be one of [`style`, `character`], default to `style``

        - `"character"`

        - `"style"`

      - `mask: Optional[str]`

        Signed URL to display the mask image

      - `mask_id: Optional[str]`

        Asset id of the mask image

      - `modality: Optional[str]`

        The modality associated with the control image used for the generation: it can either be an object with a combination of maximum

        For models of the FLUX schnell or dev families:

        - one modality from: `canny`, `tile`, `depth`, `blur`, `pose`, `gray`, `low-quality`

        Optionally, you can associate a value to these modalities or presets. The value must be within `]0.0, 1.0]`.

        Examples:

        - `canny`
        - `depth:0.5,pose:1.0`
        - `canny:0.5,depth:0.5,lines:0.3`
        - `landscape`
        - `character:0.5`
        - `illusion:1`

        Note: if you use a value that is not supported by the model family, this will result in an error.

      - `model_epoch: Optional[str]`

        The epoch of the model to use for the inference. Only available for Flux Lora Trained models.

      - `negative_prompt: Optional[str]`

        The prompt not to guide the image generation, ignored when guidance < 1 (example: "((ugly face))")
        For Flux based model (not Fast-Flux): requires negativePromptStrength > 0 and active only for inference types txt2img / img2img / controlnet.

      - `negative_prompt_strength: Optional[float]`

        Only applicable for flux-dev based models for `txt2img`, `img2img`, and `controlnet` inference types.

        Controls the influence of the negative prompt. Default 0 means the negative prompt has no effect. Higher values increase negative prompt influence.
        Must be > 0 if negativePrompt is provided.

      - `num_inference_steps: Optional[float]`

        The number of denoising steps for each image generation (within [1, 150], default: 30)

      - `num_samples: Optional[float]`

        The number of images to generate (within [1, 128], default: 4)

      - `reference_adain: Optional[bool]`

        Whether to use reference adain
        Only for "reference" inference type

      - `reference_attn: Optional[bool]`

        Whether to use reference query for self attention's context
        Only for "reference" inference type

      - `scheduler: Optional[Literal["DDIMScheduler", "DDPMScheduler", "DEISMultistepScheduler", 12 more]]`

        The scheduler to use to override the default configured for the model. See detailed documentation for more details.

        - `"DDIMScheduler"`

        - `"DDPMScheduler"`

        - `"DEISMultistepScheduler"`

        - `"DPMSolverMultistepScheduler"`

        - `"DPMSolverSinglestepScheduler"`

        - `"EulerAncestralDiscreteScheduler"`

        - `"EulerDiscreteScheduler"`

        - `"HeunDiscreteScheduler"`

        - `"KDPM2AncestralDiscreteScheduler"`

        - `"KDPM2DiscreteScheduler"`

        - `"LCMScheduler"`

        - `"LMSDiscreteScheduler"`

        - `"PNDMScheduler"`

        - `"TCDScheduler"`

        - `"UniPCMultistepScheduler"`

      - `seed: Optional[str]`

        Used to reproduce previous results. Default: randomly generated number.

      - `strength: Optional[float]`

        Controls the noise intensity introduced to the input image, where a value of 1.0 completely erases the original image's details. Available for img2img and inpainting. (within [0.01, 1.0], default: 0.75)

      - `style_fidelity: Optional[float]`

        If style_fidelity=1.0, control more important, else if style_fidelity=0.0, prompt more important, else balanced
        Only for "reference" inference type

      - `width: Optional[float]`

        The width of the generated images, must be a 8 multiple (within [64, 2048], default: 512)
        If model.type is `flux.1.1-pro-ultra`, you can use the aspectRatio parameter instead

    - `updated_at: str`

      The preset last update date as an ISO string (example: "2023-02-03T11:19:41.579Z")
