Skip to main content

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​

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 generate
  • negative_prompt: Elements you want to avoid in the generated image
  • width: Image width in pixels
  • height: Image height in pixels
  • num_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​

  1. Be specific in your prompts
  2. Use negative prompts to avoid unwanted elements
  3. Experiment with different parameters
  4. Use appropriate image dimensions
  5. Save your seeds for reproducible results