Supporting Page — Practical Generation Guide

Mastering Text-to-Image with Mage-Flow

Learn how to craft effective prompts, configure sampling steps across model variants, and select native aspect ratios ranging from standard portrait to extreme 4:1 panoramas.

High Fidelity

Mage-Flow-4B-Base

Full 30-step flow matching model for maximum detail exploration, complex lighting, and artistic nuances.

Default Steps: 30
Human Aligned

Mage-Flow-4B (RL)

20-step model fine-tuned with reinforcement learning to prioritize human preference and prompt adherence.

Default Steps: 20
Fastest Execution

Mage-Flow-4B-Turbo

4-step distilled model optimized for sub-second web applications and rapid interactive iteration.

Default Steps: 4

1. Structuring Prompts for Mage-Flow

Mage-Flow incorporates a dual text encoder combining Qwen3 language representations with CLIP vision embeddings. This architecture understands natural language descriptions, complex spatial layouts, and stylistic instructions without requiring awkward comma-separated keyword stacks.

Recommended Prompt Architecture:

  1. Primary Subject: Clear identification of the main character, object, or architectural structure.
  2. Environment & Context: Description of the surrounding scene, atmospheric weather, background elements, and spatial positioning.
  3. Lighting & Color Palette: Specific lighting directions (e.g. golden hour sunlight, soft volumetric neon glow, dramatic rim lighting).
  4. Medium & Photographic Style: Art style specification (e.g. 35mm film photograph, macro studio camera render, oil canvas painting).
Example Prompt Format

"A cinematic portrait of a robotic astronaut standing on a reflective obsidian dune under a sapphire twilight sky, dramatic cyan rim lighting, crisp 35mm photography, highly detailed armor plates."

2. Aspect Ratio Configuration & Resolution Framing

Thanks to Mage-Flow's Native-Resolution Sequence Packing, you do not need to restrict generation to 1:1 square aspect ratios. The model dynamically allocates 2D Rotary Position Embeddings (2D RoPE) for diverse target dimensions:

Target Aspect RatioRecommended PixelsIdeal Use Case
1:1 Square1024 x 1024Social avatars, product showcases, square graphics
16:9 Widescreen1280 x 720 / 1920 x 1080Cinematic wallpaper, YouTube banners, desktop graphics
9:16 Vertical720 x 1280 / 1080 x 1920Mobile story layouts, vertical posters, mobile UI backgrounds
4:1 Ultra Panorama2048 x 512 / 512 x 2048Wide landscape horizons, architectural banners, web headers

3. Sampling Guidance & Classifier-Free Guidance (CFG)

Classifier-Free Guidance controls how strongly the diffusion sampling process adheres to your input prompt text versus exploring unconditioned data distributions.

  • Mage-Flow-Base (CFG 3.5 - 5.0): Provides optimal balance between imaginative composition and prompt text fidelity.
  • Mage-Flow RL-Aligned (CFG 2.5 - 3.5): Requires lower CFG values because reinforcement learning alignment inherently sharpens text control.
  • Mage-Flow-Turbo (CFG 1.0 - 2.0): Distilled trajectory checkpoints function best with low CFG values to avoid over-saturation artifacts during 4-step sampling.

4. Negative Prompt Strategies

While Mage-Flow possesses strong positive prompt adherence, supplying targeted negative prompts helps filter undesirable compositional traits during multi-step sampling:

Recommended Negative Prompt: "blurry, distorted anatomy, extra limbs, low resolution compression artifacts, oversaturated colors, text watermarks"

5. Seed Control & Batch Consistency

By locking the random seed parameter, Mage-Flow reproduces identical spatial compositions and lighting paths across generation runs. When testing subtle prompt adjustments (such as changing clothing color or sky weather), keeping the seed constant isolates prompt modification effects cleanly.

6. Detailed Domain Prompting Masterclass

Achieving exceptional results across different domain verticals (such as photorealism, digital art, product design, or fantasy landscapes) requires tailored prompting vocabularies.

Photorealistic Portrait Prompting:

When synthesizing human portraits, specify camera focal length, lens aperture, skin texture detail, and natural ambient lighting rather than generic terms like "ultra realistic":

"Editorial portrait photograph of a 30-year-old female architect, 85mm lens, f/1.8 aperture, natural window lighting, subtle skin freckles, shallow depth of field."

Architectural & Environmental Design:

For architectural concepts, describe materials, lighting temperature, and environmental integration:

"A minimalist brutalist concrete library situated beside a serene Japanese koi pond, morning fog, soft diffused sunlight, damp stone textures, 16:9 widescreen composition."

7. Python Script for Batch Generation Across Aspect Ratios

import torch
from diffusers import MageFlowPipeline

pipe = MageFlowPipeline.from_pretrained("microsoft/Mage-Flow-Turbo", torch_dtype=torch.bfloat16).to("cuda")

prompts_and_ratios = [
    ("Cyberpunk neon street at night, rain reflections", 1280, 720),
    ("Fantasy mountain citadel above clouds, 4:1 panorama", 2048, 512),
    ("Product shot of a sleek glass perfume bottle on black marble", 1024, 1024),
]

for idx, (p, w, h) in enumerate(prompts_and_ratios):
    img = pipe(prompt=p, width=w, height=h, num_inference_steps=4, guidance_scale=1.5).images[0]
    img.save(f"batch_output_{idx}.png")
    print(f"Generated image {idx+1}: {w}x{h}")

8. Prompt Engineering Dictionary for Lighting & Camera Control

Fine-tuning lighting terms in your prompt drastically influences output moods. Use these tested keyword modifiers within Mage-Flow:

  • Volumetric Lighting: Creates visible light rays streaming through fog, windows, or dense forest foliage.
  • Chiaroscuro: Produces intense contrast between bright highlights and deep shadows, ideal for dramatic portraits.
  • Bioluminescent Glow: Generates soft glowing cyan, blue, or purple illumination on fantasy flora and aquatic subjects.
  • Cinematic Anamorphic: Produces horizontal lens flares, oval bokeh background blurs, and wide 2.39:1 aspect ratio compositions.

9. Native Resolution Calculation Reference Table

Aspect Ratio NameWidth x HeightTotal PixelsPatch Token Count (2x2 Latent)
1:1 Square Standard1024 x 10241.05 Mpix4,096 Tokens
16:9 Widescreen HD1280 x 7200.92 Mpix3,600 Tokens
9:16 Portrait Story720 x 12800.92 Mpix3,600 Tokens
21:9 Ultrawide Cinema1792 x 7681.37 Mpix5,376 Tokens
4:1 Extreme Panorama2048 x 5121.05 Mpix4,096 Tokens

10. Troubleshooting Generation Artifacts

If generated outputs exhibit oversaturation, blurriness, or text distortion, review these quick corrective adjustments:

  • Oversaturated Colors: Lower the Guidance Scale (CFG) from 3.5 down to 1.5 - 2.0.
  • Blurry Fine Details: Switch from 4-step Turbo to 20-step RL-aligned or 30-step Base models.
  • Text Mismatch: Re-phrase long complex sentences into direct subject-action-environment clauses.

11. Summary of Text-to-Image Generation Best Practices

By combining structured prompt syntax, native resolution dimensions, appropriate Guidance Scale (CFG) values, and 4-step Turbo sampling, Mage-Flow provides a fast, flexible framework for synthesizing studio-grade images without subscription credit limits.

Next Guide

Discover instruction-based image editing with Mage-Flow-Edit.

Explore Image Editing Guide