Generate an image based on the given text by employing AI models like Flux, Stable Diffusion, and other top models.
POST
/
v1
/
ai
/
image_generation
import{JigsawStack}from"jigsawstack";const jigsawstack =JigsawStack({apiKey:"your-api-key",});const result =await jigsawstack.image_generation({prompt:"A serene mountain landscape with a lake reflecting the sunset",aspect_ratio:"16:9",steps:30,advance_config:{negative_prompt:"blurry, low quality",guidance:7.5,},});// The result is a Response object containing the imageconst imageData =await result.blob();// Use the imageData in your application
The API returns the generated image directly in the response body as binary data.
import{JigsawStack}from"jigsawstack";const jigsawstack =JigsawStack({apiKey:"your-api-key",});const result =await jigsawstack.image_generation({prompt:"A serene mountain landscape with a lake reflecting the sunset",aspect_ratio:"16:9",steps:30,advance_config:{negative_prompt:"blurry, low quality",guidance:7.5,},});// The result is a Response object containing the imageconst imageData =await result.blob();// Use the imageData in your application
import{JigsawStack}from"jigsawstack";const jigsawstack =JigsawStack({apiKey:"your-api-key",});const result =await jigsawstack.image_generation({prompt:"A serene mountain landscape with a lake reflecting the sunset",aspect_ratio:"16:9",steps:30,advance_config:{negative_prompt:"blurry, low quality",guidance:7.5,},});// The result is a Response object containing the imageconst imageData =await result.blob();// Use the imageData in your application