Files
SolitaryThinker db866dfb04 [misc] v2: simplify docstrings/comments + drop deleted-design-doc citations
Sweep all 296 v2 modules: simplify verbose docstrings/comments and remove 376 dangling
"(design_vN §X)" citations to the now-deleted design docs (v2/README.md is the source of
truth). Comment/docstring-only — AST-verified code-identical; the CPU suite holds at 237
passed / 5 pre-existing. Also applies yapf + ruff --fix auto-fixes (import ordering,
forward-ref annotation de-quoting under `from __future__ import annotations`; behavior-
neutral, suite-confirmed) and adds the legitimate domain terms mot/clen/te to the codespell
ignore-list. Remaining ruff (24) + mypy (68 no-untyped-call) findings are pre-existing v2
debt, untouched here.
2026-06-19 20:54:59 +00:00

35 lines
1.4 KiB
Python

"""Tiled-decode program: text_encode → diffusion_denoise → vae_tile.
The VAE decode is a ``ModelLoopNode`` (the ``vae_tile`` loop), not a one-shot ``ComponentNode`` — so its
tiles become scheduled ``VAE_TILE`` WorkUnits that interleave with other requests' ``DIFFUSION_STEP``
units. (Contrast the plain Wan program, where decode is a single in-tick node.)
"""
from __future__ import annotations
from v2.program import ComponentNode, ModelLoopNode, Program, ProgramKind
from v2.recipes.common import text_encode_node_fn as _text_encode
def build_tiled_program() -> Program:
return Program(
program_id="wan.t2v.tiled",
kind=ProgramKind.INLINE,
nodes=[
ComponentNode("text_encode", fn=_text_encode, writes=("text_embeds", "neg_text_embeds")),
ModelLoopNode("denoise",
loop_id="diffusion_denoise",
output_slot="denoise_out",
reads=("text_embeds", ),
writes=("denoise_out", )),
ModelLoopNode("vae_tile",
loop_id="vae_tile",
output_slot="tiled_out",
reads=("denoise_out", ),
writes=("tiled_out", )),
],
output_artifacts={
"video": "tiled_out",
"latents": "denoise_out"
},
).validate()