# Scenario Upscale V3 — API Reference Model ID: `model_upscale-v3` --- ## Authentication Scenario API uses HTTP Basic Auth. Encode your credentials in Base64 and pass them as the `Authorization` header. ``` Authorization: Basic base64(":") ``` - **API_KEY** and **API_SECRET** are found in your [Scenario Project Settings](https://app.scenario.com/team&tab=project_api_keys) under API Keys. - In shell: `$(echo -n ':' | base64)` - In JavaScript: `btoa(":")` - In Python: `base64.b64encode(f"{api_key}:{api_secret}".encode()).decode()` --- ## Generate **Endpoint:** `POST https://api.cloud.scenario.com/v1/generate/custom/model_upscale-v3` ### Parameters | Parameter | Type | Required | Default | Description | |-----------|------|----------|---------|-------------| | `style` | string | - | `standard` | Selecting a custom style will optimize settings for the output image to match the selected style | | `upscaleFactor` | number | - | `2` | Scaling factor (when target width not specified). If 1, then it's a refinement step only | | `preset` | string | - | `precise` | Select a preset to apply a set of parameters | | `styleStrength` | number | - | `0.5` | Higher fidelity keeps the enhanced image's style closely aligned with the style images. | | `tileStyle` | boolean | - | `false` | If set to true, during the upscaling process, the model will match tiles of the source image with tiles of the style image. This will result in a more coherent style transfer. Works best with style images that have a similar composition. | | `prompt` | string | - | `` | Prompt | | `negativePrompt` | string | - | `` | | | `guidanceScale` | number | - | `6` | Higher fidelity prioritizes the prompt over the image | | `controlnetConditioningScale` | number | - | `0.8` | Higher fidelity keeps the enhanced image closer to the original structure of the input image | | `strength` | number | - | `0.1` | Higher creativity levels introduce extra imaginative elements to enhanced images | | `fractality` | number | - | `0` | Fractality will add small fractal-like details, possibly repeating intricated patterns and repeating these details across tiles | | `loraDetailsScale` | number | - | `0` | Enhances or reduces the intensity of the details | | `seed` | number | - | - | Seed used for reproduction | | `strengthDecay` | number | - | `0.8` | The degree of creativity retained at each stage of the enhancement process (only applies for scale factors above 2) | | `overrideEmbeddings` | boolean | - | `false` | Removes any additional custom embeddings used to guide the 'Style' | ### Example Requests **cURL** ```bash curl -X POST "https://api.cloud.scenario.com/v1/generate/custom/model_upscale-v3" \ -H "Authorization: Basic $(echo -n ':' | base64)" \ -H "Content-Type: application/json" \ --data-binary @- <<'EOF' { "style": "standard", "upscaleFactor": 2, "preset": "precise", "styleStrength": 0.5, "tileStyle": false, "prompt": "", "negativePrompt": "", "guidanceScale": 6, "controlnetConditioningScale": 0.8, "strength": 0.1, "fractality": 0, "loraDetailsScale": 0, "strengthDecay": 0.8, "overrideEmbeddings": false } EOF ``` **Python** ```python import requests import base64 api_key = "" api_secret = "" token = base64.b64encode(f"{api_key}:{api_secret}".encode()).decode() url = "https://api.cloud.scenario.com/v1/generate/custom/model_upscale-v3" headers = { "Authorization": f"Basic {token}", "Content-Type": "application/json" } payload = { "style": "standard", "upscaleFactor": 2, "preset": "precise", "styleStrength": 0.5, "tileStyle": False, "prompt": "", "negativePrompt": "", "guidanceScale": 6, "controlnetConditioningScale": 0.8, "strength": 0.1, "fractality": 0, "loraDetailsScale": 0, "strengthDecay": 0.8, "overrideEmbeddings": False } response = requests.post(url, headers=headers, json=payload) print(response.json()) ``` **JavaScript** ```javascript const token = btoa(":"); const body = { "style": "standard", "upscaleFactor": 2, "preset": "precise", "styleStrength": 0.5, "tileStyle": false, "prompt": "", "negativePrompt": "", "guidanceScale": 6, "controlnetConditioningScale": 0.8, "strength": 0.1, "fractality": 0, "loraDetailsScale": 0, "strengthDecay": 0.8, "overrideEmbeddings": false }; const response = await fetch( "https://api.cloud.scenario.com/v1/generate/custom/model_upscale-v3", { method: "POST", headers: { "Authorization": `Basic ${token}`, "Content-Type": "application/json", }, body: JSON.stringify(body), } ); const data = await response.json(); console.log(data); ``` --- ## Retrieve Results After submitting a generation request, you receive a `jobId`. Poll the job status endpoint until the job completes. **Endpoint:** `GET https://api.cloud.scenario.com/v1/jobs/{jobId}` **Headers:** ``` Authorization: Basic base64(":") ``` Poll until `job.status` is `"success"`. The generated asset IDs are in `job.metadata.assetIds`. **Example response:** ```json { "job": { "jobId": "job_abc123", "status": "success", "metadata": { "assetIds": [ "asset_abc123" ] } } } ``` > **Important:** Generated asset URLs are **temporary** and expire after a short period. Download and store any images you wish to keep before the URL expires. More info: [Content Delivery Network (CDN)](https://docs.scenario.com/docs/content-delivery-network-cdn). --- *Generated by [Scenario](https://app.scenario.com)*