Word2img

Create beautifully designed words using Segmind’s word to image for your marketing purposes

~10.19s
~$0.005
 1import requests
 2import json
 3
 4url = "https://api.segmind.com/v1/w2imgsd1.5-img2img"
 5headers = {
 6    "x-api-key": "YOUR_API_KEY",
 7    "Content-Type": "application/json"
 8}
 9
10data = {
11    "image": "https://segmind.com/word2img_input.png",
12    "prompt": "top-view, A mouth-watering pizza topped with gooey cheese and fresh ingredients,Food Photography",
13    "negative_prompt": "square, poorly drawn, low quality",
14    "scheduler": "ddim",
15    "num_inference_steps": 25,
16    "guidance_scale": 7.5,
17    "control_scale": 1.9,
18    "control_start": 0.19,
19    "control_end": 1,
20    "samples": 1,
21    "seed": 6130473235,
22    "size": 768,
23    "base64": false
24}
25
26response = requests.post(url, headers=headers, json=data)
27
28if response.status_code == 200:
29    result = response.json()
30    print(json.dumps(result, indent=2))
31else:
32    print(f"Error: {response.status_code}")
33    print(response.text)

API Endpoint

POSThttps://api.segmind.com/v1/w2imgsd1.5-img2img

Parameters

imagerequired
string (uri)

Input Image

promptrequired
string

Prompt to render

base64optional
boolean

Base64 encoding of the output image.

Default: false
control_endoptional
number

Scale for controlnet guidance end

Default: 1Range: 0.01 - 1
control_scaleoptional
number

Scale for controlnet conditioning scale

Default: 1.8Range: 0 - 5
control_startoptional
number

Scale for controlnet guidance start

Default: 0.19Range: 0.01 - 1
guidance_scaleoptional
number

Scale for classifier-free guidance

Default: 7.5Range: 0.1 - 25
negative_promptoptional
string

Prompts to exclude, eg. 'bad anatomy, bad hands, missing fingers'

num_inference_stepsoptional
integer

Number of denoising steps.

Default: 25Range: 25 - 100
samplesoptional
integer

Number of samples to generate.

Default: 1Range: 1 - 4
scheduleroptional
string

Type of scheduler.

Default: "ddim"
Allowed values :
"ddim""dpmpp_2m"
seedoptional
integer

Seed for image generation.

Default: -1
sizeoptional
integer

Image resolution.

Allowed values :
5127681024

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