Request Parameters
Body
The text prompt to generate the image from. Must be between 1-5000 characters.
The aspect ratio of the generated image.1:1
16:9
21:9
3:2
2:3
4:5
5:4
3:4
4:3
9:16
9:21
The width of the image. Must be between 256-1920 pixels.
The height of the image. Must be between 256-1920 pixels.
The number of denoising steps. Must be between 1-90. Higher values produce better quality images but take more time to generate.
The output format of the generated image. Must be one of the following values:
A valid URL where the generated image will be sent.
Key to store the generated image in file storage.
Text describing what you don’t want in the image.
Higher guidance forces the model to better follow the prompt, but may result in lower quality output. Must be between 1-28.
Makes generation deterministic. Using the same seed and set of parameters will produce identical image each time.
The specified return type for the response
Response
The API returns the generated image directly in the response body as binary data.
import { JigsawStack } from "jigsawstack";
const jigsaw = JigsawStack({ apiKey: "your-api-key" });
const response = await jigsaw.image_generation({
"prompt": "A beautiful sunset over a calm ocean",
"return_type": "url"
})
{
"success": true,
"url": "https://jigsawstack-temp.b1e91a466694ad4af04df5d05ca12d93.r2.cloudflarestorage.com/temp/b8312fec-fe00-4caa-9fb8-8a8106771a69.png?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Credential=7b9a19349842b7b1a9e4c2e19f05b232%2F20250910%2Fauto%2Fs3%2Faws4_request&X-Amz-Date=20250910T183430Z&X-Amz-Expires=604800&X-Amz-Signature=7b451d420fa3e0391274deaab27db0a266ebd4d3d54d78a4aa2f0e1772a74457&X-Amz-SignedHeaders=host&x-amz-checksum-mode=ENABLED&x-id=GetObject",
"_usage": {
"input_tokens": 18,
"output_tokens": 77,
"inference_time_tokens": 2612,
"total_tokens": 2707
}
}