Skip to content

Automatic1111

Send the first inference using our API and Automatic1111. Use the address of your endpoint, and include:

txt2img

/sdapi/v1/txt2img

Example: https://71bd1b92256e.app.modelserve.ai/sdapi/v1/txt2img

Payload:

    {
    "prompt": "portrait of a young women, blue eyes, cinematic",
    "steps": 25,
    "width": 512,
    "height": 512
    }
curl -s -X POST \
     -H 'Accept: application/json' \
     -H 'Content-Type: application/json' \
     -H 'Authorization: Bearer X' \
     -d '{"prompt": "portrait of a young women, blue eyes, cinematic", "steps": 25, "width": 512, "height": 512}' \
     'https://{address}/sdapi/v1/txt2img'
import requests

r = requests.post(
    "https://{address}/sdapi/v1/txt2img",
    headers={
        "Accept": "application/json",
        "Content-Type": "application/json",
        "Authorization": "Bearer X",
    },
    data={
        "prompt": "portrait of a young women, blue eyes, cinematic",
        "steps": 25,
        "width": 512,
        "height": 512,
    },
)
fetch('https://{address}/sdapi/v1/txt2img', {
  "method": "POST",
  "headers": {
    "Accept": "application/json",
    "Content-Type": "application/json",
    "Authorization": "Bearer X"
  },
  "body": JSON.stringify({"prompt": "portrait of a young women, blue eyes, cinematic", "steps": 25, "width": 512, "height": 512})
});

Remember to replace the "X" in Authorization with your real Access Token. Where to find your Access Token (Bearer)? Learn more in the 🚀 Quickstart section.

Learn more about the capabilities of the Automatic1111 API by clicking below. Also, check the Notebooks section where you will find ready-made solutions to test.

Learn more

img2img

/sdapi/v1/img2img

Example: https://71bd1b92256e.app.modelserve.ai/sdapi/v1/img2img

Payload:

    {
    "prompt": "girl with red eyes",
    "init_images": [encoded_base64_image],
    "steps": 30,  # optimal steps to maintain quality
    "width": 512,  # match the original image dimensions
    "height": 512,  # match the original image dimensions
    "denoising_strength": 0.2,  # low denoising strength to preserve original details
    "cfg_scale": 7  # Classifier-Free Guidance Scale
    }
curl -s -X POST \
     -H 'Accept: application/json' \
     -H 'Content-Type: application/json' \
     -H 'Authorization: Bearer X' \
     -d '{"prompt": "a dog sitting on a bench", "init_images": [encoded_base64_image], "steps": 30, "width": 512, "height": 512, "denoising_strength": 0.2, "cfg_scale": 7}' \
     'https://{address}/sdapi/v1/imgt2img'
import requests

r = requests.post(
    "https://{address}/sdapi/v1/imgt2img",
    headers={
        "Accept": "application/json",
        "Content-Type": "application/json",
        "Authorization": "Bearer X",
    },
    data={
        "prompt": "a dog sitting on a bench",
        "init_images": [encoded_base64_image],
        "steps": 30,
        "width": 512,
        "height": 512,
        "denoising_strength": 0.2,
        "cfg_scale": 7,
    },
)
fetch('https://{address}/sdapi/v1/imgt2img', {
  "method": "POST",
  "headers": {
    "Accept": "application/json",
    "Content-Type": "application/json",
    "Authorization": "Bearer X"
  },
  "body": JSON.stringify({"prompt": "a dog sitting on a bench", "init_images": [encoded_base64_image], "steps": 30, "width": 512, "height": 512, "denoising_strength": 0.2, "cfg_scale": 7})
});

Remember to replace the "X" in Authorization with your real Access Token. Where to find your Access Token (Bearer)? Learn more in the 🚀 Quickstart section.

Learn more about the capabilities of the Automatic1111 API by clicking below. Also, check the Notebooks section where you will find ready-made solutions to test.

Learn more