POST
/
realtime
/
img2img
Generate image from image (Real-Time)
curl --request POST \
  --url https://modelslab.com/api/v6/realtime/img2img \
  --header 'Content-Type: application/json' \
  --data '{
  "key": "<string>",
  "prompt": "<string>",
  "negative_prompt": "<string>",
  "width": 512,
  "height": 512,
  "samples": 1,
  "safety_checker": false,
  "seed": 123,
  "instant_response": false,
  "base64": false,
  "webhook": "<string>",
  "track_id": "<string>",
  "init_image": "<string>",
  "strength": 0.5
}'
{
  "status": "success",
  "generationTime": 123,
  "id": 123,
  "output": [
    "<string>"
  ],
  "proxy_links": [
    "<string>"
  ],
  "meta": {},
  "nsfw_content_detected": true
}
Image to image endpoint result
This API currently supports the following image formats: PNG and JPG.

Request

Make a POST request to below endpoint and pass the required parameters as a request body to the endpoint.
curl
--request POST 'https://modelslab.com/api/v6/realtime/img2img' \

Body

json
{        
    "key": "your_api_key",    
    "prompt": "a cat sitting on a bench",    
    "negative_prompt": "bad quality",    
    "init_image": "https://raw.githubusercontent.com/CompVis/stable-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo.png",    
    "width": "512",    
    "height": "512",    
    "samples": "1",    
    "temp": false,    
    "safety_checker": false,    
    "strength":0.7,    
    "seed": null,    
    "webhook": null,    
    "track_id": null
}

Body

application/json

Response

Image-to-image generation response

The response is of type object.