Create
models.presets.create(strmodel_id, PresetCreateParams**kwargs) -> PresetCreateResponse
POST/models/{modelId}/presets
Create a new preset for the given modelId
Create
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){
"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"
}
}Returns Examples
{
"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"
}
}