AI Model Wiki

    Skip to main content
    Back to Glossary

    Text-to-Image

    Text-to-image is a generative AI capability in which a model synthesises a pixel-level image conditioned on a natural-language description, with no hand-crafted rules or templates. Modern systems — Stable Diffusion, Midjourney, DALL-E 3, and FLUX — are predominantly Diffusion models or hybrid architectures that iteratively refine random noise into a coherent image guided by a text Embedding derived from a language encoder. The same Latent Space representation that encodes "a photorealistic red fox sitting in a library" steers the denoising trajectory toward the intended visual content.

    Think of it like commissioning a painting from a highly skilled artist who works entirely from your written brief. The artist's training — millions of paintings and their captions — gives them an intuition about what "impressionist foggy harbour at dawn" should look like, and they execute it without ever asking for a sketch.

    import torch
    from diffusers import StableDiffusionPipeline
    
    pipe = StableDiffusionPipeline.from_pretrained(
        "runwayml/stable-diffusion-v1-5", torch_dtype=torch.float16).to("cuda")
    image = pipe("a vintage robot reading a newspaper in a 1950s diner",
                  num_inference_steps=30, guidance_scale=7.5).images[0]
    image.save("output.png")
    

    Text-to-image models are a subclass of Multimodal systems because they bridge language and vision modalities. The quality and coherence of outputs depend heavily on Prompt Engineering: specificity about lighting, style, composition, and aspect ratio dramatically affects results. GANs were the dominant approach before diffusion models and remain relevant for real-time applications where iterative denoising is too slow.

    You will encounter text-to-image whenever you use a creative AI tool, generate product mockups, create dataset images for computer-vision training, or integrate image generation into a multi-step AI pipeline.

    Related Courses

    AI Terminology
    Glossary