LuminaT2XModel<T>
Models & Types · AiDotNet.Diffusion.Video
Lumina-T2X model — transformer-based text-to-any generation (image, video, 3D, audio).
Inheritance: DiffusionModelBase<T> → LatentDiffusionModelBase<T> → LuminaT2XModel<T>
For Beginners
Lumina-T2X is a unified model for multiple generation tasks:
Key characteristics:
- Single architecture generates images, videos, 3D, and audio
- Flag-DiT: improved DiT with flow matching
- Resolution-aware encoding: handles any aspect ratio
- Gemma text encoder for multilingual prompts
- Scalable from 0.6B to 7B parameters
Use Lumina-T2X when you need:
- Multi-modal generation from text
- Flexible resolution/aspect ratio support
- Research into unified generation
How It Works
Lumina-T2X is a unified transformer framework for generating multiple modalities from text: images, videos, 3D objects, and audio. It uses a Flag-DiT backbone with resolution-aware positional encoding.
Technical specifications:
- Architecture: Flag-DiT with flow matching
- Text encoder: Gemma-2B (2048-dim)
- Resolution: up to 2048x2048
- Latent channels: 4, 8x downsampling
- Flow matching with velocity prediction
Reference: Gao et al., “Lumina-T2X: Transforming Text into Any Modality”, 2024
Example
var options = new DiffusionModelOptions<float> { LatentChannels = 4, DefaultInferenceSteps = 30 };
var trainX = Tensor<float>.CreateRandom(2, 4, 32, 32);
var trainY = Tensor<float>.CreateRandom(2, 4, 32, 32);
var result = new AiModelBuilder<float, Tensor<float>, Tensor<float>>()
.ConfigureModel(new LuminaT2XModel<float>(options: options))
.Build(trainX, trainY);
var noise = Tensor<float>.CreateRandom(new[] { 1, 4, 128, 128 });
var generated = result.Predict(noise);
Constructors
| Constructor | Summary |
|---|---|
LuminaT2XModel(NeuralNetworkArchitecture<T> architecture, DiffusionModelOptions<T> options, INoiseScheduler<T> scheduler, DiTNoisePredictor<T> dit, StandardVAE<T> vae, IConditioningModule<T> conditioner, int? seed) |
Properties
| Property | Summary |
|---|---|
IConditioningModule<T> Conditioner { get; } |
|
INoisePredictor<T> NoisePredictor { get; } |
|
IVAEModel<T> VAE { get; } |
|
int LatentChannels { get; } |
Methods
| Method | Summary |
|---|---|
ModelMetadata<T> GetModelMetadata() |
|
Tensor<T> GenerateFromText(string prompt, string negativePrompt, int width, int height, int numInferenceSteps, double? guidanceScale, int? seed) |
Fields
| Field | Summary |
|---|---|
int DefaultHeight |
|
int DefaultWidth |