illusion-diffusion-hq

Monster Labs QrCode ControlNet on top of SD Realistic Vision v5.1

~61.00s
~$0.048
 1import requests
 2import json
 3
 4url = "https://api.segmind.com/v1/illusion-diffusion-hq"
 5headers = {
 6    "x-api-key": "YOUR_API_KEY",
 7    "Content-Type": "application/json"
 8}
 9
10data = {
11    "seed": -1,
12    "image": "https://segmind-sd-models.s3.amazonaws.com/display_images/spiral.png",
13    "width": 768,
14    "border": 1,
15    "height": 768,
16    "prompt": "(masterpiece:1.4), (best quality), (detailed), Medieval village scene with busy streets and castle in the distance",
17    "num_outputs": 1,
18    "guidance_scale": 7.5,
19    "negative_prompt": "ugly, disfigured, low quality, blurry, nsfw",
20    "qrcode_background": "gray",
21    "num_inference_steps": 40,
22    "controlnet_conditioning_scale": 1
23}
24
25response = requests.post(url, headers=headers, json=data)
26
27if response.status_code == 200:
28    result = response.json()
29    print(json.dumps(result, indent=2))
30else:
31    print(f"Error: {response.status_code}")
32    print(response.text)

API Endpoint

POSThttps://api.segmind.com/v1/illusion-diffusion-hq

Parameters

promptrequired
string

The prompt to guide QR Code generation.

Default: "(masterpiece:1.4), (best quality), (detailed), Medieval village scene with busy streets and castle in the distance"
borderoptional
integer

QR code border size

Default: 1Range: 0 - 4
controlnet_conditioning_scaleoptional
number

The outputs of the controlnet are multiplied by `controlnet_conditioning_scale` before they are added to the residual in the original unet.

Default: 1Range: 0 - 4
guidance_scaleoptional
number

Scale for classifier-free guidance

Default: 7.5Range: 0.1 - 30
heightoptional
integer

Height out the output image

Default: 768
imageoptional
string (uri)

Input image. If none is provided, a QR code will be generated

Default: "https://segmind-sd-models.s3.amazonaws.com/display_images/spiral.png"
negative_promptoptional
string

The negative prompt to guide image generation.

Default: "ugly, disfigured, low quality, blurry, nsfw"
num_inference_stepsoptional
integer

Number of diffusion steps

Default: 40Range: 20 - 100
num_outputsoptional
integer

Number of outputs

Default: 1Range: 1 - 4
qr_code_contentoptional
string

The website/content your QR Code will point to.

Default: ""
qrcode_backgroundoptional
string

An enumeration.

Default: "gray"
Allowed values :
"gray""white"
seedoptional
integer

Seed

Default: -1
widthoptional
integer

Width out the output image

Default: 768

Response Type

Returns: Image

Common Error Codes

The API returns standard HTTP status codes. Detailed error messages are provided in the response body.

400

Bad Request

Invalid parameters or request format

401

Unauthorized

Missing or invalid API key

403

Forbidden

Insufficient permissions

404

Not Found

Model or endpoint not found

406

Insufficient Credits

Not enough credits to process request

429

Rate Limited

Too many requests

500

Server Error

Internal server error

502

Bad Gateway

Service temporarily unavailable

504

Timeout

Request timed out