Image Generation Guide 🎨
Overview​
This guide will help you get started with image generation using our AI models. We'll cover the basics of generating images, including how to use different models and parameters to achieve the best results.
Available Models​
- HiDream-I1-dev - High-quality image generation model
- Flux Dev - Fast and efficient image generation
- Flux Schnell - Ultra-fast image generation
- Flux Dev LoRA - Customizable image generation
- Flux Schnell LoRA - Fast customizable generation
Basic Usage​
Here's a simple example of how to generate an image:
from flymyai import client
# Initialize the client
fma_client = client(apikey="your-api-key")
# Set the model
model = "flymyai/hidream-i1-dev"
# Prepare the input data
payload = {
"prompt": "A beautiful sunset over mountains, digital art",
"negative_prompt": "blurry, low quality",
"width": 512,
"height": 512,
"num_inference_steps": 30,
"guidance_scale": 7.5,
"seed": 42
}
# Make the prediction
response = fma_client.predict(
model=model,
payload=payload
)
# Get the generated image URL
image_url = response.output_data["image_url"]
Parameters​
prompt
: The text description of the image you want to generatenegative_prompt
: Elements you want to avoid in the generated imagewidth
: Image width in pixelsheight
: Image height in pixelsnum_inference_steps
: Number of denoising steps (higher = better quality but slower)guidance_scale
: How closely to follow the prompt (higher = more faithful to prompt)seed
: Random seed for reproducibility
Best Practices​
- Be specific in your prompts
- Use negative prompts to avoid unwanted elements
- Experiment with different parameters
- Use appropriate image dimensions
- Save your seeds for reproducible results