video-and-inpainting
Use Imagen-Pytorch video generation and image/video inpainting APIs, including Unet3D tensor shapes, sampling frame counts, conditioning frames, masks, and safe preflight validation.
- License 许可
- MIT
- 最近更新
- 2026-09-03
- Stars
- ★ 351
- Forks
- 27
01 前言 Front Matter
- name
- video-and-inpainting
- license
- MIT
- metadata
- { "disco-role": "operating" }
- description
- Use Imagen-Pytorch video generation and image/video inpainting APIs, including Unet3D tensor shapes, sampling frame counts, conditioning frames, masks, and safe preflight validation.
- disable-model-invocation
- true
02 资源文件 4
- 参考文档references/api-reference.md7.7 KB
- 参考文档references/troubleshooting.md5.3 KB
- 参考文档references/workflows.md5.7 KB
- 脚本scripts/video_shape_quickcheck.py19.0 KB
03 SKILL.md 正文
video-and-inpainting
Use this sub-skill when the task mentions Unet3D, text-to-video, video_frames, temporal_downsample_factor, cond_video_frames, post_cond_video_frames, inpaint_images, inpaint_videos, inpaint_masks, ignore_time, or video limitations around return_pil_images.
Route first
- Generic text-to-image, super-resolution image sampling, or PIL image return: use image-generation.
- Training loops, EMA, checkpoint save/load, or trainer internals: use training-and-checkpointing.
- Dataset folders, Hugging Face datasets, captions, T5 text encodings, and data collation: use data-and-text-conditioning.
- Stay here for video-specific Imagen/ElucidatedImagen setup, conditioning frames, and image/video inpainting arguments.
Non-negotiable shape contract
- Video tensors are always
(batch, channels, frames, height, width). - Image tensors are
(batch, channels, height, width). - Inpainting masks are boolean-like
(batch, height, width)for images; for videos they may be(batch, height, width)to broadcast across frames or(batch, frames, height, width)for per-frame masks. - Imagen and ElucidatedImagen become video models if any cascade stage is a
Unet3D; video sampling then needsvideo_framesunless it is inferred frominpaint_videos. temporal_downsample_factoris per cascade stage, must be descending, and the last stage must be1.- Video/PIL conversion is not implemented; use
return_pil_images=Falsefor video samples and save the returned tensor with your own video writer.
Safe workflow
-
Choose
Unet3Dstages for video. Use onlyUnet3Dstages for ordinary video cascades; do not sample through aNullUnetplaceholder. -
Choose frame counts before model calls. For a cascade with
temporal_downsample_factor=(2, 1)andvideo_frames=20, the base stage sees 10 frames and the final stage sees 20. -
From this sub-skill directory, run the bundled preflight checker before expensive model calls:
python scripts/video_shape_quickcheck.py \ --operation sample \ --video-model \ --video-frames 20 \ --temporal-downsample-factor 2,1 \ --texts 4 -
Keep generation and training on practical CUDA-scale hardware. Construction only established a CUDA torch smoke; it did not prove realistic video quality or affordable full generation.
-
For API details and copyable recipes, use workflows, api-reference, and troubleshooting.
Minimal decision rules
- Text-to-video sampling: call
sample(..., texts=[...], video_frames=F, return_pil_images=False). - Video inpainting: call
sample(..., inpaint_videos=videos, inpaint_masks=masks, return_pil_images=False);videossuppliesF. - Image inpainting: call
sample(..., inpaint_images=images, inpaint_masks=masks)and keep image shapes 4D. - Image-only pretraining with
Unet3D: pass images as 4D; the model path converts them to single-frame videos and setsignore_time=Trueautomatically. Preflight temporal factors first, because the source still derives one-frame cascade dimensions before temporal modules are skipped. - Conditioning with preceding/following frames: pass 5D
cond_video_framesand/orpost_cond_video_frames; keep frame lengths divisible after temporal downsampling.
04 同仓库更多 Skills
passnet-triton-opt
Make a single PassNet Triton kernel fast AND numerically faithful: performance model (when a replacement can win at all), block/grid/warp tuning, autotune policy, launch overhead, and per-op numeric recipes to pass the dtype baseline tolerances. Use when a pass matches and is correct but speedup below expected, or when correctness fails by small numeric margins.
passnet-solve
END-TO-END playbook for solving one PassNet sample: analyze the computation graphs, decide the optimization strategy (what to fuse, what to replace, what to leave alone), drive the iteration loop, and maximize the sample score. This is the ENTRY skill — invoke it first for any PassNet optimization task; it tells you when to use passnet-pattern-fusion, passnet-triton-opt and passnet-feedback.
passnet-skill
PassNet GPU kernel optimization via compiler passes. Design and implement Triton-based optimization passes, create pass files under ./pass_dir/, self-evaluate with pass_evaluator, and iterate to maximize GPU speedup.
passnet-pattern-fusion
Author PassNet pass files: write patterns that actually MATCH the FX graph, pick fusion regions (which ops to absorb into one Triton kernel), and structure multi-pass submissions with the mandatory shared-dispatch architecture. Use when creating or fixing pattern()/replacement_args()/replacement_func() files, when a pass "failed to match", or when deciding how to fuse multiple kernels/ops.
passnet-orchestrate
Round/batch planning and decision support for PassNet graph optimization. Use for multi-sample triage, worker allocation, eval-budget policy, and post-eval keep/revert decisions. For solving one concrete sample end to end, use passnet-solve as the entry skill; consult this skill only when you need broader planning or a specific decision gate.
passnet-feedback
Fast, deterministic feedback for PassNet work: pre-flight pattern/match verification WITHOUT burning a GPU evaluation, per-node bottleneck analysis of a sample's graphs, and eval-log parsing into per-variant status + estimated score + failure classification. Use BEFORE every GPU evaluation (check_pattern), at the START of a sample (analyze_graph), and AFTER every evaluation (parse_eval_log).