Flux Models Guide
Overview​
The Flux family of models provides fast and efficient image generation with optional LoRA support for customization.
Available Models​
- Flux Dev Fast - Fast development-quality image generation
- Flux Schnell Fast - Ultra-fast image generation
- Flux Dev LoRA - Development version with LoRA support
- Flux Schnell LoRA - Fast version with LoRA support
Basic Usage​
Flux Schnell Fast​
from flymyai import client
import base64
fma_client = client(apikey="fly-***")
response = fma_client.predict(
model="flymyai/flux-schnell-fast",
payload={
"prompt": "A magical forest with glowing mushrooms and fairies",
"height": 1024,
"width": 1024,
"num_inference_steps": 4,
"seed": 42
}
)
image_data = base64.b64decode(response.output_data["sample"][0])
with open("output.jpg", "wb") as f:
f.write(image_data)
Flux Dev Fast​
from flymyai import client
import base64
fma_client = client(apikey="fly-***")
response = fma_client.predict(
model="flymyai/flux-dev-fast",
payload={
"prompt": "A photorealistic portrait of an astronaut on Mars",
"height": 1024,
"width": 1024,
"num_inference_steps": 4,
"seed": 42
}
)
image_data = base64.b64decode(response.output_data["sample"][0])
with open("output.jpg", "wb") as f:
f.write(image_data)
Parameters​
| Parameter | Description |
|---|---|
prompt | 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 apply (for LoRA variants) |
lora_scale | Strength of the LoRA effect (0.0 to 1.0) |
LoRA Support​
Flux LoRA variants allow you to apply custom LoRA models to influence the generation style. Provide a publicly accessible URL to a .safetensors file:
from flymyai import client
import base64
fma_client = client(apikey="fly-***")
response = fma_client.predict(
model="flymyai/flux-schnell-lora",
payload={
"prompt": "a robotic cat with a cyberpunk style",
"height": 1024,
"width": 1024,
"num_inference_steps": 4,
"guidance_scale": "0",
"seed": 1654,
"lora_url": "https://civitai.com/api/download/models/730973?type=Model&format=SafeTensor",
"lora_scale": "0.9"
}
)
image_data = base64.b64decode(response.output_data["sample"][0])
with open("lora_output.jpg", "wb") as f:
f.write(image_data)