Open-source video models

Member lesson

Running a video model with diffusers

Lesson 5 of 10 in Open-source video models.

Checked against the makers' documentation on 25 September 2026.

Lesson

diffusers is Hugging Face's Python library for diffusion models, and version 0.40.0, released on 20 August 2026, runs all four current families, MiniMax H3 through its newer modular system and the others through ordinary pipelines. Wan 2.2 TI2V-5B is the simplest. One class, WanPipeline, loads it, one call generates 121 frames at 1280 by 704, and one helper writes them to an MP4 at 24 frames a second, which is 5.04 seconds of video. It is also Apache-licensed and small enough for a single 24 GB card with offloading, so the code below is the version worth keeping.

cpu offload: each part visits the gpu in turnprompttext encodertransformer50 stepsvae decode121 framesexport_to_video.mp4one clip, about 5 seconds at 24 fps
What one diffusers call does: the prompt goes through the text encoder, the transformer runs fifty steps, the VAE decodes 121 frames, and export_to_video writes the mp4; with CPU offload each part visits the GPU in turn.
An ink drawing of a recipe card with wavy lines for writing, clipped to a steel kitchen pass, beside a white plate holding a finished dish.
A short script is a recipe card: follow it exactly and the same dish comes out.
Member

The rest of this is for members.

You have read the opening of this lesson. The rest of it comes with a membership.

One membership covers all four courses and Brands.

  • All lessons in the four Learn courses
  • All brand breakdowns in the Brands section
  • All quizzes, flashcards and crosswords
  • An AI teacher on every lesson, for up to 60 questions a day
  • All course material published during the membership

Price

Membership is from $12 a month on the Yearly plan, which is charged at $144 once a year. Lifetime access is $59, paid once.Membership is from ₹200 a month on the Yearly plan, which is charged at ₹2,400 + GST once a year. Lifetime access is ₹3,999 + GST, paid once.

Check what stuck

Members only

You can't take this check yet.

Members answer these 3 questions and keep the ticket for this lesson. Every lesson has one.

  1. Question 1, locked

    Which of these words means this? “The diffusers object that bundles a model's text encoder, transformer, VAE and scheduler behind one call.”

    • Inference Providers
    • Pipeline
    • Unified memory
    • Steps
  2. Question 2, locked

    Which of these words means this? “The number format the weights are loaded in; torch.bfloat16 halves the memory of 32-bit weights with little visible loss.”

    • Release notes
    • dtype
    • Distilled checkpoint
    • VAE
  3. Question 3, locked

    Which of these words means this? “Keeping each part of the pipeline in ordinary RAM and moving it onto the GPU only while it is working.”

    • Template
    • Open source AI
    • Gated repository
    • Model CPU offload

Elsewhere in the library

Hear about new courses.

Leave an email and we will tell you when something new lands. We do not write often.