Skip to main content

Image Generation Guide

Overview​

This guide covers image generation using the FlyMyAI platform. We'll walk through available models, parameters, and how to get the best results.

Available Models​

Basic Usage​

SDXLTurbo (fastest)​

from flymyai import client
import base64

fma_client = client(apikey="fly-***")

response = fma_client.predict(
model="flymyai/SDXLTurbo",
payload={
"prompt": "A beautiful sunset over mountains, digital art",
"negative_prompt": "blurry, low quality",
}
)

# SDXLTurbo returns base64 image under the "sample" key
image_data = base64.b64decode(response.output_data["sample"][0])
with open("output.jpg", "wb") as f:
f.write(image_data)

NanoBananaPro​

from flymyai import client
import base64

fma_client = client(apikey="fly-***")

response = fma_client.predict(
model="flymyai/nano-banana-pro",
payload={
"prompt": "A magical forest with glowing mushrooms and fairies",
"width": 1024,
"height": 1024,
"num_inference_steps": 4,
"seed": 42
}
)

# NanoBananaPro returns base64 image under the "image" key
image_data = base64.b64decode(response.output_data["image"][0])
with open("output.png", "wb") as f:
f.write(image_data)
note

Different models return output under different keys (e.g. sample, image). Check the model page on FlyMy.AI for the exact output schema.

Parameters​

ParameterDescription
promptText description of the image you want to generate
negative_promptElements you want to avoid in the generated image
widthImage width in pixels
heightImage height in pixels
num_inference_stepsNumber of denoising steps (higher = better quality but slower)
guidance_scaleHow closely to follow the prompt (higher = more faithful)
seedRandom seed for reproducibility

Not all parameters are supported by every model. Check the model page for the exact parameters available.

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 for your use case
  5. Save your seeds for reproducible results