API reference · Stability AI
stability-ai/fast-sdxl/image-to-image
Integrate this model through SandBase's unified API, with production-ready schemas and examples.
Production endpoint
Send your first request
OpenAI-compatible endpoint with unified authentication and usage tracking.
POST
https://api.sandbase.ai/v1/runModel ID
stability-ai/fast-sdxl/image-to-image01
Input Schema
15 parameters · 2 required · 13 optional
| Parameter | Type | Required | Description |
|---|---|---|---|
image | string | Required | The URL of the image to use as a starting point for the generation. |
prompt | string | Required | The prompt to use for generating the image. Be as descriptive as possible for best results. |
seed | integer | Optional | The same seed and the same prompt given to the same version of Stable Diffusion will output the same image every time. · Default: null |
loras | object[] | Optional | The list of LoRA weights to use. · Default: [] |
format | string | Optional | The format of the generated image. · Options: jpeg, png · Default: "jpeg" jpegpng |
strength | number | Optional | determines how much the generated image resembles the initial image · Min: 0.05 · Max: 1 · Default: 0.95 |
embeddings | object[] | Optional | The list of embeddings to use. · Default: [] |
request_id | string | Optional | An id bound to a request, can be used with response to identify the request itself. · Default: "" |
crop_output | boolean | Optional | If set to true, the output cropped to the proper aspect ratio after generating. · Default: false |
aspect_ratio | string | Optional | The aspect ratio of the generated image. · Options: 21:9, 16:9, 3:2, 4:3, 5:4, 1:1, 4:5, 3:4, 2:3, 9:16 21:916:93:24:35:41:14:53:42:39:16 |
expand_prompt | boolean | Optional | If set to true, the prompt will be expanded with additional prompts. · Default: false |
guidance_scale | number | Optional | The CFG (Classifier Free Guidance) scale is a measure of how close you want the model to stick to your prompt when looking for a related image to show you. · Min: 0 · Max: 20 · Default: 7.5 |
num_inference_steps | integer | Optional | The number of inference steps to perform. · Min: 1 · Max: 65 · Default: 25 |
preserve_aspect_ratio | boolean | Optional | If set to true, the aspect ratio of the generated image will be preserved even if the image size is too large. However, if the image is not a multiple of 32 in width or height, it will be resized to the nearest multiple of 32. By default, this snapping to the nearest multiple of 32 will not preserve the aspect ratio. Set crop_output to True, to crop the output to the proper aspect ratio after generating. · Default: false |
safety_checker_version | string | Optional | The version of the safety checker to use. v1 is the default CompVis safety checker. v2 uses a custom ViT model. · Options: v1, v2 · Default: "v1" v1v2 |
02
Output Schema
| Field | Type | Description |
|---|---|---|
id | string | Unique identifier for the generation task |
status | string | Task status: pending, running, completed, failed, timeout |
model | string | Model used for the generation |
outputs | array | Array of output items |
outputs[].url | string | URL of the generated artifact |
outputs[].content_type | string | MIME type (e.g. image/png, video/mp4) |
error | object | null | Error details if failed, null on success |
error.type | string | Machine-readable error type code |
error.message | string | Human-readable error description |
Async Workflow
This model uses asynchronous execution. Submit a request and poll for the result.
- Submit — POST to /v1/run, receive an
id - Poll — GET /v1/run/{id} until status is
completed,failed, ortimeout - Retrieve — Read
outputsfrom the completed response
03
Code Examples
Ready-to-run snippets
# Step 1: Submit
curl -X POST https://api.sandbase.ai/v1/run \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{
"model": "stability-ai/fast-sdxl/image-to-image",
"seed": null,
"image": "https://fal-cdn.batuhan-941.workers.dev/files/tiger/IExuP-WICqaIesLZAZPur.jpeg",
"loras": [],
"format": "jpeg",
"prompt": "an island near sea, with seagulls, moon shining over the sea, light house, boats int he background, fish flying over the sea",
"strength": 0.95,
"embeddings": [],
"request_id": "",
"crop_output": false,
"expand_prompt": false,
"guidance_scale": 7.5,
"num_inference_steps": 25,
"preserve_aspect_ratio": false,
"safety_checker_version": "v1"
}'
# Step 2: Poll result (replace <id>)
curl https://api.sandbase.ai/v1/run/<id> \
-H "Authorization: Bearer YOUR_API_KEY"
