--- library_name: transformers pipeline_tag: text-to-image tags: - text-to-image - custom_code --- # Pyramid Flow 100M Pyramid Flow generates 256 × 256 RGB images from English prompts. The model runs on CPU or CUDA with Hugging Face Transformers. It uses the T5-base text encoder and the SD-VAE decoder, which download separately on first use. ## Generate an image Install the dependencies in `requirements.txt`, then run the following Python example. ```python import torch from transformers import AutoModel repo = "TheHuggerFacer/Pyramid-Flow-100M" device = "cuda" if torch.cuda.is_available() else "cpu" model = AutoModel.from_pretrained(repo, trust_remote_code=True).eval().to(device) image = model.generate_image( "A clockwork owl perched on a brass telescope, studio photograph", seed=42, num_inference_steps=20, guidance_scale=4.0, )[0] image.save("clockwork-owl.png") ``` Pass a list of prompts to generate a batch. The method returns one PIL image per prompt. A fixed seed makes it easier to compare prompts on the same device. A guidance scale of 1 uses the conditional prediction directly. Object counts, spatial relations and fine details can be inconsistent. The text encoder and decoder are distributed separately under their respective terms. [T5-base](https://huggingface.co/google-t5/t5-base) · [SD-VAE](https://huggingface.co/stabilityai/sd-vae-ft-mse) The inference implementation uses attention, rotary embeddings and timestep components adapted from [tinydit](https://github.com/ivanmikhnenkov/tinydit).