Skip to main content

Flux Models Guide ⚡

Overview

This guide covers the Flux family of models, which are optimized for fast and efficient image generation. We'll explore the different variants and their specific use cases.

Available Models

Basic Usage

Here's a simple example of how to use a Flux model:

from flymyai import client

# Initialize the client
fma_client = client(apikey="your-api-key")

# Set the model
model = "flymyai/flux-dev"

# Prepare the input data
payload = {
"prompt": "A magical forest with glowing mushrooms and fairies",
"height": 512,
"width": 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"]

Model Variants

Flux Dev

The standard version of Flux, offering a good balance between speed and quality.

Flux Schnell

An optimized version for ultra-fast image generation, perfect for real-time applications.

Flux Dev LoRA

The standard version with LoRA support, allowing for custom model fine-tuning.

Flux Schnell LoRA

The fast version with LoRA support, combining speed with customization.

Parameters

  • prompt: The text description of the image you want to generate
  • height: Image height in pixels
  • width: Image width in pixels
  • num_inference_steps: Number of denoising steps
  • guidance_scale: How closely to follow the prompt
  • seed: Random seed for reproducibility
  • lora_url: URL of the LoRA model to use (for LoRA variants)

Best Practices

  1. Choose the right model variant for your needs
  2. Use appropriate image dimensions
  3. Experiment with different parameters
  4. Save your seeds for reproducible results
  5. Use LoRA models for specific styles or subjects