Instructions to use lox9973/MiniT2I-B-16-MF-compact with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use lox9973/MiniT2I-B-16-MF-compact with Diffusers:
pip install -U diffusers transformers accelerate
import torch from diffusers import DiffusionPipeline # switch to "mps" for apple devices pipe = DiffusionPipeline.from_pretrained("lox9973/MiniT2I-B-16-MF-compact", dtype=torch.bfloat16, device_map="cuda") prompt = "Astronaut in a jungle, cold color palette, muted colors, detailed, 8k" image = pipe(prompt).images[0] - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- Draw Things
- DiffusionBee
MiniT2I-B-16-MF-compact
512 Γ 512 text-to-image generation in four steps, with a compact text encoder.
MiniT2I-B-16-MF-compact is a fine-tune of MiniT2I-B-16-MF that reduces total pipeline parameters from 603.3M to 315.1M (47.8% fewer) by replacing FLAN-T5-large with a trained, 16-layer encoder based on FLAN-T5-small. These totals include the image transformer and text encoder. It keeps the base model's Mean Flow image generator and four-step sampling, with updated text-conditioning preamble blocks.
Generated with seed 0 and prompts from the official MiniT2I gallery.
Highlights
- Compact text conditioning: a width-512 T5 encoder trained to reproduce the original model's conditioning, with its projection fused into the image model.
- Four-step generation: native Mean Flow sampling at 512 Γ 512 pixels.
- Ready for Diffusers: weights, tokenizer, scheduler, and custom Python pipeline are included. No JAX installation or separate base-model download is needed.
Quick start
import torch
from diffusers import DiffusionPipeline
MODEL_ID = "lox9973/MiniT2I-B-16-MF-compact"
pipe = DiffusionPipeline.from_pretrained(
MODEL_ID,
custom_pipeline=MODEL_ID,
trust_remote_code=True,
torch_dtype=torch.float32,
).to("cuda")
image = pipe(
"A lonely astronaut standing on a quiet beach under two moons.",
num_inference_steps=4,
guidance_scale=12.0,
generator=torch.Generator(device="cuda").manual_seed(0),
).images[0]
image.save("minit2i.png")
MODEL_ID can be a downloaded model folder or this model's Hugging Face
repository ID. Loading runs the custom Python code included in the repository.
For CPU inference, change both "cuda" values to "cpu".
Recommended settings
| Setting | Value |
|---|---|
| Image size | 512 Γ 512 (fixed) |
| Sampling steps | 4 |
| Embedded guidance | guidance_scale=12.0 |
| Guidance interval | t_min=0.2, t_max=0.8 |
| Prompt length | Up to 256 tokens, including EOS |
| Weight storage | float16 |
| Default computation | float32 for both text encoder and image transformer |
These are the pipeline defaults. Overlong prompts raise an error; shorten them
instead of relying on truncation. num_images_per_prompt generates multiple
images per prompt. The pipeline does not accept a negative prompt or custom
width and height. Quality at other sampling settings has not been established.
Weight storage and inference precision are separate. FP16/BF16 files save download and disk space; loading in FP32 uses FP32 model memory and preserves the rounding already present in the stored weights. The example uses FP32, matching the release gallery. Loading directly in FP16 is not the recommended inference configuration.
Model details
The compact encoder has five retained FLAN-T5-small blocks and eleven newly initialized blocks, trained together with the original model's two text preamble blocks. A bias-free projection connects the compact encoder to the image model and is fused into the exported weights. The image denoising backbone is otherwise frozen during this fine-tune.
Training uses conditioning distillation on 80,000 captions: 40,000 from BLIP3o and 40,000 from ShareGPT, with held-out validation and test captions. The goal is to retain the base model's behavior with a smaller text frontend. This release does not claim higher image quality than the base model.
Limitations
Text rendering, anatomy, counting, spatial relationships, and detailed prompt following can be unreliable. The gallery shows selected examples rather than a quality benchmark. Outputs can reflect biases inherited from the base model and text encoder. This pipeline does not include a safety checker.
Credits and licenses
- Base image model: MiniT2I/MiniT2I-B-16-MF-jax.
- Text encoder initialization: google/flan-t5-small; conditioning teacher: google/flan-t5-large.
- Gallery prompt source: the official MiniT2I gallery.
This model is released under the MIT License, following upstream MiniT2I. The upstream notice is retained in LICENSE-MiniT2I.txt. FLAN-T5's upstream model cards also document its Apache-2.0 license.
- Downloads last month
- 69
