Running IF with 🧨 diffusers on a Free Tier Google Colab
DeepFloyd's IF, a pixel-space text-to-image model built on a T5-XXL text encoder with over 10B parameters, can run on a free-tier Google Colab (13 GB CPU RAM, 15 GB T4 VRAM) by loading its components one at a time with diffusers. The recipe quantizes T5 to 8-bit with bitsandbytes, loads the UNets in fp16, and passes precomputed prompt embeddings between pipelines. Each component is freed with del, gc.collect and torch.cuda.empty_cache before the next one loads. These steps trade inference speed for memory, so for production the recommendation is a 40GB A100 with all components kept on the GPU. Image variation and inpainting are also covered.
Related posts
- Deploying Hugging Face Models with BentoML: DeepFloyd IF in Action
Hugging Face mediumAdeptDeepFloyd IF, a pixel-space text-to-image model with a T5-XXL text encoder and three cascaded diffusion stages (64px up to 1024px), can be packaged and served with BentoML by saving each stage's model to the BentoML Model Store, wrapping them as separate Runners in a Service, and building a Bento artifact. Because each stage is its own Runner, stages can be pinned to different GPUs (e.g. Stage 1 on one T4, Stages 2 and 3 on another) or scaled independently. Hardware guidance is at least 2x16GB or 1x40GB of VRAM. The resulting ~49 GiB Bento can be served directly, containerized with `bentoml containerize`, and deployed to Kubernetes.
- Welcome FLUX.3 Image Klein in Diffusers
Hugging Face mediumAdeptFLUX.3 Image Klein from Black Forest Labs is supported in Diffusers from launch. It is a single model for text-to-image, multi-reference image-to-image, and bounding-box layout control, where regions are written as JSON with normalized 0–1000 boxes to place new content or move content from a reference image. The distilled checkpoint renders 1024×1024 in about 1.9 s on an H100 in 16 steps without CFG. Reference images roughly double the time because each adds 4,096 tokens to the transformer sequence. The post also covers FP8 and NVFP4 single-file variants that cut peak memory to about 15–16 GiB, DreamBooth LoRA training scripts, the VAE tokenization (one token per 16×16 patch), and Modular Diffusers pipeline usage.
- Introducing Würstchen: Fast Diffusion for Image Generation
Hugging Face mediumAdeptWürstchen is a text-to-image diffusion model whose text-conditional Prior (Stage C) runs in a latent space with 42x spatial compression, far beyond the usual 4-8x. Two decoder stages, a VQGAN (Stage A) and a Diffusion Autoencoder (Stage B), reconstruct images from that latent. The result is faster, lower-memory inference than SDXL and much cheaper training: 9,000 GPU hours for v1 and 24,602 for v2, against 150,000 for Stable Diffusion 1.4. The model is integrated into Diffusers, with example code for AutoPipeline inference, PyTorch 2 SDPA or xFormers attention, CPU offload and torch.compile, where compilation takes up to 2 minutes up front for faster runs afterwards.
- State of open video generation models in Diffusers
Hugging Face mediumAdeptOpen video generation models such as HunyuanVideo, CogVideoX, LTX-Video, Mochi-1 and Allegro share a common architecture: T5-style text encoders, a DiT-based denoiser over 3D spatio-temporal tokens, a spatially and temporally compressing VAE, and a scheduler. Diffusers runs them in a few lines of code but they need a lot of memory, about 60 GB for HunyuanVideo at default settings. Benchmarks combining bitsandbytes/FP8 quantization, CPU and group offloading, VAE tiling and layerwise casting bring HunyuanVideo down to about 6.6 GB with little extra latency. Timestep and guidance distillation speed up generation, and the finetrainers repo supports LoRA fine-tuning.
- 🧨 Stable Diffusion in JAX / Flax !
Hugging Face mediumAdeptHugging Face Diffusers 0.5.1 adds Flax support, enabling Stable Diffusion inference on Google TPUs. The walkthrough loads bf16 weights with FlaxStableDiffusionPipeline, then replicates parameters and shards prompts across 8 TPU devices to generate 8 images in parallel. It also covers PRNG key splitting for reproducibility and why input shapes must stay fixed to avoid recompilation. On a TPU v2-8, the first JIT compile takes over a minute, after which a batch of 8 images takes about 7 seconds. It closes by showing how jax.pmap compiles the generation function and runs it SPMD-style on each device.