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.

Images generated by MiniT2I-B-16-MF-compact

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

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
Safetensors
Model size
0.3B params
Tensor type
F16
Β·
Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support

Model tree for lox9973/MiniT2I-B-16-MF-compact

Finetuned
(1)
this model
Quantizations
2 models

Space using lox9973/MiniT2I-B-16-MF-compact 1