v1

latestSwagger 2.02026-07-176096209.1 KB
v2

Initiate an Asynchronous request to generate images

This endpoint will immediately return with the UUID of the request for generation. This endpoint will always be accepted, even if there are no workers available currently to fulfill this request. Perhaps some will appear in the next 10 minutes. Asynchronous requests live for 10 minutes before being considered stale and being deleted.

post/v2/generate/async

Headers

apikeystring required

The API Key corresponding to a registered user.

Client-Agentstring

The client name and version

X-Fieldsstring mask

An optional fields mask

Request body

promptstring required

The prompt which will be sent to Stable Diffusion to generate an image.

nsfwboolean

Set to true if this request is NSFW. This will skip workers which censor images.

trusted_workersboolean

When true, only trusted workers will serve this request. When False, Evaluating workers will also be used which can increase speed but adds more risk!

slow_workersboolean

When True, allows slower workers to pick up this request. Disabling this incurs an extra kudos cost.

censor_nsfwboolean

If the request is SFW, and the worker accidentally generates NSFW, it will send back a censored image.

workersstring[]
worker_blacklistboolean

If true, the worker list will be treated as a blacklist instead of a whitelist.

modelsstring[]
source_imagestring

The Base64-encoded webp to use for img2img.

source_processing'img2img' | 'inpainting' | 'outpainting' | 'remix'

If source_image is provided, specifies how to process it.

source_maskstring

If source_processing is set to 'inpainting' or 'outpainting', this parameter can be optionally provided as the Base64-encoded webp mask of the areas to inpaint. If this arg is not passed, the inpainting/outpainting mask has to be embedded as alpha channel.

r2boolean

If True, the image will be sent via cloudflare r2 download link.

sharedboolean

If True, The image will be shared with LAION for improving their dataset. This will also reduce your kudos consumption by 2. For anonymous users, this is always True.

replacement_filterboolean

If enabled, suspicious prompts are sanitized through a string replacement filter instead.

dry_runboolean

When true, the endpoint will simply return the cost of the request in kudos and exit.

proxied_accountstring

If using a service account as a proxy, provide this value to identify the actual account from which this request is coming from.

disable_batchingboolean

When true, This request will not use batching. This will allow you to retrieve accurate seeds. Feature is restricted to Trusted users and Patreons.

allow_downgradeboolean

When true and the request requires upfront kudos and the account does not have enough The request will be downgraded in steps and resolution so that it does not need upfront kudos.

webhookstring

Provide a URL where the AI Horde will send a POST call after each delivered generation. The request will include the details of the job as well as the request ID.

Example request

{
  "params": {
    "sampler_name": "k_euler",
    "denoising_strength": 0.75,
    "seed": "The little seed that could",
    "seed_variation": 1,
    "post_processing": [
      "GFPGAN"
    ],
    "clip_skip": 1,
    "control_type": "canny",
    "facefixer_strength": 0.75,
    "loras": [
      {
        "name": "Magnagothica"
      }
    ],
    "tis": [
      {
        "name": "7808",
        "inject_ti": "prompt"
      }
    ]
  },
  "source_processing": "img2img",
  "webhook": "https://haidra.net/00000000-0000-0000-0000-000000000000"
}

Response

Generation Queued

idstring

The UUID of the request. Use this to retrieve the request status in the future.

kudosnumber

The expected kudos consumption for this request.

messagestring

Any extra information from the horde about this request.

Example response

{
  "warnings": [
    {
      "code": "NoAvailableWorker"
    }
  ]
}