image-generation
Construct and use imagen-pytorch image diffusion models for text-conditioned, unconditional, super-resolution, ElucidatedImagen, sampling, and tiny smoke workflows.
- License 许可
- MIT
- 最近更新
- 2026-09-03
- Stars
- ★ 351
- Forks
- 27
01 前言 Front Matter
- name
- image-generation
- license
- MIT
- metadata
- { "disco-role": "operating" }
- description
- Construct and use imagen-pytorch image diffusion models for text-conditioned, unconditional, super-resolution, ElucidatedImagen, sampling, and tiny smoke workflows.
- disable-model-invocation
- true
02 资源文件 4
- 参考文档references/api-reference.md10.6 KB
- 参考文档references/troubleshooting.md5.4 KB
- 参考文档references/workflows.md7.8 KB
- 脚本scripts/tiny_image_smoke.py8.0 KB
03 SKILL.md 正文
image-generation
Use this sub-skill when a task asks for image-only imagen-pytorch model construction or direct image diffusion calls with Unet, NullUnet, BaseUnet64, SRUnet256, SRUnet1024, Imagen, or ElucidatedImagen.
Use when
- Building text-to-image, unconditional, cascade, or super-resolution-only Imagen models.
- Choosing
condition_on_text,cond_drop_prob,cond_scale,timesteps,noise_schedules,pred_objectives,lowres_sample_noise_level, or Karras /ElucidatedImagensampling hyperparameters. - Calling
Imagen.forward,ElucidatedImagen.forward,.sample(...),return_pil_images,return_all_unet_outputs,start_at_unet_number,stop_at_unet_number,start_image_or_video, or image inpainting arguments. - Running a safe no-network API smoke with synthetic tensors.
Route elsewhere
- Trainer state, optimizers, dataloaders, EMA, checkpoint save/load, and resume flows: training-and-checkpointing.
- Config classes, JSON config files, and
imagenCLI commands: configuration-and-cli. - Folder datasets, Hugging Face datasets, T5 helpers, text tokenization, and precomputing text embeddings: data-and-text-conditioning.
Unet3D, video tensor dimensions, temporal conditioning, and video inpainting: video-and-inpainting.
Quick workflow
- Pick the conditioning mode first:
- Unconditional: set
Imagen(..., condition_on_text=False)/ElucidatedImagen(..., condition_on_text=False)and do not passtextsortext_embeds. - Text-conditioned without network surprises: pass precomputed
text_embeds(and optionaltext_masks) whose final dimension matchestext_embed_dim. - Text strings: expect the package's T5 path to be used; route text preparation details to data-and-text-conditioning.
- Unconditional: set
- Match cascade length:
len(unets)must equallen(image_sizes). The first unet is base generation; every later unet is automatically cast as low-resolution-conditioned. - For cascade training, always provide
unet_number; trainNullUnetstages never. - For upscaler-only sampling, pass both
start_at_unet_number > 1and a low-resolutionstart_image_or_video. - Treat CPU as API smoke only. Realistic generation or training is practical CUDA-scale; quality was not proven by the construction smoke.
References and helper
- API reference lists public image API signatures, tensor contracts, defaults, and important assertions.
- Workflows gives task recipes for unconditional smoke, precomputed text embeddings, super-resolution-only branches,
ElucidatedImagen, and output modes. - Troubleshooting maps common assertion messages and runtime symptoms to fixes.
- tiny_image_smoke.py runs a short no-network unconditional API check with optional sampling.
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).