tiny ramdom models
Collection
158 items β’ Updated β’ 11
How to use tiny-random/minimax-h3-image with Diffusers:
pip install -U diffusers transformers accelerate
import torch
from diffusers import DiffusionPipeline
# switch to "mps" for apple devices
pipe = DiffusionPipeline.from_pretrained("tiny-random/minimax-h3-image", dtype=torch.bfloat16, device_map="cuda")
prompt = "Astronaut in a jungle, cold color palette, muted colors, detailed, 8k"
image = pipe(prompt).images[0]import torch
from diffusers import DiffusionPipeline
# switch to "mps" for apple devices
pipe = DiffusionPipeline.from_pretrained("tiny-random/minimax-h3-image", dtype=torch.bfloat16, device_map="cuda")
prompt = "Astronaut in a jungle, cold color palette, muted colors, detailed, 8k"
image = pipe(prompt).images[0]This is a randomly initialized tiny model based on MiniMaxAI/MiniMax-H3-Image for testing and debugging.
| Feature | Source | This repo |
|---|---|---|
| Checkpoint tensor elements | 66.46B BF16, 604.20M F32 | 3.55M BF16, 1.13M F32 |
| Safetensors weight files | 135.34 GB (28 files) | 11.71 MB (3 files) |
| Diffusion transformer layers / refiner layers | 50 / 2 | 4 / 2 |
| Transformer width / heads / head dimension | 5,376 / 56 / 128 | 64 / 4 / 32 |
| Transformer FFN width | 14,336 | 128 |
| Per-step output heads (PDD) | 6 | Same |
| Image transformer image / text width | 24 / 5,120 | 8 / 8 |
| Text encoder layers / width / head dimension | 64 / 5,120 / 128 | 51 / 8 / 32 |
| Text encoder vision tower layers / width | 27 / 1,152 | 2 / 64 |
| Tokenizer / processor vocabulary rows | 151,936 | Same |
| Image VAE stages / residual blocks | 6 / 2 | Same |
| Image VAE stage widths | 128 / 256 / 256 / 512 / 512 / 1024 | 32 at every stage |
| Image VAE latent channels / compression | 24 / 16x | 8 / 16x |
| ViT decoder layers / heads / head dimension | 24 / 16 / 64 | 4 / 2 / 32 |
| Transformer precision | BF16 blocks, FP32 patch/timestep/output heads | Same |
| Image VAE precision | FP32 | Same |
| Inputs / output | Text, optional reference images -> image | Same |
The DiT conditions on hidden_states[50] of its Qwen3-VL conditioner, so the tiny text encoder keeps 51 decoder layers and shrinks only its width. Six VAE stages keep the source's 16x spatial compression, and the transformer keeps the full 2x2 latent patch and six-step PDD schedule that replaces the base output layer. The text condition width is reduced to 8 columns.
| File path | Size |
|---|---|
| text_encoder/model.safetensors | 6.2MB |
| transformer/diffusion_pytorch_model.safetensors | 1.1MB |
| vae/diffusion_pytorch_model.safetensors | 4.5MB |
Requires Diffusers 0.43.0 or newer, which ships the MiniMax-H3-Image integration, and Torchvision for the Qwen3-VL video processor.
def run_diffusers(model_id: str):
import torch
from PIL import Image
from diffusers import ModularPipeline
pipe = ModularPipeline.from_pretrained(model_id)
# The index stores the components relative to the repo root (`.`) so the same
# checkpoint loads from a local directory and from the Hub.
pipe.load_components(
pretrained_model_name_or_path=model_id, dtype={"default": torch.bfloat16, "vae": torch.float32}
)
device = "cuda" if torch.cuda.is_available() else "cpu"
pipe.to(device)
image = pipe(
prompt="A red fox trotting through a snowy pine forest.",
height=64,
width=64,
min_generation_area=1024,
generator=torch.Generator(device=device).manual_seed(42),
output="images",
)[0]
image.save("minimax-h3-image-t2i.png")
print("text-to-image", image.size)
reference = Image.new("RGB", (64, 64), "blue")
image = pipe(
prompt="Keep everything in <Picture 1> as it is, but turn the square green.",
image=reference,
height=64,
width=64,
min_generation_area=1024,
generator=torch.Generator(device=device).manual_seed(1234),
output="images",
)[0]
image.save("minimax-h3-image-edit.png")
print("image editing", image.size)
if __name__ == "__main__":
run_diffusers(model_id="scratch/minimax-h3-image")
This repo is generated by DeepSeek-V4.1-Flash.