Qwen Image
Qwen-Image revolutionizes image generation and editing with seamless multilingual text integration and photorealistic detail.
API
If you're looking for an API, you can choose from your desired programming language.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
import requests
import base64
# Use this function to convert an image file from the filesystem to base64
def image_file_to_base64(image_path):
with open(image_path, 'rb') as f:
image_data = f.read()
return base64.b64encode(image_data).decode('utf-8')
# Use this function to fetch an image from a URL and convert it to base64
def image_url_to_base64(image_url):
response = requests.get(image_url)
image_data = response.content
return base64.b64encode(image_data).decode('utf-8')
# Use this function to convert a list of image URLs to base64
def image_urls_to_base64(image_urls):
return [image_url_to_base64(url) for url in image_urls]
api_key = "YOUR_API_KEY"
url = "https://api.segmind.com/v1/qwen-image"
# Request payload
data = {
"prompt": "A mystical dragon hovering above a sparkling waterfall under a starry sky.",
"negative_prompt": "blurry, cartoonish",
"steps": 30,
"seed": -1,
"guidance": 4.5,
"aspect_ratio": "16:9",
"image_format": "png",
"quality": 90,
"base64": False
}
headers = {'x-api-key': api_key}
response = requests.post(url, json=data, headers=headers)
print(response.content) # The response is the generated image
Attributes
Describe imaginative landscapes or detailed environments for image generation. Examples: 'A mystical dragon cave' or 'rustic mountain cabin'.
Exclude elements to control results. Useful filters: 'blur' for clarity, 'cartoonish' for realism.
Adjust detail with steps. Use 50 for detailed render, 20 for speed.
min : 1,
max : 50
Determines image variation. Use -1 for unique images, fixed for repeatability.
Adjusts adherence to prompt. Set 2.5 for creativity, 5.0 for precision.
min : 1,
max : 20
Defines image proportion. Use 16:9 for cinematic, 1:1 for square formats.
Allowed values:
Select image format. Use 'jpeg' for small files, 'png' for quality.
Allowed values:
Set clarity level. Choose 80 for web, 100 for print quality.
min : 10,
max : 100
Outputs base64 image string. Enable for embedding, disable for files.
To keep track of your credit usage, you can inspect the response headers of each API call. The x-remaining-credits property will indicate the number of remaining credits in your account. Ensure you monitor this value to avoid any disruptions in your API usage.
Resources to get you started
Everything you need to know to get the most out of Qwen Image
Creative ImageGen Mode: Effective Usage Guide
Unlock the full potential of the Creative ImageGen Mode by understanding its parameters and choosing the right settings for your project. This guide walks you through core options, outlines use-case recipes, and shares advanced tips for consistent, high-quality results.
1. Core Parameters Overview
- •prompt (required): Your main creative directive.
Example:“A mystical dragon hovering above a sparkling waterfall under a starry sky.”
- •negative_prompt (advanced): Filters out unwanted elements.
Default:blurry, cartoonish
- •steps (1–50): Number of inference steps.
• 50 for high detail.
• 20 for faster preview. - •seed (int): Controls randomness.
•-1
for unique variations.
• Fixed number for reproducible outputs. - •guidance_scale (1.0–20.0): Balances creativity vs. precision.
• 2.5 for free-form imagination.
• 5.0+ to strictly follow the prompt. - •aspect_ratio: Choose from
1:1
,16:9
,9:16
,4:3
,3:4
,3:2
,2:3
. - •image_format: Output file type.
•png
for lossless quality.
•jpeg
for smaller file size.
•webp
for modern web usage. - •quality (10–100): Final image fidelity.
• 100 for print-ready.
• 80 for standard web.
2. Use-Case Recipes
- •
High-Resolution Print
• steps: 50
• guidance_scale: 5.0
• quality: 100
• image_format:png
• aspect_ratio: custom (e.g.,4:3
) - •
Web Thumbnails / Previews
• steps: 20
• guidance_scale: 4.5
• quality: 80
• image_format:jpeg
• aspect_ratio:16:9
- •
Square Social Media Posts
• steps: 30
• guidance_scale: 4.0
• quality: 90
• image_format:webp
• aspect_ratio:1:1
- •
Concept Sketches & Iteration
• steps: 15
• guidance_scale: 2.5
• seed:-1
(explore variations)
• quality: 70
• image_format:png
3. Advanced Tips
- •Lock the seed to reproduce a favorite design or tweak details iteratively.
- •Use negative_prompt to refine outputs; e.g., “no text, no artifacts.”
- •For cinematic scenes, pick
16:9
and boost guidance_scale to 6–8. - •Enable Base64 Output for direct embedding in web apps (advanced setting).
- •Tweak steps in small increments to balance speed vs. detail.
By mixing these parameters thoughtfully, you can produce anything from quick concept art to gallery-quality prints. Experiment, iterate, and let Creative ImageGen Mode bring your vision to life!
Other Popular Models
Discover other models you might be interested in.
idm-vton
Best-in-class clothing virtual try on in the wild

illusion-diffusion-hq
Monster Labs QrCode ControlNet on top of SD Realistic Vision v5.1

sdxl1.0-txt2img
The SDXL model is the official upgrade to the v1.5 model. The model is released as open-source software

codeformer
CodeFormer is a robust face restoration algorithm for old photos or AI-generated faces.
