Skip to main content

Module imagegen

Module imagegen 

Source
Expand description

End-to-end Lumina-Image 2.0 text→image: Gemma-2 prompt encode → flow-matching Next-DiT loop → FLUX-VAE decode.

Fourth increment of the image-generation runtime (docs/GENERATIVE.ru.md). Mirrors diffusers Lumina2Pipeline: the system-prompt template "<sys> <Prompt Start> <prompt>", Gemma hidden_states[-2] as caption features, FlowMatchEulerDiscrete with static shift 6 (σ’ = 6σ/(1+5σ) over linspace(1, 1/N, N), terminal 0), the model called at t = 1−σ, CFG with per-row norm rescaling and the sign flip before the Euler step. Loads stages sequentially and drops each when done — peak RSS is one component (Gemma 10.4 GB f32), not the sum.

Structs§

GenParams

Constants§

DEFAULT_SYSTEM_PROMPT

Functions§

generate
Generate an RGB image [3, height, width] in [0, 1] from root: either a diffusers Lumina-Image 2.0 directory (tokenizer/ text_encoder/ transformer/ vae/, exact f32) or a packaged .cmf file (cortiq imagine-pack, quantized + mmap). progress is called after every denoise step.