ComfyUI + Wan 2.2 β€” a ready-to-run text-to-video notebook

A single marimo notebook that turns a fresh GPU box into a private text-to-video studio: it installs ComfyUI, fetches the weights, runs the server, and drives it from the browser. Built and measured on a molab GPU box.

This repository contains no model weights. It is a recipe: a notebook plus a pinned file list. The weights are public and are downloaded from Comfy-Org/Wan_2.2_ComfyUI_Repackaged (Apache-2.0) at the exact revision ee6f4a40737a995bf5818954cfce6d59443b0f04, so the bytes you get are reproducible without duplicating 49 GB.

What it is

Task text-to-video and image-to-video
Models used Wan 2.2 TI2V-5B, T2V-A14B (MoE) and I2V-A14B (MoE)
Runtime ComfyUI, driven over its HTTP + WebSocket API
Interface a marimo notebook (browser UI, no ComfyUI graph editing needed)
Weights location /marimo/ComfyUI/models on your box
Licence of the weights Apache-2.0

What it can do

  • Text β†’ video. Type a prompt, press Generate video, watch the clip in the notebook and download the .mp4 to your computer.
  • Image β†’ video. Attach a picture and the video starts from it. Attach one of your own clips and the notebook decodes a frame out of it β€” the last frame by default, so the new video carries on from where the old one stopped.
  • Three model tiers. A fast 5B, plus two higher-quality 14B mixture-of-experts: T2V for text, I2V for pictures.
  • Four A14B speed/quality modes. A distilled 4-step mode, or full 20-step sampling for maximum fidelity β€” in both the text and the image flavour.
  • Long videos, up to 30 minutes. The length menu β€” 5 s / 10 s / 30 s / 60 s / 1 min / 3 min / 5 min / 10 min / 30 min β€” is honoured by every model: the notebook renders ~5 s clips and stitches them. The TI2V-5B and the I2V-A14B chain (each clip starts from the previous clip's last frame, so the shot stays continuous β€” measured 0.94 SSIM across a seam, versus 0.48 for an unrelated clip). The T2V-A14B takes no start image, so its segments are independent takes and the result cuts between them.
  • Resumable renders. Finished clips are kept. If a render is interrupted β€” or the whole session is lost β€” pressing Generate again resumes and only renders what is missing.
  • Self-installing. On a fresh box the notebook clones ComfyUI, builds its environment and downloads the weights. Everything under /marimo, so it survives notebook restarts.
  • A clip picker to preview and download everything you have rendered.

How to use it

Option A β€” the notebook (recommended)

curl -fLO https://huggingface.co/dragonlimited/comfyui-molab/resolve/main/notebook.py
marimo edit notebook.py

Then work down the cells:

  1. Install ComfyUI (automatic, a few minutes on a fresh box).
  2. Pick a model and press Download missing model files (18.1 GB for the 5B, 38.0 GB for the A14B β€” see the table below).
  3. Server starts itself on 127.0.0.1:8188.
  4. Write a prompt β€” and optionally attach a picture or a clip to start from β€” choose quality and length, press Generate video.
  5. Watch & download the result. Step 6 lists every clip you have made.
  6. Publish (step 7) β€” pushes notebook.py plus the regenerated manifest.json / restore.sh back to this repo, so the box and the repo stay in step after you change anything.

Option B β€” headless

curl -fLO https://huggingface.co/dragonlimited/comfyui-molab/resolve/main/restore.sh
bash restore.sh          # 5B only              (18.1 GB)
bash restore.sh a14b     # T2V-A14B only        (38.0 GB, best text -> video)
bash restore.sh i2v      # I2V-A14B only        (38.0 GB, best image -> video)
bash restore.sh all      # all three            (80.5 GB)

restore.sh clones ComfyUI, creates the venv, installs dependencies and downloads the weights at the pinned revision. It uses curl deliberately β€” see the gotchas.

The models, and what they cost

preset download clip measured speed per clip
Wan 2.2 TI2V-5B 18.1 GB 1280x704, 24 fps, 121 frames (~5 s) Draft ~3.4 s Β· Standard 80.5 s Β· High ~108 s
Wan 2.2 T2V-A14B 38.0 GB (31.3 GB incremental) 1280x720, 16 fps, 81 frames (~5.06 s) Turbo ~80 s Β· Quality 12.9 min
Wan 2.2 I2V-A14B 38.0 GB (31.3 GB incremental) 1280x720, 16 fps, 81 frames (~5.06 s) Turbo ~80 s Β· Quality 12.9 min

The 5B is the consumer-GPU variant (~24 GB card). The A14B is the quality tier: a two-expert mixture-of-experts, where a high-noise expert samples the first half of the steps and a low-noise expert the second half. It needs a different VAE (wan_2.1_vae, not wan2.2_vae).

A14B quality vs speed

mode steps cfg LoRA measured
A14B Turbo 4 1.0 LightX2V 4-step distillation ~80 s/clip
A14B Quality 20 5.0 none ~12.9 min/clip (34 s per step)

A14B Turbo costs about the same wall-clock as 5B Standard but with the better model β€” that is the sweet spot. Full-quality 20-step A14B is ~9x slower: ideal for one hero shot, impractical for long videos.

Runtime expectations

At 5B Standard (~80 s per 5 s clip): a 30 s video is ~8 min, 1 min ~16 min, 3 min ~48 min, 5 min ~1.3 h, 10 min ~2.7 h, 30 min ~8 h. A14B Turbo is about the same; A14B Quality is ~9x slower β€” 5 s ~13 min, 10 min ~26 h, 30 min ~77 h.

Starting from your own picture or clip

Step 4 has two optional drop-zones:

  • Start image β€” a PNG, JPEG, WEBP or BMP. The first clip is rendered from that picture and every later clip is chained on from the one before it.
  • Start clip β€” an MP4, MOV, WEBM or MKV. The notebook decodes one frame out of it with ffmpeg and uses that as the start image: pick last frame to carry on from where your clip ended, or first frame to animate its opening.

Uploads are re-encoded to a real PNG and named from their content hash, so re-running the notebook reuses the same start frame β€” which is what keeps long, resumable renders resumable. Only the models that accept a start image use it: the TI2V-5B and the I2V-A14B. Attach a picture while a T2V-A14B preset is selected and the notebook says so rather than failing.

Limitations

  • ~5 seconds per clip is the model's ceiling. All three models are trained on ~5-second clips; anything longer is built by chaining or stitching ~5 s clips, not by one long shot.
  • The T2V-A14B cannot chain. Its text-to-video graph uses EmptyHunyuanLatentVideo, which takes no start image, so consecutive T2V-A14B clips cannot be joined into one continuous shot. The length menu still works on it β€” long videos are rendered as independent ~5 s segments and stitched, so the video cuts between them rather than flowing. For a continuous 14B long shot use the I2V-A14B, which takes a start image and therefore chains; the TI2V-5B is the fast option.
  • No usable faster attention kernel. The shipped flash_attn_4 wheel is FlashAttention 4's flash_attn.cute CuTe-DSL build and provides no flash_attn_func, which is what ComfyUI imports; it rejects --use-flash-attention. --use-ck-attention is not implemented in this ComfyUI. The only real speed levers are fewer sampling steps and lower resolution.
  • Chained videos drift over many clips, since each clip is generated from the previous one.
  • Quality is subjective. No aesthetic guarantees are made.

Gotchas discovered on this box

  • certifi's CA bundle is missing in the molab image. Anything built on httpx β€” the hf CLI, huggingface_hub β€” dies with FileNotFoundError from ssl.create_default_context. urllib and curl work (system CA store), which is why restore.sh uses curl. Fix if you need the CLI: point certifi.where() at /etc/ssl/certs/ca-certificates.crt.
  • The venv is not portable. It is created with --system-site-packages to reuse the box's CUDA-enabled torch, and holds absolute paths. Rebuild it; do not copy it.
  • /marimo is not a persistent volume. It survives a kernel restart but not a fresh container.
  • UI state does not persist. The prompt resets to the sample text, the seed to -1, run buttons are unpressed, and a mo.ui.dropdown resets to its value= default whenever its defining cell re-runs.
  • The quality menu follows the model. Only the presets belonging to the model picked in step 2 are offered, so the two cannot disagree; switching the model resets the quality menu to that family's own default.

Files

file purpose
notebook.py the marimo notebook β€” the whole workflow, as cells
restore.sh [5b|a14b|i2v|all] headless rebuild of ComfyUI + the chosen weights
manifest.json machine-readable list: preset β†’ destination, URL, exact byte size, pinned revision
README.md this card

restore.sh and manifest.json are generated from the notebook's own MODEL_PRESETS, so they cannot drift from the code: step 7 of the notebook, Publish to Hugging Face, regenerates both and pushes them together with notebook.py in a single commit. Press it after you edit the notebook on your box and the repo is up to date again.

Credits

Downloads last month
-
Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support