Skip to content

[Issue 101][eval-and-fix] Fix VideoAutoencoderKL.forward return contract (closes pollockjj/mydevelopment#190)#41

Closed
pollockjj wants to merge 7 commits into
issue_101from
issue_190
Closed

[Issue 101][eval-and-fix] Fix VideoAutoencoderKL.forward return contract (closes pollockjj/mydevelopment#190)#41
pollockjj wants to merge 7 commits into
issue_101from
issue_190

Conversation

@pollockjj
Copy link
Copy Markdown
Owner

Plan: Fix VideoAutoencoderKL.forward to honor tensor/tuple return contract

Overview

VideoAutoencoderKL.forward() on pollockjj/ComfyUI:issue_101 dereferences
diffusers-style .latent_dist and .sample attributes on values that are
already plain torch.Tensor (or one-element tuple) returns from encode()
and decode_(). Direct module invocation via forward(x, mode=…) raises
AttributeError immediately, and the mode == "decode" branch additionally
calls self.decode(x) on a class that does not define decode (only
decode_). The fix replaces the buggy attribute access with the actual
return contract and adds a regression test that exercises forward() for
mode="encode", mode="decode", and mode="all" and asserts each return is
a torch.Tensor of the expected shape — binary equality, no tolerance bands.

Diagnosis Summary

The buggy method body, captured live from issue_101:comfy/ldm/seedvr/vae.py
lines 2194–2207 (Ground Truth Probe GTP-3):

def forward(
    self, x: torch.FloatTensor, mode: Literal["encode", "decode", "all"] = "all", **kwargs
):
    # x: [b c t h w]
    if mode == "encode":
        h = self.encode(x)
        return h.latent_dist
    elif mode == "decode":
        h = self.decode(x)
        return h.sample
    else:
        h = self.encode(x)
        h = self.decode(h.latent_dist.mode())
        return h.sample

Live AST probe of VideoAutoencoderKL (GTP-1) confirms the class defines
encode, decode_, and forward, but has no decode member. The actual
encode() body (GTP-2) returns the tensor posterior = DiagonalGaussianDistribution(h).mode() when return_dict=True (the default
under forward's call site) and (posterior,) when return_dict=False.
decode_() mirrors that contract — decoded (tensor) by default, (decoded,)
when return_dict=False. None of those returns expose .latent_dist or
.sample. Every code path of the current forward raises before producing a
result. Fix shape: route through self.decode_ (with the trailing
underscore), return tensors directly, and tolerate the optional one-element
tuple shape that return_dict=False would produce.

Reproduction command: `cd /home/johnj/dev_cuda_1/ComfyUI && python3 -m pytest tests-unit/comfy_test/seedvr_vae_forward_test.py -v`
Observed failure: pre-fix run raises `AttributeError` in the encode/decode/all paths as described below.

The pre-fix runs against issue_101:comfy/ldm/seedvr/vae.py raise
AttributeError: 'Tensor' object has no attribute 'latent_dist' for
mode="encode" and mode="all", and AttributeError: 'VideoAutoencoderKL' object has no attribute 'decode' for mode="decode". The same invocation
post-fix exits 0 with 4 passed. AC-1 / AC-2 capture this A/B pair as
committed pytest logs.

Affected Repositories

Repository Path Base Branch Issue Branch
pollockjj/ComfyUI /home/johnj/dev_cuda_1/ComfyUI issue_101 issue_190
pollockjj/mydevelopment /home/johnj/dev_cuda_1/mydevelopment main issue_190

pollockjj/ComfyUI is the deliverable: the fix to comfy/ldm/seedvr/vae.py
and the new regression test under tests-unit/comfy_test/ land here on
issue_190 and PR back into issue_101.

pollockjj/mydevelopment is the bookkeeping target: every committed
artifact under github_issues/190/slice1/ (pytest logs, source extracts,
diff transcripts, grep transcripts) lives on the outer workspace's
issue_190 branch and PRs back into main as the standard
[bookkeeping] [Issue 101][eval-and-fix] pattern (see merged PRs Comfy-Org#197Comfy-Org#201
for the precedent).

Asset Readiness

Asset Location Provenance Status Evidence
ComfyUI deliverable checkout /home/johnj/dev_cuda_1/ComfyUI pollockjj/ComfyUI branch issue_101 -> issue_190 VERIFIED branch/path verified before slice execution
Python test environment /home/johnj/dev_cuda_1/ComfyUI/.venv/ local-only with no upstream VERIFIED pytest/torch invocation succeeds on slot
Base-branch source under test issue_101:comfy/ldm/seedvr/vae.py pollockjj/ComfyUI issue_101 VERIFIED GTP-1, GTP-2, GTP-3
Bookkeeping workspace /home/johnj/dev_cuda_1/mydevelopment pollockjj/mydevelopment main -> issue_190 VERIFIED artifact paths under github_issues/190/slice1/ are writable/tracked

Research and Methodology

Plan Foundations Comment URL: https://github.com/pollockjj/mydevelopment/issues/190#issuecomment-4378366792

Plan Foundations Comment Pin: comment-id=IC_kwDOR2e1q88AAAABBPiTSA edited-at=2026-05-05T10:19:01Z

Detected Scope: none — trivial bug-fix where the existing encode() /
decode_() return contract IS the spec; the fix duplicates that contract
correctly inside forward() and adds a regression test that locks the
contract.

The change class is "honor an existing internal API contract." No external
research, no canonical references, no metric definitions, and no published
anchor are invoked. The equivalence rule is binary type/shape equality
on the tensors returned by forward()type(result) is torch.Tensor and
result.shape == expected_shape. No tolerance bands; no statistical tests.
Source authority is the live source of comfy/ldm/seedvr/vae.py on the
issue's base branch (issue_101), captured verbatim under
## Ground Truth Probes.

Binding parent-issue directives quoted verbatim from
pollockjj/mydevelopment#190 issue body (the tracking issue this plan
finalizes):

"The fix must route through decode_ on this class; do NOT invent a new
decode method on the parent class."

"Adjacent VideoAutoencoderKLWrapper.forward has the same bug class but
is tracked separately as Comfy-Org#192; do NOT modify that method here."

"Any change to encode() / decode_() signatures or return shapes is
out of scope and indicates plan drift — stop and surface."

These three directives bound the scope of every AC below.

Tools, Pipeline, and Measurements

Plan Foundations Comment URL: https://github.com/pollockjj/mydevelopment/issues/190#issuecomment-4378366792

Plan Foundations Comment Pin: comment-id=IC_kwDOR2e1q88AAAABBPiTSA edited-at=2026-05-05T10:19:01Z

Existing tooling — REUSE only. Trivial scope; no external tools beyond
the change itself.

Tool / Dep / Repo Version / SHA Status Citation
pytest repo tests-unit/requirements.txt pin (per tests-unit/README.md) REUSE git show issue_101:tests-unit/README.md documents pytest tests-unit/ as the canonical invocation
torch repo .venv/ pin on the deliverable slot /home/johnj/dev_cuda_1/ComfyUI/.venv/ REUSE already on the slot per CLAUDE.md slot layout
comfy.ldm.seedvr.vae.VideoAutoencoderKL issue_101 HEAD REUSE live AST + import probe captured as GTP-1
git system REUSE for diff/log artifacts

Pipeline: edit one method body in one source file → add one test file →
run pytest against the new test on issue_190 (post-fix) and against
the same test with vae.py reverted to issue_101:comfy/ldm/seedvr/vae.py
(pre-fix) → commit pytest logs, AST-extracted forward source, grep
transcripts, and a scope-bounded git diff to github_issues/190/slice1/
on the bookkeeping branch.

Measurements: the only "measurement" is binary type and shape equality on
three tensor returns from forward(). There is no metric, no anchor, no
statistical test, no sweep, and no characterization verdict. Single-probe
and boundary-bracketing requirements (HR-06, HR-11) do not apply.

Ground Truth Probes

Probe ID Consumed by AC(s) Probe command Observed output (verbatim)
GTP-1 Slice 1 AC-3, AC-5, AC-6, AC-7 cd /home/johnj/dev_cuda_1/ComfyUI && git show issue_101:comfy/ldm/seedvr/vae.py | python3 -c 'import ast,sys; tree=ast.parse(sys.stdin.read()); [print("class VideoAutoencoderKL methods:", [m.name for m in n.body if isinstance(m,(ast.FunctionDef,ast.AsyncFunctionDef))]) for n in ast.walk(tree) if isinstance(n,ast.ClassDef) and n.name=="VideoAutoencoderKL"]' class VideoAutoencoderKL methods: ['__init__', 'encode', 'decode_', '_encode', '_decode', 'slicing_encode', 'slicing_decode', 'tiled_encode', 'tiled_decode', 'forward'] — i.e. encode, decode_, and forward are members; decode (no underscore) is NOT a member
GTP-2 Slice 1 AC-1, AC-2, AC-7 cd /home/johnj/dev_cuda_1/ComfyUI && git show issue_101:comfy/ldm/seedvr/vae.py | sed -n '2101,2118p'
    def encode(self, x: torch.FloatTensor, return_dict: bool = True):
h = self.slicing_encode(x)
posterior = DiagonalGaussianDistribution(h).mode()

if not return_dict:
return (posterior,)

return posterior

def decode_(
self, z: torch.Tensor, return_dict: bool = True
):
decoded = self.slicing_decode(z)

if not return_dict:
return (decoded,)

return decoded
i.e. encode/decode_ return a tensor when return_dict=True (the default at the forward call site) and a one-element tuple (tensor,) when return_dict=False. Neither return path produces an object with .latent_dist or .sample.
GTP-3 Slice 1 AC-1, AC-3, AC-4, AC-5 cd /home/johnj/dev_cuda_1/ComfyUI && git show issue_101:comfy/ldm/seedvr/vae.py | sed -n '2194,2208p'
    def forward(
self, x: torch.FloatTensor, mode: Literal["encode", "decode", "all"] = "all", **kwargs
):
# x: [b c t h w]
if mode == "encode":
h = self.encode(x)
return h.latent_dist
elif mode == "decode":
h = self.decode(x)
return h.sample
else:
h = self.encode(x)
h = self.decode(h.latent_dist.mode())
return h.sample
i.e. the buggy method (a) accesses .latent_dist on lines 2200/2206, (b) accesses .sample on lines 2203/2207, and (c) calls self.decode(...) on lines 2202/2206 — three distinct AttributeError sites that the fix removes.
GTP-4 Slice 1 AC-6 cd /home/johnj/dev_cuda_1/ComfyUI && git show issue_101:comfy/ldm/seedvr/vae.py | python3 -c 'import ast,sys; tree=ast.parse(sys.stdin.read()); [print("class VideoAutoencoderKLWrapper methods:", [m.name for m in n.body if isinstance(m,(ast.FunctionDef,ast.AsyncFunctionDef))]) for n in ast.walk(tree) if isinstance(n,ast.ClassDef) and n.name=="VideoAutoencoderKLWrapper"]' class VideoAutoencoderKLWrapper methods: ['__init__', 'forward', 'encode', 'decode', 'set_memory_limit'] — combined with the AST-extracted body of VideoAutoencoderKLWrapper.forward from the same source, captured via python3 -c 'import ast,sys; src=sys.stdin.read(); tree=ast.parse(src); [print(ast.get_source_segment(src,m)) for n in ast.walk(tree) if isinstance(n,ast.ClassDef) and n.name=="VideoAutoencoderKLWrapper" for m in n.body if isinstance(m,ast.FunctionDef) and m.name=="forward"]', yielding
def forward(self, x: torch.FloatTensor):
with torch.no_grad() if self.freeze_encoder else nullcontext():
z, p = self.encode(x)
x = self.decode(z).sample
return x, z, p
. Both literal output blocks were captured live on issue_101 HEAD; AC-6 cites GTP-4 to lock the wrapper class methods and forward body as the off-limits surface that the scope-diff artifact must not touch.
GTP-5 Slice 1 AC-7 cd /home/johnj/dev_cuda_1/ComfyUI && git ls-tree --name-only issue_101 tests-unit/comfy_test/
tests-unit/comfy_test/folder_path_test.py
tests-unit/comfy_test/model_detection_test.py
i.e. on issue_101, tests-unit/comfy_test/ contains exactly two files (folder_path_test.py and model_detection_test.py) and zero seedvr coverage. AC-7's pre-fix-fingerprint cites GTP-5 to lock the absence of any seedvr_vae_forward_test.py on the base branch.

Every literal API surface the ACs below cite — VideoAutoencoderKL,
encode, decode_, forward, the mode parameter and its Literal
values "encode" / "decode" / "all", the .latent_dist and .sample
attribute references in the buggy body, the self.decode( call site
that must become self.decode_(, the off-limits VideoAutoencoderKLWrapper
class and its forward body, and the base-branch tests-unit/comfy_test/
directory contents — is anchored to one of GTP-1, GTP-2, GTP-3, GTP-4,
GTP-5 above.

Created Surface Contract

Surface Created by Contract
tests-unit/comfy_test/seedvr_vae_forward_test.py Slice 1 New file in pollockjj/ComfyUI on issue_190. Defines four pytest test functions that exercise VideoAutoencoderKL.forward() against a stub subclass (which bypasses the heavy __init__ via torch.nn.Module.__init__(self) and overrides encode/decode_ with known tensors): test_forward_encode_returns_tensor, test_forward_decode_returns_tensor, test_forward_all_returns_tensor, test_forward_source_has_no_diffusers_attr_access. The first three assert type(result) is torch.Tensor and result.shape == expected_shape for each mode. The fourth uses inspect.getsource(VideoAutoencoderKL.forward) and asserts ".latent_dist" not in src, ".sample" not in src, and a regex r"self\.decode\(" (open paren, no underscore) does not match.
github_issues/190/slice1/pytest_post_fix.log Slice 1 Committed to pollockjj/mydevelopment issue_190. Verbatim stdout/stderr of cd /home/johnj/dev_cuda_1/ComfyUI && python3 -m pytest tests-unit/comfy_test/seedvr_vae_forward_test.py -v run on issue_190 HEAD. Final line contains 4 passed.
github_issues/190/slice1/pytest_pre_fix.log Slice 1 Committed to pollockjj/mydevelopment issue_190. Verbatim stdout/stderr of the same pytest invocation captured after git checkout issue_101 -- comfy/ldm/seedvr/vae.py is applied to the deliverable working tree. Captures three AttributeError failures on the encode/decode/all tests plus the source-shape assertion failure. Restored to issue_190 HEAD via git restore comfy/ldm/seedvr/vae.py immediately after capture.
github_issues/190/slice1/forward_source.txt Slice 1 Committed to pollockjj/mydevelopment issue_190. Verbatim AST-extracted source of VideoAutoencoderKL.forward from issue_190 HEAD comfy/ldm/seedvr/vae.py, produced by python3 -c 'import ast; src=open("comfy/ldm/seedvr/vae.py").read(); tree=ast.parse(src); cls=[n for n in ast.walk(tree) if isinstance(n,ast.ClassDef) and n.name=="VideoAutoencoderKL"][0]; m=[n for n in cls.body if isinstance(n,ast.FunctionDef) and n.name=="forward"][0]; print(ast.get_source_segment(src,m))'.
github_issues/190/slice1/forbidden_attrs_grep.log Slice 1 Committed to pollockjj/mydevelopment issue_190. Output of grep -n -E '\.latent_dist|\.sample' github_issues/190/slice1/forward_source.txt. Exit code 1, zero lines.
github_issues/190/slice1/decode_call_grep.log Slice 1 Committed to pollockjj/mydevelopment issue_190. Output of grep -n -E 'self\.decode\(' github_issues/190/slice1/forward_source.txt. Exit code 1, zero lines. (self.decode_( is permitted; the regex requires an open paren immediately after decode.)
github_issues/190/slice1/scope_diff.txt Slice 1 Committed to pollockjj/mydevelopment issue_190. Output of cd /home/johnj/dev_cuda_1/ComfyUI && git diff issue_101..issue_190 -- comfy/ldm/seedvr/vae.py. The diff shows zero hunks outside the body of VideoAutoencoderKL.forward (lines 2194–2207 on the issue_101 side); encode, decode_, _encode, _decode, slicing_encode, slicing_decode, tiled_encode, tiled_decode, and VideoAutoencoderKLWrapper are all unchanged.

Slices


Slice 1: Fix VideoAutoencoderKL.forward tensor/tuple contract

Kind: implementation

Objective: Prove that VideoAutoencoderKL.forward() returns plain torch.Tensor values for mode="encode", mode="decode", and mode="all" without dereferencing .latent_dist or .sample, and that the change is scoped strictly to the body of VideoAutoencoderKL.forward (no other method body or class touched).

Acceptance Criteria

  • AC-1: cd /home/johnj/dev_cuda_1/ComfyUI && python3 -m pytest tests-unit/comfy_test/seedvr_vae_forward_test.py -v exits 0 with 4 passed in the summary line — verified by committed artifact github_issues/190/slice1/pytest_post_fix.log whose last non-blank line ends with 4 passed.
    • Pre-fix-fingerprint: same pytest invocation against the issue_101 source raises AttributeError: 'Tensor' object has no attribute 'latent_dist' (and analogous .sample / decode errors) on every encode/decode/all test (Diagnosis Summary §"Diagnosis Summary"; GTP-3)
    • Post-fix-expectation: zero exceptions; pytest exits 0; summary line contains 4 passed
    • Assumes-passed: none
    • In-scope-of: Slice 1 Objective "Prove that VideoAutoencoderKL.forward() returns plain torch.Tensor values for mode="encode", mode="decode", and mode="all" without dereferencing .latent_dist or .sample, and that the change is scoped strictly to the body of VideoAutoencoderKL.forward (no other method body or class touched)."
    • Probe: GTP-2, GTP-3
    • Foundations-pin: comment-id=IC_kwDOR2e1q88AAAABBPiTSA edited-at=2026-05-05T10:19:01Z
  • AC-2: The committed A/B pytest pair for tests-unit/comfy_test/seedvr_vae_forward_test.py -v proves the same observable flips across the fix: github_issues/190/slice1/pytest_pre_fix.log records at least three AttributeError failures plus the test_forward_source_has_no_diffusers_attr_access failure after cd /home/johnj/dev_cuda_1/ComfyUI && git checkout issue_101 -- comfy/ldm/seedvr/vae.py, and github_issues/190/slice1/pytest_post_fix.log records pytest exit 0 with 4 passed after git restore comfy/ldm/seedvr/vae.py restores issue_190 HEAD.
    • Pre-fix-fingerprint: the same python3 -m pytest tests-unit/comfy_test/seedvr_vae_forward_test.py -v invocation raises AttributeError in the encode/decode/all paths when vae.py is reverted to issue_101 (Diagnosis Summary §"Diagnosis Summary"; GTP-3)
    • Post-fix-expectation: the same pytest invocation on restored issue_190 HEAD exits 0 with 4 passed and zero AttributeError failures
    • Assumes-passed: none
    • In-scope-of: Slice 1 Objective "Prove that VideoAutoencoderKL.forward() returns plain torch.Tensor values for mode="encode", mode="decode", and mode="all" without dereferencing .latent_dist or .sample, and that the change is scoped strictly to the body of VideoAutoencoderKL.forward (no other method body or class touched)."
    • Probe: GTP-2, GTP-3
    • Foundations-pin: comment-id=IC_kwDOR2e1q88AAAABBPiTSA edited-at=2026-05-05T10:19:01Z
  • AC-3: The AST-extracted body of VideoAutoencoderKL.forward on issue_190 HEAD contains zero occurrences of the literal .latent_dist — verified by committed artifacts github_issues/190/slice1/forward_source.txt (the extracted body) and github_issues/190/slice1/forbidden_attrs_grep.log (grep -n -E '\.latent_dist|\.sample' forward_source.txt exit code 1, zero matching lines).
    • Pre-fix-fingerprint: GTP-3 captures two .latent_dist occurrences on lines 2200 and 2206 of issue_101's vae.py
    • Post-fix-expectation: zero .latent_dist references survive in the post-fix forward body; the grep log is empty
    • Assumes-passed: none
    • In-scope-of: Slice 1 Objective "Prove that VideoAutoencoderKL.forward() returns plain torch.Tensor values for mode="encode", mode="decode", and mode="all" without dereferencing .latent_dist or .sample, and that the change is scoped strictly to the body of VideoAutoencoderKL.forward (no other method body or class touched)."
    • Probe: GTP-3
    • Foundations-pin: comment-id=IC_kwDOR2e1q88AAAABBPiTSA edited-at=2026-05-05T10:19:01Z
  • AC-4: The AST-extracted body of VideoAutoencoderKL.forward on issue_190 HEAD contains zero occurrences of the literal .sample — verified by the same committed artifacts as AC-3 (forward_source.txt plus forbidden_attrs_grep.log); the same combined grep covers both literals and reports zero matches for either.
    • Pre-fix-fingerprint: GTP-3 captures two .sample occurrences on lines 2203 and 2207 of issue_101's vae.py
    • Post-fix-expectation: zero .sample references survive in the post-fix forward body
    • Assumes-passed: none
    • In-scope-of: Slice 1 Objective "Prove that VideoAutoencoderKL.forward() returns plain torch.Tensor values for mode="encode", mode="decode", and mode="all" without dereferencing .latent_dist or .sample, and that the change is scoped strictly to the body of VideoAutoencoderKL.forward (no other method body or class touched)."
    • Probe: GTP-3
    • Foundations-pin: comment-id=IC_kwDOR2e1q88AAAABBPiTSA edited-at=2026-05-05T10:19:01Z
  • AC-5: The AST-extracted body of VideoAutoencoderKL.forward on issue_190 HEAD contains zero occurrences of the regex self\.decode\( (open paren immediately after decode, no trailing underscore) — verified by committed artifact github_issues/190/slice1/decode_call_grep.log (grep -n -E 'self\.decode\(' forward_source.txt exit code 1, zero matching lines). self.decode_( references — if the implementer chooses to call self.decode_ for mode="decode" and mode="all" — are permitted because the regex requires the next character after decode to be (.
    • Pre-fix-fingerprint: GTP-3 captures two self.decode( call sites on lines 2202 and 2206 of issue_101's vae.py; GTP-1 confirms decode is not defined on the class
    • Post-fix-expectation: zero self.decode( (open-paren-immediately) call sites remain; route is exclusively through self.decode_
    • Assumes-passed: none
    • In-scope-of: Slice 1 Objective "Prove that VideoAutoencoderKL.forward() returns plain torch.Tensor values for mode="encode", mode="decode", and mode="all" without dereferencing .latent_dist or .sample, and that the change is scoped strictly to the body of VideoAutoencoderKL.forward (no other method body or class touched)."
    • Probe: GTP-1, GTP-3
    • Foundations-pin: comment-id=IC_kwDOR2e1q88AAAABBPiTSA edited-at=2026-05-05T10:19:01Z
  • AC-6: cd /home/johnj/dev_cuda_1/ComfyUI && git diff issue_101..issue_190 -- comfy/ldm/seedvr/vae.py produces hunks confined to the line range of VideoAutoencoderKL.forward on the issue_101 side (lines 2194–2207 per GTP-3) and zero hunks touching encode, decode_, _encode, _decode, slicing_encode, slicing_decode, tiled_encode, tiled_decode, or any line of VideoAutoencoderKLWrapper (per GTP-4) — verified by committed artifact github_issues/190/slice1/scope_diff.txt. The artifact contains the verbatim diff plus a final stanza listing every @@-hunk header range and confirming each falls inside [2194, 2207] on the - side.
    • Pre-fix-fingerprint: the only intentional change in this slice is the body of one method; any hunk outside that body would prove unintended drift to call sites that the issue body lists as out of scope (VideoAutoencoderKLWrapper.forward per Add support for file list refresh feature in node Comfy-Org/ComfyUI#192 — captured live as GTP-4, encode/decode_ signatures per "plan drift" guard)
    • Post-fix-expectation: every diff hunk on the vae.py side is confined to the forward method body; the artifact's final stanza enumerates each hunk and asserts in-range
    • Assumes-passed: none
    • In-scope-of: Slice 1 Objective "Prove that VideoAutoencoderKL.forward() returns plain torch.Tensor values for mode="encode", mode="decode", and mode="all" without dereferencing .latent_dist or .sample, and that the change is scoped strictly to the body of VideoAutoencoderKL.forward (no other method body or class touched)."
    • Probe: GTP-1, GTP-3, GTP-4
    • Foundations-pin: comment-id=IC_kwDOR2e1q88AAAABBPiTSA edited-at=2026-05-05T10:19:01Z
  • AC-7: The committed test file tests-unit/comfy_test/seedvr_vae_forward_test.py on issue_190 defines four pytest test functions whose names are exactly test_forward_encode_returns_tensor, test_forward_decode_returns_tensor, test_forward_all_returns_tensor, and test_forward_source_has_no_diffusers_attr_access; the first three assert both type(result) is torch.Tensor and an exact result.shape == expected_shape equality (binary, no tolerance band) for each mode; the fourth runs inspect.getsource(VideoAutoencoderKL.forward) and asserts the absence of .latent_dist, .sample, and the regex r"self\.decode\(" — verified by committed artifact github_issues/190/slice1/test_source.txt (cp /home/johnj/dev_cuda_1/ComfyUI/tests-unit/comfy_test/seedvr_vae_forward_test.py github_issues/190/slice1/test_source.txt) plus the AC-1 pytest log showing all four test names in the PASSED lines.
    • Pre-fix-fingerprint: prior to this slice, tests-unit/comfy_test/ on issue_101 contains exactly two files (folder_path_test.py and model_detection_test.py) per GTP-5, so the regression test does not yet exist on the base branch
    • Post-fix-expectation: the test file exists with all four named functions; AC-1's pytest log lists PASSED for each by name; the binary type/shape assertions exclude tolerance-band variants
    • Assumes-passed: none
    • In-scope-of: Slice 1 Objective "Prove that VideoAutoencoderKL.forward() returns plain torch.Tensor values for mode="encode", mode="decode", and mode="all" without dereferencing .latent_dist or .sample, and that the change is scoped strictly to the body of VideoAutoencoderKL.forward (no other method body or class touched)."
    • Probe: GTP-1, GTP-2, GTP-5
    • Foundations-pin: comment-id=IC_kwDOR2e1q88AAAABBPiTSA edited-at=2026-05-05T10:19:01Z

Constraints

  • Python: python3
  • Runner: python3 -m pytest tests-unit/comfy_test/seedvr_vae_forward_test.py -v from the deliverable checkout root /home/johnj/dev_cuda_1/ComfyUI
  • No packages installed into host venv; the deliverable slot's .venv/ already provides torch and pytest per the slot layout in CLAUDE.md
  • No pkill, no rm -rf, no python main.py, no /tmp writes
  • One command per shell call; no &&/||/; chaining
  • All deliverable code commits land on pollockjj/ComfyUI:issue_190 cut from issue_101; PR target = issue_101
  • All bookkeeping evidence commits (github_issues/190/slice1/*) land on pollockjj/mydevelopment:issue_190 cut from main; PR target = main
  • Zero modifications to any method other than VideoAutoencoderKL.forward in comfy/ldm/seedvr/vae.py (encode, decode_, _encode, _decode, slicing_encode, slicing_decode, tiled_encode, tiled_decode, and the entire VideoAutoencoderKLWrapper class are off-limits)
  • Zero changes to encode() / decode_() signatures or return shapes (issue body explicit "plan drift" guard)
  • Relevant Existing Tooling:
    • pytest from the deliverable slot's .venv/ — REUSE; no install
    • comfy.ldm.seedvr.vae.VideoAutoencoderKL import path — REUSE; verified by GTP-1
    • git, grep, AST extraction via stdlib ast module — REUSE
    • The new test file is the only added Python source in the deliverable; the new artifacts under github_issues/190/slice1/ are the only added paths in the bookkeeping repo
  • Evidence Primitive Requirements:
    • Behavior change (forward stops raising AttributeError) → A/B pytest pair: post-fix log on issue_190 HEAD plus pre-fix log captured with vae.py transiently reverted to issue_101 (AC-1, AC-2)
    • Source shape claim (no .latent_dist, .sample, self.decode( in forward body) → AST-extracted committed source plus zero-match grep transcripts (AC-3, AC-4, AC-5)
    • Scope claim (only forward changed) → committed git diff issue_101..issue_190 -- vae.py with hunk-range enumeration (AC-6)
    • Test surface claim (four named functions with binary assertions) → committed copy of the test source plus pytest log naming each function as PASSED (AC-7)
  • Repository Hygiene:
    • Every dirty repo state on either deliverable or bookkeeping checkout is resolved by the agent without git stash or external decision deferral.
    • Dirty paths are classified as committed work, precise committed .gitignore rules for safe generated bulk, or discarded generated debris.
    • Clean committed work already present on issue_190 (e.g. the ?? github_issues/190/ dispatch artifacts seen at plan time on the bookkeeping checkout) is repo provenance and is integrated, not removed as dirty-state cleanup.
    • Slicers and Melian must run live git status --short gates locally on both /home/johnj/dev_cuda_1/ComfyUI and /home/johnj/dev_cuda_1/mydevelopment and must refuse to submit while either is dirty.
    • Plans must not require repo_hygiene.txt, raw git status --short transcripts, or CLEAN markers as QA evidence.
    • QA verifies submitted commits, branch refs, and artifact presence through GitHub rather than trusting slicer-authored cleanliness transcripts.
    • The transient revert in AC-2 (git checkout issue_101 -- comfy/ldm/seedvr/vae.py) MUST be undone via git restore comfy/ldm/seedvr/vae.py before any commit is created on the deliverable; the pre-fix log itself is committed only to the bookkeeping repo.

Out of Scope

  • VideoAutoencoderKLWrapper.forward (lines 2226–2230 on issue_101) — same bug class (self.decode(z).sample) but tracked separately as pollockjj/mydevelopment#192. Do not touch.
  • Any change to VideoAutoencoderKL.encode() or VideoAutoencoderKL.decode_() — signature, return shape, or body. The issue body explicitly flags such changes as plan drift; if implementation reveals a need to change them, stop and surface to the architect.
  • Any change to comfy_extras/nodes_seedvr.py, tiled_vae, or other call sites of encode() / decode_() outside VideoAutoencoderKL.forward. The fix is scoped to one method body.
  • Upstream propagation of the fix to feat: Add support For SeedVR2 (CORE-6) Comfy-Org/ComfyUI#11294. The upstream PR is mergeable=DIRTY and silent for two weeks per the issue body; pushing back to yousef-rafat:seedvr2 is out of scope and requires a separate decision.
  • Numeric correctness of the encode→decode round trip on real weights. The regression test exercises the return-type/return-shape contract with stub returns; correctness of the mathematical pipeline is covered by the existing seedvr workflow integration on issue_101 and is not re-validated by this slice.
  • Tolerance-band assertions of any kind. The fix is a contract repair; equality is binary (type(result) is torch.Tensor, result.shape == expected_shape).
  • Removal or refactor of the **kwargs parameter on forward. Honoring the call-site contract is sufficient; the parameter list stays as captured in GTP-3.

Tracked in pollockjj/mydevelopment Comfy-Org#190 (bookkeeping PR pollockjj/mydevelopment#203).

pollockjj added 7 commits May 5, 2026 05:28
…AutoencoderKL.forward (closes pollockjj/mydevelopment#190)

VideoAutoencoderKL.forward dereferenced .latent_dist and .sample on
encode()/decode_() returns and called self.decode (no underscore) on a
class that only defines decode_. Direct module invocation via
forward(x, mode=...) raised AttributeError on every path.

encode() / decode_() return a tensor when return_dict=True (the call
site default) and a one-element tuple when return_dict=False. The fix
unwraps that optional tuple shape and routes mode="decode" / mode="all"
through self.decode_ (with the trailing underscore) so the actual
contract is honored without changing either method signature.

Regression test tests-unit/comfy_test/seedvr_vae_forward_test.py
exercises forward() for mode="encode", "decode", and "all" against a
stub subclass that bypasses the heavy __init__, plus an
inspect.getsource assertion that no .latent_dist, no .sample, and no
self.decode( call survive in the post-fix forward body.

Source: CodeRabbit thread on Comfy-Org#11294
Comfy-Org#11294 (comment)
Restore **kwargs on VideoAutoencoderKL.forward so direct callers using
vae(x, mode=..., return_dict=False) continue to work, and forward kwargs
consistently to encode()/decode_() so return_dict's tuple-return shape
is honored end-to-end instead of silently discarded.

For mode="all" the internal encode runs with the default
return_dict=True (the only shape decode_ accepts as input); kwargs reach
only the terminal decode_, which controls the final return shape. This
asymmetry preserves the encode->decode_ composition while honoring the
caller's requested final shape.

Test changes: drop the negative test_forward_rejects_return_dict_kwarg
(pinned a breaking TypeError, used a bare except TypeError that would
have accepted unrelated regressions for the wrong reason) and replace
with three positive propagation tests that pin the actual tuple-return
shape for mode="encode", mode="decode", and mode="all" with
return_dict=False, plus the asymmetric-propagation invariant for
mode="all" (internal encode stays return_dict=True, terminal decode_
receives the user's kwarg).

Copilot findings addressed:
- 3187940844 (vae.py): removing **kwargs is a breaking API change.
- 3187940903 (test): pinned TypeError + bare-except blocks
  non-breaking fixes and accepts unrelated regressions.
…**kwargs surface

Cycle 7 Copilot 3188128381 offered two valid options for the kwargs surface:
(a) "validate and strip the supported kwargs here" or (b) "make the signature
explicit". Cycle 7 took (b). Cycle 8 Copilot 3188197480 / 3188197524 ask we
take (a) instead — keep the **kwargs surface so the bug-fix scope stays on
the .latent_dist / .sample / self.decode regression rather than narrowing
the API.

Switch to option (a):
- Restore **kwargs in VideoAutoencoderKL.forward signature.
- Extract return_dict via kwargs.pop("return_dict", True) and propagate
  explicitly to encode() / decode_().
- Other kwargs absorbed at the forward boundary; NOT propagated into the
  helpers (cycle 7 finding 3188128381 — leakage into helpers raises
  TypeError from inside them, harder to diagnose than entry-point absorb).

Test changes:
- Replace test_forward_unknown_kwarg_raises_type_error_at_forward_boundary
  with test_forward_unknown_kwarg_absorbed_at_forward_boundary.
  The new test pins the positive contract: forward succeeds with an unknown
  kwarg AND the helper call list shows no leakage (unsupported_kwarg not in
  encode_calls[0]). Strictly tighter than the cycle 7 negative TypeError
  assertion on the no-leakage invariant cycle 7 cared about, while not
  pinning the signature narrowing cycle 8 objects to.
- Update module docstring + propagate test docstring to reference both
  cycle 7 and cycle 8 Copilot inline IDs.

Test result: tests-unit/comfy_test/seedvr_vae_forward_test.py: 10 passed in
1.88s. tests-unit/comfy_test/: 77 passed in 3.24s.
Copilot AI review requested due to automatic review settings May 5, 2026 15:33
@qa-agent-seveneves
Copy link
Copy Markdown

Codex Review -- Round 1 -- KICKOFF

Runner: scripts/run_codex_review.py
PR: #41
Reviewer model: codex review (configured codex CLI default)
Kickoff timestamp (UTC): 2026-05-05T15:35:57Z

Prompt sent to codex review

Review the latest state of https://github.com/pollockjj/ComfyUI/pull/41. Output findings using strict P0-P3 priority tags ([P0], [P1], [P2], [P3]) at the start of each finding title. Surface P0/P1/P2 -- these block merge in this repo. Surface P3 with that tag explicitly. Do not surface style nits, formatting, typos, or pre-existing bugs. End your output with a single line -- one of: 'APPROVE' (no P0/P1/P2 found), 'REVIEW CONDUCTED AND NO ISSUES FOUND' (no P0/P1/P2 found, equivalent to APPROVE for verdict-tracking purposes; use this if you are reluctant to emit a bare APPROVE token), or 'REQUEST_CHANGES' (one or more P0/P1/P2 found). Output nothing else after that line.

Awaiting codex output. The result will be posted as a separate comment on this PR when codex exits.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes comfy.ldm.seedvr.vae.VideoAutoencoderKL.forward() so it matches the actual return contract of encode() / decode_() (plain torch.Tensor by default, or (tensor,) when return_dict=False), removing the broken diffusers-style .latent_dist / .sample dereferences and the invalid self.decode(...) call.

Changes:

  • Update VideoAutoencoderKL.forward() to call encode() / decode_() correctly and return their outputs directly (with return_dict propagation).
  • Add a focused unit test module that stubs the VAE and asserts correct behavior for mode="encode", mode="decode", and mode="all", including return_dict=False and AST-based checks to prevent regressions.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
comfy/ldm/seedvr/vae.py Repairs VideoAutoencoderKL.forward() to use decode_() and to return tensors/tuples per the real encode()/decode_() contract.
tests-unit/comfy_test/seedvr_vae_forward_test.py Adds regression coverage for forward() modes, return_dict propagation, encode→decode composition, and AST checks to block reintroducing .latent_dist/.sample/self.decode(.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@qa-agent-seveneves
Copy link
Copy Markdown

Codex Review -- Round 1 -- RESULT

PR: #41
Reviewer model: codex review (configured codex CLI default)
Result timestamp (UTC): 2026-05-05T15:38:01Z
Codex exit code: 0
Duration (s): 122.1
Detected verdict: UNKNOWN

Prompt sent to codex review

Review the latest state of https://github.com/pollockjj/ComfyUI/pull/41. Output findings using strict P0-P3 priority tags ([P0], [P1], [P2], [P3]) at the start of each finding title. Surface P0/P1/P2 -- these block merge in this repo. Surface P3 with that tag explicitly. Do not surface style nits, formatting, typos, or pre-existing bugs. End your output with a single line -- one of: 'APPROVE' (no P0/P1/P2 found), 'REVIEW CONDUCTED AND NO ISSUES FOUND' (no P0/P1/P2 found, equivalent to APPROVE for verdict-tracking purposes; use this if you are reluctant to emit a bare APPROVE token), or 'REQUEST_CHANGES' (one or more P0/P1/P2 found). Output nothing else after that line.

Verbatim codex review output

This PR was reviewed using codex review with the prompt above and produced the following output:


No merge-blocking defects were found in the latest PR state.


Codex runner stderr (non-evidence)

OpenAI Codex v0.128.0 (research preview)
--------
workdir: /home/johnj/dev_master/mydevelopment
model: gpt-5.5
provider: openai
approval: never
sandbox: workspace-write [workdir, /tmp, /home/johnj/.codex/memories]
reasoning effort: high
reasoning summaries: none
session id: 019df8c8-2704-7722-8f41-ae661a46daf5
--------
user
Review the latest state of https://github.com/pollockjj/ComfyUI/pull/41. Output findings using strict P0-P3 priority tags ([P0], [P1], [P2], [P3]) at the start of each finding title. Surface P0/P1/P2 -- these block merge in this repo. Surface P3 with that tag explicitly. Do not surface style nits, formatting, typos, or pre-existing bugs. End your output with a single line -- one of: 'APPROVE' (no P0/P1/P2 found), 'REVIEW CONDUCTED AND NO ISSUES FOUND' (no P0/P1/P2 found, equivalent to APPROVE for verdict-tracking purposes; use this if you are reluctant to emit a bare APPROVE token), or 'REQUEST_CHANGES' (one or more P0/P1/P2 found). Output nothing else after that line.
exec
/bin/bash -lc 'cat /home/johnj/.codex/skills/pr-review/SKILL.md' in /home/johnj/dev_master/mydevelopment
 succeeded in 0ms:
---
name: pr-review
description: "Iterative codex + Copilot PR review loop, slice-LLM driven. ACTIVATE when: (1) user says 'review the PR', 'kick off PR review', '/pr-review', 'disposition the PR'; (2) a PR has just been opened or had a new commit pushed to its head. Fires codex review (P0-P3 priority tags + verdict line), fires Copilot review via add-reviewer, READS the full Copilot inline-comment array (never trusts the review-body summary), decides every finding REQUIRED / NOT-REQUIRED / INVALID, applies REQUIRED fixes, posts INVALID rationale on the comment thread, then loops until codex P0-P2 list is empty AND no remaining findings about newly-changed code. Codex P0/P1/P2 findings are NEVER allowed to be classified INVALID."
---

# pr-review — codex + Copilot iterative review loop

**Role.** You own the PR. You decide every finding. You apply fixes. You reply to disagreements. The user does not adjudicate review findings — you do.

## Reviewers and what they post

| Reviewer | How fired | What it posts |
|---|---|---|
| **codex** | `python scripts/run_codex_review.py {OWNER/REPO} {PR_NUMBER} {ISSUE_NUMBER} {ROUND}` | Two PR thread comments per round (kickoff + result) as `qa-agent-seveneves[bot]`. Result body has findings tagged `[P0]`/`[P1]`/`[P2]`/`[P3]` and ends with one of: `APPROVE`, `REVIEW CONDUCTED AND NO ISSUES FOUND` (verdict-equivalent to APPROVE), or `REQUEST_CHANGES`. |
| **Copilot** | Fire: `gh pr edit {PR_NUMBER} --repo {OWNER/REPO} --add-reviewer copilot-pull-request-reviewer`. Monitor: `python scripts/run_copilot_poll.py {OWNER/REPO} {PR_NUMBER} {ISSUE_NUMBER} {ROUND} {HEAD_SHA}`. | One review (state COMMENTED) at the current head SHA, plus zero-or-more **inline comments** attached to specific file lines. The review-body summary is unreliable about inline counts. |

## The ONLY way to read Copilot's inline comments

`scripts/run_copilot_poll.py` is the runner. It polls until Copilot's review at the captured `HEAD_SHA` lands, then fetches the inline comments **scoped to that specific review** (via `/pulls/{pr}/reviews/{id}/comments` — review-scoped, not the PR-wide `/pulls/{pr}/comments` endpoint, so cycle N+1 only surfaces what THAT review added). It writes evidence to:

github_issues/{ISSUE_NUMBER}/pr_review_outputs/round{ROUND}_copilot_review.md
github_issues/{ISSUE_NUMBER}/pr_review_outputs/round{ROUND}_copilot_inline.json


and prints `REVIEW_ID`, `REVIEW_STATE`, `INLINE_COUNT`, `EVIDENCE_REVIEW`, `EVIDENCE_INLINE` lines on success.

**Always read `EVIDENCE_INLINE` after the runner exits 0.** Walk every entry: `id`, `path`, `line`, `body`, `in_reply_to_id`. Do NOT report "no actionable inline findings" based on `gh pr view --json latestReviews` body summary — that summary lies (it can say "generated 2 comments" while the body field is empty). The runner's inline-JSON file is the only authoritative source.

## Decision categories — every finding gets one

| Verdict | Meaning | Action |
|---|---|---|
| **REQUIRED** | Real defect or risk inside the PR's intended scope. | Apply the fix. Commit on the PR head branch. Push. |
| **NOT-REQUIRED** | Real, but optional / cosmetic / or genuinely outside the PR's intended scope. | Do nothing. On Copilot cycle #0, no reply needed. On cycle #1+, only worry if it concerns code touched in the most recent fix cycle. |
| **INVALID** | Reviewer is wrong: misunderstands the code, asserts a non-existent behavior, suggests a change that would break a stated invariant, or proposes a fix that defeats the test it claims to strengthen. | Post an inline reply on the comment thread with the technical rationale. Do not apply the change. |

**Hard rule:** A codex `[P0]` / `[P1]` / `[P2]` finding may NOT be classified INVALID. P0/P1/P2 are by definition merge-blocking — if you believe codex is wrong, the burden is on you to either (a) reclassify yourself privately and accept the risk by marking NOT-REQUIRED with explicit written rationale on the PR thread, or (b) apply a fix. You do not get to silently dismiss a codex P0/P1/P2.

Codex `[P3]` findings may be REQUIRED, NOT-REQUIRED, or INVALID.

## Posting an INVALID reply

gh api -X POST /repos/{OWNER/REPO}/pulls/{PR_NUMBER}/comments
-F in_reply_to={comment_id}
-f body="<REJECT rationale: name the false premise; cite the language/library semantics; cite the stated invariant>"


The reply must explain WHY the reviewer is wrong, not just that you disagree. If the reviewer is misunderstanding Python/git/HTTP/etc., cite the spec or stdlib doc. If they're proposing a change that would defeat the test's purpose, name the invariant the test guards.

## Cycle structure

A **cycle** = one round of (codex + Copilot) at the current head SHA, followed by your dispositioning of every finding, followed by any pushes you make.

- **Cycle #0**: the first time both reviewers run on this PR. Every finding warrants classification. NOT-REQUIRED Copilot findings get no reply on cycle #0.
- **Cycle #1+** (re-reviews after you pushed fixes): each Copilot re-review is a **fresh scan** of the entire PR — it will surface new findings, including ones about pre-existing code it didn't mention before. **You are only required to disposition cycle #1+ findings if they concern code that was changed in the most recent fix cycle.** Pre-existing-code findings Copilot just noticed may be ignored. (You did not introduce them in this round; they were tacit-NOT-REQUIRED on cycle #0.)

## The loop

cycle = 0
while True:
1. Capture current head SHA.
2. Fire codex review (round = cycle + 1):
python scripts/run_codex_review.py {OWNER/REPO} {PR} {ISSUE} {cycle+1}
Wait for the result comment to land.
3. Fire Copilot:
gh pr edit {PR} --repo {OWNER/REPO} --add-reviewer copilot-pull-request-reviewer
4. Monitor Copilot via the runner (blocks until review at HEAD lands):
python scripts/run_copilot_poll.py {OWNER/REPO} {PR} {ISSUE} {cycle+1} {HEAD_SHA}
The runner writes evidence files and prints REVIEW_ID / REVIEW_STATE /
INLINE_COUNT / EVIDENCE_REVIEW / EVIDENCE_INLINE on stdout.
5. Read codex result body. Parse [P0]/[P1]/[P2]/[P3] findings.
6. Read EVIDENCE_INLINE (the JSON file written by the Copilot runner).
Walk every entry. The PR-wide /pulls/{PR}/comments endpoint is
allowed as a cross-check but the runner output is canonical.
7. Disposition every finding REQUIRED / NOT-REQUIRED / INVALID per the rules above.
(Cycle #1+: skip dispositioning Copilot findings unrelated to most-recent-fix code.)
8. For each REQUIRED: apply fix, commit on PR head branch.
For each INVALID: post inline reply with rationale.
9. If you committed any fixes in step 8: push to PR head branch.
10. Termination check — break when ALL hold:
a. codex has no [P0]/[P1]/[P2] findings
b. codex has no actionable [P3] (any P3 not classified INVALID/NOT-REQUIRED)
c. on the LATEST Copilot review, no findings concern code changed in the most recent f

...truncated 191353 bytes (full stderr in round1_codex_stderr.txt)...

eference to the image/video so we later can do a colour fix later
#self.original_image_video = x
if orig_dims is not None:
self.img_dims = orig_dims
if x.ndim == 4:
x = x.unsqueeze(2)
x = x.to(dtype=next(self.parameters()).dtype)
self.device = x.device
p = super().encode(x)
z = p.squeeze(2)
return z, p

def decode(self, z):
    b, tc, h, w = z.shape
    latent = z.view(b, 16, -1, h, w)
    scale = 0.9152
    shift = 0
    latent = latent / scale + shift

    if latent.ndim == 4:
        latent = latent.unsqueeze(2)

    self.device = latent.device
    self.enable_tiling = self.tiled_args.get("enable_tiling", False)

    if self.enable_tiling:
        x = tiled_vae(latent, self, **self.tiled_args, encode=False)
        if x.ndim == 4:
            # tiled_vae squeezes the temporal axis when
            # temporal_downsample_factor == 1 AND latent T == 1
            # (see tiled_vae line 179-180); re-add it so the post-decode
            # pipeline can keep batch and time distinct on the tiled path.
            x = x.unsqueeze(2)
    else:
        x = super().decode_(latent)

    # Per #188: original_image_video carries the UNPADDED temporal length T_in
    # (set by SeedVR2InputProcessing.execute BEFORE cut_videos padding). For B == 1
    # the trim count `t = input.size(0)` therefore equals T_in and trims decode
    # output to exactly T_in. The B > 1 axis-confusion path is tracked in #189.
    input = rearrange(self.original_image_video, "b c t h w -> (b t) c h w")

    # in case of padded frames
    t = input.size(0)
    if t != 1:
        x = x[:, :, :t]
    if t == 1 and x.size(2) == 4:
        x = x[:, :, :t]

    x = rearrange(x, "b c t h w -> (b t) c h w")

    input = input.to(x.device)
    o_h, o_w = self.img_dims
    x = x[..., :o_h, :o_w]
    input = input[..., :o_h, :o_w ]
    x = lab_color_transfer(x, input)

    x = x.unsqueeze(0)
    x = rearrange(x, "b t c h w -> b c t h w")

    # ensure even dims for save video
    h, w = x.shape[-2:]
    w2 = w - (w % 2)
    h2 = h - (h % 2)
    x = x[..., :h2, :w2]

    return x

def set_memory_limit(self, conv_max_mem: Optional[float], norm_max_mem: Optional[float], memory_device = "same"):
    set_norm_limit(norm_max_mem)
    for m in self.modules():
        if isinstance(m, InflatedCausalConv3d):
            m.set_memory_limit(conv_max_mem if conv_max_mem is not None else float("inf"))

    for module in self.modules():
        if isinstance(module, InflatedCausalConv3d):
            module.set_memory_device(memory_device)

exec
/bin/bash -lc "git -C /home/johnj/dev_master/ComfyUI show origin/issue_190:comfy/ldm/seedvr/vae.py | nl -ba | sed -n '2188,2225p'" in /home/johnj/dev_master/mydevelopment
succeeded in 0ms:
2188 def tiled_encode(self, x: torch.Tensor, **kwargs) -> torch.Tensor:
2189 raise NotImplementedError
2190
2191 def tiled_decode(self, z: torch.Tensor, **kwargs) -> torch.Tensor:
2192 raise NotImplementedError
2193
2194 def forward(
2195 self,
2196 x: torch.FloatTensor,
2197 mode: Literal["encode", "decode", "all"] = "all",
2198 **kwargs,
2199 ):
2200 # x: [b c t h w]
2201 # return_dict is extracted from **kwargs and propagated so the
2202 # tensor/tuple return contract of encode() / decode_() reaches
2203 # the caller unchanged (return_dict=False -> single-element
2204 # tuple). Other kwargs are absorbed at the forward boundary,
2205 # matching the pre-fix call surface.
2206 return_dict = kwargs.pop("return_dict", True)
2207 if mode == "encode":
2208 return self.encode(x, return_dict=return_dict)
2209 elif mode == "decode":
2210 return self.decode_(x, return_dict=return_dict)
2211 else:
2212 # mode="all" (and any other value, matching the pre-fix
2213 # else-branch fallthrough). The internal encode must produce
2214 # a tensor (the only shape decode_ accepts as input), so it
2215 # runs with the default return_dict=True; return_dict
2216 # forwards to the terminal decode_ to honor the caller's
2217 # requested final return shape.
2218 latent = self.encode(x)
2219 return self.decode_(latent, return_dict=return_dict)
2220
2221 class VideoAutoencoderKLWrapper(VideoAutoencoderKL):
2222 def init(
2223 self,
2224 *args,
2225 spatial_downsample_factor = 8,

exec
/bin/bash -lc 'grep -R "forward(.*mode" -n /home/johnj/dev_master/ComfyUI' in /home/johnj/dev_master/mydevelopment
2026-05-05T15:37:12.073555Z ERROR codex_core::tools::router: error=write_stdin failed: stdin is closed for this session; rerun exec_command with tty=true to keep stdin open
exec
/bin/bash -lc "git -C /home/johnj/dev_master/ComfyUI grep -n "mode=\"encode\"" origin/issue_101" in /home/johnj/dev_master/mydevelopment
exited 1 in 0ms:
mcp: codex_apps/github_fetch_pr started
mcp: codex_apps/github_fetch_pr (completed)
exec
/bin/bash -lc 'ps -ef' in /home/johnj/dev_master/mydevelopment
succeeded in 0ms:
UID PID PPID C STIME TTY TIME CMD
johnj 1 0 0 10:37 ? 00:00:00 bwrap --new-session --die-with-parent --ro-bind / / --dev /dev --bind /tmp /tmp --perms 555 --tmpfs /tmp/.git --remount-ro /tmp/.git --perms 555 --tmpfs /tmp/.agents --remount-ro /tmp/.agents --perms 555 --tmpfs /tmp/.codex --remount-ro /tmp/.codex --bind /home/johnj/dev_master/mydevelopment /home/johnj/dev_master/mydevelopment --ro-bind /home/johnj/dev_master/mydevelopment/.git /home/johnj/dev_master/mydevelopment/.git --perms 555 --tmpfs /home/johnj/dev_master/mydevelopment/.agents --remount-ro /home/johnj/dev_master/mydevelopment/.agents --ro-bind-data 3 /home/johnj/dev_master/mydevelopment/.codex --bind /home/johnj/.codex/memories /home/johnj/.codex/memories --perms 555 --tmpfs /home/johnj/.codex/memories/.git --remount-ro /home/johnj/.codex/memories/.git --perms 555 --tmpfs /home/johnj/.codex/memories/.agents --remount-ro /home/johnj/.codex/memories/.agents --perms 555 --tmpfs /home/johnj/.codex/memories/.codex --remount-ro /home/johnj/.codex/memories/.codex --unshare-user --unshare-pid --unshare-net --proc /proc --argv0 codex-linux-sandbox -- /home/johnj/.npm-global/lib/node_modules/@openai/codex/node_modules/@openai/codex-linux-x64/vendor/x86_64-unknown-linux-musl/codex/codex --sandbox-policy-cwd /home/johnj/dev_master/mydevelopment --command-cwd /home/johnj/dev_master/mydevelopment --permission-profile {"type":"managed","file_system":{"type":"restricted","entries":[{"path":{"type":"special","value":{"kind":"root"}},"access":"read"},{"path":{"type":"special","value":{"kind":"project_roots"}},"access":"write"},{"path":{"type":"special","value":{"kind":"slash_tmp"}},"access":"write"},{"path":{"type":"special","value":{"kind":"tmpdir"}},"access":"write"},{"path":{"type":"special","value":{"kind":"project_roots","subpath":".git"}},"access":"read"},{"path":{"type":"special","value":{"kind":"project_roots","subpath":".agents"}},"access":"read"},{"path":{"type":"special","value":{"kind":"project_roots","subpath":".codex"}},"access":"read"},{"path":{"type":"path","path":"/home/johnj/.codex/memories"},"access":"write"}]},"network":"restricted"} --apply-seccomp-then-exec -- /bin/bash -lc ps -ef
johnj 2 1 0 10:37 ? 00:00:00 ps -ef

exec
/bin/bash -lc 'git -C /home/johnj/dev_master/ComfyUI rev-parse origin/issue_190' in /home/johnj/dev_master/mydevelopment
succeeded in 0ms:
c777d2a

codex
No merge-blocking defects were found in the latest PR state.
2026-05-05T15:38:01.875035Z ERROR codex_core::session: failed to record rollout items: thread 019df8c8-272d-75d1-a74c-660f38111825 not found

@pollockjj
Copy link
Copy Markdown
Owner Author

Closed — operator instruction not followed correctly during regeneration.

@pollockjj pollockjj closed this May 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants