Publish V3.9 source with per-chunk references and retained V3.8X2 workflows
This commit is contained in:
+10
-5
@@ -24,15 +24,15 @@ MANIFEST.sha256
|
||||
.gitattributes
|
||||
pytest.ini
|
||||
|
||||
# Ship only current V3.8X2 public contracts. Historical validation notes,
|
||||
# Ship current V3.9 and retained V3.8X2 public contracts. Historical validation notes,
|
||||
# version-specific design documents, and their screenshots stay in source.
|
||||
docs/*
|
||||
!docs/N2B_BRANCH_PROVENANCE_CONTRACT_V1.md
|
||||
!docs/V38_OPEN_INTEGRATION_CONTRACT.md
|
||||
!docs/V38_RELEASE_AND_MIGRATION.md
|
||||
|
||||
# Ship the two official V3.8X2 distribution names. They contain the same graph;
|
||||
# the longer name makes the Decode Cache Helper connection explicit.
|
||||
# Ship the separate V3.9 and V3.8X2 workflows. The V3.8X2 standard ZIP also
|
||||
# contains V3.9; its helper-explicit ZIP remains the V3.8X2-only alias.
|
||||
# External custom-node dependencies are documented, not bundled.
|
||||
examples/*
|
||||
!examples/workflows/
|
||||
@@ -41,10 +41,15 @@ examples/workflows/*
|
||||
!examples/workflows/MiniMax_H3_Continuum_V38X2.zip
|
||||
!examples/workflows/MiniMax_H3_Continuum_V38X2+Decode_Cache_Helper.json
|
||||
!examples/workflows/MiniMax_H3_Continuum_V38X2+Decode_Cache_Helper.zip
|
||||
!examples/workflows/MiniMax_H3_Continuum_V39_Reference_Inline.json
|
||||
!examples/workflows/MiniMax_H3_Continuum_V39_Reference_Inline.zip
|
||||
!examples/workflows/MiniMax_H3_Continuum_V39.json
|
||||
!examples/workflows/MiniMax_H3_Continuum_V39.zip
|
||||
!examples/MiniMax_H3_Continuum_V39.json
|
||||
!examples/MiniMax_H3_Continuum_V38X2.json
|
||||
|
||||
# Current loader migration instructions.
|
||||
!docs/LOADER_PERSISTENCE_REPAIR.md
|
||||
!docs/TIMELINE_VIDEO_EXPERIMENTAL.md
|
||||
|
||||
# Local updater receipt; never distribute it as package content.
|
||||
!docs/V39_REFERENCE_INLINE.md
|
||||
.h3-timeline-experimental.json
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
# AGENTS.md
|
||||
|
||||
## Scope
|
||||
MiniMax H3 Continuum V3.8 for ComfyUI. Treat the accepted V3.7 Production engine and the accepted V3.8 GPU Gates as the current execution baseline. V3.8 supports its approved current public surface; pre-V3.8 public Node IDs and saved workflows are distributed through their historical Release/tag and are not V3.8 compatibility requirements. Experimental controls must not change current Production behavior. Still Image Guide remains Experimental / Production HOLD.
|
||||
MiniMax H3 Continuum for ComfyUI. Current `main` is package 3.9.0: it keeps V3.8X2 and adds a separate V3.9 Sampler and Reference Images V3.9 helper. This source publication is not a new GitHub Release or Registry publication. Treat the accepted V3.7 Production engine and V3.8 GPU Gates as protected execution baselines. Pre-V3.8 public Node IDs and saved workflows remain historical Release/tag contracts, not automatic V3.9 migrations. Experimental controls must not change Production behavior. Still Image Guide remains Experimental / Production HOLD.
|
||||
|
||||
Current release-hygiene baseline: O1 and AUDIO-R1 are PASS; the public surface is seven nodes; Sampling Contract is v5; Run Storage is v3; State, Session, Assembly, Driving Audio, and Second Pass/O1 contracts are protected. Release / Registry readiness remains HOLD until package staging is rerun for the latest working tree.
|
||||
Current release-hygiene baseline: O1 and AUDIO-R1 are PASS; the original V3.8 launch had seven IDs, V3.8X2 has ten including deprecated loader compatibility IDs, and V3.9 registers twelve in total. Sampling Contract v5, Run Storage v3, State, Session, Assembly, Driving Audio, and Second Pass/O1 remain protected. V3.9 browser/default-template GPU acceptance and Release / Registry readiness remain HOLD.
|
||||
|
||||
## Non-negotiable rules
|
||||
- Follow ComfyUI Core behavior for user-facing validation. Continuum-only prompt restrictions, model allowlists, compatibility gates, and policy-based execution stops are prohibited.
|
||||
@@ -43,7 +43,7 @@ Current release-hygiene baseline: O1 and AUDIO-R1 are PASS; the public surface i
|
||||
- `Advanced` contains Second Pass, Selective/Temporal Refine, external integration, and diagnostics. Experimental or development-only nodes do not become public merely because their code and tests are retained.
|
||||
- Do not build an all-in-one node pack. Keep external Upscaler, TensorRT, FBC, Sol-Attn, Spectrum, Director, Prompt Planner, Save/Encoder, and Core or external VAE Decode outside Continuum unless an explicit integration contract is approved.
|
||||
- Do not grow the Main Sampler with unbounded sockets or serialized widgets. Prefer stable latent/assembly/refine/run contracts and external adapters.
|
||||
- V3.8 is the current supported product. V3.7 and earlier remain obtainable from historical GitHub Release/tag rather than being carried as public V3.8 Node-ID compatibility.
|
||||
- V3.8X2 remains available as a separate workflow and Sampler alongside V3.9 on `main`. V3.7 and earlier remain obtainable from historical GitHub Release/tag rather than being carried as automatic V3.9 Node-ID compatibility.
|
||||
- A saved workflow that references a Node ID not exported by V3.8 may load as an unknown node. State this explicitly in the V3.8 README, Release Notes, and migration note, and direct users to the corresponding historical Release/tag. Do not restore old registrations solely to hide this intentional support boundary.
|
||||
- The accepted V3.8 launch surface is seven searchable nodes: Sampler V3.8, Reference Audios, Finalize, Load Image, Load Audio, Load Video, and Second Pass. AUDIO-R1 is the approved one-node modular-input exception; existing six node IDs and schemas remain compatible.
|
||||
- Public-surface cleanup changes export mappings only. Do not physically delete legacy classes/modules while current V3.8 imports or inherits them, and do not exclude runtime-imported legacy modules from the package archive.
|
||||
@@ -57,9 +57,13 @@ Current release-hygiene baseline: O1 and AUDIO-R1 are PASS; the public surface i
|
||||
- Hi-Res Fix is not part of the new standard workflow. Preserve its historical implementation until cleanup is approved; use Second Pass as the external latent-processor bridge.
|
||||
- Keep P1a First Block Cache and P2 boundary-aware Sol-Attn `Deferred`. Keep A5 and A8b `HOLD` under their recorded release contracts. Issue #13 reporter-exact R3 remains the highest Continuation Quality investigation when its required workflow is available.
|
||||
|
||||
## H3 completion review handoff
|
||||
|
||||
- User decision (2026-09-16): do not send implementation or Gate reports to `H3情報チェック` automatically, ask for handoff approval, or wait for a reply. Send only when the user explicitly requests it again.
|
||||
|
||||
## A8b and A5 HOLD release contracts
|
||||
|
||||
- 2026-09-05 explicit user exception ("許可、許可。"): Issue13 R3B may run one isolated Video-only weak tapered context-noise A/B experiment before reporter-exact R3. This waives only the reporter-exact/independence prerequisite for that diagnostic. Keep Production/source runtime unchanged, Audio/masks/depth/Seed/SIGMAS/grouping unchanged, default OFF bit-exact, and pass CPU/Shadow/Replay before GPU. Restore clean exported prefix after the diagnostic perturbation. No combined interventions, A5 work, public controls, or Production promotion are authorized. General A8b and Release HOLD remain. Do not automatically send cross-task audit reports; sending requires a fresh explicit user request.
|
||||
- 2026-09-05 explicit user exception ("許可、許可。"): Issue13 R3B may run one isolated Video-only weak tapered context-noise A/B experiment before reporter-exact R3. This waives only the reporter-exact/independence prerequisite for that diagnostic. Keep Production/source runtime unchanged, Audio/masks/depth/Seed/SIGMAS/grouping unchanged, default OFF bit-exact, and pass CPU/Shadow/Replay before GPU. Restore clean exported prefix after the diagnostic perturbation. No combined interventions, A5 work, public controls, or Production promotion are authorized. General A8b and Release HOLD remain; GPU-audit sharing is limited to the fixed H3情報チェック task.
|
||||
|
||||
- A8a is the accepted read-only baseline: full pytest `1041`, Manifest `242/242`, every observer record has `execution_applied=false`, and Production/Sampling/Run Storage/State/Session/Assembly parity is preserved.
|
||||
- Keep A8b execution policy on HOLD until one intervention type is specified and approved. Do not change context, transport, mask, latent, or conditioning in combination. Seed, SIGMAS, and physical grouping remain unchanged unless separately approved.
|
||||
@@ -101,8 +105,8 @@ GPU checks must cover Sage only, Sage+Sol, Sage+Spectrum, and Sage+Sol+Spectrum
|
||||
- New official workflows use Core LoadAudio and Core LoadVideo -> H3ContinuumVideoAdapter. The adapter has no Enable/file/upload UI and reuses the existing frame-rate conversion. Preserve the original Audio/Video IDs as deprecated compatibility nodes; never infer lost filenames or saved OFF states.
|
||||
- The approved export exception adds H3ContinuumVideoAdapter to the existing nine-node mapping. Do not change Main Sampler, Sampling, external wrappers, Decode Cache or Run Storage semantics for this repair.
|
||||
|
||||
## User-approved Timeline Video experiment (2026-09-22)
|
||||
## User-approved Timeline Video experiment (2026-09-21)
|
||||
|
||||
- Append one optional `Video Reference Mode` to V38. Missing mode remains `Repeat Reference`; `Follow Timeline` is opt-in and uses each physical group's visible output range without consuming continuation context twice.
|
||||
- Preserve grouping, Seed, SIGMAS, Audio, masks, Run Storage schema, Terminal Merge ownership, and the two official V3.8X2 workflow files. Experimental Follow/Repeat templates remain separate comparison assets.
|
||||
- Local acceptance passed: full CPU `1424 passed / 1 skipped`, browser save/reload, Follow/Repeat GPU functional runs, A/B mode separation, and Manifest integrity. Keep the feature Experimental; do not describe it as exact motion copying or a long-input RAM optimization.
|
||||
- This ZIP adds one optional appended Video Reference Mode to V38. Missing mode stays Repeat Reference. Follow Timeline is opt-in and uses the existing physical visible range; do not change grouping, seed, audio or masks.
|
||||
- Keep current public workflow files unchanged. Separate Experimental Follow/Repeat templates are used until browser and GPU acceptance.
|
||||
- CPU module/patch-fixture tests do not constitute a full ComfyUI or GPU gate. H3 information-check handoff remains pending.
|
||||
|
||||
+157
-139
@@ -1,14 +1,32 @@
|
||||
# Changelog
|
||||
|
||||
## 3.9.0 — V3.9 source on main (2026-09-29)
|
||||
|
||||
- Publish the separate V3.9 Sampler and nine-slot Reference Images V3.9 helper with fixed `@R1`–`@R9` identities and All / Per chunk assignments. V3.8X2 keeps its existing Sampler and Reference connections; saved Runs/Takes are not automatically migrated.
|
||||
- Ship the user-selected V3.9 workflow JSON unchanged, a V3.9-only workflow ZIP, and a combined V3.8X2/V3.9 workflow ZIP. The ComfyUI Templates gallery exposes both separate workflows.
|
||||
- Promote package metadata and startup version to `3.9.0`. Keep historical Releases/tags untouched. This main-source commit is not a new GitHub Release or Registry publication; browser save/reload and the unchanged default template's GPU acceptance remain separate gates.
|
||||
|
||||
## V3.9 development history — Reference Images in-node UI (2026-09-27)
|
||||
|
||||
- Add a separate nine-slot Reference Images V3.9 helper with fixed `@R1`–`@R9` IDs, in-node All chunks / Per chunk table, and one typed connection to the V3.9 Sampler. Both choices use the existing group-effective routing engine; disconnected or unassigned slots do not renumber later images.
|
||||
- Supply a separate V3.9 workflow JSON/ZIP and user guide. V3.8 Sampler and V38X2 workflow JSON/ZIP remain unchanged. Older V3.9 prototype graphs require manual rewiring and saved Runs/Takes do not migrate automatically.
|
||||
- Local CPU `1530 passed / 1 skipped / 0 failed`, frontend Reference Images and Review Queue contracts, and standalone runtime verification passed. Live-browser and GPU acceptance of this new helper/UI remain pending. No commit, push, Release or Registry publication.
|
||||
- Rebase the separate V3.9 JSON/ZIP on the supplied V38X2+Decode Cache Helper workflow, preserving its appended Repeat Reference video setting, media loader values, Image bypass and Decode Cache Helper. Route Reference Images 1–9 through the new helper; keep all other graph nodes and settings unchanged. The running 8188 backend still exposed the old V3.9 schema until a full backend restart.
|
||||
|
||||
## Prior local prototype — V3.9 Reference Routing RR-R6B (2026-09-25)
|
||||
|
||||
- Add a separate V3.9 Sampler ID with default All (unchanged V3.8 Reference path) and opt-in Custom R1–R9 per-chunk selectors. Keep the V3.8 schema/widget order and official V3.8X2 workflow files unchanged.
|
||||
- Carry the frozen RR-R5 group contract through the private runtime to a read-only, post-Queue Plan Inspector. Pending groups remain configured/unverified; accepted groups display backend-verified generated/reused status, effective Picture mapping, SHA and warnings.
|
||||
- Capture matching group-local routed conditioning in same-Queue Refine Context; Second Pass distinguishes verified Reference inheritance from prompt-only fallback. No cross-session reconstruction is claimed.
|
||||
- Local full CPU: `1524 passed / 1 skipped / 0 failed`. RR-R6 GPU/API integration passed 11 Queues, including Review Q1–Q3, Second Pass, and the Sage/Sol/Spectrum wrapper matrix. The subsequent real-browser B0–B5 Review, completion, and save/reload gate passed using a corrected Ref2V 8-step LoRA / eight-step workflow; this is not a six-step rerun. Subjective identity and long-form image quality remain ungraded.
|
||||
- V3.8X2 workflow JSON/ZIP and the V3.8 Sampler remain available. V3.9 `All` uses the V3.8 shared-reference path; changing to V3.9 `Custom` is a manual workflow change and does not automatically migrate an accepted Run or Take.
|
||||
- The planned separate V3.8X2 tag/Release and `release/3.8x2` maintenance branch have not been created. V3.9 workflow, commit, push, Release, and Registry publication remain pending.
|
||||
|
||||
## Experimental on main — Unified Timeline Video (2026-09-22)
|
||||
|
||||
- Renamed the existing V3.8 video IMAGE input to `Timeline Video Frames` while preserving its internal key and saved links.
|
||||
- Added one appended optional `Video Reference Mode`: `Repeat Reference` remains the compatibility default; `Follow Timeline` selects the source interval belonging to each physical output group.
|
||||
- Follow mode excludes continuation-prefix frames from source consumption, records each physical slice in the plan, uses slice-specific Video VAE/cache identity, and continues without video reference after source exhaustion.
|
||||
- Kept Sampling, Seed, SIGMAS, Audio, masks, continuation grouping, Terminal Merge ownership, Run Storage schema, and the two official V3.8X2 workflows unchanged. Added separate Follow/Repeat comparison workflows.
|
||||
- Synchronized the lightweight runtime verifier and README public-surface wording with the already-exported ten-node V3.8X2 surface, including `H3ContinuumVideoAdapter`.
|
||||
- Acceptance: full CPU `1424 passed / 1 skipped / 0 failed`; browser save/reload PASS; Follow and Repeat `2 x 5 s` GPU runs PASS at 704x416/24fps with synchronized 10-second audio/video and no OOM, NaN, allocation failure, or crash.
|
||||
- This remains Experimental: it is soft H3 conditioning, not exact motion copying, and it does not reduce the RAM needed to hold a long decoded IMAGE batch.
|
||||
- Opt-in Follow Timeline / legacy-compatible Repeat Reference on the existing IMAGE input.
|
||||
- Per-physical-group reference selection; source-end fallback; distinct interval VAE keys and local prompt caches.
|
||||
- Local acceptance passed: full CPU `1424 passed / 1 skipped / 0 failed`, browser save/reload, and Follow/Repeat `2 × 5 s` GPU runs at 704×416/24fps with synchronized 10-second audio/video, mode separation, and no OOM/NaN/crash. This remains Experimental and is not a frame-perfect motion-copying or long-video RAM-optimization claim.
|
||||
|
||||
## Unreleased — Loader persistence repair (2026-09-21)
|
||||
|
||||
@@ -129,136 +147,136 @@
|
||||
- Preserved all V3.4/V3.5 node IDs, backend socket keys, saved-workflow compatibility, Sampling, Conditioning, Terminal Merge, Assembly, Seam, and Run Storage contracts.
|
||||
|
||||
## 3.5.1
|
||||
|
||||
- Added `H3 Continuum Conditioning Bridge V3.5`, exposing one complete Core-compatible MODEL and CONDITIONING object per Continuum physical group without flattening CONDITIONING entries.
|
||||
- Added optional standalone Reference Audio conditioning to Sampler V3.5. Its two Python-defined sockets remain permanently present; the frontend no longer adds/removes them or serializes a visibility-only widget, preserving workflow widget alignment on save/reload.
|
||||
|
||||
- Added `H3 Continuum Conditioning Bridge V3.5`, exposing one complete Core-compatible MODEL and CONDITIONING object per Continuum physical group without flattening CONDITIONING entries.
|
||||
- Added optional standalone Reference Audio conditioning to Sampler V3.5. Its two Python-defined sockets remain permanently present; the frontend no longer adds/removes them or serializes a visibility-only widget, preserving workflow widget alignment on save/reload.
|
||||
- Removed the experimental Last Queued Seed override and restored standard ComfyUI `control after generate` behavior for the V3.5 sampler.
|
||||
- Renamed the displayed video-guide inputs to `Video Guide Frames` and `Video Guide Size` to distinguish a video loader's IMAGE frame batch from still Reference Images. Backend input keys and saved-workflow links are unchanged.
|
||||
- GPU-accepted Conditioning Bridge generation, Reference Audio/Image retention, and the V3.5 Second Pass/Hi-Res paths while preserving physical-group, Terminal Merge, Run Storage, and audio contracts.
|
||||
|
||||
## 3.5.0
|
||||
|
||||
- Added `H3 Continuum Sampler V3.5` with a Continuum-aware refine-context output while preserving the V3.4 sampler path.
|
||||
- Added `H3 Continuum Second Pass V3.5` as the advanced bridge for externally processed H3 video latents, including physical-group and Long Terminal Merge preservation.
|
||||
- Added experimental `H3 Continuum Hi-Res Fix V3.5`, using a bounded pixel/VAE resize round trip before low-denoise Second Pass sampling.
|
||||
- Added `H3 Continuum Latent Resize V3.5` as an advanced utility; direct high-ratio latent interpolation is not the recommended main Hi-Res Fix path.
|
||||
- Added `H3 Continuum Assemble + Seam V3.5` with Auto, RAM, and Windows-safe disk-backed video buffers while keeping audio in RAM.
|
||||
- Added the recommended V3.5 template workflow with optional Hi-Res Fix, Auto assembly, shared still-image megapixel sizing, and separate Video Guide Frames sizing.
|
||||
- Preserved Exact Duration, seam behavior, physical decode-group ordering, first-pass audio passthrough, and external Core VAE Decode contracts.
|
||||
- Kept V3.4 nodes and saved-workflow compatibility unchanged.
|
||||
- Validated a 9.49 GiB final IMAGE with hash-identical RAM/Disk-backed output and approximately 9.50 GiB lower Windows private memory in Disk-backed mode.
|
||||
- GPU-accepted the integrated 1x5 576-to-1152 Main path and Hybrid/Reference 1x5 paths; documented that the 3x5 2x terminal 77T group exceeds the tested RTX 5060 Ti 16 GiB.
|
||||
|
||||
## 3.4.0
|
||||
|
||||
- Completed the V3.4 runtime path from the public sampler through V3/V2 to `run_sequence()`.
|
||||
- Added Driving Audio with absolute-time guide slices while preserving the original source for final output.
|
||||
- Added persistent Video Guide Frames conditioning with Efficient 0.4 MP, Balanced 0.6 MP, and Match Output modes.
|
||||
- Included Driving Audio and Video Guide Frames identities in Run Storage contracts.
|
||||
- Changed malformed or empty prompts to warning-and-fallback behavior instead of stopping generation.
|
||||
- Removed independent compatibility, model, and upstream-node restrictions that were stricter than ComfyUI Core.
|
||||
- Added V3.4 runtime, driving-audio, and context diagnostics coverage.
|
||||
|
||||
## 3.3.0
|
||||
|
||||
- Promoted Timeline Video to a stable public node with chunk-local slicing and a 0.4 MP default.
|
||||
- Added `H3 Continuum Assemble + Seam` with stable Audio Seam Auto and guarded Video Seam Auto defaults.
|
||||
- Kept `Auto 2` as an experimental exposure-ramp extension without widening the visible option label.
|
||||
- Added native Reference Audio conditioning and retained up to three ordered Reference Images.
|
||||
- Preserved stable sampler Node IDs, Run Storage compatibility, Core VAE decode, and Spectrum Interop API v1 Actual Prefix 2 behavior.
|
||||
- Added consolidated runtime validation results and documented known Timeline Video and Auto 2 limitations.
|
||||
|
||||
## 3.2.4
|
||||
|
||||
- Added native MiniMax H3 Reference Audio 1 conditioning with deferred Audio VAE encoding.
|
||||
- Matched Core's permissive prompt handling by warning instead of stopping on unavailable Picture or Audio tags.
|
||||
- Matched Core's dynamic Reference behavior by compacting active image inputs into Picture 1 through Picture N.
|
||||
- Kept Sampling, Continuation, Spectrum Interop, external Core VAE Decode, and assembly semantics unchanged.
|
||||
|
||||
## 3.2.3
|
||||
|
||||
- Formalized the third ordered Reference Image as a compatibility-preserving extension.
|
||||
- Kept V3.2.2 zero, one, and two-image Reference Contract JSON unchanged.
|
||||
- Added Image 3 shape, dtype, exact SHA-256, position, and preprocess metadata only for three-image runs.
|
||||
- Added Golden Contract and Revision identity regression coverage for V3.2.2 saved runs.
|
||||
- Kept Sampling, Continuation, Spectrum Interop, Core VAE Decode, and assembly semantics unchanged.
|
||||
|
||||
## 3.2.2
|
||||
|
||||
- Allowed Ref2VA, FL2VA, and unverified checkpoints with Reference conditioning.
|
||||
- Kept checkpoint classification as diagnostics without automatic MODEL switching.
|
||||
- Kept Strict Compatibility for genuinely unsafe or unsupported H3 contracts.
|
||||
|
||||
## 3.2.1
|
||||
|
||||
- Declared V3.2.1 stable after GitHub Actions, Windows Ref2VA generation, Spectrum Actual Prefix 2, chunk integrity and complete Auto Resume passed.
|
||||
- Added T2VA, First/Last Frame, FL2VA and persistent two-image Reference conditioning to the production sampler.
|
||||
- Added crash-safe raw AV Run Storage, automatic resume, deterministic Revisions and partial regeneration.
|
||||
- Combined ordered upstream graph fingerprints with runtime MODEL/CLIP/VAE weight probes for fail-closed reuse.
|
||||
- Added per-chunk SHA-256 verification and rejected Regenerate From when Run Storage is disabled.
|
||||
- Added official MiniMax H3 Sigma Shift graph-contract support.
|
||||
- Updated CI dependencies, Windows runtime verification and package metadata for V3.2.1.
|
||||
- Standardized project licensing as MIT.
|
||||
- Kept sampling, Continuation, Spectrum Interop and external Core VAE decode semantics unchanged.
|
||||
|
||||
## 2.1.7
|
||||
|
||||
- Added the compact static `H3 Continuum Sampler` facade over the unchanged V2 execution core.
|
||||
- Added Clip Overrides, Advanced, and Result pack helper nodes.
|
||||
- Preserved `H3ContinuumSamplerV2` as a Legacy/Core workflow compatibility node.
|
||||
- Removed the frontend display controller and all dynamic socket, proxy-widget, DOM, resize, and serialization workarounds.
|
||||
- Kept State, Session, Prompt Plan, Sampling, Native Continuity, and Spectrum Interop contracts unchanged.
|
||||
|
||||
## 2.1.6
|
||||
|
||||
- Rebuilt the Sampler V2 frontend as one Vue-aware display controller.
|
||||
- Removed the Individual Clip Overrides accordion; only active Clip Prompt sockets are shown.
|
||||
- Kept connected out-of-range Clip Prompt sockets visible when chunks is reduced.
|
||||
- Added one Advanced Settings control; connected advanced sockets stay visible while collapsed.
|
||||
- Removed fixed node-height handling and all input/output add/remove UI folding.
|
||||
- Kept backend socket/widget order, types, serialization, State/Session/Prompt Plan schemas, sampling, and Spectrum Interop unchanged.
|
||||
- Exposed show_preview as a per-node basic control and removed the duplicate global preview setting.
|
||||
|
||||
## 2.0.1
|
||||
|
||||
- Fixed the bundled V2 example workflow widget serialization for `base_seed` with `control_after_generate`.
|
||||
- Added an in-memory migration guard for the malformed 2.0.0 example where later widgets were shifted by one slot (`diagnostics` arrived as `0`).
|
||||
- Preserved valid 2.0.0 workflows and all V1/V2 node identifiers and schemas.
|
||||
- Added regression coverage for the legacy shifted-widget signature.
|
||||
|
||||
## 2.0.0
|
||||
|
||||
- Added production **H3 Continuum Sampler V2** for integrated N-chunk generation.
|
||||
- Kept the V1 continuation algorithm and all V1 node identifiers unchanged.
|
||||
- Added Fixed, List, and Timeline prompt planning plus a connectable Prompt Plan node.
|
||||
- Cached each unique Qwen prompt conditioning before H3 sampling.
|
||||
- Reused one externally accelerator-patched MODEL, sampler, and sigma schedule across all chunks.
|
||||
- Deferred Video/Audio VAE decoding until every H3 chunk finished.
|
||||
- Captured full raw AV chunk latents and next-state tails on CPU before decoding.
|
||||
- Removed the second device-to-host state transfer by deriving next-state tails from committed CPU entries.
|
||||
- Added conservative latent-motion Auto Context selection with 5/22/39-frame profiles.
|
||||
- Added deterministic independent 64-bit per-chunk seeds and reroll nonces.
|
||||
- Added V2 Session resume, accepted-prefix reuse, branch-safe reroll, and atomic safetensors/JSON persistence.
|
||||
- Added exact cumulative audio sample-boundary assembly to prevent long-chain rounding drift.
|
||||
- Added exact total-duration correction.
|
||||
- Added single-allocation decoded IMAGE assembly and preflight RAM safety checks.
|
||||
- Added Basic and Full diagnostics, including video overlap MAE/PSNR and audio correlation/boundary jump.
|
||||
- Added optional V1 State entry point and V2 Session-to-V1 State conversion.
|
||||
- Added V2 public API modules and regression/orchestration tests.
|
||||
- Updated installer runtime verification for all ten registered nodes.
|
||||
|
||||
## 1.0.1
|
||||
|
||||
- Fixed a false strict-compatibility failure when Sol-Attn wraps MiniMax H3
|
||||
`PackedLayout.__init__` with `*args` / `**kwargs` for Morton/span tracking.
|
||||
- Strict checking still fails closed when the native H3 constructor genuinely
|
||||
removes required positional or keyword capabilities.
|
||||
- Added regression tests for the native signature, Sol-Attn forwarding wrapper,
|
||||
and a genuinely incompatible constructor.
|
||||
|
||||
## 1.0.0
|
||||
|
||||
- Added **H3 Continuum Join** for initial and continuation clips.
|
||||
- Added direct native video/audio latent state capture with 5/22/39-frame profiles.
|
||||
- Represented continuation history as one native H3 `video` / `video_audio` reference block.
|
||||
- Added Finish, Assemble, atomic State Save/Load, signed audio-grid offsets, in-place MM-RoPE adjustment, strict compatibility tests, and accelerator composition.
|
||||
- Renamed the displayed video-guide inputs to `Video Guide Frames` and `Video Guide Size` to distinguish a video loader's IMAGE frame batch from still Reference Images. Backend input keys and saved-workflow links are unchanged.
|
||||
- GPU-accepted Conditioning Bridge generation, Reference Audio/Image retention, and the V3.5 Second Pass/Hi-Res paths while preserving physical-group, Terminal Merge, Run Storage, and audio contracts.
|
||||
|
||||
## 3.5.0
|
||||
|
||||
- Added `H3 Continuum Sampler V3.5` with a Continuum-aware refine-context output while preserving the V3.4 sampler path.
|
||||
- Added `H3 Continuum Second Pass V3.5` as the advanced bridge for externally processed H3 video latents, including physical-group and Long Terminal Merge preservation.
|
||||
- Added experimental `H3 Continuum Hi-Res Fix V3.5`, using a bounded pixel/VAE resize round trip before low-denoise Second Pass sampling.
|
||||
- Added `H3 Continuum Latent Resize V3.5` as an advanced utility; direct high-ratio latent interpolation is not the recommended main Hi-Res Fix path.
|
||||
- Added `H3 Continuum Assemble + Seam V3.5` with Auto, RAM, and Windows-safe disk-backed video buffers while keeping audio in RAM.
|
||||
- Added the recommended V3.5 template workflow with optional Hi-Res Fix, Auto assembly, shared still-image megapixel sizing, and separate Video Guide Frames sizing.
|
||||
- Preserved Exact Duration, seam behavior, physical decode-group ordering, first-pass audio passthrough, and external Core VAE Decode contracts.
|
||||
- Kept V3.4 nodes and saved-workflow compatibility unchanged.
|
||||
- Validated a 9.49 GiB final IMAGE with hash-identical RAM/Disk-backed output and approximately 9.50 GiB lower Windows private memory in Disk-backed mode.
|
||||
- GPU-accepted the integrated 1x5 576-to-1152 Main path and Hybrid/Reference 1x5 paths; documented that the 3x5 2x terminal 77T group exceeds the tested RTX 5060 Ti 16 GiB.
|
||||
|
||||
## 3.4.0
|
||||
|
||||
- Completed the V3.4 runtime path from the public sampler through V3/V2 to `run_sequence()`.
|
||||
- Added Driving Audio with absolute-time guide slices while preserving the original source for final output.
|
||||
- Added persistent Video Guide Frames conditioning with Efficient 0.4 MP, Balanced 0.6 MP, and Match Output modes.
|
||||
- Included Driving Audio and Video Guide Frames identities in Run Storage contracts.
|
||||
- Changed malformed or empty prompts to warning-and-fallback behavior instead of stopping generation.
|
||||
- Removed independent compatibility, model, and upstream-node restrictions that were stricter than ComfyUI Core.
|
||||
- Added V3.4 runtime, driving-audio, and context diagnostics coverage.
|
||||
|
||||
## 3.3.0
|
||||
|
||||
- Promoted Timeline Video to a stable public node with chunk-local slicing and a 0.4 MP default.
|
||||
- Added `H3 Continuum Assemble + Seam` with stable Audio Seam Auto and guarded Video Seam Auto defaults.
|
||||
- Kept `Auto 2` as an experimental exposure-ramp extension without widening the visible option label.
|
||||
- Added native Reference Audio conditioning and retained up to three ordered Reference Images.
|
||||
- Preserved stable sampler Node IDs, Run Storage compatibility, Core VAE decode, and Spectrum Interop API v1 Actual Prefix 2 behavior.
|
||||
- Added consolidated runtime validation results and documented known Timeline Video and Auto 2 limitations.
|
||||
|
||||
## 3.2.4
|
||||
|
||||
- Added native MiniMax H3 Reference Audio 1 conditioning with deferred Audio VAE encoding.
|
||||
- Matched Core's permissive prompt handling by warning instead of stopping on unavailable Picture or Audio tags.
|
||||
- Matched Core's dynamic Reference behavior by compacting active image inputs into Picture 1 through Picture N.
|
||||
- Kept Sampling, Continuation, Spectrum Interop, external Core VAE Decode, and assembly semantics unchanged.
|
||||
|
||||
## 3.2.3
|
||||
|
||||
- Formalized the third ordered Reference Image as a compatibility-preserving extension.
|
||||
- Kept V3.2.2 zero, one, and two-image Reference Contract JSON unchanged.
|
||||
- Added Image 3 shape, dtype, exact SHA-256, position, and preprocess metadata only for three-image runs.
|
||||
- Added Golden Contract and Revision identity regression coverage for V3.2.2 saved runs.
|
||||
- Kept Sampling, Continuation, Spectrum Interop, Core VAE Decode, and assembly semantics unchanged.
|
||||
|
||||
## 3.2.2
|
||||
|
||||
- Allowed Ref2VA, FL2VA, and unverified checkpoints with Reference conditioning.
|
||||
- Kept checkpoint classification as diagnostics without automatic MODEL switching.
|
||||
- Kept Strict Compatibility for genuinely unsafe or unsupported H3 contracts.
|
||||
|
||||
## 3.2.1
|
||||
|
||||
- Declared V3.2.1 stable after GitHub Actions, Windows Ref2VA generation, Spectrum Actual Prefix 2, chunk integrity and complete Auto Resume passed.
|
||||
- Added T2VA, First/Last Frame, FL2VA and persistent two-image Reference conditioning to the production sampler.
|
||||
- Added crash-safe raw AV Run Storage, automatic resume, deterministic Revisions and partial regeneration.
|
||||
- Combined ordered upstream graph fingerprints with runtime MODEL/CLIP/VAE weight probes for fail-closed reuse.
|
||||
- Added per-chunk SHA-256 verification and rejected Regenerate From when Run Storage is disabled.
|
||||
- Added official MiniMax H3 Sigma Shift graph-contract support.
|
||||
- Updated CI dependencies, Windows runtime verification and package metadata for V3.2.1.
|
||||
- Standardized project licensing as MIT.
|
||||
- Kept sampling, Continuation, Spectrum Interop and external Core VAE decode semantics unchanged.
|
||||
|
||||
## 2.1.7
|
||||
|
||||
- Added the compact static `H3 Continuum Sampler` facade over the unchanged V2 execution core.
|
||||
- Added Clip Overrides, Advanced, and Result pack helper nodes.
|
||||
- Preserved `H3ContinuumSamplerV2` as a Legacy/Core workflow compatibility node.
|
||||
- Removed the frontend display controller and all dynamic socket, proxy-widget, DOM, resize, and serialization workarounds.
|
||||
- Kept State, Session, Prompt Plan, Sampling, Native Continuity, and Spectrum Interop contracts unchanged.
|
||||
|
||||
## 2.1.6
|
||||
|
||||
- Rebuilt the Sampler V2 frontend as one Vue-aware display controller.
|
||||
- Removed the Individual Clip Overrides accordion; only active Clip Prompt sockets are shown.
|
||||
- Kept connected out-of-range Clip Prompt sockets visible when chunks is reduced.
|
||||
- Added one Advanced Settings control; connected advanced sockets stay visible while collapsed.
|
||||
- Removed fixed node-height handling and all input/output add/remove UI folding.
|
||||
- Kept backend socket/widget order, types, serialization, State/Session/Prompt Plan schemas, sampling, and Spectrum Interop unchanged.
|
||||
- Exposed show_preview as a per-node basic control and removed the duplicate global preview setting.
|
||||
|
||||
## 2.0.1
|
||||
|
||||
- Fixed the bundled V2 example workflow widget serialization for `base_seed` with `control_after_generate`.
|
||||
- Added an in-memory migration guard for the malformed 2.0.0 example where later widgets were shifted by one slot (`diagnostics` arrived as `0`).
|
||||
- Preserved valid 2.0.0 workflows and all V1/V2 node identifiers and schemas.
|
||||
- Added regression coverage for the legacy shifted-widget signature.
|
||||
|
||||
## 2.0.0
|
||||
|
||||
- Added production **H3 Continuum Sampler V2** for integrated N-chunk generation.
|
||||
- Kept the V1 continuation algorithm and all V1 node identifiers unchanged.
|
||||
- Added Fixed, List, and Timeline prompt planning plus a connectable Prompt Plan node.
|
||||
- Cached each unique Qwen prompt conditioning before H3 sampling.
|
||||
- Reused one externally accelerator-patched MODEL, sampler, and sigma schedule across all chunks.
|
||||
- Deferred Video/Audio VAE decoding until every H3 chunk finished.
|
||||
- Captured full raw AV chunk latents and next-state tails on CPU before decoding.
|
||||
- Removed the second device-to-host state transfer by deriving next-state tails from committed CPU entries.
|
||||
- Added conservative latent-motion Auto Context selection with 5/22/39-frame profiles.
|
||||
- Added deterministic independent 64-bit per-chunk seeds and reroll nonces.
|
||||
- Added V2 Session resume, accepted-prefix reuse, branch-safe reroll, and atomic safetensors/JSON persistence.
|
||||
- Added exact cumulative audio sample-boundary assembly to prevent long-chain rounding drift.
|
||||
- Added exact total-duration correction.
|
||||
- Added single-allocation decoded IMAGE assembly and preflight RAM safety checks.
|
||||
- Added Basic and Full diagnostics, including video overlap MAE/PSNR and audio correlation/boundary jump.
|
||||
- Added optional V1 State entry point and V2 Session-to-V1 State conversion.
|
||||
- Added V2 public API modules and regression/orchestration tests.
|
||||
- Updated installer runtime verification for all ten registered nodes.
|
||||
|
||||
## 1.0.1
|
||||
|
||||
- Fixed a false strict-compatibility failure when Sol-Attn wraps MiniMax H3
|
||||
`PackedLayout.__init__` with `*args` / `**kwargs` for Morton/span tracking.
|
||||
- Strict checking still fails closed when the native H3 constructor genuinely
|
||||
removes required positional or keyword capabilities.
|
||||
- Added regression tests for the native signature, Sol-Attn forwarding wrapper,
|
||||
and a genuinely incompatible constructor.
|
||||
|
||||
## 1.0.0
|
||||
|
||||
- Added **H3 Continuum Join** for initial and continuation clips.
|
||||
- Added direct native video/audio latent state capture with 5/22/39-frame profiles.
|
||||
- Represented continuation history as one native H3 `video` / `video_audio` reference block.
|
||||
- Added Finish, Assemble, atomic State Save/Load, signed audio-grid offsets, in-place MM-RoPE adjustment, strict compatibility tests, and accelerator composition.
|
||||
|
||||
+10
-5
@@ -1,4 +1,6 @@
|
||||
ComfyUI-H3-Continuum V3.8 — インストール
|
||||
ComfyUI-H3-Continuum 3.9.0 — V3.9 / V3.8X2 インストール
|
||||
|
||||
V3.9.0はmainの現行ソースです。新しいGitHub Release/Registry公開は別工程で、過去のRelease/tagは残します。V3.8X2 WorkflowをV3.9へ自動変換せず、別々のWorkflowとして保存してください。保存済みRun/Takeも自動移行しません。
|
||||
|
||||
1. ComfyUIを終了します。
|
||||
2. 既存の `ComfyUI-H3-Continuum` を更新する場合は、作業中のworkflowとRun Storageを先に退避します。
|
||||
@@ -11,7 +13,7 @@ StabilityMatrixの配置例:
|
||||
PowerShellによる自動インストール:
|
||||
`install_windows.ps1`
|
||||
|
||||
V3.8の公開ノードは7個です。
|
||||
現行ソースの登録IDは計12件です。以下の旧V3.8基本7件(旧Audio/Video Loader 2件を含む)に、Reference Images、Decode Cache Helper、Video Adapterを加えたV3.8X2の10件と、V3.9 Sampler/Reference Images V3.9の2件です。旧Audio/Video Loaderは新規Workflowでは推奨しません。
|
||||
|
||||
- H3 Continuum Sampler V3.8
|
||||
- H3 Continuum Reference Audios
|
||||
@@ -21,16 +23,19 @@ V3.8の公開ノードは7個です。
|
||||
- H3 Continuum Load Video
|
||||
- H3 Continuum Second Pass
|
||||
|
||||
標準の入出力経路は、Sampler V3.8 → ComfyUI Core Video / Audio Decode → Finalize → Core Create Video → Core Save Videoです。Hi-Res Fixは標準経路に含みません。サイズは `Size Source = First Image`(初期画像がある場合)または `Manual`(Width / Heightを入力)で指定します。
|
||||
V3.8X2公式Workflowの標準経路は、Sampler V3.8 → Decode Cache Helper → Finalize → Core Create Video → Core Save Videoです。V3.9公式はSampler V3.9とReference Images V3.9ヘルパーを使用し、残りの出力経路は同様です。Hi-Res Fixは標準経路に含みません。サイズは `Size Source = First Image`(初期画像がある場合)または `Manual`(Width / Heightを入力)で指定します。
|
||||
|
||||
配布Workflowは `examples/workflows/MiniMax_H3_Continuum_V38x.json` と同じJSONを含む同名ZIPです。このV3.8X(package 3.8.1)ZIPはWorkflowだけを格納しており、手順3のカスタムノード本体ZIPとは別物です。旧V3.8.0は`v3.8.0` tagから導入できます。Spectrum対応graphですが、保存状態ではSpectrumとTurbo LoRAはどちらもOFFです。Spectrum、rgthree、KJNodesを別途導入してください。ComfyUI-Easy-Useは不要です。モデルや画像・音声は含みません。保存済みファイル名は各自の入力へ置き換え、不要な入力はOFFにしてください。
|
||||
Workflowは `examples/workflows/MiniMax_H3_Continuum_V39.json` と `examples/workflows/MiniMax_H3_Continuum_V38X2.json` を別々に用意し、Templatesにも2件表示します。V3.8X2標準ZIPには両JSONを同梱し、V3.9単独ZIPも残します。ZIPはWorkflow用で、カスタムノード本体のインストーラーではありません。V3.9公式はユーザー指定JSONを無改変で採用した32ノード/39リンク、First Image+Draft 0.30 MP、2×10秒のGenerate Full Video(保存値はFull Run)です。First Image Loaderは有効なので、Queue前に自分の画像を選んでください。Reference-onlyならFirst ImageをOFFにし、Size SourceをManualへ切り替えます。保存済み480×640はManual時のみ有効です。画像Loader 1~6は接続済み・初期Bypassで、7~9は必要な場合に画像Loaderを追加接続します。Sequence Promptは空欄なので実行前に入力してください。SpectrumとTurbo LoRAは初期OFFです。完全なgraphにはSpectrum、rgthree、KJNodesを別途導入してください。ComfyUI-Easy-Useは不要です。モデルや画像・音声は同梱しません。
|
||||
|
||||
最小確認:
|
||||
- chunks: 2 または 3
|
||||
- chunk_seconds: 5.0
|
||||
- continuity: Balanced — 22 frames
|
||||
- Sequence Prompt: Text (Multiline)を接続
|
||||
- 最終Video/Audio VAE Decodeと保存はComfyUI Coreノードへ接続
|
||||
- V3.8X2/V3.9公式Workflowでは内蔵Decode Cache Helper、Finalize、Core Create Video/Save Videoの接続を維持
|
||||
- Reference Audioを複数使う場合は `H3 Continuum Reference Audios` helperへ最大3本を接続
|
||||
- V3.9のチャンク別Reference Imageは `H3 Continuum Reference Images V3.9` で割り当て、Sampler V3.9へ1本接続
|
||||
|
||||
`pyproject.toml`の依存宣言はComfyUI >=0.32.0ですが、現行の実生成・GPU検証基準は0.34.2です。新しいV3.9テンプレートの実ブラウザー保存・再読込およびGPU受入は別Gateで、まだRelease/Registry公開を意味しません。
|
||||
|
||||
同一機能の旧フォルダーや旧Manager導入版を重複配置しないでください。V3.7以前のNode IDを使う保存workflowは、その対応Release/tagで開いてください。
|
||||
|
||||
+63
-41
@@ -1,10 +1,10 @@
|
||||
dca65fb1393e67f59c6f81f9411e3e745eb8f1097e9a2adf7ffc6f4e3901ca9f __init__.py
|
||||
bb6f7d1227f7c0cc4e134ccc0e037c8c4fe4af63d8c990ac00b7af2279695871 .comfyignore
|
||||
32a0b0b45442edb97fe151faaa1a03a84bc4ee63b4a2ab6066a80c9f50629f1b .comfyignore
|
||||
3d681ded5d4c50cc20c2382e29fdc98d8a48e76d552c41ad5a195d941e66e612 .gitattributes
|
||||
8296f0afc7be47171e439c02fb2988cfeb0df904acbe3fc4f507f426d709157e .github/workflows/tests.yml
|
||||
0a2f69d4cec89d440f5d5aa1ec68a7c9a741382d313f80dcddf96d13f70b3e68 .gitignore
|
||||
3e7a1ec3380be2a222c8a3e9b8a6bb184d3a760478957f48186438f15235bdba branch_provenance.py
|
||||
ad340adc9506ab069a83f586d954fbd19f44df4e18a5346d5a8923a489d3cb85 CHANGELOG.md
|
||||
593ec5bafb8e506cc7b326bdc7e3f024a142569f24f8d39c1aaa3b5acfd0beca CHANGELOG.md
|
||||
c1ed3a0342730450958fb62fd21854a876991f3a4aefb24e5383b0c73cd2312d compatibility.py
|
||||
4d62508f900af9f93ec320afb900c27cc9a300d1e0c0a94714258498c5ede5fc conditioning.py
|
||||
294251c40b1be2e296c5e5f627b68091d087bdb39179e3a0c3cebd2ee8a344f5 constants.py
|
||||
@@ -80,7 +80,7 @@ a032738b0bc5acb136e92d8bf7694643a5f518b9c7fc0fc878d66d81ba8b1b04 docs/V2_1_6_UN
|
||||
1840c81b4090ff3c86c0c1b0acc2cc10d3d9839e383c81f262a5c59a67504cd6 docs/V35_HIRES_FIX.md
|
||||
ca9f1aecd1032f0f0b237948c7fc1e4e693440dff35f5f17fd5e6d5ca4dab7f9 docs/V38_BEGINNER_MANUAL_PLAN_AND_CAPTURE_SCRIPT_JA.md
|
||||
717577efdec5e61600504b77bc2a099ef022c4fe2333e936c3310c7182d8f2a0 docs/V38_OPEN_INTEGRATION_CONTRACT.md
|
||||
b08159178c999c4c97df6aed67c6cf48b5032548a1d370dc4a0cf7e293ab8031 docs/V38_RELEASE_AND_MIGRATION.md
|
||||
3496636f645b39336fd95a4f21a562810c56f8e1d92fa6eeb1e4b0786ad11b37 docs/V38_RELEASE_AND_MIGRATION.md
|
||||
f0806bb2b999794ddda072e98424dbd1b613df1cd8a096b12d979f124e066d8a docs/VALIDATION_JA.md
|
||||
3fec541a675c1e4e5e287cc8e498036001f34f7a62460321e16f9ba27b5e4c18 docs/VALIDATION_RESULTS.md
|
||||
cedd7b07901d6065079ef37380f0062d535a39c98c8f614e1b26582f549d7183 driving_audio.py
|
||||
@@ -88,14 +88,14 @@ cedd7b07901d6065079ef37380f0062d535a39c98c8f614e1b26582f549d7183 driving_audio.
|
||||
be419d6c773784823af7b58a3423ef2e21d3cc3e23c40e60e274560895ca034b examples/H3_Continuum_V2_README.txt
|
||||
4b94f779a98bfc555f6999113a694da07746cc3cf400bfc70ebc580592034d52 examples/H3_Continuum_V2_reference.webp
|
||||
c3cefcdf50df9d6609f583a008453b587c011a0fb41e290d5f1196ce62f58877 examples/H3_CONTINUUM_V2_WIRING_JA.md
|
||||
68e1a724d3b99458b86b8f643dcb916183e7e8dd12d7b4b3850991feb8077694 examples/recommended_settings_v1.json
|
||||
5a26408c770381cdb259cb710de7dab12d7ddecca262bdbf35ba1566056050f5 examples/recommended_settings_v2.json
|
||||
68e1a724d3b99458b86b8f643dcb916183e7e8dd12d7b4b3850991feb8077694 examples/settings/recommended_settings_v1.json
|
||||
5a26408c770381cdb259cb710de7dab12d7ddecca262bdbf35ba1566056050f5 examples/settings/recommended_settings_v2.json
|
||||
b8275c8cecde12aee0418cea456d1e7f4b875cbb1bce32f1f3d9e06a44dd0be1 examples/v2_prompt_list_example.txt
|
||||
0e59ea821081cb93165aa3f88c6949736dd225837fe1cdcf1173aa5cd54c6d29 examples/v2_prompt_timeline_example.txt
|
||||
26bbca92b5f7cac4cbde89290b3f801b7a895df76a07493ca6f65c18d5b1154a examples/workflows/MiniMax_H3_Continuum_V38x.json
|
||||
df4e0e355020d2e731932cff86a4b00932b4f193ec7ed513be0db994ec0e71bb examples/workflows/MiniMax_H3_Continuum_V38x.zip
|
||||
1b2212b7511fac0b63dfa6e9f006cd8644c72d08c6945ab0e4ed0e722c97a730 examples/workflows/MiniMax_H3_Continuum_V38X2.json
|
||||
8f839a955859bffa0d9cf0b15e91ee484dd911aca5ae31f1787debd56afdc7da examples/workflows/MiniMax_H3_Continuum_V38X2.zip
|
||||
f3d8dd0f0872afdd97fe24e58b5cb74190d03e3583a66a5d013fee41f6894cda examples/workflows/MiniMax_H3_Continuum_V38X2.zip
|
||||
1b2212b7511fac0b63dfa6e9f006cd8644c72d08c6945ab0e4ed0e722c97a730 examples/workflows/MiniMax_H3_Continuum_V38X2+Decode_Cache_Helper.json
|
||||
4fa8680037595f55f97715f9a2f63d28f11328a87f5c33c316cc4b0ae817e668 examples/workflows/MiniMax_H3_Continuum_V38X2+Decode_Cache_Helper.zip
|
||||
7861fac4c8fe82372c5459aa574d35ea003bdb4fd846d567bd891c2e38571b3d graph_contract.py
|
||||
@@ -103,33 +103,33 @@ bf0556b076dbaca67c3405a7d86c333ca7fdf3d4381529b0a9edc906519943e9 guide_timeline
|
||||
6e889c42490ccb5f376694b5944c693a84e7febedf38e631d687e96bc1e76376 H3-Continuum-LLM-System-Prompt-v1.zip
|
||||
144324850d4ba086938da5f4ed7b02ff0668dec554f092695328240e43fec3ec H3-Continuum-Skill-v1.zip
|
||||
1473c384082700f422f2cf9141e0d012d87d2b43ac8a8a433edc7172e6ca7bf6 hardening.py
|
||||
de0da5590691554cbf7f6318ac539a160e639bc3e20ee0752ae189dc31e979ce INSTALL_JA.txt
|
||||
9fca2d9c04be387160dee84e5ee9ce538cb910e79e356b9236e6d2240ea6d4ee INSTALL_JA.txt
|
||||
23bddc5a41d2e997f4fbf789c7128e32f4f197f1405b2aef1c76794f57482446 install_windows.bat
|
||||
12bf572a65d57bbc9a72b459f29691c2057768f4fb7a74f9db87f4775e995bda install_windows.ps1
|
||||
83b9d5cda57079fbf8e4691893c1733e5afc08b13a70f12762aef1b912dd309a layout_adapter.py
|
||||
139546ec1ff459945aa89b50f74b5ee69f62a0e07bbddfcae06936091a409a83 layout_adapter.py
|
||||
c44abbd789091bbead01250dbd5453e60539d2665c69f162335fdbd2936019c2 LICENSE
|
||||
d3e213005670e94dee33a240349a4d245cf9a3b6602099f11ed30cf5a32e2c21 media.py
|
||||
1970342c93f0189ade437cbfc278900713f043882933789cb8c54f35cf2ec96b metadata.ini
|
||||
8ce5a7c255088fb6038925a93b71b87972bf2f02e450af86da5c317e95506c41 metadata.ini
|
||||
fd23c7f32810788aaaf1709c4959c40ec72303aecc6f6afa5fa68d824cca97a8 minimax-h3-continuum-dance-director.zip
|
||||
d7e613e2cc24110213b477bdd1d390234a41f2af3b1ed006a809066d71d658eb model_patch.py
|
||||
e2b72149b0433e95c13659cc9e742fe38523e67d4f4a2fdb08aed1943fecf653 nodes.py
|
||||
2b8c19f9474beabfebe1802cdf4a89780dce3c351c48d65e1ce8bb77d2fb9ba9 PACKAGE_INFO_JA.txt
|
||||
4852ad216f85c22f008abe18464eab2c913bd88baa7db35764df2de9cf401d6d PACKAGE_VALIDATION.txt
|
||||
ecb65a5dbf9e1683c5a3cadd82daaea3a90a2b776f6ebabfbe8b07aa93177422 nodes.py
|
||||
99405e4357a143b0f5d0b374c9c0d2089435a7055bea2f3d1216dbbad25e4339 PACKAGE_INFO_JA.txt
|
||||
ea64b8e0aa0dda828047c9c12818be8554429774049b9e8c0482c84b9c4f4071 PACKAGE_VALIDATION.txt
|
||||
b470819f16fc179654dc1600721a63f0a5a14e777f4c004d574b499da6886ba5 public_api.py
|
||||
15a3925218e0c5f968795d7d11e4783c3c6868917447274bc700328851b3fbfb pyproject.toml
|
||||
667f2646e82362d472d91a7cf5dc9a86c95f6637f3bc8c672dd516800b1a598c pyproject.toml
|
||||
94fdc2d545b2d4077a4d70229fd22ba3ccac21d49d1097d2873f76d04e9a3c7a pytest.ini
|
||||
6f108a67967dd686011bf031b8176373f6ab80635f7e01e3e935e8585b804fc9 README_JA.md
|
||||
77cdaadd32f9d722f6b05abc196cbdb9dded32387493664620a30fa405429743 README.md
|
||||
a6927e8ecbbf3997317c918a200a815f84de2bef8ba5fe863fa9589c07fcfa7c README_JA.md
|
||||
7a2269cad66c13ef335c9905b0e8cabf09c0e1685ffab574c07386f0e01c33a3 README.md
|
||||
44127adcfa30ee84bff9cd4b2d0c695355209550e76982d374122008728aa5bc reference_audio.py
|
||||
5cb9bfd6810d3a93a637451980a4cc5c1436e5b84cfd1c7a111cd192e876351b reference_video.py
|
||||
c7b14ed6f8cfc2a1f0a21db4fe56fba75a93ffcb0be0c22bbd2e691c45cd0e2d reference.py
|
||||
96ea9b3dcef1fec7bf05795d0857a18579e9b4b3dc482cc77d13b65b4ca49b35 REGISTRY_MANIFEST.sha256
|
||||
caa572ea65dafc86850db99f52433d360ac9c4ab36b854292a3dccd5ba32dc76 reference.py
|
||||
d06af0a69b9d33f598407ad0ba3a583f2d3a744ae6254b127d834bb34e5bf574 REGISTRY_MANIFEST.sha256
|
||||
467edb2c188d024c2392aafe7423b3f835e16b10f570da76e2f7dda8a962c1c5 requirements.txt
|
||||
8bfa113a2ec11325619be300b4d2b53a157b1d2c1ef7855057a4b3bbd05aeef3 run_storage.py
|
||||
53827c94b3f588f35bb8eacb404e1bd5e233d25f4ee0fdd286efc7d8ddb52b6f run_storage.py
|
||||
6056de6c0a5322a8a51ba5a114538dca2ef67788cd1afba10fedd483b95f6afa state_io.py
|
||||
3a359a0467725cc292ccb4c86cf0c3d30bb6a114d01f5345792b09ea3d45441d state.py
|
||||
43ec4023dc06c941e5d7a04db4b8a89fb58d744ceb986f6eb9bf534d4fdcb87b temporal.py
|
||||
e6506f7ee87f59c25e05156f6b9a835ef78443dcf6f0435c48675dda0c0dd63d tests/conftest.py
|
||||
45f5f7479786e2c4c035d5df07b7fd85bcc56710452093c163f120c18f069d09 tests/conftest.py
|
||||
7f34c43ea74c43cfc4f9453848c69c8ed7546de5b78c7c7d063d643f2c483c36 tests/decode_cache/conftest.py
|
||||
8d0cced8c945c4333ef78688b51a988d7e1d560e5f9e6cceec8310b17c98ad53 tests/decode_cache/helpers/cache_process_worker.py
|
||||
a41a4de12e6fe5690845f9f0795fa82c4907f0afe2551034fa2a4c95617ac39c tests/decode_cache/test_adapter_nodes.py
|
||||
@@ -138,7 +138,7 @@ a41a4de12e6fe5690845f9f0795fa82c4907f0afe2551034fa2a4c95617ac39c tests/decode_c
|
||||
7e627131904dc6d6f58021fad396185c531858b62dd6febf12c3f95fd1391138 tests/decode_cache/test_store.py
|
||||
db08ce77cc5c5835f2403d4d589394090fa5d25ff3b1840312b2808e1bc203b7 tests/fixtures/v38_a3c_selective_refine_saved_workflow.json
|
||||
606b3985f2b644fac40c84de3e08d1453e87a988acca51ce9595516a7c60a577 tests/frontend_decode_cache_helper.mjs
|
||||
94b11903eff9a1805001617477d9066b47f856e4e102b381d8d528c0a100e0d2 tests/frontend_review_queue.cjs
|
||||
302ef3cf57fe1ab0cd9b7fc97f9201e4c06ab1036fcb1170621b6dfe9b0b7120 tests/frontend_review_queue.cjs
|
||||
36f74c03a40c4b62b90eede070d976bcd1b7f0ea828983d1e61a6cb6d80a0ea8 tests/helpers/r5_process_crash_worker.py
|
||||
706029af8c8d979b2b700f5bc2b96a3064fe7c728f487698d9f079abb02e9409 tests/terminal_merge_diagnostics.py
|
||||
fe23752312d62ddc8c23a3c598ed2f92f2d46e2e4460f06aea91921659092451 tests/test_audit_boundary_repairs.py
|
||||
@@ -156,9 +156,8 @@ c058f189d8e58fd48a80c20c0a857969737a8b13960eee60e5c17db2b9288bc1 tests/test_lay
|
||||
ab1ea95e363ad0effb9459bcbe713838f12e3501515871203672ea91e7fd4c32 tests/test_m3_conditioning_display.py
|
||||
a5aa420008daaa84ffb998715f52fc8c13911a6dadc43c61a860ecc455dfaee6 tests/test_model_patch.py
|
||||
45e8839cd82fd955df344b3bc6efa20092b8870ea378b0c898b073665d3e47d7 tests/test_nodes_logic.py
|
||||
2d16f6de7bcaf1f92718d3719654a746438f6218bba8d25b3632c318a1ab9c98 tests/test_packed_layout_preflight.py
|
||||
b635d404ca67df69894c4fcf80d8782cc5699e946bfb55ae4c44fff9d930b018 tests/test_p20_file_backed_tensor_poc.py
|
||||
|
||||
1dfe5af2b83ce69efbc509f4367f24aed2b32fc7d64b2925b95a23204f7b40c8 tests/test_packed_layout_preflight.py
|
||||
0f18b8810b2899f87ce6d6bfeee46fcd90ba787fa09665bddd8fc128f1952c65 tests/test_p21_memory_attribution.py
|
||||
2b097971258dd10f0df33e0f8cb5843ee6cd3e9ef9e7abb80b890c66baf22908 tests/test_p22_file_backed_buffer.py
|
||||
d09d2bae2fac04a058ebce22fa0e761d90b267107923ab8cd01a99cc547624e6 tests/test_p23_assembly_v35.py
|
||||
@@ -172,7 +171,7 @@ c2560cbafc5962bce5f063e262cf6a173dd8df18f7b58035ec326f616617d61c tests/test_p25
|
||||
403a0ff300330ac1f97642bf0681e80b83eec18e8911c03952ddf203ce794e5a tests/test_p46a_reference_video_memory.py
|
||||
1ae0369943ba2fb13f21ad0cf56ee58621ba09bf20174379595e157a1775c7fd tests/test_public_api.py
|
||||
892d3e3e022a527652dd995508c8bbb650c370caf9ee66fa3eb1f7fd288bba38 tests/test_public_workflow_integrity.py
|
||||
b3363add9a08864afbb26a52e0124156f089e95b710c95676f358c9a16f4a64e tests/test_release_metadata.py
|
||||
5d487395fb78c3d9ef98d0af037059ca87a92a28e65285023c234f4151c8b093 tests/test_release_metadata.py
|
||||
5f6caf1814052798f20571ebb863c098bec23d8f2e091fc1f30ce1ef9c58675a tests/test_review_identity_lifecycle.py
|
||||
5f7d3e01bc78fa076ecb17f8532b6d3f3137545da4028032ad6769407d80be07 tests/test_review_provenance_reroll.py
|
||||
ed81cc9c969f8402bf4286954e2848df5f38bd4fe16dcff2ac0b4d894a70138b tests/test_runtime_redesign_r0_characterization.py
|
||||
@@ -195,15 +194,15 @@ b42bcc0983147462d96c6b71cc4a38e846995dafa6eebefc3ae0d9bb36caf359 tests/test_v2_
|
||||
0b5b20a8318862d167f135720e0489b8d4f93406d67c6646e052e35b03dcb876 tests/test_v2_session.py
|
||||
b5c320279fd38d2038e39951a3d016aa9b80741523d2816e01ceda1bdecb71b8 tests/test_v2_terminal_merge.py
|
||||
e22486ac62c53132c275614e4e161c78e6dce09dd0d1a7cf64f641a3b7052b99 tests/test_v2_widget_migration.py
|
||||
4cb8ed59bab9580b7bdb955d21086c31108d9e4f218e0a57ad357b2c917f5b16 tests/test_v217_stable_facade.py
|
||||
dff09049cbcc59896dad32d36cf3fdef2e6a67c6a8ff3150a33d784d8ca165c5 tests/test_v217_stable_facade.py
|
||||
473abac48a57aa5f297c6e141a94de17ddcb9424a8744bae1c46e6a6a734a0ab tests/test_v3_hardening.py
|
||||
9242f74663ccb04020ad2fb1199990c84433c9b4c5cf0560e93416c7b15e1913 tests/test_v3_physical_decode_groups.py
|
||||
35b26c8cade7acb2eec35375d7dfa9a4a112f67a5cec6a842d61c69039de0d84 tests/test_v3_video_seam.py
|
||||
cc954e0cb40f093b03f8a5b655993ab82375f23b624af995fbdb330f1facf1da tests/test_v31_run_storage.py
|
||||
42ac5b9337fce10a236f140d000e620ac45079ca1aaafcb8be731cfc6e0d858e tests/test_v31_run_storage.py
|
||||
3af78ab85c8e19dee8d0a98bfd11a2c0e88c30d87256da1f9699c49a19a684e9 tests/test_v32_reference.py
|
||||
43aef01fc587c9f9e87baf312eb4d588975aaaacab161a36bfcb638a4c11e31c tests/test_v34_driving_audio.py
|
||||
aa1f36601489c360d2f1f989c10c5424bd85bd2115df2427afe696758eefd239 tests/test_v34_hybrid_reference.py
|
||||
4279354d9ed046588d3a685f5150f1cd1891575ddbdcdba870062d8000c64f30 tests/test_v35_compact_ui_frontend.py
|
||||
f457c3956fc804816783005a2349889796aeb5a6b930f09db0c3f43e051c6e2e tests/test_v35_compact_ui_frontend.py
|
||||
75dbdd0d9694d82fab7da23f5cc03bc118c024abc865f6c282799aa8c57427fc tests/test_v35_conditioning_bridge.py
|
||||
f9e191b2262030f988b6230e2a1f32484df03568fa43ac46d2c34adb61b6dffa tests/test_v35_context_sampler.py
|
||||
7380c2ea1eeb4fb212ef51ffdf6d14a33132d3ae6d4c7ed5015f28bba6b7e75b tests/test_v35_hires_fix.py
|
||||
@@ -233,17 +232,17 @@ bb5a1530c890d357dc48ea74039340d746e876e8f85e06d4d9a19369f8ff5961 tests/test_v38
|
||||
8edaae5f1ca93925e9269c9a4447c97edf5958395f08659e61a09e8d7efa088a tests/test_v38_multi_reference_audio.py
|
||||
623d528a02b6712cba28c374ba3ad979bc84e2ac5318640692589a04ba6ab15f tests/test_v38_open_integration_contract.py
|
||||
12337a491fa67b38b32aaeb16e0b209393960dbc46db2a8bf968b8c3902855ef tests/test_v38_packed_row_planner.py
|
||||
71a042353883ec6c86bbab2027c89087d479a419e9d4a1801d6852904c980e04 tests/test_v38_public_surface_cleanup.py
|
||||
927348e89480b2f3b2fc2dcffa1398931d20e8812d94374ad05b374b453b7814 tests/test_v38_public_workflow.py
|
||||
35c7a49eb6ff0159bb13ce0f731f10a6b6eca0972bd9a2debbffe650a0dc4867 tests/test_v38_public_surface_cleanup.py
|
||||
7aebd3668e04233f34c2d94e75d4708cadd64d6882cf77ec59afa0a394dcb006 tests/test_v38_public_workflow.py
|
||||
14ff6561a127287d0a20887790a978612ef9d291f1d3be7d5e85b37b2c74760e tests/test_v38_ref_encode_cache.py
|
||||
8b376f45261d045b584f02b4d14cd70c2d6269b9c814d4e62b5c612f6e30e36f tests/test_v38_refine_target.py
|
||||
03eb5bf6d845b22334fcc800d81b419f1c8d8593fa65a1e0460144456ff2c8ba tests/test_v38_reliability.py
|
||||
c7713198c14316d62425f15b4273d5998cc284d32da3babd6b296a496040721b tests/test_v38_resolution_preset.py
|
||||
b5159cfaa9dae929194d819437f61027077688d57b0d51a1eaca3567e9134ff7 tests/test_v38_resolution_preset.py
|
||||
2ac395009e49f9554af8d1a251d93fc5d5e7070bf80f5a0b7b3f7e00cde15077 tests/test_v38_review_cache.py
|
||||
72a0e3cb334049b66dd36f52c826931067c242fa63557933fd667138b38d6e8d tests/test_v38_review_control.py
|
||||
f62daa235117a3041c66ebb17adedb13c0452c3a2fc0acdd51006d7aa0078a9b tests/test_v38_review_execution_cap.py
|
||||
483735a87ffd67b5d5e3d8cebca5d3c4be00b1bc50c0ab4dba3e5e06f6a2ca98 tests/test_v38_review_run_storage.py
|
||||
2011ca4fc8b5b0cea7cb8df313f89ccc071396b9121ca27e988f6d7df45016bb tests/test_v38_review_ui.py
|
||||
615b51cafb1441fe49486381d9cd30f53b570eec10d35b785bc13629664d84ac tests/test_v38_review_run_storage.py
|
||||
2d8b74a56da4c15509ef9ef082f87321182d9d97ca6c417d5a6c055d67a4ee8e tests/test_v38_review_ui.py
|
||||
75697036f361a9b8ea74f69b15e408670f686c8c0e8a6c1d48fe059cc837d12a tests/test_v38_selective_second_pass_node.py
|
||||
8026a241301dfc4de518649305458a538ef17a0b1567b113877a2af377738528 tests/test_v38_temporal_window_refine.py
|
||||
0b2b1280a1217816984a99c0f948a52a8e2e6fdf924b5c4f2f578719b12b01ed tests/test_v38_video_audio_refine.py
|
||||
@@ -302,20 +301,20 @@ cc247c01a01efaf594c24c7ce36ca3357c092fc28dd742c7577093ee9d5efdef tools/v38_reso
|
||||
ad8609a45ba818fb74245b30cb0a3a221d6b345c20671092cafd714d8b07aaea tools/v38_review_phase_f_gpu_gate_runner.py
|
||||
60e9bf2c7c40ef9dd71f08ec2ec8c25f7ae9b08e74c3b7be5964e1138848ae82 tools/v38_review_phase_f_recovery_runner.py
|
||||
a18136a4decfeef344635bbe9bb18502231c2503b034ce1d21cc2e5e77cc5e2f tools/validate.ps1
|
||||
deeae570772c1a32dbb356aa30c8ef473b9334a0a36b71c0cccba12203f76415 tools/verify_runtime.py
|
||||
aab887698f4767722c833b9e55d605f9597ab0d823e32e8c5416f26a210cab1d tools/verify_runtime.py
|
||||
ffd61f3f31c9b6430e1169007ee906c8f5000eba63ee44e2976ad4f5f1112671 v2/__init__.py
|
||||
2003902c87bba09cfa143f5a9e4248f3a78c0fb544449a75fd40ba2cacb35655 v2/context_diagnostics.py
|
||||
cde27db19b677e318cc4dfb4235be7a11429c19945f4083052a91fe117e74c82 v2/decoder.py
|
||||
31012ec48a64c7467ad869c79982b7f8502c1785c33f51ee1b5727ce8b4243fb v2/diagnostics.py
|
||||
2ebff4502381f675d06bba4b127b81bc3201e7579ddcd46fa5051cbdf3facd55 v2/h3_builder.py
|
||||
fed4bc3cbff47bd0b16b6e99385680dc2253c745f30b7f686afafbb25f77efb1 v2/motion.py
|
||||
aefa29b9d51a05f9a972d75404fd786300202251887e67f55530e97ccd9519f5 v2/nodes.py
|
||||
de47a847ba27390df542086735a926d2812d77ad05b21ccc2e67633d4ffd11b0 v2/nodes.py
|
||||
dc2b901789e4b024dbcbc4024c63eb8cbc564d77003ce8c35c0584851ba6dfbd v2/prompts.py
|
||||
4080f1875b958b316e8e76852c4be5527a6de5c71d604e7642d3098478eb4a36 v2/sampling.py
|
||||
2fd811794c4cc0f2ce050250b80484876454926b9f20fce6af3a97d728e5acdf v2/seam_guard.py
|
||||
be0d8585fa57e0ccd6d02577bbc7299629e5bfe20e186747f571fccc98b67d7e v2/seam_types.py
|
||||
12cfcc0c71ca087fe39a5ce2922959a62b2bb311bfe664f05c4480affce03708 v2/seeds.py
|
||||
fe7df9efea15b157c158046f64328b3dce3cfbd35cf180573ce4ec771ddcea8c v2/sequence.py
|
||||
c218c9c361079ff9ddae1401618924f9f563ed03e576792c5ee57c72278acd4f v2/sequence.py
|
||||
13213e7709fd02bb810af3c18e4cd7d010f8cdfb121a4b99866a9f2333331089 v2/session_io.py
|
||||
3ea23dbce6fcd217b6e81235855479b9b16fed7a21693cf156f9014555c4fe13 v2/session.py
|
||||
78c830cdf49034c6e3b2cd3da5914d5cfc5638eb63ec6dbd1bab13c50d6d4caf v3/__init__.py
|
||||
@@ -323,7 +322,7 @@ ea2922567df90436dd6fa21696833a49dd0cbfeee142a5fedc3a7c303824d473 v3/adaptive_co
|
||||
b3dc61503d35d9ef0a0dc7fed1c9b2fdc00fcb2072d4e39f64ae0826f9ec7dca v3/assembly_v35.py
|
||||
7815230e0a9540bc2edeaf818e940b7a1fdd817fd217ba8a4f9cb21aaf6a308e v3/assembly.py
|
||||
3f62fdb35e804f42d7cbf0828b4e87e69a2b99246c3f7467fe4fa698f1d803c9 v3/conditioning_bridge_nodes.py
|
||||
82238eff890574fcf977dc3d2bc092287f63710a47bfc0f6692c272814dbd295 v3/driving_nodes.py
|
||||
e3a6f537a8709c7d05e4df95f1ff40c9129e7845e9ea23097d64953b4770e06d v3/driving_nodes.py
|
||||
147a1d3fc5e09b323a4c3d13d30e432410389bae52b58330462375b9f307b791 v3/easy_audio_nodes.py
|
||||
64b3e54b42e5156642f9957ccc374fd190d9fc7145637984e702534fb1bf80b4 v3/easy_image_nodes.py
|
||||
ac859cb1a6e23b8ceae300d818c24fe1346b649a0d663017a9b3ac64aa96fca3 v3/easy_nodes.py
|
||||
@@ -335,15 +334,19 @@ cb53e1b104415032ec79b7e7aa1c99848e63da3eedaa251eeba102970e4172b5 v3/hires_fix_n
|
||||
5b8a54e67a608e757a505abc712effb33312636e3bb235835a485a506e80eeee v3/masked_continuation.py
|
||||
91a868d2e392b018b01d0396209849c146b0d560ceb109fcdd87dea7f3d786aa v3/memory_action_policy.py
|
||||
85477badd85281cfb77582fdd5b34228a9f6b68376f1b7743af2ca7d4b55aa36 v3/memory_attribution.py
|
||||
2a03bfd7dae9856c0f4be77130f318b95f8c2f2130a0c9122479bcdef70bb7ec v3/node_facade.py
|
||||
185e15373609d810f1ac57b46a823d44c6e098386f18c65b39dfa06afe9ea893 v3/nodes.py
|
||||
4a48f74584d8ba3187e1accc31ae5acd3a2ffb9a491bb4f5ca43322db418e770 v3/node_facade.py
|
||||
7fe71802319ad7659c90839f960238d0fd054662af31a4d320806c426e755ecb v3/nodes.py
|
||||
a3411c7a295308d21623551cf4aeca5bef511eb5f063f31ac84032e3bdf4e16d v3/packed_row_planner.py
|
||||
b7c4a35a5e73f528492bc6946b97b687c412f1d3f5f976c19d45c6dc20288c9a v3/pixel_vae_resize.py
|
||||
b139843ccfc826937c80f118920bbee2609c37d45ef88291f80f491744fd5e76 v3/plan.py
|
||||
0e3dd69d6d2bec6d9491c2fb806c25f0c62629b1eb5f9e4f77ae8d27a5b19cfc v3/planning_types.py
|
||||
8b9c1cadf76e2c2425d6bf8a5783ced593a75f83a6b3f219a0f870b4c177e058 v3/reference_effective_plan.py
|
||||
7b512612de5433bdb14c347e5bb8d27244c2298406bb37d383bb412f50654707 v3/reference_runtime.py
|
||||
4fb950bbdc7cdb55365fde373ee190af6cdf99f7ce4c54ef73b94f0aca4e1fda v3/reference_storage_contract.py
|
||||
196d1b6f4a73c4fb8669e9c399ffae526bd74765f96fbf5340c780f4331e5594 v3/reference_routing.py
|
||||
ec71e3965f445756d54d005c0e27bea520e26dbac44e1ee3d3867bfe2da100b0 v3/ref_encode_cache.py
|
||||
057921bf2b05e88c2cbc08c16e2ac483aea905b8a144fbadf4a21d6ae8252427 v3/reference_video.py
|
||||
9076c47aa5145c81f34793d6c90410656065248f37d9990a92a6a4061b358811 v3/refine_context.py
|
||||
b191009d686680c6eec1fdba15b76b7c9f40f11f331faaf7b69ef784e99f4989 v3/refine_context.py
|
||||
519586b1b3f48c73d329f7a2aaa8a1bfc6fe31ac2ecb64f2b1fdf9c19026001a v3/refine_sampling.py
|
||||
43f33f989eb70ca87b916fc33267732a2be3dd4581fc72af17c53f840b53ca49 v3/refine_schedule.py
|
||||
afc149dc347b4c1502ddf32ea4229e633799cd34d2b2c6f98bf8a47910a9ef77 v3/refine_scope.py
|
||||
@@ -355,19 +358,19 @@ ae909b43ad17934c85881d3b0bea81e7b45c215eeb4d1f9f6a9ea72faf633ddf v3/reliability
|
||||
be6610fb9427546d9485a17015cfbdc8786715e6a0967f3e4c1dee35d8768385 v3/runtime_coordinator.py
|
||||
d0a004aa3030c8adaa5ea788f9acc758fcb4a556f203f9a3f63fa4e4b5772063 v3/sampling_engine.py
|
||||
452022107cea233aa84d5366ec4943ac5aadbd5fcf786113f1d542a641eac8f7 v3/second_pass_nodes.py
|
||||
66501234756c2b558ce84f887bd540e7f843ed574c8a8b2522950bd1985d7acc v3/second_pass.py
|
||||
aa4afff697bd9b8a8505e6cc7d94fcef7aabf9d93ed123ec226fad1960807e77 v3/second_pass.py
|
||||
6e71e944313339f14e14e11cec682593159ca5542aa5d38095371da781d60224 v3/targeted_refine_sampling.py
|
||||
5a044bdd70c546e4446e0c26af92aae88049ffa2e0e2d01b52033a83a3152d0e v3/targeted_second_pass.py
|
||||
4178dcfa442abdb06ce276e05bd7bcbaa6da28469ba5e57d3da3c663de4e4a9d v3/video_seam_v35.py
|
||||
2f07ace1462644f0bee553827b3571535de4d0c2d9ef847bd9e0ca73a4eed5cb v3/video_seam.py
|
||||
453c98485ec55cca959aa5863ac35ae3b86c4781ae95c9e52ac9f1d9115c9eed version.py
|
||||
0d08a173819d63d969694f14e4a1d59ccbec357f37342e00a4db03e1144c2e02 version.py
|
||||
685df8e0fa23e3663ab31da1e4470cd19bdaa0dc16362cb606e874d9d6153c2c web/decode_cache_helper.js
|
||||
fefafd4550511d80bd85ade46a0476f0cf3de13ddb94a908dff6b175f2a0e199 web/easy_bypass_toggle.js
|
||||
092088096307d33ac016b82b4774ca38845a2ff2f63b97ac6da8c5aca4fea413 web/easy_load_audio.js
|
||||
9db0aa94f634578a962d5db49e5c70356040a59df968e3a2e531b327a623081f web/easy_load_image.js
|
||||
35090816ba7470a7255eb85d003b7e79f8a0065982dacf98a18f41c8ebff655d web/easy_load_video.js
|
||||
0c68d13a1f8beb7431a32b471f8b0612c42fcc4bf72dd97611a025d158008662 web/easy_v38.js
|
||||
bb7e29359e1fe26fd70d22f6bc70eb8c8858f68ab954ba39ad3670f2cdeeae7d web/project_id.js
|
||||
7bdd15370b02a21b0352f9bf3c963b899cbb0a5dc9d142de8784152bb0aab23e web/project_id.js
|
||||
ae59273f163a116ece418957c557c4fd8c3285e3c60814679b9361d2e6e6fa02 web/reference_audio_ui.js
|
||||
46c9f75c9462bf26300332448f4431cca801f38964ca0a49bc2c50a88a7cc40f web/reference_image_ui.js
|
||||
26b13614ba0a5fd8b192a106c9503b2f4b6fe7f9268a0fcb0f544979a49cab34 v3/video_adapter_nodes.py
|
||||
@@ -382,3 +385,22 @@ b07b941082a947d9e938ff399ec8b77fcd29c1a222e0e6b0dedf5d8e7482ce84 tests/test_vid
|
||||
e61e45f218609a7ec845d2e8762dfd1efed6c51a398061066d1e51fc93556663 examples/workflows/MiniMax_H3_Continuum_V38X2_Timeline_Experimental_Follow.zip
|
||||
7d6754cfc75599e07046b1949c1723a56f57871ecd5abc9543fcf8b34bca8c04 examples/workflows/MiniMax_H3_Continuum_V38X2_Timeline_Experimental_Repeat.json
|
||||
9b60c8495e3d0e32c2bcd609080342ae19d0fd4c7c0662d5fe32e7fad4a9b41c examples/workflows/MiniMax_H3_Continuum_V38X2_Timeline_Experimental_Repeat.zip
|
||||
68e5ee459f87724712d450d063bb4409cb26dd112b3b62602f1b43c88a3c08fb tests/test_v39_rr_r1_fixed_identity.py
|
||||
4a97449504c720b0b4846293beb857b48986b3d175215509c144ee1b52c34f23 tests/test_v39_rr_r2_reference_routing.py
|
||||
32e25a0f4815f954ba3e64e2445309babc83b78a964e2a6a5287b1c7accb275e tests/test_v39_rr_r3_effective_plan.py
|
||||
6ec7852560f4e0588fc0b5d34743195554475167b46606d3166fdb5fb97f9c4e tests/test_v39_rr_r4_reference_runtime.py
|
||||
4105844681b0be9ea3363630f91196302c269f7dd00d8ccb1aa734562401b6ef tests/test_v39_rr_r4_sequence_integration.py
|
||||
307993ea60e2265a77ddf709350f51a134fceff6e2b26dcffd893af62162262e tests/test_v39_rr_r5_reference_storage_contract.py
|
||||
4cc53a322960373949cc4e86a3102c04d3dce4dfac00f7cc62b01cf637775b62 v3/reference_plan_inspector.py
|
||||
62843c5c4d6150f66f4b232d9ec3c121fef984adfd8f316660be751c7c99ebe7 tests/test_v39_rr_r6_public.py
|
||||
b64f4d3d9547ac00f8edb2155109476df5b8baea730fb94e8b5bfca6d11564e6 v3/reference_images_v39.py
|
||||
e9d7753f313ebbe3d13e477f5b4e4767a735b0619b52ba54bcc5218f3eb7eb7c web/reference_images_v39.js
|
||||
4d17d74107e78404b190fec9494b443249e5aff4f58670c50d54dfdfb064334b docs/V39_REFERENCE_INLINE.md
|
||||
67e81fbdd4c21a8d64fb3bedb5e495698fc8df5cdd9540c8ef5476caa76119c0 examples/workflows/MiniMax_H3_Continuum_V39_Reference_Inline.json
|
||||
65689fd800a60ab6939bea020d630616b03a453cf6d48022cd1361992a765abc examples/workflows/MiniMax_H3_Continuum_V39_Reference_Inline.zip
|
||||
da45ac4b9422f04a6867ff4cff4b12cf1dff88422522b8010a960b5ecfce046a tests/frontend_reference_images_v39.cjs
|
||||
40199d2500174ba51c040d6983f88d74c4bfbaf19191e728818e6b969b869b0f examples/workflows/MiniMax_H3_Continuum_V39.json
|
||||
f69b734b5bf19fb6db78bbe4737db0bef69c2a6cef2710f28767882ef35ec847 examples/workflows/MiniMax_H3_Continuum_V39.zip
|
||||
37107bbefa1a8c92abfc286b873efddd9a5feda2d0455e97149cc35a611cabfe tests/test_v39_official_workflow.py
|
||||
40199d2500174ba51c040d6983f88d74c4bfbaf19191e728818e6b969b869b0f examples/MiniMax_H3_Continuum_V39.json
|
||||
1b2212b7511fac0b63dfa6e9f006cd8644c72d08c6945ab0e4ed0e722c97a730 examples/MiniMax_H3_Continuum_V38X2.json
|
||||
|
||||
+11
-1
@@ -1,4 +1,14 @@
|
||||
ComfyUI-H3-Continuum V3.8X / package 3.8.1
|
||||
ComfyUI-H3-Continuum 3.9.0 / V3.8X2併存
|
||||
パッケージmetadata: 3.9.0(mainソース。新しいGitHub Release/Registry公開は未実施。過去のReleaseは維持)
|
||||
|
||||
現行ソース:
|
||||
- 登録IDは計12件。V3.8X2の10件(旧Audio/Video Loader互換IDを含む)に、別IDのSampler V3.9とReference Images V3.9を追加
|
||||
- V3.9公式Workflowは無改変のユーザー指定MiniMax_H3_Continuum_V39.json/同名ZIP。32ノード/39リンク、画像Loader 1~6だけが新ヘルパーへ配線済み・初期Bypass。7~9は必要に応じて追加接続。V3.8X2標準ZIPにも両バージョンのJSONを同梱
|
||||
- V3.8X2公式WorkflowとSampler V3.8は別に維持。Reference配線、保存済みRun/TakeはV3.9へ自動移行しない
|
||||
- 初期V3.9 WorkflowはFirst Image+Draft 0.30 MP、2×10秒、Generate Full Video(保存値はFull Run)。First Image Loaderは有効なので、Queue前に自分の画像ファイルを選ぶ。Reference-onlyならFirst ImageをOFFにしてManualへ切り替える。保存済み480×640はManual時だけ有効。Sequence Promptは空欄なので入力する
|
||||
- ComfyUI依存の宣言は>=0.32.0、現行の実生成・GPU検証基準は0.34.2。新テンプレートのブラウザー保存・再読込とGPU受入は別途必要
|
||||
|
||||
以下は旧V3.8X / package 3.8.1の履歴記録です。現在の導入案内ではありません。
|
||||
|
||||
MiniMax H3の5秒ChunkをAV latent contextで継続し、長尺映像として組み立てるComfyUIカスタムノードです。
|
||||
|
||||
|
||||
+47
-2
@@ -1,3 +1,47 @@
|
||||
ComfyUI-H3-Continuum 3.9.0 / V3.9 main-source validation — 2026-09-29
|
||||
|
||||
Status: MAIN SOURCE PUBLICATION. The ComfyUI_W worktree has 12 public node IDs: the
|
||||
existing V3.8 and V3.9 Samplers plus the new V3.9 Reference Images helper.
|
||||
Package metadata is 3.9.0. A GitHub main commit is not a new GitHub Release or Registry publish; earlier Releases are retained.
|
||||
|
||||
The user-selected official V3.9 JSON is copied byte-for-byte and has 32
|
||||
nodes/39 links. Its matching one-JSON ZIP and gallery copy preserve that graph.
|
||||
The standard V38X2 ZIP now includes both unchanged V38X2 and V3.9 JSONs for
|
||||
one-download setup; the V38X2 JSON itself is unchanged. V3.9 retains the V38X2-based
|
||||
model/LoRA, Decode Cache, Finalize and Save chain; Image loaders 1–6 are wired
|
||||
to the new helper but bypassed by default, while 7–9 require user-added loaders.
|
||||
Its Sequence Prompt is blank. Its saved size controls are First Image + Draft
|
||||
0.30 MP, with the First Image loader enabled; users must select their own
|
||||
image before Queue. For Reference-only, turn it off and choose Manual.
|
||||
Saved 480x640 applies only to Manual mode.
|
||||
Other saved controls include two 10-second chunks, Full Run mode,
|
||||
Spectrum/Turbo LoRA off, and a separate Project ID.
|
||||
|
||||
V3.9 connects fixed Reference Images 1–9 to one helper, then connects its one
|
||||
typed output to the V3.9 Sampler. The helper's in-node table selects All chunks
|
||||
or per-chunk assignments. The backend retains sparse fixed IDs, uses the
|
||||
existing effective plan/Run Storage contracts, and rejects incompatible
|
||||
payloads. The V3.8 Sampler and official V38X2 workflow JSON/ZIP are unchanged.
|
||||
Older V3.9 prototype workflows need manual rewiring; saved Runs/Takes are not
|
||||
automatically migrated.
|
||||
|
||||
The latest recorded Windows CPU run is 1536 passed, 1 skipped, 0 failed.
|
||||
A separate Linux/Python 3.13.5 CPU audit reported 1534 passed, 3 skipped,
|
||||
0 failed; that external count was not rerun during this documentation edit.
|
||||
The selected workflow JSON has 32/39 nodes/links. The development Manifest
|
||||
contains 406 entries and the Registry Manifest contains 138 entries. Both
|
||||
were resynchronized and hash-checked after this documentation reconciliation.
|
||||
The earlier RR-R6B browser result predates this helper UI, and configured
|
||||
Reference-only GPU/API evidence does not establish browser save/reload or GPU
|
||||
acceptance of the current default official template. That acceptance remains HOLD.
|
||||
This source publication makes no generation-code changes relative to the
|
||||
validated local V3.9 candidate and does not create a tag, GitHub Release,
|
||||
Registry package, or new GPU run.
|
||||
|
||||
Historical V3.8X2 / package 3.8.3 validation record follows. Its test counts,
|
||||
node count and workflow SHA describe that earlier preparation, not the current
|
||||
V3.9 candidate:
|
||||
|
||||
ComfyUI-H3-Continuum V3.8X2 / package 3.8.3 — package validation record
|
||||
|
||||
Status: local commit/push preparation PASS. No commit, push, tag, GitHub Release,
|
||||
@@ -17,8 +61,9 @@ Public surface: exactly nine nodes
|
||||
Official V3.8X2 workflows
|
||||
- MiniMax_H3_Continuum_V38X2.json / .zip
|
||||
- MiniMax_H3_Continuum_V38X2+Decode_Cache_Helper.json / .zip
|
||||
- Both names contain the same graph. Each ZIP contains only its correspondingly
|
||||
named JSON. The JSON SHA-256 is
|
||||
- Both names contain the same graph. The current standard V38X2 ZIP also
|
||||
includes V3.9; the helper-explicit ZIP remains single-JSON. The historical
|
||||
V38X2 JSON SHA-256 is
|
||||
6c445d62979632bc1a801b1c28dbd639c23b51cc156ebae18837baaa757e592b.
|
||||
|
||||
Reference Image 1–9 resource gate
|
||||
|
||||
+1592
-1458
File diff suppressed because it is too large
Load Diff
@@ -1,15 +1,54 @@
|
||||
# ComfyUI-H3-Continuum 3.8.3 — V3.8X2
|
||||
# ComfyUI-H3-Continuum 3.9.0 — V3.9
|
||||
|
||||
## Start here: V3.9 and the retained V3.8X2 workflow
|
||||
|
||||
The ComfyUI **Templates → ComfyUI-H3-Continuum** gallery offers two separate entries: the user-selected [V3.9 workflow](examples/workflows/MiniMax_H3_Continuum_V39.json) and [V3.8X2 workflow](examples/workflows/MiniMax_H3_Continuum_V38X2.json). The [V3.8X2 workflow ZIP](examples/workflows/MiniMax_H3_Continuum_V38X2.zip) contains **both unchanged JSON workflows** for one-download setup; the [V3.9 ZIP](examples/workflows/MiniMax_H3_Continuum_V39.zip) contains only V3.9. These are workflow archives, not custom-node installers. The V3.8 Sampler remains available, so existing V3.8X2 workflows still load. V3.9 does not automatically convert their Reference connections or saved Runs/Takes: preserve the old workflow and open the dedicated V3.9 graph for new work.
|
||||
|
||||
The selected V3.9 template has 32 nodes. Image loaders 1–6 are wired to the new helper and bypassed by default; slots 7–9 remain available but require the user to add and connect their own image loaders. Choose actual files and enable only the desired images. The saved size controls are **First Image + Draft — 0.30 MP**, and the separate First Image loader is enabled; select your own First Image file before Queue. The saved 480×640 Width/Height values apply only in Manual mode. `Reference Image Size` is `Match Output`; it resizes conditioning after source-image load, not the source files themselves. For a clear per-chunk Reference test, turn First Image and Last Image off, switch to Manual, and use Reference Images alone. First/Last additionally constrain the video; Last Image may merge the final two logical chunks into one physical group, which requires the same effective Reference set in both. A subject may remain visible in later chunks through video continuity even after its Reference is no longer assigned.
|
||||
|
||||
In the helper, `All chunks` uses connected images throughout; `Per chunk` provides an image-by-chunk table. The template starts in `Per chunk` with all assignments off: after enabling a loader, tick the chunks that should use it. Slot numbers never shift: Image 1 is `@R1` and Image 9 is `@R9`, even when intervening slots are empty. In Sequence Prompt, describe the action for each chunk and use `@R` tags only for active References; their actual `<Picture N>` numbers are resolved per group. Unused tags warn without stopping generation. Start with short chunks and pre-resized images: source images may consume RAM before the Sampler's Reference Image Size setting applies.
|
||||
|
||||
V3.9.0 is the current source version on `main`. This source update is **not** a new GitHub Release or ComfyUI Registry publication; existing Releases and tags are left in place. Configured 1024×1024 Reference-only GPU/API runs succeeded, but the unchanged default template and browser save/reload remain separate acceptance gates. For a reproducible older environment, use the matching historical Release/tag and workflow; the retained V3.8 Sampler on current `main` specifically supports V3.8X2 workflows.
|
||||
|
||||
`pyproject.toml` declares ComfyUI `>=0.32.0`; the current real-generation/GPU validation baseline is ComfyUI `0.34.2`. The minimum declaration does not establish V3.9 runtime acceptance on 0.32.0. The latest recorded Windows CPU run is `1536 passed / 1 skipped / 0 failed`; a separate Linux rerun report records `1534 passed / 3 skipped / 0 failed`. Neither replaces browser save/reload or GPU acceptance for the current official template.
|
||||
|
||||
## V3.9 Reference Images
|
||||
|
||||
V3.9 now connects all nine fixed Reference Images through one **H3 Continuum Reference Images V3.9** node. Its in-node table selects All chunks or specific chunks. The V3.9 Sampler has one typed Reference Images connection and keeps Sequence Prompt, First/Last, Review and the rest of its generation controls. Use `@R1` for Image 1; the backend converts active tags to the group's actual `<Picture N>`. Both modes use the same group-routing engine.
|
||||
|
||||
Prompt parsing never blocks generation. If an explicit Timeline cannot be parsed, the original text falls back to Fixed with diagnostic `H3C-P100`. An uncovered Timeline chunk reuses the previous prompt and reports `H3C-P101`. Select the image for each chunk in the Reference Images node; `@R1`–`@R9` in Sequence Prompt refer to those fixed image numbers.
|
||||
|
||||
For the supplied `2 × 10 s` workflow, put each time header on its own line and describe only that chunk's action. For example, after enabling the matching image loaders and checking their chunk assignments:
|
||||
|
||||
```text
|
||||
[0-10s]
|
||||
@R1 walks forward through a quiet hallway. The camera follows smoothly.
|
||||
|
||||
[10-20s]
|
||||
@R2 enters from the right. The camera turns to follow @R2.
|
||||
```
|
||||
|
||||
Use the actual subjects and actions from your images; this is a syntax example, not a saved prompt in the downloadable workflow. Do not place prompt text on the same line as `[0-10s]`: that is not a Timeline header. A Reference can still influence a chunk without an explicit `@R` mention when its checkbox is enabled.
|
||||
|
||||
The [official V3.9 workflow](examples/workflows/MiniMax_H3_Continuum_V39.json) is the latest user-supplied JSON, copied without editing; its [single-workflow ZIP](examples/workflows/MiniMax_H3_Continuum_V39.zip) is also available. It preserves the full V38X2 model/LoRA, Decode Cache, Finalize and Save chain. Six image loaders are prewired (initially bypassed); to use Image 7–9, add `H3 Continuum Load Image` nodes and connect them to the matching helper slots. The Sequence Prompt input remains connected but is intentionally blank: write your own prompt before Queue. The saved graph uses `Timeline`, two 10-second chunks, `Full Run` (displayed as Generate Full Video), First Image + Draft 0.30 MP size selection, and a separate Project ID. The earlier [Reference Inline migration fixture](examples/workflows/MiniMax_H3_Continuum_V39_Reference_Inline.json) remains available unchanged. See the [step-by-step Reference Images guide](docs/V39_REFERENCE_INLINE.md). Replace local media and model filenames as needed before Queue; enabling an image requires choosing a real file. Seven to nine active references can be particularly memory-intensive: start with fewer, smaller source images. A full ComfyUI backend restart and browser hard-refresh are required before the new node definitions appear. Browser save/reload and GPU acceptance of this unchanged default graph are still pending; this source publication is not a GitHub Release or Registry package.
|
||||
|
||||
**Compatibility:** Existing V3.8X2 workflows still use the V3.8 Sampler and old Reference Images 4–9 helper. V3.9 needs its new helper and connection. Open the new V3.9 workflow instead of only changing the Sampler type in an old graph: older V3.9 prototype workflows with direct 1–3 connections and Sampler-side routing widgets need manual rewiring, and their saved widget positions may differ. Accepted V3.8 Runs/Takes are not automatically migrated. Keep a copy of the previous workflow and use a new Run Name for V3.9.
|
||||
|
||||
The earlier RR-R6B browser PASS covered the old V3.9 controls. The new helper has configured GPU/API execution evidence; its browser save/reload and the unchanged default template's full acceptance are still open. CPU/JS and manifest results are separate; no V3.9 Release/Registry publication is implied.
|
||||
|
||||
**Version boundary:** V3.8X2 package 3.8.3 and V3.9.0 are separate workflows. This update does not create a V3.8X2 or V3.9 GitHub Release, tag, maintenance branch, or Registry version; it does not remove any older Release. The existing [`v3.8.0` tag](https://github.com/ukr8b3g-cmyk/ComfyUI-H3-Continuum/tree/v3.8.0) remains the reproducible V3.8.0 baseline.
|
||||
|
||||
## Loader persistence repair on main (2026-09-21, after 3.8.3)
|
||||
|
||||
The current paired V3.8X2 workflows now use **Core Load Audio** and **Core Load Video -> H3 Continuum Video Adapter**. The adapter has Force Rate (default 24) and IMAGE/AUDIO outputs, but **no Enable switch or file selector**. Core owns video selection/upload/save; the established duration-preserving frame selection is reused and audio is passed unchanged. To disable Timeline Video guidance, bypass the adapter or the whole video-input group; do not bypass only Load Video while leaving its required-input adapter active.
|
||||
The current paired V3.8X2 workflows now use **Core Load Audio** and **Core Load Video -> H3 Continuum Video Adapter**. The adapter has Force Rate (default 24) and IMAGE/AUDIO outputs, but **no Enable switch or file selector**. Core owns video selection/upload/save; the established duration-preserving frame selection is reused and audio is passed unchanged. To disable Video Guide, bypass the adapter or the whole video-input group; do not bypass only Load Video while leaving its required-input adapter active.
|
||||
|
||||
**H3 Continuum Load Image remains**, including Enable Image. Its mode observer now delegates to inherited Core setters (Issue #23), and no longer replaces the widget collection while drawing or saving. Enable is appended after Core's widgets; Core handles the filename and native Bypass persistence. The older Audio/Video node IDs remain loadable as deprecated compatibility nodes, not as the recommended new-workflow loaders. Ten node IDs are registered including these two legacy nodes. Sampler inputs, generation parameters, Decode Cache, Finalize and existing latent/storage contracts are unchanged.
|
||||
**H3 Continuum Load Image remains**, including Enable Image. Its mode observer now delegates to inherited Core setters (Issue #23), and no longer replaces the widget collection while drawing or saving. Enable is appended after Core's widgets; Core handles the filename and native Bypass persistence. The older Audio/Video node IDs remain loadable as deprecated compatibility nodes, not as the recommended new-workflow loaders. The V3.8X2 baseline registered ten node IDs including these two legacy nodes; V3.9 adds the V3.9 Sampler and Reference Images helper as separate IDs, for twelve total. V3.8 Sampler inputs, generation parameters, Decode Cache, Finalize and existing latent/storage contracts are unchanged.
|
||||
|
||||
After updating, restart ComfyUI and reload/refresh the frontend. A workflow that already omitted its filename or saved an incorrect mode cannot recover those missing values: reselect the intended file and Bypass state, then save once. Existing user workflows and saved Takes are not automatically rewritten. Changing upstream node types can legitimately create a new Run Storage revision; preserve the original workflow when resuming accepted runs.
|
||||
|
||||
Validation details and limits: [Loader repair record](docs/LOADER_PERSISTENCE_REPAIR.md). CPU/store-model regression tests are not a substitute for the pending Windows Core 0.36.0 / frontend 1.53.6 browser tab-switch acceptance. No Release/tag or Registry publication is implied by this main-branch repair. Older loader screenshots below describe the retained legacy nodes.
|
||||
|
||||
|
||||
## Timeline Video — Experimental on main
|
||||
|
||||
The existing video IMAGE input is now displayed as **`Timeline Video Frames`** and has one appended optional control, **`Video Reference Mode`**. Existing workflows and API calls that do not contain the new setting keep the old behavior through the default **`Repeat Reference`** mode.
|
||||
@@ -32,8 +71,7 @@ The two comparison workflows are intentionally separate from the unchanged offic
|
||||
|
||||
Local acceptance passed with full CPU `1424 passed / 1 skipped / 0 failed`, browser save/reload, and Follow/Repeat `2 x 5 s` GPU runs at 704x416, 24 fps, 240 frames, and 10-second 32 kHz stereo audio. Follow changed to the later source interval for Chunk 2 while Repeat retained the shared prefix; both completed without OOM, NaN, allocation failure, or crash. Peak observed VRAM was about 15.6–15.7 GiB on the tested RTX 5060 Ti 16 GB system, so 16 GB headroom was small. This is a functional mode-separation result, not a universal speed or subjective-quality guarantee. See [Timeline Video Experimental](docs/TIMELINE_VIDEO_EXPERIMENTAL.md).
|
||||
|
||||
|
||||
> **V3.8X2** is the product and workflow label for package metadata `3.8.3`. Current `main` includes the post-3.8.3 loader-persistence repair: the official workflows use Core Load Audio and Core Load Video -> H3 Continuum Video Adapter, while the deprecated Continuum Audio/Video loader IDs remain registered for saved-workflow compatibility. V3.8X2 also includes optional Reference Images 4–9 and the built-in Decode Cache Helper. Timeline Video remains Experimental on `main`. The older V3.8.0 package remains available from tag [`v3.8.0`](https://github.com/ukr8b3g-cmyk/ComfyUI-H3-Continuum/tree/v3.8.0).
|
||||
> **V3.8X2** is the product and workflow label for package `3.8.3`. It keeps the V3.8 production sampler and adds optional Reference Images 4–9 plus the built-in Decode Cache Helper. The older V3.8.0 package remains available from tag [`v3.8.0`](https://github.com/ukr8b3g-cmyk/ComfyUI-H3-Continuum/tree/v3.8.0).
|
||||
<img width="1536" height="1024" alt="exec-9cfa73b4-c1d3-4416-8950-fa661b946638_2" src="https://github.com/user-attachments/assets/8df15764-6db6-4d4c-9eb5-0d2c7b0668f0" />
|
||||
|
||||
|
||||
@@ -42,7 +80,7 @@ Local acceptance passed with full CPU `1424 passed / 1 skipped / 0 failed`, brow
|
||||
- **Standard name:** [JSON](examples/workflows/MiniMax_H3_Continuum_V38X2.json) | [ZIP](examples/workflows/MiniMax_H3_Continuum_V38X2.zip)
|
||||
- **Helper-explicit name:** [JSON](examples/workflows/MiniMax_H3_Continuum_V38X2+Decode_Cache_Helper.json) | [ZIP](examples/workflows/MiniMax_H3_Continuum_V38X2+Decode_Cache_Helper.zip)
|
||||
|
||||
The two names contain the **same official graph**; they are distribution aliases, not different configurations. Both include the built-in Decode Cache Helper with its saved `Auto / RAM 256MB / Disk 8GB / reset_token 0` settings and the nine-reference helper connection. Each ZIP contains only the correspondingly named JSON. Older V3.8X workflows remain available for existing projects.
|
||||
The two V3.8X2 JSON names contain the **same official graph**; they are distribution aliases, not different configurations. Both include the built-in Decode Cache Helper with its saved `Auto / RAM 256MB / Disk 8GB / reset_token 0` settings and the nine-reference helper connection. The standard V3.8X2 ZIP now also contains the separate V3.9 JSON, while the helper-explicit ZIP contains only its correspondingly named V3.8X2 JSON. Older V3.8X workflows remain available for existing projects.
|
||||
|
||||
## Nine Reference Images: memory warning
|
||||
|
||||
@@ -56,7 +94,7 @@ When using many references, especially all nine, resize copies of the source ima
|
||||
|
||||
### Important: this is not an unconditional new-generation speedup
|
||||
|
||||
**Manual cache clear:** normally no action is needed. Press the Helper's **Clear cache** button (Japanese UI: **キャッシュをクリア**) to discard that Helper's cache on the next Queue and run native Decode again. It does not delete immediately or queue automatically. The internal `reset_token` remains serialized for workflow/API compatibility and increments once per click (wrapping to 0 at the INT limit). Creating, loading, or cloning a node does not change it. Without JavaScript, or in API workflows, change `reset_token` through the traditional numeric input.
|
||||
**Manual cache clear:** normally no action is needed. Press the Helper's "キャッシュをクリア" (Clear cache) button to discard that Helper's cache on the next Queue and run native Decode again. It does not delete immediately or queue automatically. The internal `reset_token` remains serialized for workflow/API compatibility and increments once per click (wrapping to 0 at the INT limit). Creating, loading, or cloning a node does not change it. Without JavaScript, or in API workflows, change `reset_token` through the traditional numeric input.
|
||||
|
||||
**The Helper saves time only when unchanged latents are decoded again. It does not accelerate Sampling.** A first MISS runs native Decode and stores the result; hashing and storage can make that run slower. Generating different latents with a new random seed each time normally produces MISS, so this feature should not be expected to speed up that usage.
|
||||
|
||||
@@ -72,7 +110,7 @@ The action names themselves do not enable reuse. **Each Video/Audio entry must m
|
||||
|
||||
Cache reuse is process-local and does not survive Python restarts. Eviction and VAE identity changes can also cause MISS. Changing mode, RAM/Disk budgets, or `reset_token` clears this implementation's Helper cache. Keeping `reset_token = 0` does not reset it on every Queue.
|
||||
|
||||
V3.8X2 ships `H3DecodeCacheHelper` inside this Continuum package. It remains a separate public node under `MiniMax H3/Continuum/Helpers`; no second custom-node addon is needed. The package registers ten IDs, including the Video Adapter and the two deprecated loader compatibility IDs. Sampler, Finalize, Assembly Plan, Core Decode, and the pre-existing saved Sampler widget/socket prefix are unchanged; Timeline Video adds only one optional widget at the end.
|
||||
V3.8X2 ships `H3DecodeCacheHelper` inside this Continuum package. It remains a separate public node under `MiniMax H3/Continuum/Helpers`; no second custom-node addon is needed. The original nine IDs remain registered for compatibility; the loader migration adds H3ContinuumVideoAdapter. Sampler, Finalize, Assembly Plan, Core Decode, and saved Sampler widget/socket contracts are unchanged.
|
||||
|
||||
Connect Sampler `video_latents` and `audio_latents` plus their native Video/Audio VAE inputs to the Helper, then connect Helper `images` and `audio` to Finalize. Keep the Sampler `assembly_plan` directly connected to Finalize. The [official V3.8X2 workflow](examples/workflows/MiniMax_H3_Continuum_V38X2.json) preserves its saved graph and settings. It contains no Core VAE Decode nodes, so returning to Core direct Decode requires adding those two Core nodes and reconnecting Finalize, or loading a prior Core-direct V3.8X workflow. Do not simply remove the Helper and expect automatic rewiring.
|
||||
|
||||
@@ -114,7 +152,7 @@ git clone --branch v3.8.0 --single-branch https://github.com/ukr8b3g-cmyk/ComfyU
|
||||
|
||||
Use only one Continuum checkout at a time. ComfyUI Manager **Update** tracks `main`; it does not select historical tags.
|
||||
|
||||
Download the current V3.8X2 workflow: [JSON](examples/workflows/MiniMax_H3_Continuum_V38X2.json) or [ZIP containing the same JSON](examples/workflows/MiniMax_H3_Continuum_V38X2.zip). This is one Spectrum-capable graph, also usable with [LightX2V Turbo](https://github.com/ModelTC/Minimax-H3-Turbo); both Spectrum and all Turbo LoRA entries are saved disabled. Install its external Spectrum, rgthree, and KJNodes nodes before opening it. ComfyUI-Easy-Use is not required. See [Spectrum and Turbo setup](#turbo-lora-and-spectrum-in-supplied-workflows) below.
|
||||
Download the current V3.8X2 workflow: [JSON](examples/workflows/MiniMax_H3_Continuum_V38X2.json) or [combined V3.8X2/V3.9 ZIP](examples/workflows/MiniMax_H3_Continuum_V38X2.zip). The V3.8X2 JSON is one Spectrum-capable graph, also usable with [LightX2V Turbo](https://github.com/ModelTC/Minimax-H3-Turbo); both Spectrum and all Turbo LoRA entries are saved disabled. Install its external Spectrum, rgthree, and KJNodes nodes before opening it. ComfyUI-Easy-Use is not required. See [Spectrum and Turbo setup](#turbo-lora-and-spectrum-in-supplied-workflows) below.
|
||||
|
||||
## Prompt and skill downloads
|
||||
|
||||
@@ -141,7 +179,7 @@ AI products, plans, and repository-reading behavior change frequently. If a URL
|
||||
|
||||
## V3.8 supported surface
|
||||
|
||||
The package registers ten node IDs, including two deprecated loader compatibility IDs. Current workflows use Core Load Audio and Core Load Video plus the Video Adapter.
|
||||
The V3.8X2 baseline registers ten node IDs, including two deprecated loader compatibility IDs; V3.9 adds a separate Sampler and Reference Images helper. Current official workflows use Core Load Audio and Core Load Video plus the Video Adapter.
|
||||
|
||||
- **H3 Continuum Sampler V3.8** — the Main sampler
|
||||
- **H3 Continuum Finalize** — decoded Video/Audio assembly with optional seam handling
|
||||
@@ -170,7 +208,7 @@ The Helper delegates cache MISS entries to native Core Video/Audio Decode. A man
|
||||
|
||||
## Complete V3.8 UI reference
|
||||
|
||||
This section covers the current ten-node V3.8X2 public surface and the Sampler controls. Names such as `Power Lora Loader (rgthree)`, Spectrum, SageAttention, Core VAE Decode, and Core Save Video belong to ComfyUI or another extension. They may be used in a supplied workflow, but they are not Continuum controls.
|
||||
This section covers every user-facing control and socket on the seven public V3.8 nodes. Names such as `Power Lora Loader (rgthree)`, Spectrum, SageAttention, Core VAE Decode, and Core Save Video belong to ComfyUI or another extension. They may be used in a supplied workflow, but they are not Continuum controls.
|
||||
|
||||
### H3 Continuum Sampler V3.8: required graph inputs
|
||||
|
||||
@@ -193,25 +231,19 @@ The Sampler returns six outputs: a list of `video_latents`, a list of `audio_lat
|
||||
| `last_frame` | Optional final-image constraint for FL2VA | Can trigger a Long Terminal Merge; the final pair may become one atomic review unit |
|
||||
| `reference_image_1`–`reference_image_3` | Ordered appearance, identity, subject, or scene references | They never become the implicit size source |
|
||||
| `Reference Images (Optional)` | Additional images 4–9 bundled by `H3 Continuum Reference Images` | Empty inputs are skipped; encoding remains in the Sampler |
|
||||
| `Timeline Video Frames` | The Video Adapter's 24 fps IMAGE frame batch | `Repeat Reference` keeps the legacy shared prefix; experimental `Follow Timeline` selects successive physical output intervals. Source audio is separate. |
|
||||
| `Video Guide Frames` | A video loader's IMAGE frame batch, applied as a persistent guide | It does not carry the source video's audio; frames are interpreted at 24 fps |
|
||||
| `Driving Audio` + `Driving Audio VAE` | Original audio timeline used as native guide conditioning | The selected source audio becomes final audio; generated audio and Audio Seam are bypassed |
|
||||
| `Reference Audio (Optional)` + `Reference Audio VAE (Optional)` | Legacy single conditioning-only audio reference | Generated audio remains final audio |
|
||||
| `Audio References (Optional)` | Ordered bundle from `H3 Continuum Reference Audios` | Do not connect this together with the legacy single Reference Audio path |
|
||||
| `Still Image Guide (Optional)` | Compatibility socket inherited from the V3.7 guide contract | Experimental; not part of the V3.8X2 official workflow |
|
||||
|
||||
#### First Image, Last Image, and Reference Images
|
||||
#### First Image, Last Image, and Reference Images
|
||||
|
||||

|
||||
|
||||
- **First Image** establishes the opening image and is the normal visual starting point for I2VA/FL2VA. It is also the only media input that can drive `Size Source = First Image`.
|
||||
- **Last Image** constrains the sequence ending. Leave it `OFF` for T2VA and ordinary I2VA. With a connected Last Image, extending or regenerating the sequence may rebuild the terminal pair.
|
||||
- **Reference Images 1–9** guide identity or appearance throughout generation. Inputs 1–3 remain on the Sampler; optional inputs 4–9 are on `H3 Continuum Reference Images`, connected to the Sampler's `Reference Images (Optional)` socket. The helper only bundles images: resizing, hashing, and VAE encoding remain in the existing Sampler path. Empty slots are skipped; Picture numbers follow active slot order after any First/Last Image. Existing three-loader templates still work unchanged.
|
||||
|
||||
#### Timeline Video Frames and Video Reference Mode
|
||||
|
||||
Connect `Core Load Video` to `H3 Continuum Video Adapter`, then connect Adapter `images` to `Timeline Video Frames`. The Adapter's default `Force Rate = 24` matches the input contract. Connect Adapter `audio` to `Driving Audio` only when that source audio should guide generation and become the final audio.
|
||||
|
||||
`Video Reference Mode` is visible only while Timeline Video Frames is connected. `Repeat Reference` is the compatibility default. `Follow Timeline` advances through the source according to the physical visible frames actually added to the output, including Review, Resume, and Terminal Merge grouping. It does not change `Seconds per Chunk`; all chunks still use the Sampler's common duration. See the [experimental contract and limitations](docs/TIMELINE_VIDEO_EXPERIMENTAL.md).
|
||||
- **Reference Images 1–9** guide identity or appearance throughout generation. Inputs 1–3 remain on the Sampler; optional inputs 4–9 are on `H3 Continuum Reference Images`, connected to the Sampler's `Reference Images (Optional)` socket. The helper only bundles images: resizing, hashing, and VAE encoding remain in the existing Sampler path. Empty slots are skipped; Picture numbers follow active slot order after any First/Last Image. Existing three-loader templates still work unchanged.
|
||||
|
||||
Saved workflows with the earlier direct image 4/5 inputs migrate those links into a bundle after graph loading. Migration preserves the original source links and only removes a legacy input after its new link is verified. If a source is unavailable or its destination is occupied, the legacy link is retained with a warning. Old API prompts remain accepted; supplying both legacy and bundle images for the same slot is an explicit input conflict.
|
||||
|
||||
@@ -229,7 +261,7 @@ Every `H3 Continuum Load Image` has `Enable Image`. `ON` loads through ComfyUI C
|
||||
|
||||

|
||||
|
||||
- New workflows use Core `Load Video` followed by `H3 Continuum Video Adapter`. The Adapter's positive `Force Rate` drops/duplicates frames while preserving nominal duration and passes audio through unchanged. Connect `images` to `Timeline Video Frames`; connect `audio` to `Driving Audio` only when the source audio should guide and become the final output. The legacy `H3 Continuum Load Video` remains registered for compatibility.
|
||||
- `H3 Continuum Load Video`: `Enable Video`, `Video`, and `Force Rate`. `Force Rate = 0` uses source FPS; a positive value drops/duplicates frames to that rate while preserving nominal duration and audio. Connect `images` to `Video Guide Frames` when visual video guidance is wanted. Connect `audio` to `Driving Audio` only when the source audio should guide and become the final output.
|
||||
- `H3 Continuum Load Audio`: `Enable Audio` and the audio file. Use it for Driving Audio or Reference Audio according to the socket you connect.
|
||||
- The node titled `Audio Switch` in the example image is ComfyUI Core's `If/Else Switch` (`ComfySwitchNode`); `Fast Groups Bypasser (rgthree)` belongs to the rgthree extension. Neither is a Continuum node or a requirement of Continuum. The Continuum loaders already provide their own native ON/OFF controls.
|
||||
|
||||
@@ -277,7 +309,7 @@ Every `H3 Continuum Load Image` has `Enable Image`. `ON` loads through ComfyUI C
|
||||
|
||||

|
||||
|
||||
If First Image mode is selected but no usable First Image reaches the Sampler, V3.8 uses the stored Manual Width/Height as a safe fallback and reports the dimensions in `status`. Select `Size Source = Manual` to inspect or edit those values; Width/Height are hidden in the First Image facade. Reference Images and Timeline Video Frames never become implicit size sources. The historical `Auto / Landscape / Portrait / Square` values are migration/API compatibility values, not current Main choices.
|
||||
If First Image mode is selected but no usable First Image reaches the Sampler, V3.8 uses the stored Manual Width/Height as a safe fallback and reports the dimensions in `status`. Select `Size Source = Manual` to inspect or edit those values; Width/Height are hidden in the First Image facade. Reference Images and Video Guide never become implicit size sources. The historical `Auto / Landscape / Portrait / Square` values are migration/API compatibility values, not current Main choices.
|
||||
|
||||
Size selection is built into the V3.8 Sampler. A separate megapixel, empty-latent, or image-size node is not required for the normal Continuum workflow.
|
||||
|
||||
@@ -299,7 +331,7 @@ For an audio-only listening diagnostic, use T2VA, `Size Source = Manual`, and a
|
||||
| `Variation Nonce` | Explicit `Regenerate From = Chunk N` | `0`: automatic variation selection with interrupted-run resume; `1` or higher: a fixed variation value. Base Seed and the other generation settings stay unchanged |
|
||||
| `Run Name (Optional Override)` | Advanced open and Progress On | Stable name for resume and Render History; blank uses the Sampler's automatic identity |
|
||||
| `Reference Image Size` | Advanced open and a Reference Image connected | `Match Output` is practical; `Max Identity` preserves more reference detail and may use more memory |
|
||||
| `Video Guide Size` | Advanced open and Timeline Video Frames connected | `Efficient — 0.4 MP`, `Balanced — 0.6 MP`, or `Match Output` |
|
||||
| `Video Guide Size` | Advanced open and Video Guide connected | `Efficient — 0.4 MP`, `Balanced — 0.6 MP`, or `Match Output` |
|
||||
|
||||
Frontend-managed IDs, selected Take IDs, one-shot review actions, diagnostics, preview, and legacy compatibility values are deliberately not editable as ordinary node widgets. The corresponding settings or action buttons below are the supported interface.
|
||||
|
||||
@@ -383,7 +415,7 @@ The same graph can be used as the quick Turbo path: disable Spectrum, enable exa
|
||||
|
||||
An experimental prefix-amplitude renormalization produced a strong improvement in one `6 × 5 s` run, but a later frozen `4 × 8 s` A/B/C gate did not reproduce the target drift and therefore applied gains of `1.0`; Standard and the experimental arm were bit-exact. The older Compatibility route did not justify replacing Standard and raised a separate boundary-audio concern. The accurate release statement is therefore: **the issue is not proven fixed, the current Standard path is unchanged, and experimental mitigation stays Default Off**. Report the first and worst affected chunk, workflow JSON, prompt, seed, model/LoRA, Steps/SIGMAS, size, Continuity, and Audio Continuity when reproducing it.
|
||||
|
||||
> **Support boundary:** The original V3.8 launch surface had seven nodes. V3.8X2 now exports ten IDs: it adds Reference Images, Decode Cache Helper, and Video Adapter while retaining the deprecated Audio/Video loader IDs for saved-workflow compatibility. Some nodes retain earlier IDs, including Finalize (`H3ContinuumAssembleSeamV35`) and Second Pass (`H3ContinuumSecondPassV35`); this does not make all older workflows compatible. Use the matching historical Release/tag for unsupported node IDs. See [V3.8 Release and Migration Policy](docs/V38_RELEASE_AND_MIGRATION.md).
|
||||
> **Support boundary:** The original V3.8 launch surface had seven IDs. V3.8X2 registers ten IDs including the Video Adapter and two deprecated loader compatibility IDs; V3.9 adds two more, for twelve. Some retain earlier IDs, including Finalize (`H3ContinuumAssembleSeamV35`) and Second Pass (`H3ContinuumSecondPassV35`); this does not make all older workflows compatible. Use the matching historical Release/tag for unsupported node IDs. See [V3.8 Release and Migration Policy](docs/V38_RELEASE_AND_MIGRATION.md).
|
||||
|
||||
The accepted 16GB GPU gates reached about `15.5-15.6 GiB` in the most complex cases. Actual use varies by GPU, driver, backend, model precision, resolution, and connected nodes; this is not a universal 16GB guarantee.
|
||||
|
||||
@@ -740,7 +772,7 @@ Prompt/CLIP figures measure only the conditioning subphase, not total generation
|
||||
|
||||
The measured Sage-only production baselines on the tested RTX 5060 Ti 16 GB / 64 GB system were 168.069 seconds for 1×5-second 576×576 T2VA and 379.765 seconds for 3×5-second 640×640 FL2VA Long Terminal Merge. These are configuration-specific baselines, not universal speed guarantees. Sampling remained the dominant cost; Continuum Assemble + Seam stayed below 1%.
|
||||
|
||||
> **V3.8.0 is the historical release baseline.** The current publication target is V3.8X2 / package 3.8.3. Historical implementation modules remain in source because V3.8X2 reuses them internally. Only the ten current public node IDs are exported, including the two deprecated loader compatibility IDs. Use the matching historical Release/tag for workflows requiring other IDs. Still Image Guide remains Experimental.
|
||||
> **V3.8.0 is the historical release baseline.** V3.8X2 remains a separate package-3.8.3 workflow, while V3.9.0 source is available on `main`. Historical implementation modules remain in source because V3.8X2 reuses them internally. The current registration has ten V3.8X2 IDs plus two V3.9 IDs. Use the matching historical Release/tag for workflows requiring other IDs. Still Image Guide remains Experimental.
|
||||
|
||||
## V3.5.1 Reference Audio & Compatibility Update
|
||||
|
||||
@@ -751,7 +783,7 @@ V3.5.1 added two focused features without changing the V3.4 Sampling, Conditioni
|
||||
|
||||
The Reference Audio sockets are permanently defined by Python `INPUT_TYPES`. Dynamic socket changes and the UI-only `Hidden / Show` control were removed to prevent workflow save/reload value shifts. Node IDs, backend keys, Sampling, Conditioning, standard Seed handling, and other widgets are unchanged.
|
||||
|
||||
In the historical V3.5.1 package, V3.4 node IDs and backend socket keys remained registered for saved-workflow compatibility. V3.4/V3.5 workflows continued to load there; V3.5.1 clarified the displayed input names without rewriting saved links. The original V3.8 launch used a seven-node boundary; current V3.8X2 exports the ten IDs listed in the current guide above.
|
||||
In the historical V3.5.1 package, V3.4 node IDs and backend socket keys remained registered for saved-workflow compatibility. V3.4/V3.5 workflows continued to load there; V3.5.1 clarified the displayed input names without rewriting saved links. V3.8 instead uses the seven-node support boundary above.
|
||||
|
||||
### Reference inputs at a glance
|
||||
|
||||
@@ -894,7 +926,7 @@ For the failed 3 x 5s case, First Pass and the 37T Second Pass group completed.
|
||||
|
||||
## V3.4 compatibility baseline
|
||||
|
||||
The historical V3.5 package retained V3.4 nodes for saved workflows; it did not replace their Node IDs, public sockets, Sampling, Conditioning, Terminal Merge, Assembly, Seam, or Run Storage behavior. Those historical workflows remain available through the corresponding Release/tag. V3.8X2 does not export IDs outside its current ten public nodes, even when their implementation modules remain in source.
|
||||
The historical V3.5 package retained V3.4 nodes for saved workflows; it did not replace their Node IDs, public sockets, Sampling, Conditioning, Terminal Merge, Assembly, Seam, or Run Storage behavior. Those historical workflows remain available through the corresponding Release/tag. Current V3.9 exports only its twelve registered IDs, even when older implementation modules remain in source.
|
||||
|
||||

|
||||
|
||||
@@ -921,13 +953,14 @@ V3.4 therefore prioritizes:
|
||||
|
||||
This is a usability and reliability decision, not a claim that the experimental timeline paths are impossible. They are hidden from the stable interface while the public workflow stays focused on predictable user-controlled inputs.
|
||||
|
||||
## Example workflow
|
||||
|
||||
- [V3.8X2 workflow JSON](examples/workflows/MiniMax_H3_Continuum_V38X2.json) — current official graph; Spectrum is disabled by default
|
||||
- [V3.8X2 workflow ZIP](examples/workflows/MiniMax_H3_Continuum_V38X2.zip) — contains exactly the correspondingly named JSON, not another variant or a custom-node installer
|
||||
## Example workflow
|
||||
|
||||
- [V3.9 workflow JSON](examples/workflows/MiniMax_H3_Continuum_V39.json) and [ZIP](examples/workflows/MiniMax_H3_Continuum_V39.zip) — current V3.9 graph; the ZIP contains only this JSON
|
||||
- [V3.8X2 workflow JSON](examples/workflows/MiniMax_H3_Continuum_V38X2.json) — retained V3.8X2 graph; Spectrum is disabled by default
|
||||
- [V3.8X2 workflow ZIP](examples/workflows/MiniMax_H3_Continuum_V38X2.zip) — contains both the V3.8X2 and V3.9 JSON files; it is not a custom-node installer
|
||||
- [V3.8X2 Helper-explicit JSON](examples/workflows/MiniMax_H3_Continuum_V38X2+Decode_Cache_Helper.json) and [ZIP](examples/workflows/MiniMax_H3_Continuum_V38X2+Decode_Cache_Helper.zip) — the same graph under an explicit distribution name
|
||||
|
||||
The declared Registry payload includes this one graph in both formats; it is **not dependency-free**. Spectrum, rgthree, and KJNodes must be installed separately; ComfyUI-Easy-Use is not required. Historical workflow files remain in GitHub source but are excluded from the Registry payload. For an older saved workflow, use its matching historical Release/tag as described in the [migration policy](docs/V38_RELEASE_AND_MIGRATION.md). Registry packaging validation/publication is separate from this GitHub source update.
|
||||
The declared Registry payload includes both V3.9 and V3.8X2 graphs; it is **not dependency-free**. Spectrum, rgthree, and KJNodes must be installed separately; ComfyUI-Easy-Use is not required. Historical workflow files remain in GitHub source but are excluded from the Registry payload. For an older saved workflow, use its matching historical Release/tag as described in the [migration policy](docs/V38_RELEASE_AND_MIGRATION.md). Registry packaging validation/publication is separate from this GitHub source update.
|
||||
|
||||
## V3.4 feature details
|
||||
|
||||
@@ -1016,11 +1049,11 @@ The public nodes focus on normal production controls. Developer diagnostics and
|
||||
|
||||
### Timeline paths
|
||||
|
||||
The retired V3.3 Timeline Sampler and earlier timeline-audio paths remain historical and are not exported by V3.8X2. The current experimental implementation instead adds `Follow Timeline` to the existing `Timeline Video Frames` input on Sampler V3.8; it does not restore the old node ID. Open V3.3 workflows with their matching historical package.
|
||||
Experimental Timeline Video and earlier timeline-audio paths remain in historical implementation code but are not exported by V3.8. Open V3.3 workflows with their historical package; new V3.8 workflows should use `Driving Audio` and `Video Guide Frames`.
|
||||
|
||||
## Installation
|
||||
|
||||
`pyproject.toml` declares `requires-comfyui >=0.32.0`. The current generation baseline verified by this project is ComfyUI `0.34.2`. The current V3.8X2 live-runtime acceptance evidence recorded here is for `0.34.2`, not `0.32.x`, and seam behavior on newer Core versions is currently being investigated in Issue #24. Treat `0.34.2` as the current verified baseline, not as the minimum install version or a guarantee that all newer Core versions behave identically. Historical acceptance records below may mention older ComfyUI versions.
|
||||
V3.8 is verified against ComfyUI 0.34.2. Historical acceptance records below may mention older ComfyUI versions; they are not the current installation target.
|
||||
|
||||
### Updating an existing installation
|
||||
|
||||
@@ -1033,7 +1066,7 @@ git pull --ff-only origin main
|
||||
|
||||
Restart ComfyUI after the update. If the node was installed with ComfyUI Manager, use its **Update** action instead of running `git pull` manually. Do not mix Manager updates and a separate Git checkout for the same installation.
|
||||
|
||||
After the backend restart, search for `H3 Continuum Sampler V3.8`. The complete V3.8X2 search surface contains the ten nodes listed above. If they are missing, check the startup console for the `H3 Continuum 3.8.3 loaded` message and any `ComfyUI-H3-Continuum` import error.
|
||||
After the backend restart, search for `H3 Continuum Sampler V3.8` with the V3.8X2 workflow, or `H3 Continuum Sampler V3.9` and `H3 Continuum Reference Images V3.9` with the V3.9 workflow. The source registers twelve IDs in total. If they are missing, check the startup console for the `H3 Continuum 3.9.0 loaded` message and any `ComfyUI-H3-Continuum` import error.
|
||||
|
||||
Search for H3 Continuum or Continuum in ComfyUI Manager, or install manually:
|
||||
|
||||
@@ -1190,9 +1223,7 @@ Not recommended:
|
||||
[0-5s] Describe the scene.
|
||||
~~~
|
||||
|
||||
The second form is not recognized as a Timeline header. With **Prompt Format = Auto**, it is detected as Fixed. With **Prompt Format = Timeline**, a Timeline parse error currently fails open to Fixed and emits diagnostic `H3C-P100`; the complete text can therefore be reused across all chunks.
|
||||
|
||||
A Timeline that parses successfully but does not cover a chunk emits `H3C-P101` and reuses the previous prompt, or the earliest valid section for a leading gap. To avoid accidental repeated actions, explicitly cover every chunk interval.
|
||||
The second form is not recognized as a Timeline header. When **Prompt Format = Auto**, it may therefore be interpreted as a Fixed prompt instead, causing the complete text to be reused across chunks.
|
||||
|
||||
The time ranges should normally match the configured `chunk_seconds`.
|
||||
|
||||
@@ -1345,11 +1376,9 @@ Use a 24 fps source for `Video Guide Frames`. `Load Video (Upload)` may accept f
|
||||
|
||||
## Current validation status
|
||||
|
||||
The V3.8X2 public-surface suite checks the exact ten-node export, both unchanged official workflow names and matching ZIP payloads, the separate experimental Follow/Repeat workflows, declared external dependencies, Registry exclusions, the preserved V3.8 widget/socket prefix plus the appended mode widget, and presentation-only `Show Advanced Settings` / `Hide Advanced Settings` behavior. Registry payload hashes are recorded in `REGISTRY_MANIFEST.sha256`; source integrity is recorded in `MANIFEST.sha256`.
|
||||
The public-surface suite checks ten V3.8X2 IDs and twelve IDs including V3.9, official workflows and matching ZIP payloads, declared external dependencies, Registry exclusions, preserved V3.8 widget/socket order, and presentation-only `Show Advanced Settings` / `Hide Advanced Settings` behavior. Registry payload hashes are recorded in `REGISTRY_MANIFEST.sha256`; source integrity is recorded in `MANIFEST.sha256`.
|
||||
|
||||
**Current `main` HEAD CPU/CI evidence (`88363ccd`):** GitHub Actions run `35811479080` completed successfully on Python 3.11 with **1,429 passed / 3 skipped / 0 failed**.
|
||||
|
||||
**Most recent browser/GPU acceptance:** the Timeline Video integration gate previously passed **1,424 passed / 1 skipped / 0 failed**, browser save/reload, and the Follow/Repeat `2 × 5 second` GPU functional runs described above. Those runs produced 704×416, 24 fps, 240-frame, 10-second video with 32 kHz stereo audio and no OOM, NaN, allocation failure, or crash. They predate the current PackedLayout HEAD and are not presented as a fresh GPU validation of `88363ccd`. The prior dedicated Review Functional Gate passed a `3 × 5 second` run: Q1–Q3 generated one physical group at a time, and Q4 reused all three groups with `3 reused / 0 generated`; Q3 and Q4 had identical decoded RGB and PCM SHA-256 values. The separate nine-reference Gate is recorded below. These checks confirm functional execution, prefix reuse, AV reconstruction, mode separation, and the tested nine-reference path; they are not a full subjective image- or audio-quality rating.
|
||||
**Historical V3.8X2 preparation evidence:** the full CPU suite passed **1,367 passed / 1 skipped / 0 failed**. The prior dedicated GPU Functional Gate passed a `3 × 5 second` Review Each Chunk run: Q1–Q3 generated one physical group at a time, and Q4 reused all three groups with `3 reused / 0 generated`. Q3 and Q4 had identical decoded RGB and PCM SHA-256 values. The separate nine-reference Gate is recorded below. These checks confirm functional execution, prefix reuse, AV reconstruction, and the tested nine-reference path; they are not a full subjective image- or audio-quality rating.
|
||||
|
||||
### Nine-reference input gate (0.3 MP reference images)
|
||||
|
||||
|
||||
+58
-44
@@ -1,15 +1,54 @@
|
||||
# ComfyUI-H3-Continuum 3.8.3 — V3.8X2
|
||||
# ComfyUI-H3-Continuum 3.9.0 — V3.9
|
||||
|
||||
## 最初に:V3.9とV3.8X2
|
||||
|
||||
ComfyUIの **Templates → ComfyUI-H3-Continuum** には、今回選んだ[V3.9公式Workflow](examples/workflows/MiniMax_H3_Continuum_V39.json)と、別の[V3.8X2 Workflow](examples/workflows/MiniMax_H3_Continuum_V38X2.json)を2件表示します。[V3.8X2 Workflow ZIP](examples/workflows/MiniMax_H3_Continuum_V38X2.zip)には、**V3.8X2とV3.9の両JSON**を同梱しました。[V3.9単独ZIP](examples/workflows/MiniMax_H3_Continuum_V39.zip)も残します。いずれもWorkflow用ZIPで、カスタムノード本体のインストーラーではありません。V3.8 Samplerは残るので既存のV3.8X2 Workflowは使えます。ただしV3.9へReference配線や保存済みRun/Takeは自動移行しません。旧Workflowを保存しておき、新しい作業ではV3.9専用Workflowを開いてください。
|
||||
|
||||
選択したV3.9テンプレートは32ノードです。画像Loader 1~6は新ヘルパーへ配線済み・初期Bypassです。7~9番の入力欄は残し、必要な人が画像Loaderを追加して接続します。使用する画像を選んで必要なLoaderだけ有効にしてください。保存済みサイズ設定は**First Image+Draft — 0.30 MP**で、別のFirst Image Loaderは有効です。Queue前に自分のFirst Imageファイルを選び直してください。保存済みのWidth/Height 480×640はManual時だけ有効です。`Reference Image Size`は`Match Output`で、読み込み後のconditioningを縮小しますが元画像ファイル自体は縮小しません。チャンク別Referenceの効果を明瞭に試すなら、First ImageとLast ImageをOFFにし、Manualへ切り替えてReference Imagesだけを使うのが勧められます。First/Lastを入れるとそれ自体が動画を拘束し、Last Imageは最後の2つの論理チャンクを1つの生成groupに結合する場合があります。その場合、両チャンクの有効Reference集合は同じにしてください。Referenceを外しても、前チャンクの映像から人物が引き継がれることはあります。
|
||||
|
||||
ヘルパーの `All chunks` は接続画像を全チャンクに、`Per chunk` は画像×チャンクの表で指定します。このテンプレートは`Per chunk`で全チェックOFFから始まるため、Loaderを有効にした後、使用したいチャンクにもチェックしてください。空欄があっても番号はずれず、Image 1は常に`@R1`、Image 9は`@R9`です。Sequence Promptにはチャンクごとの動作を短く書き、そのチャンクで使う画像の`@R`タグを付けます。内部の`<Picture N>`番号はgroupごとに自動変換されます。使わないタグは警告しますが生成を止めません。まず短いチャンクと縮小済み画像で試してください。入力元画像はSamplerのReference Image Size設定より前にRAMを使うことがあります。
|
||||
|
||||
V3.9.0は`main`の現行ソースです。今回のmain更新は新しいGitHub ReleaseやComfyUI Registry公開ではなく、過去のReleaseとtagは残します。設定済み1024×1024のReference-only GPU/APIテストは通っていますが、無改変の公式テンプレート初期設定とブラウザー保存・再読込は別の受入項目です。古い環境を厳密に再現するには対応する過去のRelease/tagとWorkflowを使用してください。現行mainにもV3.8 Samplerを残し、V3.8X2 Workflowを使えるようにしています。
|
||||
|
||||
`pyproject.toml`の宣言上はComfyUI `>=0.32.0`ですが、現行の実生成・GPU検証基準はComfyUI `0.34.2`です。最低宣言版でV3.9の実機動作を確認済みという意味ではありません。最新の記録済みWindows CPU試験は`1536 passed / 1 skipped / 0 failed`、別環境のLinux再実行報告は`1534 passed / 3 skipped / 0 failed`です。これらは現行公式テンプレートの実ブラウザー保存・再読込やGPU受入を代替しません。
|
||||
|
||||
## V3.9 Reference Images
|
||||
|
||||
V3.9では、固定番号の参照画像1~9を新しい **H3 Continuum Reference Images V3.9** ノードにまとめます。ノード内の表で「All chunks」またはチャンク別のチェックを選び、Samplerへは1本だけ接続します。`Sequence Prompt`で`@R1`と書けば固定の画像1を指します。有効なタグは各生成groupの実際の`<Picture N>`へ変換されます。両モードとも同じチャンク別処理を通ります。
|
||||
|
||||
Promptは実行を止めません。明示的なTimelineでも解析できなければ元の入力をFixedとして扱い、診断`H3C-P100`を出します。Timelineで指定のないチャンクは前のPromptを再利用し、`H3C-P101`で知らせます。どの画像を各チャンクに使うかはReference Imagesノードで選び、Prompt中の`@R1`~`@R9`は接続画像の固定番号に対応させてください。
|
||||
|
||||
同梱の`2 × 10秒`Workflowでは、時間見出しを必ず単独行にし、各チャンクの動作だけを短く書きます。対応する画像LoaderをONにしてチャンク欄へチェックを入れた場合の書式例です。
|
||||
|
||||
```text
|
||||
[0-10s]
|
||||
@R1 walks forward through a quiet hallway. The camera follows smoothly.
|
||||
|
||||
[10-20s]
|
||||
@R2 enters from the right. The camera turns to follow @R2.
|
||||
```
|
||||
|
||||
人物や動作は実際の画像に合わせて書き換えてください。これは書式例で、配布WorkflowのPromptは空欄です。`[0-10s]`と本文を同じ行には書かないでください。チェックされた画像は、Prompt中に`@R`を書かなくてもそのチャンクのconditioningに入ります。
|
||||
|
||||
[公式V3.9 Workflow](examples/workflows/MiniMax_H3_Continuum_V39.json)は、今回指定された添付JSONを無改変で採用しました。[単独ZIP](examples/workflows/MiniMax_H3_Continuum_V39.zip)も用意しています。V38X2のモデル・LoRA、Decode Cache、Finalize、Saveのフル構成を維持し、画像Loaderは1~6だけを配線済み・初期Bypassにしています。7~9番を使う場合は`H3 Continuum Load Image`を追加し、ヘルパーの同じ番号の入力へ接続してください。Sequence Promptの入力ノードと配線は残し、文章は空欄です。Queue前に自分のプロンプトを入力してください。保存設定は`Timeline`、2×10秒、`Full Run`(画面表示はGenerate Full Video)、First Image+Draft 0.30 MP、別Project IDです。従来の[V3.9 Reference Inline移行用Workflow](examples/workflows/MiniMax_H3_Continuum_V39_Reference_Inline.json)は変更せず残します。チャンク別割り当て、First/Lastとの終端結合、保存・再読込、画像メモリの注意点は[操作ガイド](docs/V39_REFERENCE_INLINE.md)を参照してください。Queue前にモデル・素材のファイル名を確認し、画像を有効化する場合は実ファイルを選択してください。7~9枚の参照は特に高負荷なので、最初は枚数と元画像サイズを抑えてください。新ノードを表示するにはComfyUI本体の完全再起動とブラウザーの強制再読込が必要です。無改変の公式テンプレートの実ブラウザー保存・再読込/GPU受入はまだ未実施です。このmain更新はGitHub ReleaseまたはRegistry公開ではありません。
|
||||
|
||||
**互換性:** V3.8X2の既存Workflowは旧V3.8 Samplerと旧4~9ヘルパーで引き続き利用します。V3.9では新ヘルパーへの接続が必要です。旧Workflow上でSamplerの型だけ変えず、上記のV3.9専用Workflowを開いてください。以前のV3.9試作WorkflowにあったSampler直結1~3やSampler側の割り当て欄は配線と保存widgetの位置が異なります。V3.8の途中Run/Takeは自動移行しません。元Workflowを保存し、V3.9では別Run Nameを使ってください。
|
||||
|
||||
旧V3.9操作系のRR-R6BブラウザーPASSは、新しいヘルパーのブラウザー保存・再読込PASSを意味しません。新ヘルパーは設定済みGPU/API実行の証拠がありますが、公式テンプレート初期設定の受入は別です。CPU/JS・Manifestも別に判定し、V3.9 GitHub Release/Registry公開はまだ行っていません。
|
||||
|
||||
**バージョン境界:** V3.8X2(package 3.8.3)とV3.9.0は別Workflowです。今回、新しいtag・GitHub Release・保守ブランチ・Registry版は作成せず、既存Releaseも削除しません。旧V3.8.0は既存の`v3.8.0` tagから取得できます。
|
||||
|
||||
## mainのLoader保存・復元修正(2026-09-21、3.8.3以降)
|
||||
|
||||
現行V3.8X2ワークフローは、音声を **Core Load Audio**、動画を **Core Load Video → H3 Continuum Video Adapter** に変更しました。Video Adapterは24fpsへの変換(Force Rate初期値24)とIMAGE/AUDIO出力だけを担当し、**Enableやファイル選択UIはありません**。動画を使わない場合はAdapter、または動画入力グループ全体をBypassしてください。Load VideoだけをBypassして必須入力のAdapterをONに残す構成は避けてください。
|
||||
|
||||
画像は **H3 Continuum Load ImageとEnable Imageを維持**します。Issue #23の継承されたmode setterへの委譲と、描画・保存中のwidget配列差し替え廃止を適用します。EnableはCoreの欄の後ろに配置し、画像ファイルとBypassの保存はCoreに委ねます。旧Audio/VideoノードIDは既存workflow用の非推奨互換ノードとして残します。登録IDは互換用2個を含め10個で、Sampler設定・Sampling・Decode Cache・Finalize・既存Run Storage契約は変更しません。
|
||||
画像は **H3 Continuum Load ImageとEnable Imageを維持**します。Issue #23の継承されたmode setterへの委譲と、描画・保存中のwidget配列差し替え廃止を適用します。EnableはCoreの欄の後ろに配置し、画像ファイルとBypassの保存はCoreに委ねます。旧Audio/VideoノードIDは既存workflow用の非推奨互換ノードとして残します。V3.8X2の登録IDは互換用2個を含め10個で、V3.9では別IDのV3.9 SamplerとReference Imagesヘルパーを追加して計12個です。V3.8 Sampler設定・Sampling・Decode Cache・Finalize・既存Run Storage契約は変更しません。
|
||||
|
||||
更新後はComfyUI再起動と画面の再読み込みが必要です。既に保存JSONから消えたファイル名やOFF状態は推測で復元できないため、一度選び直して保存してください。既存ユーザーworkflowや保存済みTakeは自動変更しません。上流ノードの種類変更でRun Storageが新revisionになることはあるため、過去Runの再開には元workflowを保管してください。
|
||||
|
||||
検証範囲は[Loader修正記録](docs/LOADER_PERSISTENCE_REPAIR.md)を参照してください。CPU回帰テストと実ブラウザ確認は別です。Windows Core 0.36.0 / frontend 1.53.6のタブ切替確認は未実施で、Release/tag・Registry公開も別作業です。以下の旧Loader画像は互換ノードの説明です。
|
||||
|
||||
|
||||
## Timeline Video — main上のExperimental機能
|
||||
|
||||
従来の動画IMAGE入力を**`Timeline Video Frames`**と表示し、末尾に省略可能な設定**`Video Reference Mode`**を1項目追加しました。新しい設定を持たない既存Workflow/APIは、初期値の**`Repeat Reference`**で従来動作を維持します。
|
||||
@@ -32,15 +71,14 @@ Core Load Video → H3 Continuum Video Adapter → Timeline Video Frames
|
||||
|
||||
ローカル受入ではFull CPU `1424 passed / 1 skipped / 0 failed`、ブラウザ保存・再読込、Follow/Repeatの`2 × 5秒` GPUテストがPASSしました。両方とも704×416、24fps、240フレーム、映像10秒、32kHz stereo音声10秒で、OOM/NaN/allocation failure/crashはありません。FollowはChunk 2で後半区間へ切り替わり、Repeatは同じ先頭側参照を維持しました。RTX 5060 Ti 16 GBで観測した最大VRAMは約15.6~15.7 GiBで、16 GBの余裕は小さい条件です。これは機能・mode分離の受入結果であり、一般的な速度や主観画質の保証ではありません。詳細は[Timeline Video Experimental](docs/TIMELINE_VIDEO_EXPERIMENTAL.md)を参照してください。
|
||||
|
||||
|
||||
> **V3.8X2**はpackage metadata `3.8.3`の製品名・Workflow名です。現在の`main`には3.8.3以降のLoader保存・復元修正が入り、公式WorkflowはCore Load AudioとCore Load Video → H3 Continuum Video Adapterを使用します。旧Continuum Audio/Video Loader IDは保存Workflow互換用として残します。Reference Images 4~9と内蔵Decode Cache Helperを含み、Timeline Videoは`main`上のExperimental機能です。旧V3.8.0は[`v3.8.0`タグ](https://github.com/ukr8b3g-cmyk/ComfyUI-H3-Continuum/tree/v3.8.0)から導入できます。
|
||||
> **V3.8X2**はpackage `3.8.3`の製品名・Workflow名です。V3.8 Production Samplerを維持し、任意のReference Image 4~9と内蔵Decode Cache Helperを追加しています。旧V3.8.0は[`v3.8.0`タグ](https://github.com/ukr8b3g-cmyk/ComfyUI-H3-Continuum/tree/v3.8.0)から導入できます。
|
||||
|
||||
## V3.8X2 公式Workflow
|
||||
|
||||
- **標準名:** [JSON](examples/workflows/MiniMax_H3_Continuum_V38X2.json)/[ZIP](examples/workflows/MiniMax_H3_Continuum_V38X2.zip)
|
||||
- **Helper明示名:** [JSON](examples/workflows/MiniMax_H3_Continuum_V38X2+Decode_Cache_Helper.json)/[ZIP](examples/workflows/MiniMax_H3_Continuum_V38X2+Decode_Cache_Helper.zip)
|
||||
|
||||
2つの名称は**同じ公式graph**を収録した配布上の別名で、異なる設定のWorkflowではありません。どちらも内蔵Decode Cache Helperと9枚Reference Image用の接続を含み、Helperの保存値は`Auto / RAM 256MB / Disk 8GB / reset_token 0`です。各ZIPには、対応する名前のJSONだけを収録します。既存projectでは従来のV3.8X Workflowも引き続き使用できます。
|
||||
V3.8X2の2つのJSON名は**同じ公式graph**を収録した配布上の別名で、異なる設定のWorkflowではありません。どちらも内蔵Decode Cache Helperと9枚Reference Image用の接続を含み、Helperの保存値は`Auto / RAM 256MB / Disk 8GB / reset_token 0`です。標準名のV3.8X2 ZIPには別のV3.9 JSONも同梱し、Helper明示名ZIPは対応するV3.8X2 JSONだけを収録します。既存projectでは従来のV3.8X Workflowも引き続き使用できます。
|
||||
|
||||
## Reference Image 9枚使用時のメモリ注意
|
||||
|
||||
@@ -70,7 +108,7 @@ Reference Image 1~3はSamplerへ直接接続し、任意の4~9は`H3 Continu
|
||||
|
||||
キャッシュはPythonプロセス内の利用に限られ、再起動後は再利用しません。上限による退避・破棄やVAE識別情報の変化でもMISSになります。モード、RAM/Disk予算、`reset_token`を変更すると、この実装ではHelperキャッシュをクリアします。`reset_token = 0`を維持することは、毎回リセットする意味ではありません。
|
||||
|
||||
`H3DecodeCacheHelper`をContinuumパッケージ内に収録し、UI上は`MiniMax H3/Continuum/Helpers`の独立公開ノードとして残します。インストール対象はContinuumだけです。現行パッケージはVideo Adapterと互換用旧Audio/Video Loaderを含む計10 IDを登録します。Sampler、Finalize、Assembly Plan、Core Decode、既存Sampler widget/socketの先頭契約は変更せず、Timeline Videoのmode widgetだけをoptional末尾へ追加します。
|
||||
`H3DecodeCacheHelper`をContinuumパッケージ内に収録し、UI上は`MiniMax H3/Continuum/Helpers`の独立公開ノードとして残します。インストール対象はContinuumだけです。V3.8X2の公開IDは、旧互換Loader 2件を含め計10件です。V3.9は別IDのSamplerとReference Imagesヘルパーを追加して計12件です。V3.8 Sampler、Finalize、Assembly Plan、Core Decode、保存済みwidget/socket契約は変更しません。
|
||||
|
||||
Samplerの`video_latents`/`audio_latents`と同じVideo/Audio VAEをHelperへ接続し、Helperの`images`/`audio`をFinalizeへ接続します。Samplerの`assembly_plan`はFinalizeへ直接接続したままです。[公式V3.8X2 Workflow](examples/workflows/MiniMax_H3_Continuum_V38X2.json)は保存済みgraphと設定を維持します。このgraphにはCore VAE Decodeノードがないため、Core直結へ戻すにはCore Video/Audio Decodeを追加してFinalizeへ再配線するか、旧V3.8XのCore直結graphを開いてください。Helperを単に削除しても自動では戻りません。
|
||||
|
||||
@@ -107,7 +145,7 @@ git clone --branch v3.8.0 --single-branch https://github.com/ukr8b3g-cmyk/ComfyU
|
||||
|
||||
Continuumのcheckoutは同時に1つだけ有効にしてください。ComfyUI Managerの**Update**は`main`を更新するため、過去tagの選択には使いません。
|
||||
|
||||
V3.8X2 Workflow:[JSON](examples/workflows/MiniMax_H3_Continuum_V38X2.json)/[同じJSONを含むZIP](examples/workflows/MiniMax_H3_Continuum_V38X2.zip)。Spectrum対応の1本で、保存状態ではSpectrumとTurbo LoRAはどちらもOFFです。[LightX2V Turbo](https://github.com/ModelTC/Minimax-H3-Turbo)にも切り替えられます。完全なgraphを開くにはSpectrum・rgthree・KJNodesが必要です。ComfyUI-Easy-Useは不要です。
|
||||
V3.8X2 Workflow:[JSON](examples/workflows/MiniMax_H3_Continuum_V38X2.json)/[V3.8X2・V3.9両JSONを含むZIP](examples/workflows/MiniMax_H3_Continuum_V38X2.zip)。V3.8X2 JSONはSpectrum対応の1本で、保存状態ではSpectrumとTurbo LoRAはどちらもOFFです。[LightX2V Turbo](https://github.com/ModelTC/Minimax-H3-Turbo)にも切り替えられます。完全なgraphを開くにはSpectrum・rgthree・KJNodesが必要です。ComfyUI-Easy-Useは不要です。
|
||||
|
||||
## プロンプト・スキルのダウンロード
|
||||
|
||||
@@ -121,14 +159,13 @@ V3.8X2 Workflow:[JSON](examples/workflows/MiniMax_H3_Continuum_V38X2.json)/[
|
||||
|
||||
H3 Continuumは、長尺映像を最初からやり直さずに生成・確認・部分再生成・再開するProduction Samplerです。V3.8は`Main / Production`と`Advanced`の2層に整理しました。
|
||||
|
||||
現行V3.8X2で検索可能なノードIDは次の10個です。旧Audio/Video Loaderは保存Workflow互換用で、新規WorkflowはCore LoaderとVideo Adapterを使います。
|
||||
以下の9ノードに`H3 Continuum Video Adapter`を加えた計10 IDがV3.8X2の登録面です。旧Audio/Video Loaderは互換IDとして残ります。V3.9はさらにSampler V3.9とReference Images V3.9を追加した計12 IDです。
|
||||
|
||||
- `H3 Continuum Sampler V3.8`
|
||||
- `H3 Continuum Finalize`
|
||||
- `H3 Continuum Load Image`
|
||||
- `H3 Continuum Load Audio`
|
||||
- `H3 Continuum Load Video`
|
||||
- `H3 Continuum Video Adapter`
|
||||
- `H3 Continuum Second Pass`
|
||||
- `H3 Continuum Reference Audios`
|
||||
- `H3 Continuum Reference Images`
|
||||
@@ -142,18 +179,12 @@ V3.8X2公式Workflowの標準経路は`Sampler V3.8 -> Decode Cache Helper -> Fi
|
||||
|
||||
`H3 Continuum Reference Audios`は、最大3本の単独Reference Audioを1本の`Audio References (Optional)` socketへまとめます。入力は間を空けずに接続し、Promptでは接続順どおりに`<Audio 1>`、`<Audio 2>`、`<Audio 3>`を使用します。共通のCore Audio VAEで各Audioを個別encodeします。生成後の最終Audioを置換せず、Driving Audio契約も変更しません。既存Workflowは従来の単数`Reference Audio (Optional)`をそのまま使用できますが、単数経路とbundle経路は同時接続しないでください。
|
||||
|
||||
> **対応範囲:** 元のV3.8 launch surfaceは7ノードでした。現行V3.8X2はReference Images、Decode Cache Helper、Video Adapterを追加し、互換用旧Audio/Video Loaderを含む計10 IDです。Finalizeの`H3ContinuumAssembleSeamV35`、Second Passの`H3ContinuumSecondPassV35`などは旧IDを維持しますが、すべての旧Workflowに互換性があるという意味ではありません。未対応のnode IDには対応するhistorical Release/tagを使用してください。詳細は[V3.8 Release/Migration Policy](docs/V38_RELEASE_AND_MIGRATION.md)を参照してください。
|
||||
> **対応範囲:** 元のV3.8公開面は7 ID、V3.8X2は互換Loaderを含め10 ID、V3.9は12 IDです。Finalizeの`H3ContinuumAssembleSeamV35`、Second Passの`H3ContinuumSecondPassV35`などは旧IDを維持しますが、すべての旧Workflowに互換性があるという意味ではありません。未対応のnode IDには対応するhistorical Release/tagを使用してください。詳細は[V3.8 Release/Migration Policy](docs/V38_RELEASE_AND_MIGRATION.md)を参照してください。
|
||||
|
||||
複雑な16GB GPU受入Gateでは約`15.5~15.6 GiB`を使用しました。GPU、driver、backend、model精度、解像度、接続ノードで変動するため、すべての16GB GPUでの動作保証ではありません。
|
||||
|
||||
Reference Imageは最大9枚です。Samplerの直入力1~3を維持し、追加4~9は`H3 Continuum Reference Images`のoptional IMAGE入力へ接続して、出力をSamplerの`Reference Images (Optional)`へ渡します。補助ノードは画像を束ねるだけで、Resize・hash・VAE Encodeは既存Sampler経路で実行します。未接続を除き1→9の順に使い、Picture番号はFirst/Last Imageの後に連番で割り当てます。空のbundleは参照なしとなり、旧0~3枚の生成・再利用契約は変わりません。
|
||||
|
||||
### Timeline Video Frames/Video Reference Mode
|
||||
|
||||
Core `Load Video`を`H3 Continuum Video Adapter`へ接続し、Adapterの`images`をSamplerの`Timeline Video Frames`へ接続します。Adapterの初期値`Force Rate = 24`が入力契約に一致します。元動画Audioもガイド兼最終Audioとして使う場合だけ、Adapterの`audio`を`Driving Audio`へ接続します。
|
||||
|
||||
`Video Reference Mode`はTimeline Video Frames接続中だけ表示します。初期値`Repeat Reference`は従来互換、`Follow Timeline`は実際に出力へ追加されるphysical visible framesに合わせて参照区間を進めます。Review、Resume、Terminal Mergeでも同じphysical group契約を使います。チャンクごとの秒数を変える機能ではなく、全チャンクは従来どおりSamplerの共通`Seconds per Chunk`を使います。詳細は[Experimental仕様と制限](docs/TIMELINE_VIDEO_EXPERIMENTAL.md)を参照してください。
|
||||
|
||||
以前の4・5直入力を含む保存Workflowは、グラフ読み込み後に元の画像接続をbundleへ移します。新接続を検証した後だけ旧接続口を削除し、接続元が不明・移行先が使用中の場合は警告して元の線を残します。旧API入力も維持しますが、同じ番号の画像を旧直入力とbundleの両方から指定すると入力競合として明示します。既存の3枚loaderテンプレートは上書きせず、そのまま利用できます。
|
||||
|
||||
### サイズの決め方を直接選択
|
||||
@@ -170,7 +201,7 @@ Mainの`Size Source`は次の2択です。
|
||||
- `First Image`:接続したFirst Imageの縦横比を維持し、Presetの目標面積から最終Width/Heightを算出します。
|
||||
- `Manual`:Width/Heightを32 pixel単位で直接指定します。この場合、Presetは適用しません。
|
||||
|
||||
MainのWidth/Heightは`Manual`のときだけ表示・編集できます。`First Image`ではResolutionを表示し、画像の縦横比からサイズを決めます。有効なFirst ImageがSamplerへ届かない場合は、保持しているManual Width/Heightへフォールバックし、その寸法をStatusへ表示します。手動寸法を確認・変更する場合は`Size Source = Manual`を選びます。Reference ImageやTimeline Video Framesからサイズを暗黙取得することはありません。
|
||||
MainのWidth/Heightは`Manual`のときだけ表示・編集できます。`First Image`ではResolutionを表示し、画像の縦横比からサイズを決めます。有効なFirst ImageがSamplerへ届かない場合は、保持しているManual Width/Heightへフォールバックし、その寸法をStatusへ表示します。手動寸法を確認・変更する場合は`Size Source = Manual`を選びます。Reference ImageやVideo Guideからサイズを暗黙取得することはありません。
|
||||
|
||||
旧V3.8の`Auto / Landscape / Portrait / Square`はWorkflow/API互換用として内部で受け付けます。FrontendはAutoをFirst Imageへ、3つの固定Aspectを同じ解決結果のManual Width/Heightへ移行します。
|
||||
|
||||
@@ -332,7 +363,7 @@ Prompt/CLIPの数値はconditioning区間だけで、総生成時間ではあり
|
||||
|
||||
RTX 5060 Ti 16 GB/RAM 64 GBの検証環境で測定したSage-only Production baselineは、576×576 T2VA 1×5秒が168.069秒、640×640 FL2VA Long Terminal Merge 3×5秒が379.765秒です。環境・設定固有の測定値であり、すべての環境に対する速度保証ではありません。Samplingが最大コストで、Continuum Assemble + Seamは1%未満でした。
|
||||
|
||||
**V3.8.0はhistorical release baselineです。現在の公開対象はV3.8X2/package 3.8.3です。** V3.8X2が内部利用する旧module/classはsourceへ維持します。exportするのは現在の公開10ノードだけで、その一部は互換用の旧IDです。それ以外のIDを必要とする旧保存Workflowは、対応するhistorical Release/tagを使用してください。Still Image Guideは引き続きExperimentalです。
|
||||
**V3.8.0はhistorical release baselineです。V3.8X2はpackage 3.8.3の別Workflowとして維持し、V3.9.0はmainの現行ソースです。** V3.8X2が内部利用する旧module/classはsourceへ維持します。現在の登録面はV3.8X2の10 IDとV3.9追加の2 IDです。一部は旧IDを維持しますが、それ以外のIDを必要とする旧保存Workflowは対応するhistorical Release/tagを使用してください。Still Image Guideは引き続きExperimentalです。
|
||||
|
||||
## V3.5.1 Reference Audio/互換性更新
|
||||
|
||||
@@ -453,11 +484,12 @@ Hi-Res Fixを接続しなければV3.4 Sampling経路は変わりません。強
|
||||
|
||||
## 公開テンプレートワークフロー
|
||||
|
||||
- [V3.8X2 Workflow JSON](examples/workflows/MiniMax_H3_Continuum_V38X2.json) — 現行公式graph。Spectrumは初期状態でOFF
|
||||
- [V3.8X2 Workflow ZIP](examples/workflows/MiniMax_H3_Continuum_V38X2.zip) — 対応する同名JSONだけを格納。カスタムノードのインストーラーではありません
|
||||
- [V3.9 Workflow JSON](examples/workflows/MiniMax_H3_Continuum_V39.json)/[単独ZIP](examples/workflows/MiniMax_H3_Continuum_V39.zip) — 現行V3.9 graph。ZIPにはこのJSONだけを収録
|
||||
- [V3.8X2 Workflow JSON](examples/workflows/MiniMax_H3_Continuum_V38X2.json) — 併存する旧系公式graph。Spectrumは初期状態でOFF
|
||||
- [V3.8X2 Workflow ZIP](examples/workflows/MiniMax_H3_Continuum_V38X2.zip) — V3.8X2とV3.9の両JSONを格納。カスタムノードのインストーラーではありません
|
||||
- [V3.8X2 Helper明示名JSON](examples/workflows/MiniMax_H3_Continuum_V38X2+Decode_Cache_Helper.json)/[ZIP](examples/workflows/MiniMax_H3_Continuum_V38X2+Decode_Cache_Helper.zip) — 同じgraphを説明的な配布名で収録
|
||||
|
||||
Registry配布予定の対象もこのJSONとZIPです。依存なしのテンプレートではなく、Spectrum・rgthree・KJNodesが必要です。ComfyUI-Easy-Useは不要です。Turboへ切り替えてもgraph内の外部ノードは残ります。SpectrumをOFFにし、用途に合うLightX2V Turbo LoRAを1本だけONにしてsampler/Stepsを合わせます。保存状態はSpectrum OFF、Turbo LoRA OFF、res_multistep/simple/20 Stepsです。
|
||||
Registry配布予定の対象はV3.9とV3.8X2のJSON/ZIPです。依存なしのテンプレートではなく、Spectrum・rgthree・KJNodesが必要です。ComfyUI-Easy-Useは不要です。Turboへ切り替えてもgraph内の外部ノードは残ります。SpectrumをOFFにし、用途に合うLightX2V Turbo LoRAを1本だけONにしてsampler/Stepsを合わせます。保存状態はSpectrum OFF、Turbo LoRA OFF、res_multistep/simple/20 Stepsです。
|
||||
|
||||
配布元のprompt、画像・音声名、ノード表示名、設定は変更していません。手元にあるファイルを選び、不要な入力をOFFにし、promptを入力してください。モデルやメディアは同梱しません。`Save 3x5s Video`などの保存済み表示名は生成時間を決めません。実際の長さはSamplerのChunksとSeconds per Chunkで決まります。
|
||||
|
||||
@@ -465,7 +497,7 @@ Registry配布予定の対象もこのJSONとZIPです。依存なしのテン
|
||||
|
||||
## V3.4互換
|
||||
|
||||
V3.4の実装moduleは内部継承とhistorical testのためsourceへ保持しています。V3.8X2からexportするのは現在の公開10ノードに含まれるIDだけです。それ以外のIDを必要とするV3.4保存Workflowは、対応するhistorical packageを使用してください。
|
||||
V3.4の実装moduleは内部継承とhistorical testのためsourceへ保持しています。現行の登録面は上記12 IDに限定します。それ以外のIDを必要とするV3.4保存Workflowは、対応するhistorical packageを使用してください。
|
||||
|
||||
## V3.4.0 Stable
|
||||
|
||||
@@ -554,22 +586,6 @@ outputs: images / audio / result
|
||||
|
||||
当時のV2.1.7では、旧`H3ContinuumSamplerV2`をLegacy/Coreノードとして登録し、既存WorkflowのノードID、入力順、出力順を維持していました。これはV3.8の公開範囲を示す説明ではありません。このIDを使う旧Workflowは対応するhistorical Release/tagで開いてください。
|
||||
|
||||
## Timeline Promptの注意
|
||||
|
||||
`Prompt Format = Timeline`では、`[0-5s]`のようなtime-range headerを必ず単独行に置き、prompt本文は次の行から記述してください。
|
||||
|
||||
```text
|
||||
[0-5s]
|
||||
最初の5秒の動作を記述します。
|
||||
|
||||
[5-10s]
|
||||
次の5秒の動作を記述します。
|
||||
```
|
||||
|
||||
`[0-5s] prompt text`のように同じ行へ本文を書く形式はTimeline headerとして認識されません。`Prompt Format = Auto`ではFixedとして判定されます。`Prompt Format = Timeline`を明示した場合でも、現行実装はTimeline parse errorで生成を停止せず、diagnostic `H3C-P100`を出してFixedへfail-openします。この場合、入力全体が各Chunkで再利用されるため、同じactionが繰り返されるように見えることがあります。
|
||||
|
||||
また、Timeline自体が正しくparseされても、あるChunkの時間範囲が未指定の場合は`H3C-P101`を出し、直前のpromptを再利用します。先頭側にgapがある場合は最初の有効sectionを使います。意図しないaction反復を避けるため、全Chunkの時間範囲を明示してください。
|
||||
|
||||
## Continuity
|
||||
|
||||
- `Auto — conservative`
|
||||
@@ -593,21 +609,19 @@ UNET -> SageAttention -> Sol-Attn -> LoRA -> Spectrum -> H3 Continuum Sampler
|
||||
|
||||
## インストール
|
||||
|
||||
`pyproject.toml`では`requires-comfyui >=0.32.0`を宣言しています。現在このプロジェクトで実生成まで検証済みの基準はComfyUI `0.34.2`です。現行V3.8X2についてREADMEに記録されているlive runtime受入証拠は`0.34.2`であり、`0.32.x`ではありません。新しいCoreについてはIssue #24のseam regressionを調査中です。したがって`0.34.2`は現在の検証基準であり、最低インストールversionや、すべての新しいCoreで同一挙動を保証する意味ではありません。以下の歴史的な受入記録には旧ComfyUI版も登場します。
|
||||
V3.8はComfyUI 0.34.2で検証しています。以下の歴史的な受入記録には旧ComfyUI版も登場しますが、現在のインストール目標ではありません。V3.8の依存を満たす限り、ComfyUIの最新版は必須ではありません。
|
||||
|
||||
ZIPを展開して、`ComfyUI-H3-Continuum`フォルダーを`ComfyUI/custom_nodes/`へ置き、ComfyUIを再起動します。
|
||||
|
||||
再起動後は`H3 Continuum Sampler V3.8`を検索してください。V3.8X2の検索面は上記10ノードです。
|
||||
再起動後はV3.8X2 Workflowで`H3 Continuum Sampler V3.8`、V3.9 Workflowで`H3 Continuum Sampler V3.9`と`H3 Continuum Reference Images V3.9`を確認してください。現行の登録面は計12 IDです。
|
||||
|
||||
旧`ComfyUI-H3-Continuum-Join`が残っている場合は同時ロードを避けるため削除または退避してください。同梱`install_windows.bat`は旧名・新名の既存フォルダーを日時付きでバックアップします。
|
||||
|
||||
## 検査
|
||||
|
||||
現在のV3.8X2 Public Surface suiteは、正確な10 ID export、変更していない公式Workflow 2名称と各ZIP内JSONの同一性、別名のExperimental Follow/Repeat Workflow、外部依存、Registry除外、既存V3.8 widget/socket先頭契約と末尾追加mode、`Show Advanced Settings`/`Hide Advanced Settings`による表示切替を確認します。Registry配布対象のハッシュは`REGISTRY_MANIFEST.sha256`、source側の整合性は`MANIFEST.sha256`で管理します。
|
||||
Public Surface suiteはV3.8X2の10 IDとV3.9を含む計12 ID、公式Workflowと各ZIP内JSONの同一性、外部依存、Registry除外、既存V3.8 widget/socket順、`Show Advanced Settings`/`Hide Advanced Settings`による表示切替を確認します。Registry配布対象のハッシュは`REGISTRY_MANIFEST.sha256`、source側の整合性は`MANIFEST.sha256`で管理します。
|
||||
|
||||
**現在の`main` HEAD CPU/CI証拠(`88363ccd`):** GitHub Actions run `35811479080`はPython 3.11で成功し、**1,429 passed / 3 skipped / 0 failed**でした。
|
||||
|
||||
**直近のbrowser/GPU受入:** Timeline Video統合時のGateではFull CPU **1,424 passed / 1 skipped / 0 failed**、ブラウザ保存・再読込、Follow/Repeatの`2 × 5秒` GPU functional runがPASSしました。両方とも704×416、24fps、240フレーム、映像10秒、32kHz stereo音声10秒で完走し、OOM/NaN/allocation failure/crashはありません。ただし、これらのbrowser/GPU結果は現在のPackedLayout HEADより前のものであり、`88363ccd`を新たにGPU検証した結果としては扱いません。従来のReview Functional Gateでは`3 × 5秒`を実行し、Q1~Q3はphysical groupを1つずつ生成、Q4は`3 reused / 0 generated`で全3 groupを再利用し、Q3とQ4の復号後RGB/PCM SHA-256が一致しました。9枚Reference Imageの別Gateは下記に記録しています。これは機能実行、prefix再利用、AV再構築、mode分離、テストした9枚経路の確認であり、画像・音声の総合的な主観品質評価ではありません。
|
||||
**過去のV3.8X2準備証拠:** Full CPU suiteは**1,367 passed / 1 skipped / 0 failed**です。従来の最終GPU Functional Gateでは`3 × 5秒`のReview Each Chunkを実行し、Q1~Q3はphysical groupを1つずつ生成、Q4は`3 reused / 0 generated`で3 groupすべてを再利用しました。Q3とQ4の復号後RGBおよびPCM SHA-256は一致しています。9枚Reference Imageの別Gateは下記に記録しています。これは実行、prefix再利用、AV再構築、テストした9枚経路の確認であり、画像・音声の総合的な主観品質評価ではありません。
|
||||
|
||||
### 9枚Reference Image入力Gate(0.3 MP参照画像)
|
||||
|
||||
|
||||
+39
-25
@@ -1,7 +1,7 @@
|
||||
dca65fb1393e67f59c6f81f9411e3e745eb8f1097e9a2adf7ffc6f4e3901ca9f __init__.py
|
||||
bb6f7d1227f7c0cc4e134ccc0e037c8c4fe4af63d8c990ac00b7af2279695871 .comfyignore
|
||||
32a0b0b45442edb97fe151faaa1a03a84bc4ee63b4a2ab6066a80c9f50629f1b .comfyignore
|
||||
3e7a1ec3380be2a222c8a3e9b8a6bb184d3a760478957f48186438f15235bdba branch_provenance.py
|
||||
ad340adc9506ab069a83f586d954fbd19f44df4e18a5346d5a8923a489d3cb85 CHANGELOG.md
|
||||
593ec5bafb8e506cc7b326bdc7e3f024a142569f24f8d39c1aaa3b5acfd0beca CHANGELOG.md
|
||||
c1ed3a0342730450958fb62fd21854a876991f3a4aefb24e5383b0c73cd2312d compatibility.py
|
||||
4d62508f900af9f93ec320afb900c27cc9a300d1e0c0a94714258498c5ede5fc conditioning.py
|
||||
294251c40b1be2e296c5e5f627b68091d087bdb39179e3a0c3cebd2ee8a344f5 constants.py
|
||||
@@ -13,35 +13,35 @@ cf255b8a635471229aebadc926acfdcacb65963adbcb9e0f9505d04eada2c6b5 continuation.p
|
||||
8b79ad007488a085284c401f8c1bb99ca6ee58cf736ec9c029548220e2d8adb9 decode_cache/store.py
|
||||
b30fe4640359bebfcdeeb94dbeec94cb346c8e3646509e1dcdb87d7021ba04ff docs/N2B_BRANCH_PROVENANCE_CONTRACT_V1.md
|
||||
717577efdec5e61600504b77bc2a099ef022c4fe2333e936c3310c7182d8f2a0 docs/V38_OPEN_INTEGRATION_CONTRACT.md
|
||||
b08159178c999c4c97df6aed67c6cf48b5032548a1d370dc4a0cf7e293ab8031 docs/V38_RELEASE_AND_MIGRATION.md
|
||||
3496636f645b39336fd95a4f21a562810c56f8e1d92fa6eeb1e4b0786ad11b37 docs/V38_RELEASE_AND_MIGRATION.md
|
||||
cedd7b07901d6065079ef37380f0062d535a39c98c8f614e1b26582f549d7183 driving_audio.py
|
||||
1b2212b7511fac0b63dfa6e9f006cd8644c72d08c6945ab0e4ed0e722c97a730 examples/workflows/MiniMax_H3_Continuum_V38X2.json
|
||||
8f839a955859bffa0d9cf0b15e91ee484dd911aca5ae31f1787debd56afdc7da examples/workflows/MiniMax_H3_Continuum_V38X2.zip
|
||||
f3d8dd0f0872afdd97fe24e58b5cb74190d03e3583a66a5d013fee41f6894cda examples/workflows/MiniMax_H3_Continuum_V38X2.zip
|
||||
1b2212b7511fac0b63dfa6e9f006cd8644c72d08c6945ab0e4ed0e722c97a730 examples/workflows/MiniMax_H3_Continuum_V38X2+Decode_Cache_Helper.json
|
||||
4fa8680037595f55f97715f9a2f63d28f11328a87f5c33c316cc4b0ae817e668 examples/workflows/MiniMax_H3_Continuum_V38X2+Decode_Cache_Helper.zip
|
||||
7861fac4c8fe82372c5459aa574d35ea003bdb4fd846d567bd891c2e38571b3d graph_contract.py
|
||||
bf0556b076dbaca67c3405a7d86c333ca7fdf3d4381529b0a9edc906519943e9 guide_timeline.py
|
||||
1473c384082700f422f2cf9141e0d012d87d2b43ac8a8a433edc7172e6ca7bf6 hardening.py
|
||||
de0da5590691554cbf7f6318ac539a160e639bc3e20ee0752ae189dc31e979ce INSTALL_JA.txt
|
||||
9fca2d9c04be387160dee84e5ee9ce538cb910e79e356b9236e6d2240ea6d4ee INSTALL_JA.txt
|
||||
23bddc5a41d2e997f4fbf789c7128e32f4f197f1405b2aef1c76794f57482446 install_windows.bat
|
||||
12bf572a65d57bbc9a72b459f29691c2057768f4fb7a74f9db87f4775e995bda install_windows.ps1
|
||||
83b9d5cda57079fbf8e4691893c1733e5afc08b13a70f12762aef1b912dd309a layout_adapter.py
|
||||
139546ec1ff459945aa89b50f74b5ee69f62a0e07bbddfcae06936091a409a83 layout_adapter.py
|
||||
c44abbd789091bbead01250dbd5453e60539d2665c69f162335fdbd2936019c2 LICENSE
|
||||
d3e213005670e94dee33a240349a4d245cf9a3b6602099f11ed30cf5a32e2c21 media.py
|
||||
1970342c93f0189ade437cbfc278900713f043882933789cb8c54f35cf2ec96b metadata.ini
|
||||
8ce5a7c255088fb6038925a93b71b87972bf2f02e450af86da5c317e95506c41 metadata.ini
|
||||
d7e613e2cc24110213b477bdd1d390234a41f2af3b1ed006a809066d71d658eb model_patch.py
|
||||
e2b72149b0433e95c13659cc9e742fe38523e67d4f4a2fdb08aed1943fecf653 nodes.py
|
||||
2b8c19f9474beabfebe1802cdf4a89780dce3c351c48d65e1ce8bb77d2fb9ba9 PACKAGE_INFO_JA.txt
|
||||
4852ad216f85c22f008abe18464eab2c913bd88baa7db35764df2de9cf401d6d PACKAGE_VALIDATION.txt
|
||||
ecb65a5dbf9e1683c5a3cadd82daaea3a90a2b776f6ebabfbe8b07aa93177422 nodes.py
|
||||
99405e4357a143b0f5d0b374c9c0d2089435a7055bea2f3d1216dbbad25e4339 PACKAGE_INFO_JA.txt
|
||||
ea64b8e0aa0dda828047c9c12818be8554429774049b9e8c0482c84b9c4f4071 PACKAGE_VALIDATION.txt
|
||||
b470819f16fc179654dc1600721a63f0a5a14e777f4c004d574b499da6886ba5 public_api.py
|
||||
15a3925218e0c5f968795d7d11e4783c3c6868917447274bc700328851b3fbfb pyproject.toml
|
||||
6f108a67967dd686011bf031b8176373f6ab80635f7e01e3e935e8585b804fc9 README_JA.md
|
||||
77cdaadd32f9d722f6b05abc196cbdb9dded32387493664620a30fa405429743 README.md
|
||||
667f2646e82362d472d91a7cf5dc9a86c95f6637f3bc8c672dd516800b1a598c pyproject.toml
|
||||
a6927e8ecbbf3997317c918a200a815f84de2bef8ba5fe863fa9589c07fcfa7c README_JA.md
|
||||
7a2269cad66c13ef335c9905b0e8cabf09c0e1685ffab574c07386f0e01c33a3 README.md
|
||||
44127adcfa30ee84bff9cd4b2d0c695355209550e76982d374122008728aa5bc reference_audio.py
|
||||
5cb9bfd6810d3a93a637451980a4cc5c1436e5b84cfd1c7a111cd192e876351b reference_video.py
|
||||
c7b14ed6f8cfc2a1f0a21db4fe56fba75a93ffcb0be0c22bbd2e691c45cd0e2d reference.py
|
||||
caa572ea65dafc86850db99f52433d360ac9c4ab36b854292a3dccd5ba32dc76 reference.py
|
||||
467edb2c188d024c2392aafe7423b3f835e16b10f570da76e2f7dda8a962c1c5 requirements.txt
|
||||
8bfa113a2ec11325619be300b4d2b53a157b1d2c1ef7855057a4b3bbd05aeef3 run_storage.py
|
||||
53827c94b3f588f35bb8eacb404e1bd5e233d25f4ee0fdd286efc7d8ddb52b6f run_storage.py
|
||||
6056de6c0a5322a8a51ba5a114538dca2ef67788cd1afba10fedd483b95f6afa state_io.py
|
||||
3a359a0467725cc292ccb4c86cf0c3d30bb6a114d01f5345792b09ea3d45441d state.py
|
||||
43ec4023dc06c941e5d7a04db4b8a89fb58d744ceb986f6eb9bf534d4fdcb87b temporal.py
|
||||
@@ -49,20 +49,20 @@ c7b14ed6f8cfc2a1f0a21db4fe56fba75a93ffcb0be0c22bbd2e691c45cd0e2d reference.py
|
||||
f218e1a93c42467c6057c5c1d04d57cc82f6331b97ec9257e4e2dfb9c831876a timeline_video.py
|
||||
0bc369ee428b8a5bc8e370a81fbab427262a1fdb7805a78c442c91698d65efba tools/__init__.py
|
||||
e5a84569953ee63b9625f4f2e3195ec368204fddcfc746564cfbd0e8449bb8e9 tools/p20_file_backed_tensor_poc.py
|
||||
deeae570772c1a32dbb356aa30c8ef473b9334a0a36b71c0cccba12203f76415 tools/verify_runtime.py
|
||||
aab887698f4767722c833b9e55d605f9597ab0d823e32e8c5416f26a210cab1d tools/verify_runtime.py
|
||||
ffd61f3f31c9b6430e1169007ee906c8f5000eba63ee44e2976ad4f5f1112671 v2/__init__.py
|
||||
2003902c87bba09cfa143f5a9e4248f3a78c0fb544449a75fd40ba2cacb35655 v2/context_diagnostics.py
|
||||
cde27db19b677e318cc4dfb4235be7a11429c19945f4083052a91fe117e74c82 v2/decoder.py
|
||||
31012ec48a64c7467ad869c79982b7f8502c1785c33f51ee1b5727ce8b4243fb v2/diagnostics.py
|
||||
2ebff4502381f675d06bba4b127b81bc3201e7579ddcd46fa5051cbdf3facd55 v2/h3_builder.py
|
||||
fed4bc3cbff47bd0b16b6e99385680dc2253c745f30b7f686afafbb25f77efb1 v2/motion.py
|
||||
aefa29b9d51a05f9a972d75404fd786300202251887e67f55530e97ccd9519f5 v2/nodes.py
|
||||
de47a847ba27390df542086735a926d2812d77ad05b21ccc2e67633d4ffd11b0 v2/nodes.py
|
||||
dc2b901789e4b024dbcbc4024c63eb8cbc564d77003ce8c35c0584851ba6dfbd v2/prompts.py
|
||||
4080f1875b958b316e8e76852c4be5527a6de5c71d604e7642d3098478eb4a36 v2/sampling.py
|
||||
2fd811794c4cc0f2ce050250b80484876454926b9f20fce6af3a97d728e5acdf v2/seam_guard.py
|
||||
be0d8585fa57e0ccd6d02577bbc7299629e5bfe20e186747f571fccc98b67d7e v2/seam_types.py
|
||||
12cfcc0c71ca087fe39a5ce2922959a62b2bb311bfe664f05c4480affce03708 v2/seeds.py
|
||||
fe7df9efea15b157c158046f64328b3dce3cfbd35cf180573ce4ec771ddcea8c v2/sequence.py
|
||||
c218c9c361079ff9ddae1401618924f9f563ed03e576792c5ee57c72278acd4f v2/sequence.py
|
||||
13213e7709fd02bb810af3c18e4cd7d010f8cdfb121a4b99866a9f2333331089 v2/session_io.py
|
||||
3ea23dbce6fcd217b6e81235855479b9b16fed7a21693cf156f9014555c4fe13 v2/session.py
|
||||
78c830cdf49034c6e3b2cd3da5914d5cfc5638eb63ec6dbd1bab13c50d6d4caf v3/__init__.py
|
||||
@@ -70,7 +70,7 @@ ea2922567df90436dd6fa21696833a49dd0cbfeee142a5fedc3a7c303824d473 v3/adaptive_co
|
||||
b3dc61503d35d9ef0a0dc7fed1c9b2fdc00fcb2072d4e39f64ae0826f9ec7dca v3/assembly_v35.py
|
||||
7815230e0a9540bc2edeaf818e940b7a1fdd817fd217ba8a4f9cb21aaf6a308e v3/assembly.py
|
||||
3f62fdb35e804f42d7cbf0828b4e87e69a2b99246c3f7467fe4fa698f1d803c9 v3/conditioning_bridge_nodes.py
|
||||
82238eff890574fcf977dc3d2bc092287f63710a47bfc0f6692c272814dbd295 v3/driving_nodes.py
|
||||
e3a6f537a8709c7d05e4df95f1ff40c9129e7845e9ea23097d64953b4770e06d v3/driving_nodes.py
|
||||
147a1d3fc5e09b323a4c3d13d30e432410389bae52b58330462375b9f307b791 v3/easy_audio_nodes.py
|
||||
64b3e54b42e5156642f9957ccc374fd190d9fc7145637984e702534fb1bf80b4 v3/easy_image_nodes.py
|
||||
ac859cb1a6e23b8ceae300d818c24fe1346b649a0d663017a9b3ac64aa96fca3 v3/easy_nodes.py
|
||||
@@ -82,15 +82,19 @@ cb53e1b104415032ec79b7e7aa1c99848e63da3eedaa251eeba102970e4172b5 v3/hires_fix_n
|
||||
5b8a54e67a608e757a505abc712effb33312636e3bb235835a485a506e80eeee v3/masked_continuation.py
|
||||
91a868d2e392b018b01d0396209849c146b0d560ceb109fcdd87dea7f3d786aa v3/memory_action_policy.py
|
||||
85477badd85281cfb77582fdd5b34228a9f6b68376f1b7743af2ca7d4b55aa36 v3/memory_attribution.py
|
||||
2a03bfd7dae9856c0f4be77130f318b95f8c2f2130a0c9122479bcdef70bb7ec v3/node_facade.py
|
||||
185e15373609d810f1ac57b46a823d44c6e098386f18c65b39dfa06afe9ea893 v3/nodes.py
|
||||
4a48f74584d8ba3187e1accc31ae5acd3a2ffb9a491bb4f5ca43322db418e770 v3/node_facade.py
|
||||
7fe71802319ad7659c90839f960238d0fd054662af31a4d320806c426e755ecb v3/nodes.py
|
||||
a3411c7a295308d21623551cf4aeca5bef511eb5f063f31ac84032e3bdf4e16d v3/packed_row_planner.py
|
||||
b7c4a35a5e73f528492bc6946b97b687c412f1d3f5f976c19d45c6dc20288c9a v3/pixel_vae_resize.py
|
||||
b139843ccfc826937c80f118920bbee2609c37d45ef88291f80f491744fd5e76 v3/plan.py
|
||||
0e3dd69d6d2bec6d9491c2fb806c25f0c62629b1eb5f9e4f77ae8d27a5b19cfc v3/planning_types.py
|
||||
8b9c1cadf76e2c2425d6bf8a5783ced593a75f83a6b3f219a0f870b4c177e058 v3/reference_effective_plan.py
|
||||
7b512612de5433bdb14c347e5bb8d27244c2298406bb37d383bb412f50654707 v3/reference_runtime.py
|
||||
4fb950bbdc7cdb55365fde373ee190af6cdf99f7ce4c54ef73b94f0aca4e1fda v3/reference_storage_contract.py
|
||||
196d1b6f4a73c4fb8669e9c399ffae526bd74765f96fbf5340c780f4331e5594 v3/reference_routing.py
|
||||
ec71e3965f445756d54d005c0e27bea520e26dbac44e1ee3d3867bfe2da100b0 v3/ref_encode_cache.py
|
||||
057921bf2b05e88c2cbc08c16e2ac483aea905b8a144fbadf4a21d6ae8252427 v3/reference_video.py
|
||||
9076c47aa5145c81f34793d6c90410656065248f37d9990a92a6a4061b358811 v3/refine_context.py
|
||||
b191009d686680c6eec1fdba15b76b7c9f40f11f331faaf7b69ef784e99f4989 v3/refine_context.py
|
||||
519586b1b3f48c73d329f7a2aaa8a1bfc6fe31ac2ecb64f2b1fdf9c19026001a v3/refine_sampling.py
|
||||
43f33f989eb70ca87b916fc33267732a2be3dd4581fc72af17c53f840b53ca49 v3/refine_schedule.py
|
||||
afc149dc347b4c1502ddf32ea4229e633799cd34d2b2c6f98bf8a47910a9ef77 v3/refine_scope.py
|
||||
@@ -102,19 +106,19 @@ ae909b43ad17934c85881d3b0bea81e7b45c215eeb4d1f9f6a9ea72faf633ddf v3/reliability
|
||||
be6610fb9427546d9485a17015cfbdc8786715e6a0967f3e4c1dee35d8768385 v3/runtime_coordinator.py
|
||||
d0a004aa3030c8adaa5ea788f9acc758fcb4a556f203f9a3f63fa4e4b5772063 v3/sampling_engine.py
|
||||
452022107cea233aa84d5366ec4943ac5aadbd5fcf786113f1d542a641eac8f7 v3/second_pass_nodes.py
|
||||
66501234756c2b558ce84f887bd540e7f843ed574c8a8b2522950bd1985d7acc v3/second_pass.py
|
||||
aa4afff697bd9b8a8505e6cc7d94fcef7aabf9d93ed123ec226fad1960807e77 v3/second_pass.py
|
||||
6e71e944313339f14e14e11cec682593159ca5542aa5d38095371da781d60224 v3/targeted_refine_sampling.py
|
||||
5a044bdd70c546e4446e0c26af92aae88049ffa2e0e2d01b52033a83a3152d0e v3/targeted_second_pass.py
|
||||
4178dcfa442abdb06ce276e05bd7bcbaa6da28469ba5e57d3da3c663de4e4a9d v3/video_seam_v35.py
|
||||
2f07ace1462644f0bee553827b3571535de4d0c2d9ef847bd9e0ca73a4eed5cb v3/video_seam.py
|
||||
453c98485ec55cca959aa5863ac35ae3b86c4781ae95c9e52ac9f1d9115c9eed version.py
|
||||
0d08a173819d63d969694f14e4a1d59ccbec357f37342e00a4db03e1144c2e02 version.py
|
||||
685df8e0fa23e3663ab31da1e4470cd19bdaa0dc16362cb606e874d9d6153c2c web/decode_cache_helper.js
|
||||
fefafd4550511d80bd85ade46a0476f0cf3de13ddb94a908dff6b175f2a0e199 web/easy_bypass_toggle.js
|
||||
092088096307d33ac016b82b4774ca38845a2ff2f63b97ac6da8c5aca4fea413 web/easy_load_audio.js
|
||||
9db0aa94f634578a962d5db49e5c70356040a59df968e3a2e531b327a623081f web/easy_load_image.js
|
||||
35090816ba7470a7255eb85d003b7e79f8a0065982dacf98a18f41c8ebff655d web/easy_load_video.js
|
||||
0c68d13a1f8beb7431a32b471f8b0612c42fcc4bf72dd97611a025d158008662 web/easy_v38.js
|
||||
bb7e29359e1fe26fd70d22f6bc70eb8c8858f68ab954ba39ad3670f2cdeeae7d web/project_id.js
|
||||
7bdd15370b02a21b0352f9bf3c963b899cbb0a5dc9d142de8784152bb0aab23e web/project_id.js
|
||||
ae59273f163a116ece418957c557c4fd8c3285e3c60814679b9361d2e6e6fa02 web/reference_audio_ui.js
|
||||
46c9f75c9462bf26300332448f4431cca801f38964ca0a49bc2c50a88a7cc40f web/reference_image_ui.js
|
||||
26b13614ba0a5fd8b192a106c9503b2f4b6fe7f9268a0fcb0f544979a49cab34 v3/video_adapter_nodes.py
|
||||
@@ -122,3 +126,13 @@ ae59273f163a116ece418957c557c4fd8c3285e3c60814679b9361d2e6e6fa02 web/reference_
|
||||
b935ad3bb729948bb3890ce967b0ecbef737a5e51ddfc47a0060fc20aa78dcda video_reference_modes.py
|
||||
bf41bf08dd0504eb753fa5781e6c2b8c1285758ad4bb7309975bb9231d5f8e41 web/video_reference_mode_ui.js
|
||||
4c33d223a77c78e5c74946aa43f537031fd5aa415388d46fed975f9b07d53c3e docs/TIMELINE_VIDEO_EXPERIMENTAL.md
|
||||
4cc53a322960373949cc4e86a3102c04d3dce4dfac00f7cc62b01cf637775b62 v3/reference_plan_inspector.py
|
||||
b64f4d3d9547ac00f8edb2155109476df5b8baea730fb94e8b5bfca6d11564e6 v3/reference_images_v39.py
|
||||
e9d7753f313ebbe3d13e477f5b4e4767a735b0619b52ba54bcc5218f3eb7eb7c web/reference_images_v39.js
|
||||
4d17d74107e78404b190fec9494b443249e5aff4f58670c50d54dfdfb064334b docs/V39_REFERENCE_INLINE.md
|
||||
67e81fbdd4c21a8d64fb3bedb5e495698fc8df5cdd9540c8ef5476caa76119c0 examples/workflows/MiniMax_H3_Continuum_V39_Reference_Inline.json
|
||||
65689fd800a60ab6939bea020d630616b03a453cf6d48022cd1361992a765abc examples/workflows/MiniMax_H3_Continuum_V39_Reference_Inline.zip
|
||||
40199d2500174ba51c040d6983f88d74c4bfbaf19191e728818e6b969b869b0f examples/workflows/MiniMax_H3_Continuum_V39.json
|
||||
f69b734b5bf19fb6db78bbe4737db0bef69c2a6cef2710f28767882ef35ec847 examples/workflows/MiniMax_H3_Continuum_V39.zip
|
||||
40199d2500174ba51c040d6983f88d74c4bfbaf19191e728818e6b969b869b0f examples/MiniMax_H3_Continuum_V39.json
|
||||
1b2212b7511fac0b63dfa6e9f006cd8644c72d08c6945ab0e4ed0e722c97a730 examples/MiniMax_H3_Continuum_V38X2.json
|
||||
|
||||
+139
-4
@@ -1875,8 +1875,143 @@ D:\Codex\_snapshots\ComfyUI-H3-Continuum\pre-rollback-after-00038-fail-20260821_
|
||||
- Full isolated CPU/Node suite: 1377 passed, 3 skipped, zero failures/errors. Actions run 35558988542. Source was snapshotted with `tools/snapshot.ps1` before edits; source/Registry manifest hashes verified.
|
||||
- Windows deployment, live-browser checks and GPU generation were not performed; fixed H3情報チェック handoff remains pending. No Release/tag/Registry publication.
|
||||
|
||||
## Timeline Video Experimental local acceptance and publication preparation (2026-09-22)
|
||||
## Unified Timeline Video Experimental 1 — h3-timeline-video-experimental-1 (2026-09-21)
|
||||
|
||||
- Applied the approved Timeline Video implementation to ComfyUI_W from baseline `085943ad...`. Added `Repeat Reference` compatibility default and opt-in `Follow Timeline` over the existing 24fps IMAGE input, plus slice-specific cache identity and separate comparison workflows. Official V3.8X2 workflow bytes were not changed.
|
||||
- Full CPU suite passed `1424 passed / 1 skipped / 0 failed`. Browser save/reload retained Follow mode and the Timeline Video input. Follow and Repeat `2 x 5 s` GPU runs both produced 704x416/24fps/240-frame/10-second video with 32kHz stereo audio; no OOM, NaN, allocation failure, or crash. Chunk-2 A/B SSIM `0.7246` confirmed mode separation after nearly identical Chunk 1.
|
||||
- README/README_JA and the experimental contract were updated with wiring, behavior, limits, measured 16GB headroom, and the corrected ten-node V3.8X2 public-surface count. No Release/tag or Registry publish is included in this main commit/push task.
|
||||
- User-approved offline ZIP implementation based on main `085943ad9cb8023a2042d4d731c83e638361c06e`. One appended optional `video_reference_mode`, old `reference_video_1` IMAGE input retained. Missing mode is Repeat; experimental copies explicitly select Follow/Repeat.
|
||||
- Follow selects the existing physical group's natural visible frame interval, excluding continuation context. It does not use the old timeline source that disables Terminal Merge. Per-slice VAE keys and fresh group-local prompt-cache dictionaries separate equal-prompt intervals. After source EOF, use no video reference; no automatic loop/stretch/long hold.
|
||||
- Source mode/content/preprocess identity does not depend on configured Chunks. Preserve sampling, seed, SIGMAS, masks, Audio, wrappers, existing public workflow bytes and old Repeat preprocessing.
|
||||
- Creation-time validation: isolated CPU backend tests with three Git-blob-verified upstream helpers, AST source-transform fixtures, Node.js restoration fixtures and installer transaction tests. See the ZIP's verification/evidence report for exact counts and scope. This is NOT full-repository, installed-ComfyUI, real-browser or GPU validation.
|
||||
- The offline updater requires exact baseline fingerprints, compiles intended Python changes before writing, and runs repository tools/snapshot.ps1 on the selected authoritative source before applying. The updater does not commit/push, restart the backend, submit a Queue, or access saved runs/media. Applied location and actual snapshot are recorded in .h3-timeline-experimental.json.
|
||||
- Production/GPU acceptance HOLD. Fixed H3情報チェック handoff PENDING; no cross-task transport in the creation environment. No Release/tag/Registry promotion.
|
||||
|
||||
## 2026-09-23 — PackedLayout preflight and safe stale-layout repair (local)
|
||||
|
||||
- Snapshotted the 604-file ComfyUI_W runtime before editing. Added block-level Video/Audio latent geometry and aggregate PackedLayout row validation in `layout_adapter.py`, integrated pre/post-materialization checks in `model_patch.py`, and retained one proven-safe rebuilt layout across Sampling evaluations.
|
||||
- Added CPU contracts for normal mixed blocks, stale-layout repair, Visual keyframe mismatch, Reference Image metadata mismatch, Reference Audio metadata mismatch, unavailable-layout compatibility, final validation and wrapper persistence. Focused suite passed `18`; full non-Manifest regression passed `1430` with `1 skipped`; the only unfiltered full-suite failure was the expected stale Registry Manifest hash after local source changes.
|
||||
- Deployed only `layout_adapter.py`, `model_patch.py`, `tests/test_model_patch.py`, and new `tests/test_packed_layout_preflight.py` to ComfyUI_W. Existing Timeline experimental and unrelated dirty files were preserved. No GPU Queue, backend restart, manifest update, source-repository edit, commit or push was performed.
|
||||
|
||||
## 2026-09-24 — RR-R1 fixed Reference identity (local CPU)
|
||||
|
||||
- Snapshotted the 605-file ComfyUI_W runtime immediately before editing. Added internal `source_slot_ids` to prepared Reference assets before sparse-slot compaction; normal and cached VAE encode retain the IDs through `replace()`. Existing Reference contract, hashes, order, and public surface remain unchanged.
|
||||
- Added 14 RR-R1 CPU tests covering sparse direct/bundle slots, legacy R4/R5, duplicate image slots, resize, golden pre-change hashes/contract, and plain/cached latent identity. RR-R1 plus related regression: `180 passed, 1 deselected` (known Registry Manifest mismatch). No GPU, browser, full-suite Green claim, Manifest update, commit, or push.
|
||||
|
||||
## 2026-09-24 — RR-R1 Manifest and full CPU Green (local)
|
||||
|
||||
- Snapshotted the 606-file ComfyUI_W source before this follow-up. Synchronized existing PackedLayout and RR-R1 source hashes in both Manifests; added the two new CPU regression files to the source Manifest. Source `384/384` and Registry `124/124` SHA entries now match, without changing runtime logic or workflow bytes.
|
||||
- Full CPU suite: `1445 passed, 1 skipped, 0 failed`. An isolated 125-file Registry declaration stage (including its Manifest) matched every source SHA; the four official/experimental workflow JSON-ZIP pairs matched. Official comfy-cli pack, live-browser/GPU checks, commit, push and publication were not performed.
|
||||
|
||||
## 2026-09-24 — RR-R1 sparse-reference GPU integration smoke (local)
|
||||
|
||||
- Used the already-running user-owned ComfyUI_W at `127.0.0.6:8188`; submitted the official V38X2 workflow in-memory without changing the saved workflow or browser tab. Queue was empty before and after.
|
||||
- T01 connected sparse R1/R4/R9 with the same full-body person image, 1x5s, Draft 0.30MP, Dasiwa Hybrid v2 int8, 20-step `res_multistep`/`simple`, Spectrum OFF, Run Storage OFF. Generation completed in `213.06s`; no OOM, NaN, allocation failure, crash, or execution error.
|
||||
- Output: 448x672, 24fps, 120 frames/5s; AAC 32kHz stereo/5s. Visual spot check showed recognizable face/outfit and forward movement. Audio was non-silent but dialogue/sound quality was not graded. Peak VRAM 15,565 MiB (718 MiB minimum free); peak RAM 35.54 GiB. See `D:\Codex\_test_results\ComfyUI-H3-Continuum\v39-rr-r1-gpu-20260924\T01_GPU_REPORT_JA.md` and raw JSON evidence.
|
||||
- Scope is only live sparse-reference integration. RR-R1 preserves internal slot IDs but does not route references per chunk or alter Sampling; this GPU smoke is not a proof of those later behaviors. No source/workflow changes, commit, push, tag, release, Registry publication, backend restart, or backend stop.
|
||||
|
||||
## 2026-09-24 — RR-R1 all-nine Reference GPU integration (local)
|
||||
|
||||
- After ComfyUI_W returned from the user's restart, verified API `127.0.0.6:8188`, ComfyUI 0.37.0, Sampler registration, and Queue `0/0`. T02 used the official V38X2 graph in-memory and independently connected the same 0.30MP person image to R1-R9, with no edits to saved workflows or browser tabs.
|
||||
- Fresh 1x5s Full Run with the same Dasiwa Hybrid v2 int8 / 20-step `res_multistep` / `simple` / Spectrum OFF / Run Storage OFF settings completed in `246.72s`. No OOM, NaN, allocation failure, crash, or execution error. Queue returned to `0/0`.
|
||||
- Output: 448x672, 24fps, 120 frames/5s; AAC 32kHz stereo/5s. Visual spot check showed consistent face/outfit and visible approach; audio was non-silent but dialogue/sound quality was not graded. Peak VRAM 15,165 MiB (1,118 MiB minimum free); peak RAM 40.17 GiB (23.75 GiB minimum free).
|
||||
- This validates maximum-slot input wiring/cardinality on this 16GB GPU at Draft 0.30MP, not distinct-image identity separation or later per-chunk routing. Detailed evidence: `D:\Codex\_test_results\ComfyUI-H3-Continuum\v39-rr-r1-gpu-20260924\T02_GPU_REPORT_JA.md`. No source/workflow changes, commit/push/publication, backend restart, or backend stop.
|
||||
|
||||
## 2026-09-24 — RR-R2 pure Reference Routing schedule (local CPU)
|
||||
|
||||
- Snapshotted the authoritative 606-file ComfyUI_W source before code changes (`pre-v39-rr-r2-20260924_141213`). Added isolated `v3/reference_routing.py` and 20 CPU contracts; no public node, frontend, Sampling, Review, Run Storage, Execution Planner, or active backend behavior was changed.
|
||||
- Selector parser supports legacy/unset All, explicit All, Custom R1-R9 selectors (`all`, `off`, integer, inclusive range, comma combinations), stable fixed-slot order, and structured invalid-input classification. Full logical chunk numbering remains 1-based and is not rebased; physical groups come from the existing `physical_groups()` function.
|
||||
- Terminal atomic route disagreement is preserved as a schedule `conflict`, with each member route retained and no auto-split, auto-selection, route union, or execution stop. Explicit Custom all-off is valid and distinct from absent-mode legacy All.
|
||||
- Focused RR-R2 tests: `20 passed`. Full CPU suite: `1465 passed, 1 skipped, 0 failed`. Updated Development/Registry manifests to include the new test/runtime module; final audit `386/386` and `125/125`, zero missing/hash mismatch. `git diff --check` and new-file whitespace checks passed.
|
||||
- Snapshots: `pre-v39-rr-r2-manifest-20260924_141955` (608 files) before manifest edits; `pre-v39-rr-r2-state-record` before this log/state update. GPU/browser not required or run. ComfyUI_W remains user-owned and running; no restart/stop, commit, push, or publication. RR-R3+ remain pending.
|
||||
|
||||
## 2026-09-24 — RR-R3 pure effective Reference plan (local CPU)
|
||||
|
||||
- Snapshotted the authoritative ComfyUI_W worktree before code, identity, Manifest, and state-record edits. Added `v3/reference_effective_plan.py` and 20 CPU contracts. The plan maps each logical route and physical group from fixed R1-R9 slots to compact asset indices, prepared-image SHA-256 and Core Picture numbers, accounting for First/Last presentation. Sparse and duplicate-content slots preserve their distinct IDs; empty routes stay empty; a conflicting terminal group has no silently chosen Picture map.
|
||||
- Focused RR-R3 tests: `20 passed`; full CPU suite: `1485 passed, 1 skipped, 0 failed`. Development Manifest `388/388` and Registry Manifest `126/126` matched actual SHA-256 values with no missing or duplicate entries. `git diff --check` and new-file whitespace checks passed. Existing Reference/Routing code, public nodes, frontend, and official workflow JSON/ZIP are byte-identical to the pre-R3 snapshot.
|
||||
- RR-R3 is plan construction only. Applying selected images to Qwen/DiT/VAE, prompt rewrite, cache, Run Storage, UI, and runtime/GPU validation belong to later phases. User-owned ComfyUI_W was not restarted or stopped; no Queue, commit, push, tag, release, or Registry publication occurred. RR-R4+ remain pending.
|
||||
|
||||
## 2026-09-24 — RR-R4 group-local Reference runtime (local CPU)
|
||||
|
||||
- Snapshotted the authoritative ComfyUI_W source before code, compatibility, Manifest, and record edits. Added the private RR-R4 runtime adapter and group-local selection in the existing Reference/Sequence path. Only each generated physical group's connected selected R1-R9 images reach resize/hash, VAE, Qwen, and DiT. `@R` tags resolve against that group's Picture map; inactive tags warn without stopping. Custom all-off remains empty; equal prompts with different selected references are encoded separately; terminal members share one physical route.
|
||||
- The first full CPU run found one regression: adding a private router argument changed the protected 41-keyword `run_sequence` signature. Replaced that with a private scoped entrypoint using `ContextVar`, restored both original signatures, and tested error-path context cleanup. Final full CPU: `1499 passed, 1 skipped, 0 failed`; focused signature/R4 suite `22 passed`.
|
||||
- Final Development Manifest `391/391` and Registry Manifest `127/127` SHA match, zero missing/duplicates. Public nodes, frontend, Sampling Engine, Run Storage, and official V38X2 JSON/ZIP match the pre-R4 snapshot. `git diff --check` and new-file whitespace checks pass.
|
||||
- R4 remains internal and CPU-validated. Saved Run/Session/State and Refine are explicitly deferred to RR-R5/RR-R6, so the private route cannot use them yet. User-owned backend was not restarted or stopped; no browser/GPU Queue, commit/push, or external publication.
|
||||
|
||||
## 2026-09-25 — RR-R5 Reference Routing persistence (local CPU)
|
||||
|
||||
- Snapshotted the authoritative ComfyUI_W worktree before implementation, Run Storage, Sequence/Session, Take import, Manifest synchronization and status recording. Added the private physical-group Reference descriptor with prepared-image SHA, compact Picture presentation, effective Prompt and terminal policy; routed Run Storage and explicit Session now certify only complete compatible prefixes. The old non-routing Sampling Contract path remains unchanged.
|
||||
- Added selected Take validation across changed-plan lineages, new-plan-owned raw copying and local provenance. Selected Take mismatch rejects at the first changed group without silently choosing canonical data. The generation path rechecks the frozen descriptor before VAE/CLIP/Sampling. Focused Take/import/Session save-load/changed-image tests passed; full CPU `1515 passed, 1 skipped, 0 failed`. Development Manifest `393/393`, Registry Manifest `128/128`, protected public source/workflow SHA parity and `git diff --check` passed.
|
||||
- This is RR-R5 local CPU completion only. Private GPU persistence/reuse Gate and RR-R6 public integration remain pending. The user-owned ComfyUI_W backend was not restarted or stopped; no Queue, commit, push, release or Registry publication occurred.
|
||||
|
||||
## 2026-09-25 — RR-R5 GPU Gate and RR-R6 local integration
|
||||
|
||||
- RR-R5 isolated GPU Functional Gate passed 7/7 across Full A/B, Review Q1–Q3 and Session S0/S1, with accepted-prefix tensor SHA/value parity, correct generated/reused groups and AV output. The isolated 8190 backend was stopped after Queue empty; 8188 remained user-owned. The pre-sampling first adapter rejection was corrected only in test harness, not Production source.
|
||||
- Snapshotted authoritative ComfyUI_W source before RR-R6. Added separate V3.9 public Sampler (All defaults to V3.8 path; Custom routes R1–R9), transient backend-derived Plan Inspector, and same-execution routed Refine Context/Second Pass inheritance classification. Kept V3.8 schema/widget order, official workflows, Sampling Engine, Runtime Coordinator and Run Storage unchanged. Frontend test harness now exercises V3.9 serialization, invalidation and reload.
|
||||
- Focused gates passed; Full CPU `1523 passed, 1 skipped, 0 failed`, frontend Review Queue `47/47`, JS syntax and local native PackedLayout/runtime verifier with 11 registered nodes passed. Manifests were synchronized after code/docs/tests. No real browser or V3.9 GPU test, backend restart, commit, push, tag, release or Registry publish in this phase. RR-R6 is local CPU PASS, not release acceptance.
|
||||
|
||||
## 2026-09-25 — V3.9 local documentation and V3.8X2 release separation
|
||||
|
||||
- Snapshotted the authoritative ComfyUI_W worktree to `D:\Codex\_snapshots\ComfyUI-H3-Continuum\pre-v39-local-rc-docs-20260925_232940` before editing. Updated both READMEs with V3.8X2-to-V3.9 workflow steps, `All`/`Custom` behavior, R1–R9 selectors, `@R` Picture mapping, saved-run compatibility limits and the local RR-R6B browser result. Corrected the stale CPU-only status in the Changelog and Project State.
|
||||
- Recorded the proposed separate V3.8X2 tag/Release plus `release/3.8x2` maintenance branch and a later separate V3.9 workflow/Release. These names are plans, not published download targets. No production code, official workflow, package version, commit, push, tag, Release or Registry publication was changed in this documentation task.
|
||||
- Rehashed changed public documents: Development Manifest `395/395` and Registry Manifest `129/129` match, zero errors. Focused release/Registry pytest `3 passed`; `git diff --check` passed. V3.9 runtime and official V38X2 JSON/ZIP match the pre-documentation snapshot SHA-256.
|
||||
|
||||
## 2026-09-27 — V3.9 Reference Images in-node local implementation
|
||||
|
||||
- Took the 617-file pre-change snapshot of authoritative ComfyUI_W source. Added a separate V3.9 nine-image helper, in-node All/Per-chunk table, one typed Sampler input, stable sparse IDs, new workflow JSON/ZIP, documentation and focused Python/JS contracts. Kept V3.8 Sampler and V38X2 workflows intact.
|
||||
- First full CPU run found old target indices on the V3.9 workflow's audio/video links; corrected the workflow generator, regenerated JSON/ZIP and re-synced both manifests. Final CPU `1530 passed / 1 skipped / 0 failed`; focused workflow and distribution tests `22 passed`; frontend and standalone runtime verification passed. No live browser/GPU run, backend restart or publication.
|
||||
|
||||
## 2026-09-27 — V3.9 local CPU audit correction
|
||||
|
||||
- Snapshotted the authoritative ComfyUI_W worktree (617 files) before changing it. Preserved all existing uncommitted V3.9 work.
|
||||
- Unified group prompt/warning resolution for generated and reused groups, while retaining descriptor/hash and observed accepted-group warnings. Indexed immutable Reference plan group lookup without changing its public constructor or returned record semantics.
|
||||
- Added focused CPU regression tests for reused warnings, atomic plan publication, and lookup parsing. Clarified current module/package documentation. Full CPU, manifest integrity and protected workflow checks follow this edit; no GPU, backend restart, commit, push or release was requested.
|
||||
|
||||
## 2026-09-28 — V3.9 full official workflow candidate
|
||||
|
||||
- Took a verified 629-file pre-change snapshot. Built a separate 36-node/42-link full V3.9 workflow JSON and matching single-entry ZIP from the existing V38X2-derived V3.9 candidate. Wired bypassed loaders into all nine helper slots, added a two-chunk standalone-header Timeline prompt, set Manual size for the bypassed First Image, fresh graph/Project IDs, and a correctly named V3.9 Save output. Preserved the V38X2 files, prior V3.9 migration fixture, model/LoRA/scheduler, Spectrum setting, Decode Cache and Finalize chain.
|
||||
- Focused static tests verify links, V3.9 helper/Sampler schema, prompt-plan coverage, bypass defaults and ZIP byte identity. Browser save/reload and GPU generation were not performed; no commit, push or release.
|
||||
|
||||
## 2026-09-27 — V3.9 supplied-workflow rebase and stale live registration
|
||||
|
||||
- Took a verified 623-file snapshot before edits. Converted the user-supplied V38X2+Decode Cache Helper graph to V3.9, routing all Reference Images 1–9 into the new helper and preserving all other nodes and media/model settings. Set a distinct Project ID to avoid reusing the original V3.8 Run Storage folder; regenerated matching JSON/ZIP and tightened the workflow test.
|
||||
- Read-only live `/object_info` showed that 8188 still had the old V3.9 schema; its Python process predates the new source. Did not stop or replace the user-managed backend. Final CPU `1530 passed / 1 skipped / 0 failed`, focused graph/public/Registry `22 passed`, JS contract and runtime verifier PASS, Manifest `401/401` and Registry Manifest `134/134` SHA-256 PASS. Live restart/browser/GPU acceptance remains separate.
|
||||
|
||||
## 2026-09-27 — V3.9 stale direct Reference input UI cleanup
|
||||
|
||||
- Verified the current 8188 backend and candidate workflow each expose only the new `reference_images` Sampler socket; the screenshot's separate node #359 retained old direct 1–3 sockets. Took a verified 625-file snapshot before edits.
|
||||
- Added idempotent frontend cleanup for unconnected obsolete V3.9 direct Reference inputs. Connected old inputs are preserved and visibly warned instead of being silently disconnected. V3.8 and backend contracts are unchanged. Added frontend regressions and documented the browser reload boundary.
|
||||
- Focused V3.9 frontend and Review UI regressions, 16 focused Python tests, JS syntax and diff whitespace checks passed. Development Manifest `401/401` and Registry Manifest `134/134` match. The live server serves the updated JS. The user's unsaved Chrome workflow was not reloaded, so actual browser canvas and GPU Gates remain pending. No commit, push, Release, Registry publication or ComfyUI restart.
|
||||
|
||||
## 2026-09-28 — V3.9 Reference Images assignment panel overlap
|
||||
|
||||
- A new browser screenshot confirmed overlap resolution but revealed excess blank space. Took a verified 629-file snapshot; compacted the DOM top gap and row-based panel height and allowed the helper node to shrink to its computed height. The three-row case now reserves 193 px total rather than 243 px. Focused JS contract/syntax passed; browser visual recheck and GPU test remain pending.
|
||||
- Follow-up screenshot confirmed that the previous height-only fix still let `Image 2 Chunks` draw at the panel top. A second verified 629-file snapshot was taken. Suppressed only the nine legacy selector widgets' visual drawing, retained their values, and placed the assignment panel in a host with 24 px of reserved top spacing. Focused frontend test and JavaScript syntax passed; no browser reload or GPU queue was performed.
|
||||
- The user's three-reference screenshot showed the per-chunk assignment DOM panel covering the selector control above it. Took a verified 629-file snapshot before changing the ComfyUI_W runtime.
|
||||
- Reserved explicit DOM widget height based on the connected-image rows, capped at 360 px with scrolling, and expanded the node when its computed height grows. No backend, reference routing, or serialized widget value changed.
|
||||
- Frontend contract checks cover three connected images, All chunks mode, and nine images across 16 chunks. JavaScript syntax and focused frontend contract passed. Manifest entries were updated. Browser visual verification remains pending until a safe refresh of the user's active tab; GPU test has not been queued for this UI repair.
|
||||
|
||||
## 2026-09-28 — Local V3.9 launch-template and README preparation
|
||||
|
||||
- Took and verified a 633-file snapshot of the ComfyUI_W source. Adopted the user-supplied V3.9 graph as a 35-node official workflow, correcting only its accidental `[` prompt and extra empty helper display-widget serialization. Rebuilt single-JSON ZIP and template-gallery copy. Added an unchanged V38X2 gallery copy; preserved the two old recommended-settings files byte-for-byte under `examples/settings/`.
|
||||
- Corrected `.comfyignore` so the official V3.9 JSON/ZIP and both gallery JSONs are distributable. Updated README/README_JA with V3.9 usage, V3.8 coexistence, Reference-only/First/Last caveats, prompt tags and resource limits. Package metadata and old V38X2 JSON/ZIP remain unchanged.
|
||||
- Live template API lists precisely V38X2/V39 and serves V39 HTTP 200. Final full CPU `1536 passed / 1 skipped / 0 failed` in 114.54 s; Development Manifest 406/406 and Registry Manifest 138/138 matched; ZIP has one JSON entry; diff whitespace check clean. No fresh default-template GPU or browser save/reload, version bump, commit, push or publication.
|
||||
|
||||
## 2026-09-29 — V3.9 documentation reconciliation
|
||||
|
||||
- Snapshotted the authoritative ComfyUI_W runtime before editing (635 files). Reconciled README EN/JA, package validation/install/info, historical V3.8 migration guidance and AGENTS version baseline without changing generation code or workflows.
|
||||
- Distinguished V3.8X2's ten IDs and the local V3.9 candidate's twelve, package metadata 3.8.3, historical versus current CPU results, and the still-pending browser/default-template GPU gates. Resynchronized both manifests and ran focused public-surface/official-workflow tests. No commit, push or publication.
|
||||
|
||||
## 2026-09-29 — User-selected V3.9 Workflow (3) and combined V3.8X2 ZIP
|
||||
|
||||
- Verified a new 635-file snapshot before replacement. Copied the user's `MiniMax_H3_Continuum_V39 (3).json` byte-for-byte into the official workflow and Templates gallery locations. Its 32 nodes/39 links, empty prompt, six prewired bypassed image loaders, First Image + Draft 0.30 MP saved size controls, and bypassed First Image loader were not changed.
|
||||
- Repacked the V3.9-only ZIP and added both V3.8X2 and V3.9 JSONs to the standard V3.8X2 ZIP. The V3.8X2 JSON and its helper-explicit single-JSON ZIP were not changed. Updated launch README EN/JA, installer/package guidance, V3.9 guide, and tests for the exact bundle and the First Image setup caveat.
|
||||
- Focused workflow tests passed 22/22. The live `/workflow_templates` API listed exactly `MiniMax_H3_Continuum_V38X2` and `MiniMax_H3_Continuum_V39`; the supplied screenshot showed an older browser Templates view, so visual refresh confirmation remains pending. No GPU, version bump, commit, push, Release, or Registry publication.
|
||||
|
||||
## 2026-09-29 — Final user-selected V3.9 Workflow (4)
|
||||
|
||||
- Took a verified 635-file snapshot, then copied `MiniMax_H3_Continuum_V39 (4).json` byte-for-byte over the V3.9 official JSON and gallery copy. The only graph-setting change from (3) is the enabled First Image loader; viewport coordinates also changed. Repacked the V3.9-only and combined V38X2/V3.9 ZIPs without editing either workflow JSON.
|
||||
- Updated the focused workflow contract and launch guidance to show First Image + Draft 0.30 MP with an enabled image loader. Users must select their own First Image; Reference-only use needs First Image OFF and Manual sizing. Final focused tests 28/28 PASS, Registry Manifest 138/138, development Manifest 406/406, and whitespace check PASS. Live Templates API lists both workflows and serves both JSONs with HTTP 200; Chrome visual refresh remains pending because the user's original workflow tab may have unsaved work. No GPU, commit, push, Release, or Registry publication.
|
||||
|
||||
## 2026-09-29 — V3.9.0 main-source publication
|
||||
|
||||
- Snapshotted the authoritative ComfyUI_W source (635 files) before the version/documentation update. Kept the user's official V3.9 JSON byte-identical and retained the separate V3.8X2 Sampler, workflow JSON and historical GitHub Releases.
|
||||
- Bumped package metadata to 3.9.0, made README EN/JA and install/package guidance V3.9-first, retained V3.8X2 compatibility and both Templates, and reconciled the accepted Timeline Video Experimental documentation from the existing main branch. Updated integrity manifests and release-metadata tests.
|
||||
- Full Windows CPU suite passed `1536 passed / 1 skipped / 0 failed`; `git diff --check` passed. This GitHub main-source publication does not create a tag, new Release, Registry package or new GPU run. Default V3.9 template browser save/reload and GPU acceptance remain pending.
|
||||
|
||||
@@ -1,8 +1,16 @@
|
||||
# V3.8X Release and Migration Policy
|
||||
|
||||
> Historical V3.8X / package 3.8.1 record. Current `main` uses package 3.9.0,
|
||||
> retains the V3.8X2 Sampler/workflow, and adds a separate V3.9 Sampler plus
|
||||
> Reference Images V3.9 helper. V3.8X2 registers ten IDs, including two
|
||||
> deprecated loader compatibility IDs; V3.9 registers twelve in total.
|
||||
> Use the dedicated V3.9 workflow for its new
|
||||
> Reference wiring. Old workflows and saved Runs/Takes are not automatically
|
||||
> converted. See the main README for the current installation path and gates.
|
||||
|
||||
## Supported release
|
||||
|
||||
V3.8X is the current supported H3 Continuum product. Its package version is `3.8.1` and it exports seven Node IDs:
|
||||
The historical V3.8X package version `3.8.1` exported seven Node IDs:
|
||||
|
||||
```text
|
||||
H3ContinuumSamplerV38
|
||||
@@ -18,7 +26,7 @@ The assembler, loader, and Second Pass IDs are retained while their V3.8 display
|
||||
|
||||
## Saved workflows from older releases
|
||||
|
||||
Only the seven IDs listed above are exported by V3.8X, including the retained Finalize, loader, and Second Pass IDs. Other public Node IDs from V3.7 and earlier are not exported. ComfyUI can therefore show an unknown node when a saved workflow refers to an ID outside this list. This is an intentional support boundary, not a request to replace the unknown node with a superficially similar V3.8X node.
|
||||
Only the seven IDs listed above were exported by that historical V3.8X package, including the retained Finalize, loader, and Second Pass IDs. The current main source's separate V3.8X2/V3.9 surfaces are described above. ComfyUI can show an unknown node when a saved workflow refers to an ID outside the installed package's mappings. Do not replace it with a superficially similar node without checking its saved contract.
|
||||
|
||||
- Use tag `v3.7.0` for V3.7 workflows.
|
||||
- Use tag `v3.6.0` for V3.6 workflows.
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
# V3.9 Reference Images — usage and compatibility
|
||||
|
||||
V3.9 has a new Reference Images input. The V3.8 sampler and the V38X2 workflow are retained. Start with `examples/workflows/MiniMax_H3_Continuum_V39.json` as a separate workflow; the earlier `MiniMax_H3_Continuum_V39_Reference_Inline.json` remains a migration fixture. The unchanged default official workflow has not passed a real browser save/reload or GPU acceptance gate yet. Its image loaders 1–6 are wired but bypassed, slots 7–9 need user-added loaders, and Sequence Prompt is blank for the user to fill. The user-selected JSON is used without edits. Its saved size controls are First Image + Draft 0.30 MP and the First Image loader is enabled: select your own First Image file before Queue. For Reference-only, turn that loader off and choose Manual. Saved 480×640 applies only to Manual mode. The standard V38X2 ZIP contains both V38X2 and V3.9 JSONs; the two Templates remain separate.
|
||||
|
||||
1. Connect images to `H3 Continuum Reference Images V3.9`, slots `Reference Image 1` through `Reference Image 9`. Each number is fixed; an empty slot never shifts the later numbers.
|
||||
2. Connect its one `reference_images` output to the V3.9 Sampler's `Reference Images (Optional)` input. The official V3.9 workflow has this wiring already.
|
||||
3. Choose `Reference Use = All chunks` to use connected images in every chunk. For different images in each chunk, select `Per chunk` and tick the table inside the helper node. Switching to Per chunk for the first time starts with no ticks. The helper keeps its ticks if you return to All and then select Per chunk again.
|
||||
4. The Sampler owns the chunk count. For six chunks you may tick Image 1 at chunks 1, 3 and 6. If you temporarily reduce Chunks to three, the saved tick at six remains and becomes active again when Chunks returns to six. New chunks are unticked in Per chunk mode.
|
||||
5. In `Sequence Prompt`, use `@R1` for fixed Image 1, `@R4` for fixed Image 4, and so on. The actual `<Picture N>` may change by chunk and with First/Last Image connections. Inactive `@R` tags produce warnings; they do not block generation. An image can condition a chunk even without an explicit tag. Not assigning an image in a later chunk does not guarantee the subject disappears from continued video.
|
||||
6. If an existing First/Last setup merges the final two logical chunks into one physical group, those two chunks must have the same effective reference set. The runtime reports a conflict before sampling if they differ. It never merges or changes the assignments automatically.
|
||||
|
||||
The helper table displays configured intent. The Sampler's Reference Plan reports observed group mappings and hashes after Queue. A saved workflow retains input connections and selection widgets, not a previous Queue's verified report. Use a new Run Name when switching from V3.8 or from an older V3.9 prototype. Previously accepted V3.8 Takes do not migrate automatically.
|
||||
|
||||
The new workflow is derived from the user-supplied `MiniMax_H3_Continuum_V38X2+Decode_Cache_Helper (1).json` (SHA-256 `0af34446b56381568d0fce7be5c96324cff5b02b30b753f9db8871efd90206c7`). It keeps its model, LoRA, sampler, seed, audio/video loaders, `Repeat Reference` video mode, Decode Cache Helper, and Image loader bypass state. The Sequence Prompt node remains connected but its value is intentionally empty. The V3.8 Sampler/4–9 helper and their Reference links are migrated to the V3.9 Sampler/nine-image helper. The saved Project ID is intentionally new so V3.9 does not reuse the V3.8 Run Storage folder. Check local media paths and enter a prompt before Queue. You can also build a Reference-only workflow with First/Last disconnected and `Size Source = Manual`, keeping a compatible model/LoRA combination.
|
||||
|
||||
Connected upstream image loaders may consume RAM even when their images are not assigned to a particular chunk. With many images, especially 7–9, resize the source images before loading and review `Reference Image Size` (the template uses `Match Output`); changing output MP alone is not a guarantee that source-image RAM shrinks. No speed gain or 16 GB VRAM safety margin is claimed for V3.9.
|
||||
|
||||
After updating node files, fully restart the ComfyUI backend and hard-refresh the browser so the new Python node and JavaScript panel register together. A browser refresh alone cannot replace Python node definitions already loaded by a running backend. Open this new V3.9 workflow rather than changing the node type inside an older V3.9 prototype: old serialized widget positions can be misread by the new schema. Verify that a newly added V3.9 Sampler has one `Reference Images (Optional)` socket and no direct Reference Image 1–3 sockets or Sampler-side `Reference Routing` / `R1–R9 Chunks` widgets. If a newly added node still shows those old fields after a full restart, inspect duplicate Continuum installations and the actual backend package path. Old V38X2 workflows continue to use `H3 Continuum Sampler V3.8` and the old 4–9 helper without rewiring.
|
||||
|
||||
If an earlier V3.9 prototype node is already saved on the canvas, the frontend removes only its unconnected obsolete direct Reference sockets on load. Connected obsolete sockets are preserved and visibly flagged; manually reconnect those images to the matching numbered inputs on `H3 Continuum Reference Images V3.9`. They are not silently treated as active V3.9 References. Reload the browser only after saving any unsaved workflows, or open the new official workflow in a separate tab.
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
+5
-4
@@ -10,6 +10,7 @@ of the target timeline. The older marked-keyframe form remains supported as an
|
||||
internal compatibility path, but the UI does not emit it.
|
||||
"""
|
||||
from __future__ import annotations
|
||||
from collections.abc import Mapping
|
||||
import logging
|
||||
from typing import Any
|
||||
import torch
|
||||
@@ -260,8 +261,8 @@ def preflight_packed_layout(payload,*,repair_stale=False):
|
||||
visual_blocks=[]; audio_blocks=[]; geometry_errors=[]
|
||||
visual_index=audio_index=0
|
||||
for keyframe in keyframes:
|
||||
if not isinstance(keyframe,dict):
|
||||
geometry_errors.append("keyframe entry is not a dict")
|
||||
if not isinstance(keyframe,Mapping):
|
||||
geometry_errors.append("keyframe entry is not a mapping")
|
||||
continue
|
||||
latent=keyframe.get("latent")
|
||||
if latent is not None:
|
||||
@@ -294,8 +295,8 @@ def preflight_packed_layout(payload,*,repair_stale=False):
|
||||
errors=geometry_errors,
|
||||
))
|
||||
for ref in refs:
|
||||
if not isinstance(ref,dict):
|
||||
geometry_errors.append("reference entry is not a dict")
|
||||
if not isinstance(ref,Mapping):
|
||||
geometry_errors.append("reference entry is not a mapping")
|
||||
continue
|
||||
kind=str(ref.get("kind",""))
|
||||
if kind=="image":
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
[project]
|
||||
name = H3 Continuum
|
||||
version = 3.8.3
|
||||
version = 3.9.0
|
||||
description = Native MiniMax H3 masked AV continuation, Second Pass, and disk-backed assembly.
|
||||
|
||||
@@ -462,8 +462,10 @@ NODE_DISPLAY_NAME_MAPPINGS["H3DecodeCacheHelper"] = "Decode Cache Helper"
|
||||
# inherits and reuses historical modules internally.
|
||||
_PUBLIC_NODE_DISPLAY_NAMES = {
|
||||
"H3ContinuumSamplerV38": "H3 Continuum Sampler V3.8",
|
||||
"H3ContinuumSamplerV39": "H3 Continuum Sampler V3.9",
|
||||
"H3ContinuumReferenceAudios": "H3 Continuum Reference Audios",
|
||||
"H3ContinuumReferenceImages": "H3 Continuum Reference Images",
|
||||
"H3ContinuumReferenceImagesV39": "H3 Continuum Reference Images V3.9",
|
||||
"H3ContinuumAssembleSeamV35": "H3 Continuum Finalize",
|
||||
"H3EasyLoadImage": "H3 Continuum Load Image",
|
||||
"H3EasyLoadAudio": "H3 Continuum Load Audio",
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
[project]
|
||||
name = "comfyui-h3-continuum"
|
||||
version = "3.8.3"
|
||||
version = "3.9.0"
|
||||
description = "Integrated N-chunk continuation for ComfyUI native MiniMax H3 video and audio"
|
||||
readme = "README.md"
|
||||
requires-python = ">=3.10"
|
||||
|
||||
+35
-25
@@ -65,11 +65,14 @@ def resolve_reference_image_inputs(
|
||||
|
||||
@dataclass(frozen=True)
|
||||
class ReferenceAssets:
|
||||
images: tuple[torch.Tensor, ...]
|
||||
latents: tuple[torch.Tensor | None, ...]
|
||||
image_hashes: tuple[str, ...]
|
||||
combined_hash: str
|
||||
size_mode: str
|
||||
images: tuple[torch.Tensor, ...]
|
||||
latents: tuple[torch.Tensor | None, ...]
|
||||
image_hashes: tuple[str, ...]
|
||||
combined_hash: str
|
||||
size_mode: str
|
||||
# Internal source identity, aligned with the compact images/hash/latent tuples.
|
||||
# An empty tuple keeps manually constructed legacy assets compatible.
|
||||
source_slot_ids: tuple[str, ...] = ()
|
||||
|
||||
@property
|
||||
def count(self) -> int:
|
||||
@@ -194,7 +197,7 @@ def _resize_reference(
|
||||
return resized.movedim(1, -1).contiguous()
|
||||
|
||||
|
||||
def prepare_reference_assets(
|
||||
def prepare_reference_assets(
|
||||
*,
|
||||
reference_image_1: torch.Tensor | None,
|
||||
reference_image_2: torch.Tensor | None,
|
||||
@@ -205,28 +208,34 @@ def prepare_reference_assets(
|
||||
reference_image_4: torch.Tensor | None = None,
|
||||
reference_image_5: torch.Tensor | None = None,
|
||||
image_references: ReferenceImageBundle | None = None,
|
||||
) -> ReferenceAssets | None:
|
||||
selected_source_slot_ids: tuple[str, ...] | None = None,
|
||||
) -> ReferenceAssets | None:
|
||||
# Match Core's dynamic Reference inputs: bypassed or otherwise absent
|
||||
# sockets are ignored, then active images are numbered contiguously in
|
||||
# connection order as Picture 1..N.
|
||||
inputs = [
|
||||
image
|
||||
for image in resolve_reference_image_inputs(
|
||||
reference_image_1, reference_image_2, reference_image_3,
|
||||
reference_image_4, reference_image_5, image_references,
|
||||
)
|
||||
if image is not None
|
||||
]
|
||||
if not inputs:
|
||||
return None
|
||||
images = tuple(
|
||||
_resize_reference(
|
||||
_validate_image(f"Reference Image {index}", image),
|
||||
resolved_inputs = resolve_reference_image_inputs(
|
||||
reference_image_1, reference_image_2, reference_image_3,
|
||||
reference_image_4, reference_image_5, image_references,
|
||||
)
|
||||
selected_slots = (
|
||||
None if selected_source_slot_ids is None else set(selected_source_slot_ids)
|
||||
)
|
||||
active_slots = [
|
||||
(f"R{slot_number}", image)
|
||||
for slot_number, image in enumerate(resolved_inputs, start=1)
|
||||
if image is not None
|
||||
and (selected_slots is None or f"R{slot_number}" in selected_slots)
|
||||
]
|
||||
if not active_slots:
|
||||
return None
|
||||
images = tuple(
|
||||
_resize_reference(
|
||||
_validate_image(f"Reference Image {index}", image),
|
||||
output_width=int(output_width),
|
||||
output_height=int(output_height),
|
||||
size_mode=size_mode,
|
||||
)
|
||||
for index, image in enumerate(inputs, start=1)
|
||||
for index, (_, image) in enumerate(active_slots, start=1)
|
||||
)
|
||||
image_hashes = tuple(_tensor_hash(image) for image in images)
|
||||
combined_hash = _canonical_hash(
|
||||
@@ -239,10 +248,11 @@ def prepare_reference_assets(
|
||||
return ReferenceAssets(
|
||||
images=images,
|
||||
latents=tuple(None for _ in images),
|
||||
image_hashes=image_hashes,
|
||||
combined_hash=combined_hash,
|
||||
size_mode=size_mode,
|
||||
)
|
||||
image_hashes=image_hashes,
|
||||
combined_hash=combined_hash,
|
||||
size_mode=size_mode,
|
||||
source_slot_ids=tuple(slot_id for slot_id, _ in active_slots),
|
||||
)
|
||||
|
||||
|
||||
def encode_reference_latents(video_vae: Any, assets: ReferenceAssets) -> ReferenceAssets:
|
||||
|
||||
+146
-7
@@ -54,6 +54,13 @@ from .v3.review_control import (
|
||||
validate_review_prefix_metadata,
|
||||
)
|
||||
from .v3.planning_types import PrefixFacts
|
||||
from .v3.reference_storage_contract import (
|
||||
REFERENCE_ROUTING_CONTRACT_VERSION,
|
||||
ReferenceStoragePlan,
|
||||
ReferenceStorageContractError,
|
||||
session_routing_settings,
|
||||
validate_reference_group_contracts,
|
||||
)
|
||||
|
||||
|
||||
RUN_STORAGE_SCHEMA_VERSION = 3
|
||||
@@ -731,6 +738,12 @@ def _apply_nonce_contract(
|
||||
global_hash = _hash(result["global"])
|
||||
chunk_contracts = []
|
||||
chunk_hashes = []
|
||||
routed_groups = result.get("reference_group_contracts")
|
||||
routed_by_chunk = {}
|
||||
if routed_groups is not None:
|
||||
for group_record in routed_groups:
|
||||
for chunk in group_record["descriptor"]["logical_chunks"]:
|
||||
routed_by_chunk[int(chunk)] = group_record["sha256"]
|
||||
for position, prompt_hash in enumerate(result["prompt_hashes"]):
|
||||
number = position + 1
|
||||
affected = boundary > 0 and number >= boundary
|
||||
@@ -742,6 +755,8 @@ def _apply_nonce_contract(
|
||||
"effective_reroll_nonce": int(effective_nonce) if affected else 0,
|
||||
"last_frame_hash": str(result["last_frame_hash"]) if number == int(result["chunk_count"]) else "",
|
||||
}
|
||||
if routed_groups is not None:
|
||||
chunk_contract["physical_group_reference_sha256"] = routed_by_chunk[number]
|
||||
timeline_chunks = result.get("timeline_video_chunk_contracts") or []
|
||||
if position < len(timeline_chunks):
|
||||
chunk_contract["timeline_video"] = dict(timeline_chunks[position])
|
||||
@@ -769,7 +784,7 @@ def _nonce_lineage_hash(
|
||||
) -> str:
|
||||
"""Recompute the nonce-independent compatible sampling lineage."""
|
||||
|
||||
return _hash({
|
||||
identity = {
|
||||
"global_hash": _hash(contract["global"]),
|
||||
"chunk_count": int(contract["chunk_count"]),
|
||||
"prompt_mode": str(contract["prompt_mode"]),
|
||||
@@ -780,7 +795,12 @@ def _nonce_lineage_hash(
|
||||
if timeline_video_chunk_contracts is not None
|
||||
else contract.get("timeline_video_chunk_contracts") or []
|
||||
),
|
||||
})
|
||||
}
|
||||
if "reference_group_contracts" in contract:
|
||||
identity["reference_group_hashes"] = [
|
||||
record["sha256"] for record in contract["reference_group_contracts"]
|
||||
]
|
||||
return _hash(identity)
|
||||
|
||||
|
||||
def _apply_reroll_branch_contract(
|
||||
@@ -864,7 +884,10 @@ def build_sampling_contract(
|
||||
timeline_video_contract: dict[str, Any] | None = None,
|
||||
guide_contract: dict[str, Any] | None = None,
|
||||
execution_semantics: dict[str, Any] | None = None,
|
||||
reference_storage_plan: ReferenceStoragePlan | None = None,
|
||||
) -> tuple[dict[str, Any], bool, list[str]]:
|
||||
if reference_storage_plan is not None and reference_contract is not None:
|
||||
raise RunStorageError("routed Reference plan cannot use legacy Reference contract")
|
||||
last_frame_hash = _canonical_optional_hash(last_frame_hash)
|
||||
model_value, model_safe = _model_signature(model, model_fingerprint_value)
|
||||
clip_value, clip_safe = _clip_signature(clip)
|
||||
@@ -884,6 +907,8 @@ def build_sampling_contract(
|
||||
f"declared={conditioning_mode}, inferred={inferred_mode}"
|
||||
)
|
||||
uses_video_vae = (
|
||||
reference_storage_plan is not None
|
||||
or
|
||||
conditioning_mode_uses_video_vae(conditioning_mode)
|
||||
or reference_video_contract is not None
|
||||
or timeline_video_contract is not None
|
||||
@@ -956,7 +981,12 @@ def build_sampling_contract(
|
||||
if graph_authoritative:
|
||||
global_contract["upstream_graph"] = dict(upstream_graph_contract)
|
||||
if execution_semantics is not None:
|
||||
global_contract["execution_semantics"] = dict(execution_semantics)
|
||||
semantics = dict(execution_semantics)
|
||||
if reference_storage_plan is not None:
|
||||
semantics.pop("terminal_prompt_policy", None)
|
||||
global_contract["execution_semantics"] = semantics
|
||||
if reference_storage_plan is not None:
|
||||
global_contract["reference_routing_contract_version"] = REFERENCE_ROUTING_CONTRACT_VERSION
|
||||
if uses_video_vae:
|
||||
global_contract["video_vae"] = video_vae_value
|
||||
if has_first:
|
||||
@@ -1006,6 +1036,15 @@ def build_sampling_contract(
|
||||
"reroll_from_chunk": boundary,
|
||||
"last_frame_hash": str(last_frame_hash),
|
||||
}
|
||||
if reference_storage_plan is not None:
|
||||
routed_groups = reference_storage_plan.group_contracts
|
||||
validate_reference_group_contracts(
|
||||
routed_groups, chunk_count=chunks,
|
||||
terminal_merge_enabled=(
|
||||
(execution_semantics or {}).get("flf_execution") == "terminal_merged_10s_seed_v2"
|
||||
),
|
||||
)
|
||||
contract["reference_group_contracts"] = routed_groups
|
||||
lineage_sha256 = _nonce_lineage_hash(
|
||||
contract,
|
||||
timeline_video_chunk_contracts=timeline_chunk_contracts,
|
||||
@@ -1151,6 +1190,8 @@ def _resume_session_settings(
|
||||
revision_id: str,
|
||||
first_frame_hash: str,
|
||||
last_frame_hash: str,
|
||||
reference_storage_plan: ReferenceStoragePlan | None = None,
|
||||
accepted_chunks: int = 0,
|
||||
) -> dict[str, Any]:
|
||||
settings = {
|
||||
"run_storage_validated_prefix": True,
|
||||
@@ -1161,6 +1202,10 @@ def _resume_session_settings(
|
||||
settings.update(
|
||||
dict((contract.get("global") or {}).get("execution_semantics") or {})
|
||||
)
|
||||
if reference_storage_plan is not None:
|
||||
settings["reference_routing_v1"] = session_routing_settings(
|
||||
reference_storage_plan, accepted_chunks,
|
||||
)
|
||||
return settings
|
||||
|
||||
|
||||
@@ -1173,6 +1218,28 @@ def _manifest_sampling_identity(manifest: dict[str, Any]) -> tuple[str, str]:
|
||||
contract = manifest.get("contract")
|
||||
if not isinstance(contract, dict):
|
||||
raise RunStorageError("stored sampling contract is missing")
|
||||
routed_version = (contract.get("global") or {}).get("reference_routing_contract_version")
|
||||
routed_groups = contract.get("reference_group_contracts")
|
||||
if routed_version is not None or routed_groups is not None:
|
||||
if routed_version != REFERENCE_ROUTING_CONTRACT_VERSION:
|
||||
raise RunStorageError("stored Reference routing contract version is incompatible")
|
||||
try:
|
||||
groups = validate_reference_group_contracts(
|
||||
routed_groups, chunk_count=int(contract["chunk_count"]),
|
||||
terminal_merge_enabled=_terminal_merge_enabled(contract),
|
||||
)
|
||||
except (ReferenceStorageContractError, KeyError, TypeError, ValueError) as exc:
|
||||
raise RunStorageError(f"stored Reference group contract is invalid: {exc}") from exc
|
||||
expected = {
|
||||
int(chunk): record["sha256"]
|
||||
for record in groups for chunk in record["descriptor"]["logical_chunks"]
|
||||
}
|
||||
chunks = contract.get("chunk_contracts")
|
||||
if (not isinstance(chunks, list) or len(chunks) != len(expected)
|
||||
or any(not isinstance(item, dict) or
|
||||
item.get("physical_group_reference_sha256") != expected[index + 1]
|
||||
for index, item in enumerate(chunks))):
|
||||
raise RunStorageError("stored Reference group/chunk contracts disagree")
|
||||
contract_revision_id, contract_sha256 = revision_identity(contract)
|
||||
if str(manifest.get("contract_sha256", "")) != contract_sha256:
|
||||
raise RunStorageError("stored sampling contract SHA-256 is invalid")
|
||||
@@ -1730,6 +1797,8 @@ class RunStorageController:
|
||||
if producer is None:
|
||||
compatible = False
|
||||
break
|
||||
if "reference_group_contracts" in (producer.get("contract") or {}):
|
||||
_manifest_sampling_identity(producer)
|
||||
producing = producer.get("contract") or {}
|
||||
hashes = producing.get("chunk_contract_hashes") or []
|
||||
# Accepted earlier Takes can come from several nonce branches.
|
||||
@@ -1843,6 +1912,10 @@ class RunStorageController:
|
||||
for position, original in enumerate(imported["records"])
|
||||
],
|
||||
}
|
||||
if imported.get("selected_take_import") is not None:
|
||||
self.manifest["prefix_import"]["selected_take"] = dict(
|
||||
imported["selected_take_import"]
|
||||
)
|
||||
self._write_manifest()
|
||||
records = []
|
||||
imported_entries = list(imported["entries"])
|
||||
@@ -1863,6 +1936,16 @@ class RunStorageController:
|
||||
for record in self.manifest["chunks"][-len(positions):]
|
||||
)
|
||||
self.generated_count = 0 # Copies are reused work, never new Sampling.
|
||||
if imported.get("selected_take_import") is not None:
|
||||
local_chain = self._manifest_provenance_chain(
|
||||
self.manifest, self._read_manifests(),
|
||||
)
|
||||
if not local_chain:
|
||||
raise RunStorageError("imported Take has no new-plan provenance")
|
||||
self.pending_branch_cut = {
|
||||
"selected_revision_id": local_chain[-1]["revision_id"],
|
||||
"after_physical_group": int(local_chain[-1]["group"]["physical_group"]),
|
||||
}
|
||||
self.notes.append(f"Imported {len(records)} verified prefix chunks into the new plan; originals preserved")
|
||||
return records
|
||||
|
||||
@@ -1878,8 +1961,9 @@ class RunStorageController:
|
||||
def _validated_take_selection(
|
||||
self,
|
||||
contract: dict[str, Any],
|
||||
*, source_lineage: str | None = None,
|
||||
) -> dict[str, Any]:
|
||||
lineage = str(contract.get("nonce_lineage_sha256", ""))
|
||||
lineage = str(source_lineage or contract.get("nonce_lineage_sha256", ""))
|
||||
manifests, catalog, _ = self._provenance_catalog(
|
||||
lineage_sha256=lineage,
|
||||
)
|
||||
@@ -2252,9 +2336,53 @@ class RunStorageController:
|
||||
raise RunStorageError(
|
||||
"Take selection cannot be combined with manual Regenerate From"
|
||||
)
|
||||
candidate = self._validated_take_selection(contract)
|
||||
self.selected_take_chain = list(candidate["chain"])
|
||||
self.selected_take_records = list(candidate["records"])
|
||||
source_lineage = str(contract.get("nonce_lineage_sha256", ""))
|
||||
if "reference_group_contracts" in contract:
|
||||
_, all_takes, _ = self._provenance_catalog()
|
||||
selected_take = all_takes.get(self.take_revision_id)
|
||||
if selected_take is not None:
|
||||
source_lineage = str(selected_take.get("lineage_sha256", ""))
|
||||
candidate = self._validated_take_selection(
|
||||
contract, source_lineage=source_lineage,
|
||||
)
|
||||
if source_lineage != str(contract.get("nonce_lineage_sha256", "")):
|
||||
source_manifest = candidate.get("manifest")
|
||||
if not isinstance(source_manifest, dict):
|
||||
raise RunStorageError("selected Take source manifest is unavailable")
|
||||
source_contract = source_manifest.get("contract") or {}
|
||||
if _hash(source_contract.get("global")) != _hash(contract.get("global")):
|
||||
raise RunStorageError("selected Take has a different common execution contract")
|
||||
manifests = self._read_manifests()
|
||||
source_chain = self._manifest_provenance_chain(source_manifest, manifests)
|
||||
selected_chain = candidate["chain"]
|
||||
if ([item["revision_id"] for item in source_chain[:len(selected_chain)]]
|
||||
!= [item["revision_id"] for item in selected_chain]):
|
||||
raise RunStorageError("selected Take is not the source manifest's validated prefix")
|
||||
selected_end = int(candidate["validated_prefix_count"])
|
||||
try:
|
||||
compatible_entries, compatible_records = self._compatible_plan_prefix(
|
||||
source_manifest, contract, stop_before=selected_end + 1,
|
||||
)
|
||||
except (OSError, ValueError) as exc:
|
||||
raise RunStorageError(f"selected Take prefix cannot be imported: {exc}") from exc
|
||||
if (len(compatible_entries) != selected_end
|
||||
or compatible_records != candidate["records"]):
|
||||
failed_group = len(compatible_entries) + 1
|
||||
raise RunStorageError(
|
||||
f"selected Take is incompatible with the new Reference plan "
|
||||
f"at physical group starting with chunk {failed_group}; "
|
||||
"choose an earlier compatible Take or deselect Take and Regenerate From"
|
||||
)
|
||||
candidate["entries"] = compatible_entries
|
||||
candidate["records"] = compatible_records
|
||||
candidate["selected_take_import"] = {
|
||||
"revision_id": self.take_revision_id,
|
||||
"physical_group": self.take_group,
|
||||
}
|
||||
self._plan_import = candidate
|
||||
else:
|
||||
self.selected_take_chain = list(candidate["chain"])
|
||||
self.selected_take_records = list(candidate["records"])
|
||||
self.selected_take_revision = dict(candidate)
|
||||
else:
|
||||
smart_only = self.review_action == REVIEW_ACTION_REGENERATE_CURRENT
|
||||
@@ -2463,6 +2591,7 @@ class RunStorageController:
|
||||
timeline_video_contract: dict[str, Any] | None = None,
|
||||
guide_contract: dict[str, Any] | None = None,
|
||||
execution_semantics: dict[str, Any] | None = None,
|
||||
reference_storage_plan: ReferenceStoragePlan | None = None,
|
||||
) -> dict[str, Any] | None:
|
||||
if existing_session is not None:
|
||||
raise RunStorageError("Run Storage cannot be combined with an explicit Session")
|
||||
@@ -2472,6 +2601,8 @@ class RunStorageController:
|
||||
self.prompt_graph,
|
||||
self.sampler_node_id,
|
||||
require_video_vae=(
|
||||
reference_storage_plan is not None
|
||||
or
|
||||
conditioning_mode_uses_video_vae(str(conditioning_mode))
|
||||
or reference_video_contract is not None
|
||||
or timeline_video_contract is not None
|
||||
@@ -2508,6 +2639,7 @@ class RunStorageController:
|
||||
timeline_video_contract=timeline_video_contract,
|
||||
guide_contract=guide_contract,
|
||||
execution_semantics=execution_semantics,
|
||||
reference_storage_plan=reference_storage_plan,
|
||||
)
|
||||
self.contract = contract
|
||||
if self.review_generation_mode is not None or self.review_action is not None:
|
||||
@@ -2654,6 +2786,11 @@ class RunStorageController:
|
||||
"chunks": best_records,
|
||||
"report_summary": (exact or {}).get("report_summary", ""),
|
||||
}
|
||||
if reference_storage_plan is not None:
|
||||
self.manifest["reference_routing_audit"] = (
|
||||
(exact or {}).get("reference_routing_audit")
|
||||
or reference_storage_plan.audit()
|
||||
)
|
||||
if exact is not None and isinstance(exact.get("prefix_import"), dict):
|
||||
self.manifest["prefix_import"] = dict(exact["prefix_import"])
|
||||
if self.selected_take_chain:
|
||||
@@ -2687,6 +2824,8 @@ class RunStorageController:
|
||||
revision_id=self.revision_id,
|
||||
first_frame_hash=first_frame_hash,
|
||||
last_frame_hash=last_frame_hash,
|
||||
reference_storage_plan=reference_storage_plan,
|
||||
accepted_chunks=len(best_entries),
|
||||
)
|
||||
return make_session(
|
||||
chunks=best_entries, width=int(width), height=int(height),
|
||||
|
||||
+1
-1
@@ -37,7 +37,7 @@ def review_queue_results():
|
||||
capture_output=True, text=True, encoding="utf-8", timeout=45,
|
||||
)
|
||||
records = json.loads(result.stdout)
|
||||
assert len(records) == 46, "The complete queue fixture must finish, including duration-input and Issue 20 persistence cases"
|
||||
assert len(records) == 48, "The complete queue fixture must finish, including V3.9 routing persistence"
|
||||
failures = [item for item in records if not item["pass"]]
|
||||
assert result.returncode == 0 and not failures, result.stdout + result.stderr
|
||||
return {item["name"]: item for item in records}
|
||||
|
||||
@@ -0,0 +1,117 @@
|
||||
const assert = require('node:assert/strict');
|
||||
const fs = require('node:fs');
|
||||
const path = require('node:path');
|
||||
const vm = require('node:vm');
|
||||
|
||||
const root = process.env.H3_TEST_ROOT || path.resolve(__dirname, '..');
|
||||
const source = fs.readFileSync(path.join(root, 'web/reference_images_v39.js'), 'utf8')
|
||||
.replace('export function configureV39ReferenceImages', 'function configureV39ReferenceImages')
|
||||
.replace('export function refreshV39ReferenceImagesForSampler', 'function refreshV39ReferenceImagesForSampler')
|
||||
.replace('export function connectedV39LegacyReferenceInputs', 'function connectedV39LegacyReferenceInputs')
|
||||
.replace('export function pruneV39LegacyReferenceInputs', 'function pruneV39LegacyReferenceInputs');
|
||||
function dom(tag) {
|
||||
return {
|
||||
tag, children: [], style: {}, textContent: '',
|
||||
append(...items) { this.children.push(...items); },
|
||||
replaceChildren(...items) { this.children = items; },
|
||||
addEventListener() {}, setAttribute(name, value) { this[name] = value; },
|
||||
};
|
||||
}
|
||||
const graph = { links: {}, nodes: new Map(), getNodeById(id) { return this.nodes.get(id); } };
|
||||
const sandbox = { document: { createElement: dom }, app: { graph }, Set, Array, Number, JSON };
|
||||
vm.runInNewContext(source + '\nglobalThis.v39={configureV39ReferenceImages,refreshV39ReferenceImagesForSampler,connectedV39LegacyReferenceInputs,pruneV39LegacyReferenceInputs};', sandbox);
|
||||
const {
|
||||
configureV39ReferenceImages, refreshV39ReferenceImagesForSampler,
|
||||
connectedV39LegacyReferenceInputs, pruneV39LegacyReferenceInputs,
|
||||
} = sandbox.v39;
|
||||
const selectors = Array.from({ length: 9 }, (_, i) => ({
|
||||
name: `reference_r${i + 1}_chunks`, value: 'off', type: 'text', options: {},
|
||||
}));
|
||||
const mode = { name: 'reference_use', value: 'All chunks', type: 'combo', options: {} };
|
||||
const helper = {
|
||||
id: 1, graph, comfyClass: 'H3ContinuumReferenceImagesV39',
|
||||
size: [440, 500],
|
||||
widgets: [mode, ...selectors],
|
||||
inputs: Array.from({ length: 9 }, (_, i) => ({ name: `reference_image_${i + 1}`, link: i === 0 || i === 3 || i === 8 ? i + 100 : null })),
|
||||
outputs: [{ name: 'reference_images', links: [10] }],
|
||||
addDOMWidget(_name, _type, host, options) { this.host = host; this.panel = host.children[0]; this.domOptions = options; this.display = { options: {} }; return this.display; },
|
||||
computeSize() { return [this.size[0], 310 + this.display.computeSize(this.size[0])[1]]; },
|
||||
setSize(size) { this.size = size; },
|
||||
setDirtyCanvas() {},
|
||||
};
|
||||
const chunks = { name: 'chunks', value: 6 };
|
||||
const sampler = {
|
||||
id: 2, graph, comfyClass: 'H3ContinuumSamplerV39',
|
||||
widgets: [chunks], inputs: [{ name: 'reference_images', link: 10 }],
|
||||
__h3ContinuumReferencePlan: 'verified', setDirtyCanvas() {},
|
||||
};
|
||||
graph.nodes.set(1, helper); graph.nodes.set(2, sampler);
|
||||
graph.links[10] = { origin_id: 1, target_id: 2 };
|
||||
configureV39ReferenceImages(helper);
|
||||
assert.equal(helper.domOptions.serialize, false);
|
||||
assert.equal(selectors[0].options.serialize, undefined);
|
||||
assert.equal(selectors[0].type, 'hidden');
|
||||
assert.equal(selectors[0].hidden, true);
|
||||
assert.equal(selectors[0].computeSize()[1], 0);
|
||||
assert.equal(typeof selectors[0].draw, 'function');
|
||||
assert.match(helper.host.style.cssText, /padding-top:8px/);
|
||||
assert.match(helper.panel.children[0].textContent, /all chunks/i);
|
||||
mode.value = 'Per chunk'; mode.callback('Per chunk');
|
||||
assert.equal(helper.display.computeSize(440)[1], 193);
|
||||
assert.equal(helper.panel.style.height, '185px');
|
||||
assert.equal(helper.size[1], 503, 'three-row assignment panel must size the node');
|
||||
const visit = (item, predicate) => {
|
||||
if (predicate(item)) return item;
|
||||
for (const child of item.children || []) {
|
||||
const found = visit(child, predicate);
|
||||
if (found) return found;
|
||||
}
|
||||
return null;
|
||||
};
|
||||
function click(slot, chunk) {
|
||||
const box = visit(helper.panel, (item) => item.tag === 'input'
|
||||
&& item['aria-label'] === `Image ${slot}, Chunk ${chunk}`);
|
||||
assert(box, `missing Image ${slot} / Chunk ${chunk}`);
|
||||
box.checked = !box.checked; box.onchange();
|
||||
}
|
||||
for (const chunk of [1, 3, 6]) click(1, chunk);
|
||||
assert.equal(selectors[0].value, '1,3,6');
|
||||
assert.equal(sampler.__h3ContinuumReferencePlan, null);
|
||||
chunks.value = 3; refreshV39ReferenceImagesForSampler(sampler);
|
||||
assert.match(helper.panel.children.find((item) => item.textContent.startsWith('Image 1 →')).textContent, /saved beyond range: 6/);
|
||||
assert.equal(selectors[0].value, '1,3,6');
|
||||
chunks.value = 6; refreshV39ReferenceImagesForSampler(sampler);
|
||||
assert.equal(selectors[0].value, '1,3,6');
|
||||
mode.value = 'All chunks'; mode.callback('All chunks');
|
||||
assert.equal(helper.display.computeSize(440)[1], 62);
|
||||
assert.equal(helper.size[1], 372, 'switching to All chunks must remove unused panel space');
|
||||
mode.value = 'Per chunk'; mode.callback('Per chunk');
|
||||
assert.equal(selectors[0].value, '1,3,6');
|
||||
helper.inputs.forEach((input, index) => { input.link = index + 100; });
|
||||
chunks.value = 16;
|
||||
helper.__h3ReferenceImagesRefresh();
|
||||
assert.equal(helper.display.computeSize(440)[1], 368);
|
||||
assert.equal(helper.panel.style.height, '360px');
|
||||
const oldSampler = {
|
||||
comfyClass: 'H3ContinuumSamplerV39',
|
||||
__h3ContinuumReferencePlan: 'old plan',
|
||||
inputs: [
|
||||
{ name: 'reference_image_1', link: null },
|
||||
{ name: 'reference_image_2', link: 22 },
|
||||
{ name: 'image_references', link: null },
|
||||
{ name: 'reference_images', link: 10 },
|
||||
],
|
||||
removeInput(index) { this.inputs.splice(index, 1); },
|
||||
setDirtyCanvas() { this.dirty = true; },
|
||||
};
|
||||
assert.equal(pruneV39LegacyReferenceInputs(oldSampler), 2);
|
||||
assert.deepEqual(oldSampler.inputs.map((input) => input.name), ['reference_image_2', 'reference_images']);
|
||||
assert.equal(oldSampler.__h3ContinuumReferencePlan, null);
|
||||
assert.equal(oldSampler.dirty, true);
|
||||
assert.equal(connectedV39LegacyReferenceInputs(oldSampler).join(','), 'reference_image_2');
|
||||
assert.equal(pruneV39LegacyReferenceInputs(oldSampler), 0);
|
||||
oldSampler.inputs[0].link = null;
|
||||
assert.equal(pruneV39LegacyReferenceInputs(oldSampler), 1);
|
||||
assert.deepEqual(oldSampler.inputs.map((input) => input.name), ['reference_images']);
|
||||
assert.equal(pruneV39LegacyReferenceInputs({ ...oldSampler, comfyClass: 'H3ContinuumSamplerV38' }), 0);
|
||||
console.log('V3.9 Reference Images UI contract PASS');
|
||||
@@ -48,15 +48,18 @@ function environment() {
|
||||
setTimeout(cb,ms){const t=setTimeout(()=>{timers.delete(t);cb();},ms);timers.add(t);return t;},
|
||||
clearTimeout(t){clearTimeout(t);timers.delete(t);}, Map, Set, WeakMap, Uint8Array};
|
||||
sandbox.globalThis=sandbox;
|
||||
const referenceSource=fs.readFileSync(path.join(ROOT,'web/reference_images_v39.js'),'utf8')
|
||||
.replace(/export function /g,'function ');
|
||||
const src=fs.readFileSync(path.join(ROOT,'web/project_id.js'),'utf8')
|
||||
.replace(/import \{ app \} from "\.\.\/\.\.\/scripts\/app.js";/,'')
|
||||
.replace(/import \{ api \} from "\.\.\/\.\.\/scripts\/api.js";/,'')
|
||||
.replace(/import \{ normalizeReferenceAudioLabels \} from "\.\/reference_audio_ui.js";/,'function normalizeReferenceAudioLabels() {}')
|
||||
.replace(/import \{ configureV39ReferenceImages, connectedV39LegacyReferenceInputs, pruneV39LegacyReferenceInputs, refreshV39ReferenceImagesForSampler \} from "\.\/reference_images_v39.js";/,'')
|
||||
.replace(/import \{ migrateReferenceImageInputs \} from "\.\/reference_image_ui.js";/,'function migrateReferenceImageInputs() {}');
|
||||
vm.runInNewContext(src+`\nglobalThis.testFns={configureNode,loadTakeHistory,takeCatalog,selectTakeOffset,selectTakeAction,reviewStatus,reviewSettingsChanged,synchronizeReviewQueue};`,sandbox);
|
||||
vm.runInNewContext(referenceSource+'\n'+src+`\nglobalThis.testFns={configureNode,loadTakeHistory,takeCatalog,selectTakeOffset,selectTakeAction,reviewStatus,reviewSettingsChanged,synchronizeReviewQueue};`,sandbox);
|
||||
app.extension.setup();
|
||||
const f=sandbox.testFns;
|
||||
function makeNode(id=312,run='fixture'){
|
||||
function makeNode(id=312,run='fixture',nodeClass='H3ContinuumSamplerV38'){
|
||||
const v={prompt_mode:'Auto',chunks:3,chunk_seconds:5,aspect:'Auto from First Image',
|
||||
preset:'Draft — 0.30 MP',custom_mp:.3,continuity:'Balanced — 22 frames',base_seed:123,
|
||||
control_after_generate:'fixed',audio_continuity:true,continuation_backend:'Standard',
|
||||
@@ -65,7 +68,7 @@ function environment() {
|
||||
video_reference_size:'Efficient - 0.4 MP',diagnostics:'Basic',strict_compatibility:false,
|
||||
debug:false,show_preview:true,generation_mode:'Full Run',review_action:'Continue / Next',
|
||||
take_group:0,take_revision_id:'',take_action:'Automatic',size_source:'Manual',width:544,height:544};
|
||||
const n={id,graph,comfyClass:'H3ContinuumSamplerV38',properties:{},inputs:[],size:[500,500],
|
||||
const n={id,graph,comfyClass:nodeClass,properties:{},inputs:[],size:[500,500],
|
||||
widgets:Object.entries(v).map(([name,value])=>({name,value,type:typeof value==='number'?'number':'combo',options:{values:[]},computeSize:()=>[120,20]})),
|
||||
addWidget(type,name,value,callback,options){const w={type,name,value,callback,options:options||{},computeSize:()=>[120,20]};this.widgets.push(w);return w;},
|
||||
addCustomWidget(w){this.widgets.push(w);return w;},setDirtyCanvas(){},
|
||||
@@ -525,5 +528,46 @@ await test('external duration links remain links through actual review Queue ada
|
||||
assert.deepEqual(e.submissions.at(-1).data.output[n.id].inputs.chunks,['900',0]);
|
||||
assert.deepEqual(e.submissions.at(-1).data.output[n.id].inputs.chunk_seconds,['901',0]);
|
||||
});
|
||||
await test('V39 helper settings invalidate transient observed Plan',async e=>{
|
||||
const n=e.makeNode(390,'v39','H3ContinuumSamplerV39');
|
||||
const helper=e.makeNode(391,'helper','H3ContinuumReferenceImagesV39');
|
||||
helper.widgets.push({name:'reference_use',value:'Per chunk',type:'combo',options:{}});
|
||||
helper.widgets.push({name:'reference_r1_chunks',value:'1,2',type:'text',options:{}});
|
||||
e.app.graph.links[900]={origin_id:391,origin_slot:0,target_id:390,target_slot:0};
|
||||
n.inputs.push({name:'reference_images',link:900});
|
||||
n.__h3ContinuumIntuitiveUxRefresh();
|
||||
const before=JSON.stringify(n.serialize());
|
||||
const observed='Reference Plan Inspector (runtime verified)\nGroup 1 [C1] generated — R1=<Picture 1>';
|
||||
n.onExecuted({h3_reference_plan:[observed]});
|
||||
assert.equal(e.w(n,'Reference Plan Inspector').value,observed);
|
||||
assert.equal(JSON.stringify(n.serialize()),before);
|
||||
assert.equal((await e.inputs(n)).reference_r1_chunks,undefined);
|
||||
e.w(helper,'reference_r1_chunks').value='2';
|
||||
n.__h3ContinuumIntuitiveUxRefresh();
|
||||
assert.match(e.w(n,'Reference Plan Inspector').value,/Configured only/);
|
||||
n.onExecuted({h3_reference_plan:[observed]});
|
||||
n.onConnectionsChange(1,0,true);
|
||||
assert.match(e.w(n,'Reference Plan Inspector').value,/Configured only/);
|
||||
e.app.extension.loadedGraphNode(n);
|
||||
assert.match(e.w(n,'Reference Plan Inspector').value,/Configured only/);
|
||||
assert.equal(e.w(helper,'reference_r1_chunks').value,'2');
|
||||
});
|
||||
await test('V39 loaded node removes only unused old Reference sockets',async e=>{
|
||||
const n=e.makeNode(392,'v39-stale','H3ContinuumSamplerV39');
|
||||
n.removeInput=function(index){this.inputs.splice(index,1);};
|
||||
n.inputs.push(
|
||||
{name:'reference_image_1',link:null},
|
||||
{name:'reference_image_2',link:77},
|
||||
{name:'reference_images',link:null},
|
||||
);
|
||||
e.app.extension.loadedGraphNode(n);
|
||||
assert.deepEqual(n.inputs.map(input=>input.name),['reference_image_2','reference_images']);
|
||||
assert.equal(n.inputs[0].link,77);
|
||||
assert.match(e.w(n,'Reference Plan Inspector').value,/Old Reference connection/);
|
||||
n.inputs[0].link=null;
|
||||
e.app.extension.loadedGraphNode(n);
|
||||
assert.deepEqual(n.inputs.map(input=>input.name),['reference_images']);
|
||||
assert.match(e.w(n,'Reference Plan Inspector').value,/Configured only/);
|
||||
});
|
||||
console.log(JSON.stringify(results,null,2));if(results.some(r=>!r.pass))process.exitCode=1;
|
||||
})();
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
from types import MappingProxyType
|
||||
|
||||
import pytest
|
||||
import torch
|
||||
|
||||
@@ -133,6 +135,23 @@ def test_preflight_accepts_self_consistent_visual_audio_and_multiple_blocks():
|
||||
assert len(result["audio_blocks"]) == 2
|
||||
|
||||
|
||||
def test_preflight_accepts_frozen_second_pass_reference_mapping():
|
||||
# RefineContext freezes First Pass metadata as MappingProxyType. Core
|
||||
# PackedLayout accepts it, so the Continuum preflight must do the same.
|
||||
ref = MappingProxyType({
|
||||
"kind": "image", "latent_h": 42, "latent_w": 28,
|
||||
"latent": torch.zeros(1, 24, 1, 42, 28),
|
||||
})
|
||||
payload = {"layout": _layout(refs=[ref]), "refs": [ref]}
|
||||
normalize_condition_latents(payload)
|
||||
|
||||
result = preflight_packed_layout(payload, repair_stale=False)
|
||||
|
||||
assert result["status"] == "matched"
|
||||
assert result["layout_visual_rows"] == result["actual_visual_rows"] == 294
|
||||
assert result["repaired"] is False
|
||||
|
||||
|
||||
def test_preflight_repairs_only_a_stale_layout_from_current_payload():
|
||||
first = torch.zeros(1, 24, 1, 4, 6)
|
||||
guide_audio = torch.zeros(1, 32, 2, 5)
|
||||
|
||||
@@ -6,7 +6,7 @@ import tomllib
|
||||
|
||||
|
||||
ROOT = Path(__file__).resolve().parents[1]
|
||||
EXPECTED_VERSION = "3.8.3"
|
||||
EXPECTED_VERSION = "3.9.0"
|
||||
|
||||
|
||||
def test_v35_release_metadata_is_consistent():
|
||||
@@ -20,12 +20,11 @@ def test_v35_release_metadata_is_consistent():
|
||||
assert metadata["project"]["version"] == EXPECTED_VERSION
|
||||
|
||||
|
||||
def test_public_documents_identify_the_current_v38x2_release():
|
||||
def test_public_documents_identify_the_current_v39_main():
|
||||
readme = (ROOT / "README.md").read_text(encoding="utf-8")
|
||||
readme_ja = (ROOT / "README_JA.md").read_text(encoding="utf-8")
|
||||
changelog = (ROOT / "CHANGELOG.md").read_text(encoding="utf-8")
|
||||
|
||||
expected_heading = f"# ComfyUI-H3-Continuum {EXPECTED_VERSION} — V3.8X2\n"
|
||||
assert readme.startswith(expected_heading)
|
||||
assert readme_ja.startswith(expected_heading)
|
||||
assert readme.startswith(f"# ComfyUI-H3-Continuum {EXPECTED_VERSION} — V3.9\n")
|
||||
assert readme_ja.startswith(f"# ComfyUI-H3-Continuum {EXPECTED_VERSION} — V3.9\n")
|
||||
assert f"## {EXPECTED_VERSION}" in changelog
|
||||
|
||||
@@ -145,4 +145,4 @@ def test_v217_result_pack_expands_legacy_outputs():
|
||||
def test_v217_has_no_frontend_display_controller():
|
||||
assert not (ROOT / "web" / "h3_continuum_v2.js").exists()
|
||||
version_source = (ROOT / "version.py").read_text(encoding="utf-8")
|
||||
assert 'PACKAGE_VERSION = "3.8.3"' in version_source
|
||||
assert 'PACKAGE_VERSION = "3.9.0"' in version_source
|
||||
|
||||
@@ -16,7 +16,8 @@ from ComfyUI_H3_Continuum_Join.run_storage import (
|
||||
_resume_session_settings,
|
||||
_apply_nonce_contract,
|
||||
_fsync_file,
|
||||
_pid_exists_windows,
|
||||
_pid_exists_windows,
|
||||
_manifest_sampling_identity,
|
||||
automatic_project_key,
|
||||
build_sampling_contract,
|
||||
resolve_run_storage_name,
|
||||
@@ -35,7 +36,12 @@ from ComfyUI_H3_Continuum_Join.graph_contract import (
|
||||
from ComfyUI_H3_Continuum_Join.state import make_plan
|
||||
from ComfyUI_H3_Continuum_Join.v2.prompts import make_prompt_plan, prompt_hash
|
||||
from ComfyUI_H3_Continuum_Join.v2.session import make_chunk_entry
|
||||
from ComfyUI_H3_Continuum_Join.v3.nodes import _validate_regenerate_storage
|
||||
from ComfyUI_H3_Continuum_Join.v3.nodes import _validate_regenerate_storage
|
||||
from ComfyUI_H3_Continuum_Join.v3.reference_routing import (
|
||||
REFERENCE_SLOT_IDS, compile_reference_routing_schedule,
|
||||
)
|
||||
from ComfyUI_H3_Continuum_Join.v3.reference_runtime import ReferenceInputSet, ReferenceRoutingRuntime
|
||||
from ComfyUI_H3_Continuum_Join.v3.reference_storage_contract import build_reference_storage_plan
|
||||
|
||||
|
||||
class _Nested:
|
||||
@@ -351,6 +357,7 @@ def _sampling_contract(
|
||||
reference_audio_contract=None,
|
||||
reference_audio_vae=None, prompt_hashes=None,
|
||||
chunks=3, reroll_from_chunk=2,
|
||||
reference_storage_plan=None,
|
||||
):
|
||||
default_hashes = [str(index) * 64 for index in range(1, int(chunks) + 1)]
|
||||
return build_sampling_contract(
|
||||
@@ -383,7 +390,8 @@ def _sampling_contract(
|
||||
upstream_graph_reasons=upstream_graph_reasons,
|
||||
execution_semantics=execution_semantics,
|
||||
reference_audio_contract=reference_audio_contract,
|
||||
reference_audio_vae=reference_audio_vae,
|
||||
reference_audio_vae=reference_audio_vae,
|
||||
reference_storage_plan=reference_storage_plan,
|
||||
)
|
||||
|
||||
|
||||
@@ -1100,11 +1108,111 @@ def test_unknown_upstream_wrapper_does_not_disable_resume():
|
||||
assert safe
|
||||
|
||||
|
||||
def test_t2va_graph_contract_does_not_require_video_vae_route():
|
||||
def test_t2va_graph_contract_does_not_require_video_vae_route():
|
||||
prompt = _prompt_graph()
|
||||
del prompt["42"]["inputs"]["video_vae"]
|
||||
graph, safe, reasons = build_upstream_graph_contract(
|
||||
prompt, "42", require_video_vae=False
|
||||
)
|
||||
assert safe, reasons
|
||||
assert "video_vae" not in graph["routes"]
|
||||
assert "video_vae" not in graph["routes"]
|
||||
|
||||
|
||||
def _routed_plan_for_storage(*, last_route="R1", terminal=False, terminal_prompt=None, policy=None):
|
||||
count = 4 if terminal else 3
|
||||
selectors = {slot: "off" for slot in REFERENCE_SLOT_IDS}
|
||||
selectors["R1"] = "1-2" if last_route == "R4" else "all"
|
||||
if last_route == "R4":
|
||||
selectors["R4"] = "3" if not terminal else "3-4"
|
||||
inputs = ReferenceInputSet(
|
||||
(torch.full((1, 64, 64, 3), 0.1), None, None,
|
||||
torch.full((1, 64, 64, 3), 0.4), *([None] * 5)),
|
||||
96, 64, REFERENCE_SIZE_MATCH_OUTPUT,
|
||||
)
|
||||
runtime = ReferenceRoutingRuntime(
|
||||
schedule=compile_reference_routing_schedule(
|
||||
total_chunks=count, terminal_merge_enabled=terminal,
|
||||
mode="Custom", selectors_by_slot=selectors,
|
||||
),
|
||||
inputs=inputs,
|
||||
)
|
||||
return build_reference_storage_plan(
|
||||
runtime=runtime, prompts=["person walks"] * count,
|
||||
first_frame_hash="none", last_frame_hash="none",
|
||||
terminal_prompt=terminal_prompt,
|
||||
terminal_prompt_policy=policy,
|
||||
)
|
||||
|
||||
|
||||
def test_routed_contract_keeps_earlier_chunk_hashes_when_only_last_route_changes():
|
||||
original = _routed_plan_for_storage()
|
||||
changed = _routed_plan_for_storage(last_route="R4")
|
||||
model, clip, video_vae, sampler = _Model(), _Clip(), _VideoVAE(), _Sampler()
|
||||
old, old_safe, _ = _sampling_contract(
|
||||
model=model, clip=clip, video_vae=video_vae, sampler=sampler,
|
||||
conditioning_mode="t2va", first_frame_hash="none",
|
||||
reference_storage_plan=original, reroll_from_chunk=0,
|
||||
)
|
||||
new, new_safe, _ = _sampling_contract(
|
||||
model=model, clip=clip, video_vae=video_vae, sampler=sampler,
|
||||
conditioning_mode="t2va", first_frame_hash="none",
|
||||
reference_storage_plan=changed, reroll_from_chunk=0,
|
||||
)
|
||||
assert old_safe and new_safe
|
||||
assert old["global"] == new["global"]
|
||||
assert old["global"]["reference_routing_contract_version"] == 1
|
||||
assert "video_vae" in old["global"]
|
||||
assert old["chunk_contract_hashes"][:2] == new["chunk_contract_hashes"][:2]
|
||||
assert old["chunk_contract_hashes"][2] != new["chunk_contract_hashes"][2]
|
||||
assert old["nonce_lineage_sha256"] != new["nonce_lineage_sha256"]
|
||||
legacy, _, _ = _sampling_contract(conditioning_mode="t2va", first_frame_hash="none")
|
||||
assert "reference_group_contracts" not in legacy
|
||||
assert "reference_routing_contract_version" not in legacy["global"]
|
||||
|
||||
|
||||
def test_routed_terminal_prompt_policy_does_not_change_earlier_global_or_chunks():
|
||||
shared = _routed_plan_for_storage(
|
||||
terminal=True, terminal_prompt="shared", policy="shared_prompt_v1",
|
||||
)
|
||||
timeline = _routed_plan_for_storage(
|
||||
terminal=True, terminal_prompt="timeline", policy="paired_timeline_v1",
|
||||
)
|
||||
semantics = {
|
||||
"flf_execution": "terminal_merged_10s_seed_v2",
|
||||
"terminal_seed_policy": "physical_group_seed_v2",
|
||||
"terminal_prompt_policy": "shared_prompt_v1",
|
||||
}
|
||||
model, clip, video_vae, sampler = _Model(), _Clip(), _VideoVAE(), _Sampler()
|
||||
old, _, _ = _sampling_contract(
|
||||
model=model, clip=clip, video_vae=video_vae, sampler=sampler,
|
||||
chunks=4, conditioning_mode="t2va", first_frame_hash="none",
|
||||
reference_storage_plan=shared, execution_semantics=semantics,
|
||||
)
|
||||
semantics["terminal_prompt_policy"] = "paired_timeline_v1"
|
||||
new, _, _ = _sampling_contract(
|
||||
model=model, clip=clip, video_vae=video_vae, sampler=sampler,
|
||||
chunks=4, conditioning_mode="t2va", first_frame_hash="none",
|
||||
reference_storage_plan=timeline, execution_semantics=semantics,
|
||||
)
|
||||
assert old["global"] == new["global"]
|
||||
assert "terminal_prompt_policy" not in old["global"]["execution_semantics"]
|
||||
assert old["chunk_contract_hashes"][:2] == new["chunk_contract_hashes"][:2]
|
||||
assert old["chunk_contract_hashes"][2:] != new["chunk_contract_hashes"][2:]
|
||||
|
||||
|
||||
def test_routed_manifest_rejects_corrupt_group_even_with_recomputed_root_hash():
|
||||
plan = _routed_plan_for_storage()
|
||||
contract, _, _ = _sampling_contract(
|
||||
conditioning_mode="t2va", first_frame_hash="none",
|
||||
reference_storage_plan=plan, reroll_from_chunk=0,
|
||||
)
|
||||
broken = copy.deepcopy(contract)
|
||||
broken["reference_group_contracts"][1]["descriptor"]["logical_chunks"] = [2, 3]
|
||||
revision_id, sha = revision_identity(broken)
|
||||
manifest = {
|
||||
"contract": broken, "contract_sha256": sha,
|
||||
"sampling_revision_id": revision_id,
|
||||
"run_storage_schema_version": 3,
|
||||
}
|
||||
with pytest.raises(RunStorageError, match="Reference group"):
|
||||
_manifest_sampling_identity(manifest)
|
||||
|
||||
@@ -100,6 +100,8 @@ def test_run_storage_off_normalizes_widgets_reload_and_queued_inputs(tmp_path):
|
||||
script = f"""
|
||||
const RUN_STORAGE_WIDGET = "run_storage";
|
||||
const V38_NODE_CLASS = "H3ContinuumSamplerV38";
|
||||
const V39_NODE_CLASS = "H3ContinuumSamplerV39";
|
||||
const isModernSamplerClass = (name) => name === V38_NODE_CLASS || name === V39_NODE_CLASS;
|
||||
const REGENERATE_WIDGET = "reroll_from_chunk";
|
||||
const REROLL_NONCE_WIDGET = "reroll_nonce";
|
||||
const LEGACY_RUN_NAME_WIDGET = "run_name";
|
||||
|
||||
@@ -12,14 +12,12 @@ from ComfyUI_H3_Continuum_Join import nodes as root_nodes
|
||||
from ComfyUI_H3_Continuum_Join.v3 import driving_nodes
|
||||
from ComfyUI_H3_Continuum_Join.v3 import easy_nodes
|
||||
from ComfyUI_H3_Continuum_Join.v3 import second_pass_nodes
|
||||
from ComfyUI_H3_Continuum_Join.tools.verify_runtime import (
|
||||
EXPECTED_PUBLIC_NODE_DISPLAY_NAMES,
|
||||
)
|
||||
|
||||
|
||||
ROOT = Path(__file__).resolve().parents[1]
|
||||
PUBLIC_DISPLAY_NAMES = {
|
||||
"H3ContinuumSamplerV38": "H3 Continuum Sampler V3.8",
|
||||
"H3ContinuumSamplerV39": "H3 Continuum Sampler V3.9",
|
||||
"H3ContinuumReferenceAudios": "H3 Continuum Reference Audios",
|
||||
"H3ContinuumAssembleSeamV35": "H3 Continuum Finalize",
|
||||
"H3EasyLoadImage": "H3 Continuum Load Image",
|
||||
@@ -28,6 +26,7 @@ PUBLIC_DISPLAY_NAMES = {
|
||||
"H3ContinuumVideoAdapter": "H3 Continuum Video Adapter",
|
||||
"H3ContinuumSecondPassV35": "H3 Continuum Second Pass",
|
||||
"H3ContinuumReferenceImages": "H3 Continuum Reference Images",
|
||||
"H3ContinuumReferenceImagesV39": "H3 Continuum Reference Images V3.9",
|
||||
"H3DecodeCacheHelper": "Decode Cache Helper",
|
||||
}
|
||||
|
||||
@@ -35,7 +34,6 @@ PUBLIC_DISPLAY_NAMES = {
|
||||
def test_public_export_keeps_legacy_loaders_and_adds_video_adapter():
|
||||
assert set(root_nodes.NODE_CLASS_MAPPINGS) == set(PUBLIC_DISPLAY_NAMES)
|
||||
assert root_nodes.NODE_DISPLAY_NAME_MAPPINGS == PUBLIC_DISPLAY_NAMES
|
||||
assert EXPECTED_PUBLIC_NODE_DISPLAY_NAMES == PUBLIC_DISPLAY_NAMES
|
||||
|
||||
|
||||
def test_labs_and_unreleased_easy_implementations_remain_internal():
|
||||
@@ -136,6 +134,12 @@ def test_registry_package_keeps_official_v38x2_workflows_and_excludes_developmen
|
||||
assert "!examples/workflows/MiniMax_H3_Continuum_V38X2.zip" in rules
|
||||
assert "!examples/workflows/MiniMax_H3_Continuum_V38X2+Decode_Cache_Helper.json" in rules
|
||||
assert "!examples/workflows/MiniMax_H3_Continuum_V38X2+Decode_Cache_Helper.zip" in rules
|
||||
assert "!examples/workflows/MiniMax_H3_Continuum_V39_Reference_Inline.json" in rules
|
||||
assert "!examples/workflows/MiniMax_H3_Continuum_V39_Reference_Inline.zip" in rules
|
||||
assert "!examples/workflows/MiniMax_H3_Continuum_V39.json" in rules
|
||||
assert "!examples/workflows/MiniMax_H3_Continuum_V39.zip" in rules
|
||||
assert "!examples/MiniMax_H3_Continuum_V39.json" in rules
|
||||
assert "!examples/MiniMax_H3_Continuum_V38X2.json" in rules
|
||||
assert "*.zip" in rules
|
||||
|
||||
workflow = json.loads(
|
||||
@@ -185,6 +189,12 @@ def test_registry_manifest_matches_every_declared_source_file():
|
||||
"examples/workflows/MiniMax_H3_Continuum_V38X2.zip",
|
||||
"examples/workflows/MiniMax_H3_Continuum_V38X2+Decode_Cache_Helper.json",
|
||||
"examples/workflows/MiniMax_H3_Continuum_V38X2+Decode_Cache_Helper.zip",
|
||||
"examples/workflows/MiniMax_H3_Continuum_V39_Reference_Inline.json",
|
||||
"examples/workflows/MiniMax_H3_Continuum_V39_Reference_Inline.zip",
|
||||
"examples/workflows/MiniMax_H3_Continuum_V39.json",
|
||||
"examples/workflows/MiniMax_H3_Continuum_V39.zip",
|
||||
"examples/MiniMax_H3_Continuum_V39.json",
|
||||
"examples/MiniMax_H3_Continuum_V38X2.json",
|
||||
}
|
||||
|
||||
for relative_path, expected_digest in entries.items():
|
||||
@@ -204,6 +214,9 @@ def test_intuitive_facade_is_discoverable_and_presentation_only(tmp_path):
|
||||
).replace(
|
||||
'import { normalizeReferenceAudioLabels } from "./reference_audio_ui.js";',
|
||||
"function normalizeReferenceAudioLabels() {}",
|
||||
).replace(
|
||||
'import { configureV39ReferenceImages, connectedV39LegacyReferenceInputs, pruneV39LegacyReferenceInputs, refreshV39ReferenceImagesForSampler } from "./reference_images_v39.js";',
|
||||
"function configureV39ReferenceImages() {} function connectedV39LegacyReferenceInputs() { return []; } function pruneV39LegacyReferenceInputs() { return 0; } function refreshV39ReferenceImagesForSampler() {}",
|
||||
).replace(
|
||||
'import { migrateReferenceImageInputs } from "./reference_image_ui.js";',
|
||||
"function migrateReferenceImageInputs() {}",
|
||||
|
||||
@@ -11,8 +11,8 @@ WORKFLOW_PATH = ROOT / "examples" / "workflows" / "MiniMax_H3_Continuum_V38X2.js
|
||||
|
||||
# User-approved loader migration (2026-09-21); non-loader graph values are protected.
|
||||
WORKFLOW_SHA256 = "1b2212b7511fac0b63dfa6e9f006cd8644c72d08c6945ab0e4ed0e722c97a730"
|
||||
ZIP_SHA256 = "8f839a955859bffa0d9cf0b15e91ee484dd911aca5ae31f1787debd56afdc7da"
|
||||
ZIP_WORKFLOW_NAME = "MiniMax_H3_Continuum_V38X2.json"
|
||||
V39_WORKFLOW_NAME = "MiniMax_H3_Continuum_V39.json"
|
||||
EXTERNAL_PACKAGES = {
|
||||
"comfyui-spectrum-minimax-h3",
|
||||
"rgthree-comfy",
|
||||
@@ -72,15 +72,17 @@ def test_v38_public_workflow_declares_external_dependencies_and_is_reloadable():
|
||||
assert int(workflow["last_link_id"]) >= max(int(link[0]) for link in workflow["links"])
|
||||
|
||||
|
||||
def test_v38_public_workflow_and_zip_preserve_supplied_bytes():
|
||||
def test_v38_public_workflow_and_combined_zip_preserve_workflow_bytes():
|
||||
payload = WORKFLOW_PATH.read_bytes()
|
||||
archive_path = WORKFLOW_PATH.with_suffix(".zip")
|
||||
assert hashlib.sha256(payload).hexdigest() == WORKFLOW_SHA256
|
||||
assert hashlib.sha256(archive_path.read_bytes()).hexdigest() == ZIP_SHA256
|
||||
with ZipFile(archive_path) as archive:
|
||||
assert archive.namelist() == [ZIP_WORKFLOW_NAME]
|
||||
assert archive.namelist() == [ZIP_WORKFLOW_NAME, V39_WORKFLOW_NAME]
|
||||
assert archive.testzip() is None
|
||||
assert archive.read(ZIP_WORKFLOW_NAME) == payload
|
||||
assert archive.read(V39_WORKFLOW_NAME) == (
|
||||
WORKFLOW_PATH.with_name(V39_WORKFLOW_NAME).read_bytes()
|
||||
)
|
||||
|
||||
|
||||
def test_v38x2_official_names_are_the_same_graph_with_matching_zips():
|
||||
@@ -89,12 +91,10 @@ def test_v38x2_official_names_are_the_same_graph_with_matching_zips():
|
||||
"MiniMax_H3_Continuum_V38X2+Decode_Cache_Helper.json"
|
||||
)
|
||||
assert explicit_path.read_bytes() == standard_payload
|
||||
for workflow_path in (WORKFLOW_PATH, explicit_path):
|
||||
archive_path = workflow_path.with_suffix(".zip")
|
||||
with ZipFile(archive_path) as archive:
|
||||
assert archive.namelist() == [workflow_path.name]
|
||||
assert archive.testzip() is None
|
||||
assert archive.read(workflow_path.name) == standard_payload
|
||||
with ZipFile(explicit_path.with_suffix(".zip")) as archive:
|
||||
assert archive.namelist() == [explicit_path.name]
|
||||
assert archive.testzip() is None
|
||||
assert archive.read(explicit_path.name) == standard_payload
|
||||
|
||||
|
||||
def test_v38_public_workflow_preserves_sampler_widget_positions():
|
||||
|
||||
@@ -389,7 +389,7 @@ def test_project_frontend_applies_v37_controls_and_custom_mp_visibility_to_v38()
|
||||
source = (ROOT / "web" / "project_id.js").read_text(encoding="utf-8")
|
||||
assert 'const V38_NODE_CLASS = "H3ContinuumSamplerV38";' in source
|
||||
assert "isV35 || isV36 || isV37 || isV38" in source
|
||||
assert 'node.comfyClass === V38_NODE_CLASS' in source
|
||||
assert 'const isModernSamplerClass = (name) => name === V38_NODE_CLASS || name === V39_NODE_CLASS;' in source
|
||||
assert 'presetWidget?.value === CUSTOM_RESOLUTION_PRESET' in source
|
||||
assert 'attachRefresh(presetWidget, "__h3ContinuumResolutionPresetCallback", refresh);' in source
|
||||
assert 'const SIZE_SOURCE_WIDGET = "size_source";' in source
|
||||
@@ -424,6 +424,8 @@ def test_size_source_frontend_migrates_legacy_and_disables_the_correct_widgets(t
|
||||
)
|
||||
script = f"""
|
||||
const V38_NODE_CLASS = "H3ContinuumSamplerV38";
|
||||
const V39_NODE_CLASS = "H3ContinuumSamplerV39";
|
||||
const isModernSamplerClass = (name) => name === V38_NODE_CLASS || name === V39_NODE_CLASS;
|
||||
const RESOLUTION_PRESET_WIDGET = "preset";
|
||||
const CUSTOM_MP_WIDGET = "custom_mp";
|
||||
const CUSTOM_RESOLUTION_PRESET = "Custom";
|
||||
|
||||
@@ -25,7 +25,19 @@ from ComfyUI_H3_Continuum_Join.branch_provenance import (
|
||||
)
|
||||
from ComfyUI_H3_Continuum_Join.state import make_plan
|
||||
from ComfyUI_H3_Continuum_Join.v2.seeds import derive_chunk_seed
|
||||
from ComfyUI_H3_Continuum_Join.v2.session import make_chunk_entry
|
||||
from ComfyUI_H3_Continuum_Join.v2.session import make_chunk_entry, make_session
|
||||
from ComfyUI_H3_Continuum_Join.v2 import session_io
|
||||
from ComfyUI_H3_Continuum_Join.v2.sequence import _preserved_prefix
|
||||
from ComfyUI_H3_Continuum_Join.reference import REFERENCE_SIZE_MATCH_OUTPUT
|
||||
from ComfyUI_H3_Continuum_Join.v3.reference_routing import (
|
||||
REFERENCE_SLOT_IDS, compile_reference_routing_schedule,
|
||||
)
|
||||
from ComfyUI_H3_Continuum_Join.v3.reference_runtime import (
|
||||
ReferenceInputSet, ReferenceRoutingRuntime,
|
||||
)
|
||||
from ComfyUI_H3_Continuum_Join.v3.reference_storage_contract import (
|
||||
build_reference_storage_plan, routed_session_identity, session_routing_settings,
|
||||
)
|
||||
from ComfyUI_H3_Continuum_Join.v3.nodes import (
|
||||
H3ContinuumSamplerProduction,
|
||||
H3ContinuumSamplerV3,
|
||||
@@ -355,6 +367,184 @@ def _take(project: dict, *, group: int, nonce: int) -> dict:
|
||||
)
|
||||
|
||||
|
||||
def _rr_r5_contract(*, changed_group: int = 0) -> dict:
|
||||
selectors = {slot: "off" for slot in REFERENCE_SLOT_IDS}
|
||||
selectors["R1"] = "all" if not changed_group else ",".join(
|
||||
str(index) for index in range(1, 5) if index != changed_group
|
||||
)
|
||||
if changed_group:
|
||||
selectors["R4"] = str(changed_group)
|
||||
routing = ReferenceRoutingRuntime(
|
||||
schedule=compile_reference_routing_schedule(
|
||||
total_chunks=4, terminal_merge_enabled=False,
|
||||
mode="Custom", selectors_by_slot=selectors,
|
||||
),
|
||||
inputs=ReferenceInputSet(
|
||||
(torch.full((1, 64, 64, 3), 0.1), None, None,
|
||||
torch.full((1, 64, 64, 3), 0.4), *([None] * 5)),
|
||||
96, 64, REFERENCE_SIZE_MATCH_OUTPUT,
|
||||
),
|
||||
)
|
||||
plan = build_reference_storage_plan(
|
||||
runtime=routing, prompts=[f"prompt {index}" for index in range(1, 5)],
|
||||
first_frame_hash="none", last_frame_hash="none",
|
||||
)
|
||||
contract = _contract(chunks=4)
|
||||
contract["global"]["reference_routing_contract_version"] = 1
|
||||
contract["reference_group_contracts"] = plan.group_contracts
|
||||
contract["nonce_lineage_sha256"] = _nonce_lineage_hash(contract)
|
||||
return _apply_reroll_branch_contract(
|
||||
contract, boundary=0, requested_nonce=0, effective_nonce=0,
|
||||
)
|
||||
|
||||
|
||||
def test_rr_r5_selected_foreign_take_requires_whole_compatible_prefix(tmp_path):
|
||||
source = _persist(
|
||||
tmp_path, _rr_r5_contract(), prefix=2, review_unit=(2, 2),
|
||||
updated_utc="2026-09-24T00:00:00+00:00",
|
||||
)
|
||||
selected = _take(_project(source), group=2, nonce=0)
|
||||
controller, resolved, _, decision = _resolve(
|
||||
tmp_path, _rr_r5_contract(changed_group=4),
|
||||
take_action=TAKE_ACTION_USE, take_group=2,
|
||||
take_revision_id=selected["revision_id"],
|
||||
)
|
||||
assert decision == "select_take"
|
||||
assert controller.review_runtime_metrics["review_decision_created"] == 1
|
||||
assert controller._plan_import is not None
|
||||
assert controller.selected_take_chain == []
|
||||
assert len(controller.validated_prefix.entries) == 2
|
||||
assert resolved["nonce_lineage_sha256"] != source.contract["nonce_lineage_sha256"]
|
||||
assert source.manifest["chunks"][0]["storage_revision_id"] == source.revision_id
|
||||
controller.contract = resolved
|
||||
sampling_revision_id, controller.contract_sha256 = revision_identity(resolved)
|
||||
controller.revision_id = controller.storage_revision_id_override
|
||||
controller.revision_root = controller.revisions_root / controller.revision_id
|
||||
controller.manifest = {
|
||||
"run_storage_schema_version": RUN_STORAGE_SCHEMA_VERSION,
|
||||
"sampling_contract_version": SAMPLING_CONTRACT_VERSION,
|
||||
"run_name": controller.run_name,
|
||||
"revision_id": controller.revision_id,
|
||||
"sampling_revision_id": sampling_revision_id,
|
||||
"contract_sha256": controller.contract_sha256,
|
||||
"contract": resolved,
|
||||
"nonce_lifecycle": dict(resolved["nonce_lifecycle"]),
|
||||
"status": REVISION_STATUS_IN_PROGRESS,
|
||||
"created_utc": "2026-09-24T01:00:00+00:00",
|
||||
"updated_utc": "2026-09-24T01:00:00+00:00",
|
||||
"chunks": [],
|
||||
}
|
||||
controller._write_manifest()
|
||||
imported = controller._adopt_plan_prefix(controller._plan_import)
|
||||
assert len(imported) == 2
|
||||
assert all(record["storage_revision_id"] == controller.revision_id for record in imported)
|
||||
assert controller.manifest["prefix_import"]["selected_take"]["revision_id"] == selected["revision_id"]
|
||||
assert controller.pending_branch_cut["selected_revision_id"] != selected["revision_id"]
|
||||
controller.finalize(
|
||||
session={"session_id": "routed-take", "chunks": list(controller.validated_prefix.entries)},
|
||||
report="routed Take import", review_pause_metadata=controller.review_pause_metadata(),
|
||||
)
|
||||
assert controller.manifest["status"] == REVISION_STATUS_REVIEW_READY
|
||||
assert source.manifest["chunks"][0]["storage_revision_id"] == source.revision_id
|
||||
|
||||
|
||||
def test_rr_r5_selected_foreign_take_rejects_changed_group_without_fallback(tmp_path):
|
||||
source = _persist(
|
||||
tmp_path, _rr_r5_contract(), prefix=2, review_unit=(2, 2),
|
||||
updated_utc="2026-09-24T00:00:00+00:00",
|
||||
)
|
||||
selected = _take(_project(source), group=2, nonce=0)
|
||||
with pytest.raises(RunStorageError, match="physical group starting with chunk 2"):
|
||||
_resolve(
|
||||
tmp_path, _rr_r5_contract(changed_group=2),
|
||||
take_action=TAKE_ACTION_USE, take_group=2,
|
||||
take_revision_id=selected["revision_id"],
|
||||
)
|
||||
|
||||
|
||||
def test_rr_r5_explicit_session_keeps_only_compatible_complete_groups(tmp_path, monkeypatch):
|
||||
old = _rr_r5_contract()
|
||||
current = _rr_r5_contract(changed_group=2)
|
||||
old_plan = SimpleNamespace(group_contracts=old["reference_group_contracts"],
|
||||
routing_config_sha256="a" * 64)
|
||||
current_plan = SimpleNamespace(group_contracts=current["reference_group_contracts"])
|
||||
identity = routed_session_identity("base")
|
||||
saved = make_session(
|
||||
chunks=[_entry(index, old) for index in range(3)],
|
||||
width=32, height=32, chunk_seconds=5.0,
|
||||
identity_hash=identity, model_fingerprint_value="f" * 64,
|
||||
parent_session_id=None, reroll_from_chunk=0,
|
||||
settings={"reference_routing_v1": session_routing_settings(old_plan, 3)},
|
||||
)
|
||||
monkeypatch.setattr(session_io, "session_directory", lambda: tmp_path)
|
||||
session_io.save_session(saved, prefix="rr-r5", slot=1)
|
||||
saved = session_io.load_session(prefix="rr-r5", slot=1)
|
||||
preserved, notes = _preserved_prefix(
|
||||
session=saved, prompt_hashes=current["prompt_hashes"], chunks=4,
|
||||
reroll_from_chunk=0, width=32, height=32, chunk_seconds=5.0,
|
||||
identity_hash=identity, last_frame_hash="none",
|
||||
reference_storage_plan=current_plan,
|
||||
)
|
||||
assert len(preserved) == 1
|
||||
assert any("Reference group changed" in note for note in notes)
|
||||
|
||||
|
||||
def test_rr_r5_plan_import_stops_at_first_changed_physical_group(tmp_path):
|
||||
source = _persist(
|
||||
tmp_path, _rr_r5_contract(), prefix=3, review_unit=(3, 3),
|
||||
updated_utc="2026-09-24T00:00:00+00:00",
|
||||
)
|
||||
destination = RunStorageController("phase-d-review")
|
||||
destination.run_root = source.run_root
|
||||
destination.revisions_root = source.revisions_root
|
||||
destination.prompts = [f"prompt {index}" for index in range(1, 5)]
|
||||
current = _rr_r5_contract(changed_group=3)
|
||||
imported = destination._find_plan_import(current)
|
||||
assert imported is not None
|
||||
assert imported["validated_prefix_count"] == 2
|
||||
assert [record["sequence_index"] for record in imported["records"]] == [0, 1]
|
||||
assert imported["revision_id"] == source.revision_id
|
||||
|
||||
|
||||
def test_rr_r5_review_decision_uses_fixed_imported_prefix_once(tmp_path):
|
||||
source = _persist(
|
||||
tmp_path, _rr_r5_contract(), prefix=2, review_unit=(2, 2),
|
||||
updated_utc="2026-09-24T00:00:00+00:00",
|
||||
)
|
||||
controller, resolved, _, decision = _resolve(
|
||||
tmp_path, _rr_r5_contract(changed_group=3),
|
||||
review_action=REVIEW_ACTION_CONTINUE,
|
||||
)
|
||||
assert controller._plan_import is not None
|
||||
assert len(controller.validated_prefix.entries) == 2
|
||||
assert controller.review_runtime_metrics["review_decision_created"] == 1
|
||||
assert controller.review_runtime_metrics["review_reconcile"] == 0
|
||||
assert controller.review_execution.next_review_unit_start == 3
|
||||
assert resolved["nonce_lineage_sha256"] != source.contract["nonce_lineage_sha256"]
|
||||
assert decision == "inactive"
|
||||
|
||||
|
||||
def test_rr_r5_foreign_take_preserves_verified_nonce_variation(tmp_path):
|
||||
source_contract = _apply_reroll_branch_contract(
|
||||
_rr_r5_contract(), boundary=3,
|
||||
requested_nonce=1, effective_nonce=1,
|
||||
)
|
||||
source = _persist(
|
||||
tmp_path, source_contract, prefix=3, review_unit=(3, 3),
|
||||
updated_utc="2026-09-24T00:00:00+00:00",
|
||||
)
|
||||
selected = _take(_project(source), group=3, nonce=1)
|
||||
controller, resolved, nonce, decision = _resolve(
|
||||
tmp_path, _rr_r5_contract(changed_group=4),
|
||||
take_action=TAKE_ACTION_USE, take_group=3,
|
||||
take_revision_id=selected["revision_id"],
|
||||
)
|
||||
assert decision == "select_take"
|
||||
assert (resolved["reroll_from_chunk"], nonce) == (3, 1)
|
||||
assert len(controller.validated_prefix.entries) == 3
|
||||
assert controller._plan_import is not None
|
||||
|
||||
|
||||
def _persist_resolved_branch(
|
||||
controller: RunStorageController,
|
||||
contract: dict,
|
||||
@@ -1410,6 +1600,8 @@ def test_partial_review_rebuilds_decode_outputs_without_truncating_session():
|
||||
preserve_final_frame=False,
|
||||
terminal_merged=False,
|
||||
)
|
||||
verified_route_plan = {"mode": "Custom", "accepted_chunks": 3, "groups": []}
|
||||
full_plan["reference_routing_v1"] = verified_route_plan
|
||||
result = {
|
||||
"last_state": {},
|
||||
"session": {"session_id": "session", "chunks": entries},
|
||||
@@ -1449,6 +1641,7 @@ def test_partial_review_rebuilds_decode_outputs_without_truncating_session():
|
||||
assert torch.equal(scoped[0][0]["samples"], entries[1]["video"])
|
||||
assert torch.equal(scoped[1][0]["samples"], entries[1]["audio"])
|
||||
assert scoped[2]["target_frames"] == 120
|
||||
assert scoped[2]["reference_routing_v1"] is verified_route_plan
|
||||
assert scoped[2]["chunks"][0]["sequence_index"] == 1
|
||||
assert scoped[2]["chunks"][0]["chunk_index"] == 2
|
||||
assert scoped[2]["second_pass_contract"]["physical_groups"][0][
|
||||
|
||||
@@ -286,7 +286,7 @@ def test_execution_success_reloads_v38_history_without_auto_queue():
|
||||
):
|
||||
assert f'"{event_name}"' in setup
|
||||
assert "refreshV38TakeHistoryAfterExecution" in setup
|
||||
assert "node.comfyClass !== V38_NODE_CLASS" in refresh
|
||||
assert "!isModernSamplerClass(node.comfyClass)" in refresh
|
||||
assert "await loadTakeHistory(node," in refresh
|
||||
assert "reviewPrompts.get(promptId)" in refresh
|
||||
assert "event?.detail?.prompt_id" in refresh
|
||||
@@ -308,6 +308,8 @@ def test_review_requires_fixed_control_after_generate(tmp_path):
|
||||
)
|
||||
script = f"""
|
||||
const V38_NODE_CLASS = "H3ContinuumSamplerV38";
|
||||
const V39_NODE_CLASS = "H3ContinuumSamplerV39";
|
||||
const isModernSamplerClass = (name) => name === V38_NODE_CLASS || name === V39_NODE_CLASS;
|
||||
const GENERATION_MODE_WIDGET = "generation_mode";
|
||||
const GENERATION_MODE_REVIEW = "Review Each Chunk";
|
||||
{functions}
|
||||
@@ -366,6 +368,8 @@ def test_review_mode_switch_fixes_the_linked_seed_control(tmp_path):
|
||||
)
|
||||
script = f"""
|
||||
const V38_NODE_CLASS = "H3ContinuumSamplerV38";
|
||||
const V39_NODE_CLASS = "H3ContinuumSamplerV39";
|
||||
const isModernSamplerClass = (name) => name === V38_NODE_CLASS || name === V39_NODE_CLASS;
|
||||
const GENERATION_MODE_WIDGET = "generation_mode";
|
||||
const REVIEW_ACTION_WIDGET = "review_action";
|
||||
const RUN_STORAGE_WIDGET = "run_storage";
|
||||
|
||||
@@ -0,0 +1,105 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import json
|
||||
import importlib.util
|
||||
import os
|
||||
import sys
|
||||
from pathlib import Path
|
||||
from uuid import UUID
|
||||
from zipfile import ZipFile
|
||||
|
||||
ROOT = Path(__file__).resolve().parents[1]
|
||||
WORKFLOW = ROOT / "examples" / "workflows" / "MiniMax_H3_Continuum_V39.json"
|
||||
PACKAGE_NAME = "ComfyUI_H3_Continuum_Join"
|
||||
if PACKAGE_NAME not in sys.modules:
|
||||
package_root = Path(os.environ.get("H3_CONTINUUM_PACKAGE_ROOT", ROOT))
|
||||
spec = importlib.util.spec_from_file_location(
|
||||
PACKAGE_NAME, package_root / "__init__.py",
|
||||
submodule_search_locations=[str(package_root)],
|
||||
)
|
||||
module = importlib.util.module_from_spec(spec)
|
||||
module.__path__ = [str(package_root)]
|
||||
sys.modules[PACKAGE_NAME] = module
|
||||
|
||||
def _graph():
|
||||
graph = json.loads(WORKFLOW.read_text(encoding="utf-8"))
|
||||
nodes = {node["id"]: node for node in graph["nodes"]}
|
||||
links = {link[0]: link for link in graph["links"]}
|
||||
assert len(nodes) == len(graph["nodes"])
|
||||
assert len(links) == len(graph["links"])
|
||||
for link in links.values():
|
||||
link_id, source_id, source_slot, target_id, target_slot, link_type = link
|
||||
assert link_id in nodes[source_id]["outputs"][source_slot]["links"]
|
||||
assert nodes[target_id]["inputs"][target_slot]["link"] == link_id
|
||||
assert nodes[source_id]["outputs"][source_slot]["type"] in ("*", link_type)
|
||||
assert nodes[target_id]["inputs"][target_slot]["type"] in ("*", link_type)
|
||||
return graph, nodes, links
|
||||
|
||||
|
||||
def test_official_v39_is_a_separate_complete_workflow():
|
||||
graph, nodes, links = _graph()
|
||||
assert UUID(graph["id"]).version == 4
|
||||
assert len(nodes) == 32
|
||||
assert len(links) == 39
|
||||
assert graph["last_node_id"] >= max(nodes)
|
||||
assert graph["last_link_id"] >= max(links)
|
||||
assert nodes[312]["type"] == "H3ContinuumSamplerV39"
|
||||
assert nodes[348]["type"] == "H3ContinuumReferenceImagesV39"
|
||||
assert nodes[344]["type"] == "H3DecodeCacheHelper"
|
||||
assert nodes[306]["type"] == "H3ContinuumAssembleSeamV35"
|
||||
assert nodes[228]["type"] == "CreateVideo"
|
||||
assert nodes[191]["type"] == "SaveVideo"
|
||||
assert nodes[191]["widgets_values"][0] == "video/MiniMax_H3_Continuum_V39"
|
||||
assert nodes[150]["widgets_values"][0] is False # Spectrum OFF
|
||||
assert nodes[348]["widgets_values"][:10] == ["Per chunk", *(["off"] * 9)]
|
||||
assert [item["name"] for item in nodes[348]["inputs"]] == [
|
||||
f"reference_image_{slot}" for slot in range(1, 10)
|
||||
]
|
||||
assert all(item["link"] is not None for item in nodes[348]["inputs"][:6])
|
||||
assert all(item["link"] is None for item in nodes[348]["inputs"][6:])
|
||||
for slot in range(1, 7):
|
||||
link = links[nodes[348]["inputs"][slot - 1]["link"]]
|
||||
assert nodes[link[1]]["type"] == "H3EasyLoadImage"
|
||||
assert nodes[link[1]]["mode"] == 4 # No unknown source image is silently enabled.
|
||||
assert any(link[1] == 348 and link[3] == 312 for link in links.values())
|
||||
assert all(not item["name"].startswith("reference_image_") for item in nodes[312]["inputs"])
|
||||
|
||||
|
||||
def test_official_v39_initial_settings_and_prompt_are_consistent():
|
||||
graph, nodes, links = _graph()
|
||||
sampler = nodes[312]
|
||||
named = sampler["widgets_values_named"]
|
||||
assert sampler["widgets_values"] == list(named.values())
|
||||
assert UUID(named["project_id"]).version == 4
|
||||
assert named["prompt_mode"] == "Timeline"
|
||||
assert named["chunks"] == 2
|
||||
assert named["chunk_seconds"] == 10
|
||||
assert named["size_source"] == "First Image"
|
||||
assert named["preset"] == "Draft — 0.30 MP"
|
||||
assert (named["width"], named["height"]) == (480, 640)
|
||||
assert named["video_reference_mode"] == "Repeat Reference"
|
||||
assert named["generation_mode"] == "Full Run"
|
||||
assert nodes[317]["mode"] == 0 # The user-selected First Image loader is enabled.
|
||||
assert nodes[188]["type"] == "PrimitiveStringMultiline"
|
||||
assert nodes[188]["widgets_values"] == [""]
|
||||
assert nodes[188]["widgets_values_named"]["value"] == ""
|
||||
prompt_input = next(item for item in sampler["inputs"] if item["name"] == "sequence_prompt")
|
||||
assert links[prompt_input["link"]][1] == 188
|
||||
|
||||
|
||||
def test_official_v39_zip_contains_exact_json_bytes():
|
||||
payload = WORKFLOW.read_bytes()
|
||||
with ZipFile(WORKFLOW.with_suffix(".zip")) as archive:
|
||||
assert archive.namelist() == [WORKFLOW.name]
|
||||
assert archive.read(WORKFLOW.name) == payload
|
||||
|
||||
|
||||
def test_template_gallery_uses_official_workflows_only():
|
||||
gallery = ROOT / "examples"
|
||||
assert {path.name for path in gallery.glob("*.json")} == {
|
||||
"MiniMax_H3_Continuum_V39.json",
|
||||
"MiniMax_H3_Continuum_V38X2.json",
|
||||
}
|
||||
assert (gallery / WORKFLOW.name).read_bytes() == WORKFLOW.read_bytes()
|
||||
legacy = "MiniMax_H3_Continuum_V38X2.json"
|
||||
assert (gallery / legacy).read_bytes() == (WORKFLOW.parent / legacy).read_bytes()
|
||||
@@ -0,0 +1,233 @@
|
||||
"""RR-R1: retain fixed Reference slot identity without changing V3.8 inputs."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import sys
|
||||
from types import ModuleType
|
||||
|
||||
import pytest
|
||||
import torch
|
||||
|
||||
from ComfyUI_H3_Continuum_Join.reference import (
|
||||
REFERENCE_SIZE_MATCH_OUTPUT,
|
||||
ReferenceAssets,
|
||||
ReferenceConditioningError,
|
||||
ReferenceImageBundle,
|
||||
encode_reference_latents,
|
||||
encode_reference_latents_cached,
|
||||
encode_reference_prompt,
|
||||
prepare_reference_assets,
|
||||
resolve_reference_image_inputs,
|
||||
)
|
||||
from ComfyUI_H3_Continuum_Join.v3.ref_encode_cache import clear_ref_encode_cache
|
||||
|
||||
|
||||
def _image(value: float, *, size: int = 32) -> torch.Tensor:
|
||||
return torch.full((1, size, size, 3), value, dtype=torch.float32)
|
||||
|
||||
|
||||
def _prepare(
|
||||
slots: dict[int, torch.Tensor],
|
||||
*,
|
||||
direct_legacy: dict[int, torch.Tensor] | None = None,
|
||||
output_size: int = 32,
|
||||
) -> ReferenceAssets | None:
|
||||
direct_legacy = direct_legacy or {}
|
||||
bundle = ReferenceImageBundle(
|
||||
tuple(slots.get(index) for index in range(4, 10))
|
||||
) if any(index >= 4 for index in slots) else None
|
||||
return prepare_reference_assets(
|
||||
reference_image_1=slots.get(1),
|
||||
reference_image_2=slots.get(2),
|
||||
reference_image_3=slots.get(3),
|
||||
reference_image_4=direct_legacy.get(4),
|
||||
reference_image_5=direct_legacy.get(5),
|
||||
image_references=bundle,
|
||||
output_width=output_size,
|
||||
output_height=output_size,
|
||||
size_mode=REFERENCE_SIZE_MATCH_OUTPUT,
|
||||
)
|
||||
|
||||
|
||||
class RecordingVAE:
|
||||
def __init__(self) -> None:
|
||||
self.calls = 0
|
||||
|
||||
def encode(self, image: torch.Tensor) -> torch.Tensor:
|
||||
self.calls += 1
|
||||
return torch.full((1, 24, 1, 2, 2), float(image.mean().item()))
|
||||
|
||||
|
||||
class RecordingClip:
|
||||
def __init__(self) -> None:
|
||||
self.items = None
|
||||
|
||||
def tokenize(self, prompt, *, minimax_ref_items):
|
||||
self.items = minimax_ref_items
|
||||
return prompt
|
||||
|
||||
def encode_from_tokens_scheduled(self, tokens):
|
||||
return [[torch.zeros((1, 1)), {}]]
|
||||
|
||||
|
||||
def test_all_empty_has_no_active_assets_but_nine_raw_positions():
|
||||
assert resolve_reference_image_inputs() == (None,) * 9
|
||||
assert _prepare({}) is None
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
("positions", "expected_ids"),
|
||||
[
|
||||
((1,), ("R1",)),
|
||||
((3,), ("R3",)),
|
||||
((1, 3), ("R1", "R3")),
|
||||
((4, 6, 9), ("R4", "R6", "R9")),
|
||||
((2, 5, 9), ("R2", "R5", "R9")),
|
||||
((9,), ("R9",)),
|
||||
],
|
||||
)
|
||||
def test_sparse_slots_keep_source_ids_after_compaction(positions, expected_ids):
|
||||
slots = {position: _image(index / 10) for index, position in enumerate(positions, 1)}
|
||||
assets = _prepare(slots)
|
||||
|
||||
assert assets is not None
|
||||
assert assets.source_slot_ids == expected_ids
|
||||
assert assets.count == len(positions)
|
||||
assert len(assets.source_slot_ids) == len(assets.images) == len(assets.image_hashes)
|
||||
assert all(latent is None for latent in assets.latents)
|
||||
for index, position in enumerate(positions):
|
||||
assert torch.equal(assets.images[index], slots[position])
|
||||
|
||||
|
||||
def test_duplicate_image_keeps_two_slot_identities_and_two_presentations():
|
||||
image = _image(0.5)
|
||||
assets = _prepare({1: image, 4: image})
|
||||
|
||||
assert assets is not None
|
||||
assert assets.source_slot_ids == ("R1", "R4")
|
||||
assert assets.count == 2
|
||||
assert assets.image_hashes[0] == assets.image_hashes[1]
|
||||
assert torch.equal(assets.images[0], assets.images[1])
|
||||
clear_ref_encode_cache()
|
||||
try:
|
||||
vae = RecordingVAE()
|
||||
encoded = encode_reference_latents_cached(vae, assets)
|
||||
assert encoded.source_slot_ids == ("R1", "R4")
|
||||
assert len(encoded.latents) == 2
|
||||
assert vae.calls == 1
|
||||
finally:
|
||||
clear_ref_encode_cache()
|
||||
|
||||
|
||||
def test_legacy_direct_four_and_five_keep_ids_and_existing_collision_error():
|
||||
four, five = _image(0.25), _image(0.75)
|
||||
direct = _prepare({}, direct_legacy={4: four, 5: five})
|
||||
mixed = _prepare({5: five, 9: _image(1)}, direct_legacy={4: four})
|
||||
|
||||
assert direct is not None and direct.source_slot_ids == ("R4", "R5")
|
||||
assert mixed is not None and mixed.source_slot_ids == ("R4", "R5", "R9")
|
||||
assert mixed.contract["reference_image_3"]["reference_position"] == 3
|
||||
assert mixed.contract["reference_image_3"]["sha256"] == mixed.image_hashes[2]
|
||||
assert "source_slot_ids" not in mixed.contract
|
||||
with pytest.raises(ReferenceConditioningError, match="connected through both"):
|
||||
_prepare({4: four}, direct_legacy={4: four})
|
||||
|
||||
|
||||
def test_sparse_legacy_hash_and_contract_are_golden_compatible():
|
||||
assets = _prepare({1: _image(0), 3: _image(1)})
|
||||
|
||||
assert assets is not None
|
||||
assert assets.source_slot_ids == ("R1", "R3")
|
||||
assert assets.image_hashes == (
|
||||
"f3c5e40f8a9e1c00c656265dd2ef1c2a58923cbbe538326ab3ac389e4aa0f66d",
|
||||
"fc2c027881d2ae8406cf551703cf5cdb281ce72913faa3c6702cfa2e9b8f3be1",
|
||||
)
|
||||
assert assets.combined_hash == (
|
||||
"7d0d92b68c0904cce938bb37232e3bd23a11b9265d902c6ea348e888729ad5e6"
|
||||
)
|
||||
assert assets.contract == {
|
||||
"reference_contract_version": 1,
|
||||
"count": 2,
|
||||
"size_mode": REFERENCE_SIZE_MATCH_OUTPUT,
|
||||
"image_hashes": list(assets.image_hashes),
|
||||
"combined_hash": assets.combined_hash,
|
||||
}
|
||||
|
||||
|
||||
def test_original_slot_survives_resize_and_processed_content_hash(monkeypatch):
|
||||
comfy = ModuleType("comfy")
|
||||
utils = ModuleType("comfy.utils")
|
||||
calls = []
|
||||
|
||||
def common_upscale(image, width, height, method, crop):
|
||||
calls.append((width, height, method, crop))
|
||||
return torch.nn.functional.interpolate(image, size=(height, width))
|
||||
|
||||
utils.common_upscale = common_upscale
|
||||
comfy.utils = utils
|
||||
monkeypatch.setitem(sys.modules, "comfy", comfy)
|
||||
monkeypatch.setitem(sys.modules, "comfy.utils", utils)
|
||||
|
||||
assets = _prepare({5: _image(0.25, size=64), 9: _image(0.75, size=64)})
|
||||
|
||||
assert assets is not None
|
||||
assert assets.source_slot_ids == ("R5", "R9")
|
||||
assert calls == [(32, 32, "lanczos", "disabled")] * 2
|
||||
assert [tuple(image.shape) for image in assets.images] == [(1, 32, 32, 3)] * 2
|
||||
assert [float(image.mean()) for image in assets.images] == [0.25, 0.75]
|
||||
assert assets.image_hashes[0] != assets.image_hashes[1]
|
||||
assert assets.contract["image_hashes"] == list(assets.image_hashes)
|
||||
|
||||
|
||||
def test_slot_identity_survives_plain_and_cached_vae_encode():
|
||||
assets = _prepare({2: _image(0.25), 9: _image(0.75)})
|
||||
assert assets is not None
|
||||
plain_vae = RecordingVAE()
|
||||
plain = encode_reference_latents(plain_vae, assets)
|
||||
assert plain.source_slot_ids == ("R2", "R9")
|
||||
assert [float(latent.mean()) for latent in plain.latents] == [0.25, 0.75]
|
||||
assert plain_vae.calls == 2
|
||||
|
||||
clear_ref_encode_cache()
|
||||
try:
|
||||
cached_vae = RecordingVAE()
|
||||
cold = encode_reference_latents_cached(cached_vae, assets)
|
||||
warm = encode_reference_latents_cached(cached_vae, assets)
|
||||
assert cold.source_slot_ids == warm.source_slot_ids == ("R2", "R9")
|
||||
assert [float(latent.mean()) for latent in warm.latents] == [0.25, 0.75]
|
||||
assert cached_vae.calls == 2
|
||||
finally:
|
||||
clear_ref_encode_cache()
|
||||
|
||||
|
||||
def test_existing_qwen_and_dit_order_remains_compact_with_hybrid_anchors():
|
||||
assets = _prepare({3: _image(0.25), 9: _image(0.75)})
|
||||
assert assets is not None
|
||||
encoded = encode_reference_latents(RecordingVAE(), assets)
|
||||
clip = RecordingClip()
|
||||
first, last = _image(0), _image(1)
|
||||
|
||||
conditioning = encode_reference_prompt(
|
||||
clip, "Use the references.", encoded, first_image=first, last_image=last
|
||||
)
|
||||
|
||||
assert encoded.source_slot_ids == ("R3", "R9")
|
||||
assert all(
|
||||
item["data"] is expected
|
||||
for item, expected in zip(
|
||||
clip.items, (first, last, *encoded.images), strict=True
|
||||
)
|
||||
)
|
||||
refs = conditioning[0][1]["minimax_refs"]
|
||||
assert [float(item["latent"].mean()) for item in refs] == [0.25, 0.75]
|
||||
|
||||
|
||||
def test_legacy_manual_assets_constructor_remains_valid_without_slot_metadata():
|
||||
assets = ReferenceAssets(
|
||||
images=(_image(0.5),),
|
||||
latents=(None,),
|
||||
image_hashes=("legacy",),
|
||||
combined_hash="legacy",
|
||||
size_mode=REFERENCE_SIZE_MATCH_OUTPUT,
|
||||
)
|
||||
assert assets.source_slot_ids == ()
|
||||
@@ -0,0 +1,236 @@
|
||||
"""RR-R2 CPU contracts for selectors and logical/physical routing schedules."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import pytest
|
||||
|
||||
from ComfyUI_H3_Continuum_Join.branch_provenance import physical_groups
|
||||
from ComfyUI_H3_Continuum_Join.v3.reference_routing import (
|
||||
REFERENCE_SLOT_IDS,
|
||||
compile_reference_routing_schedule,
|
||||
parse_chunk_selector,
|
||||
)
|
||||
|
||||
|
||||
def _selectors(**overrides: str) -> dict[str, str]:
|
||||
result = {slot_id: "off" for slot_id in REFERENCE_SLOT_IDS}
|
||||
result.update(overrides)
|
||||
return result
|
||||
|
||||
|
||||
def test_absent_mode_preserves_legacy_all_for_every_logical_chunk():
|
||||
schedule = compile_reference_routing_schedule(
|
||||
total_chunks=4,
|
||||
terminal_merge_enabled=True,
|
||||
)
|
||||
|
||||
assert schedule.valid
|
||||
assert schedule.mode == "all"
|
||||
assert schedule.legacy_fallback is True
|
||||
assert tuple(route.logical_chunk for route in schedule.logical_routes) == (1, 2, 3, 4)
|
||||
assert all(route.reference_slot_ids == REFERENCE_SLOT_IDS for route in schedule.logical_routes)
|
||||
assert tuple(route.logical_chunks for route in schedule.physical_routes) == tuple(
|
||||
tuple(range(group.start, group.end + 1))
|
||||
for group in physical_groups(chunks=4, terminal_merge_enabled=True)
|
||||
)
|
||||
|
||||
|
||||
def test_explicit_all_matches_legacy_routes_but_is_not_legacy_fallback():
|
||||
legacy = compile_reference_routing_schedule(
|
||||
total_chunks=3,
|
||||
terminal_merge_enabled=False,
|
||||
)
|
||||
explicit = compile_reference_routing_schedule(
|
||||
total_chunks=3,
|
||||
terminal_merge_enabled=False,
|
||||
mode="All",
|
||||
selectors_by_slot={"not-used": object()},
|
||||
)
|
||||
|
||||
assert explicit.valid
|
||||
assert explicit.legacy_fallback is False
|
||||
assert explicit.logical_routes == legacy.logical_routes
|
||||
|
||||
|
||||
def test_custom_selector_forms_compile_in_fixed_slot_order():
|
||||
schedule = compile_reference_routing_schedule(
|
||||
total_chunks=6,
|
||||
terminal_merge_enabled=False,
|
||||
mode="Custom",
|
||||
selectors_by_slot=_selectors(
|
||||
R1="all",
|
||||
R2="off",
|
||||
R3="1-3",
|
||||
R4="2, 4, 6",
|
||||
R5="1-2, 4-5",
|
||||
R9="6",
|
||||
),
|
||||
)
|
||||
|
||||
assert schedule.valid
|
||||
by_chunk = {route.logical_chunk: route.reference_slot_ids for route in schedule.logical_routes}
|
||||
assert by_chunk == {
|
||||
1: ("R1", "R3", "R5"),
|
||||
2: ("R1", "R3", "R4", "R5"),
|
||||
3: ("R1", "R3"),
|
||||
4: ("R1", "R4", "R5"),
|
||||
5: ("R1", "R5"),
|
||||
6: ("R1", "R4", "R9"),
|
||||
}
|
||||
|
||||
|
||||
def test_explicit_custom_all_off_is_valid_and_distinct_from_legacy_all():
|
||||
schedule = compile_reference_routing_schedule(
|
||||
total_chunks=3,
|
||||
terminal_merge_enabled=True,
|
||||
mode="Custom",
|
||||
selectors_by_slot=_selectors(),
|
||||
)
|
||||
|
||||
assert schedule.valid
|
||||
assert schedule.legacy_fallback is False
|
||||
assert all(route.reference_slot_ids == () for route in schedule.logical_routes)
|
||||
assert all(route.status == "empty" for route in schedule.physical_routes)
|
||||
assert all(route.reference_slot_ids == () for route in schedule.physical_routes)
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
("selector", "expected_code"),
|
||||
[
|
||||
("", "selector_empty"),
|
||||
("0", "chunk_out_of_range"),
|
||||
("6", "chunk_out_of_range"),
|
||||
("3-2", "reversed_range"),
|
||||
("1,,2", "empty_selector_item"),
|
||||
("1-3,3", "duplicate_chunk"),
|
||||
("all,2", "invalid_selector_item"),
|
||||
("-1", "invalid_selector_item"),
|
||||
(None, "selector_not_string"),
|
||||
],
|
||||
)
|
||||
def test_invalid_selector_is_classified_without_partial_selection(selector, expected_code):
|
||||
parsed = parse_chunk_selector(selector, total_chunks=5)
|
||||
|
||||
assert not parsed.valid
|
||||
assert parsed.kind == "invalid"
|
||||
assert parsed.logical_chunks == ()
|
||||
assert expected_code in {issue.code for issue in parsed.issues}
|
||||
|
||||
|
||||
def test_selector_parser_preserves_all_off_and_expands_inclusive_ranges():
|
||||
assert parse_chunk_selector("ALL", total_chunks=4).logical_chunks == (1, 2, 3, 4)
|
||||
assert parse_chunk_selector(" off ", total_chunks=4).kind == "off"
|
||||
assert parse_chunk_selector(" 1 - 2, 4 ", total_chunks=4).logical_chunks == (1, 2, 4)
|
||||
|
||||
|
||||
def test_resume_does_not_rebase_project_wide_logical_chunk_numbers():
|
||||
schedule = compile_reference_routing_schedule(
|
||||
total_chunks=5,
|
||||
terminal_merge_enabled=False,
|
||||
mode="Custom",
|
||||
selectors_by_slot=_selectors(R4="4-5"),
|
||||
)
|
||||
|
||||
assert schedule.valid
|
||||
assert tuple(route.logical_chunk for route in schedule.logical_routes) == (1, 2, 3, 4, 5)
|
||||
assert tuple(route.logical_chunk for route in schedule.logical_routes if route.reference_slot_ids) == (4, 5)
|
||||
assert tuple(route.reference_slot_ids for route in schedule.logical_routes) == (
|
||||
(), (), (), ("R4",), ("R4",)
|
||||
)
|
||||
|
||||
|
||||
def test_terminal_atomic_group_classifies_route_conflict_without_auto_correction():
|
||||
schedule = compile_reference_routing_schedule(
|
||||
total_chunks=4,
|
||||
terminal_merge_enabled=True,
|
||||
mode="Custom",
|
||||
selectors_by_slot=_selectors(R1="3", R2="4"),
|
||||
)
|
||||
|
||||
terminal = schedule.physical_routes[-1]
|
||||
assert schedule.valid
|
||||
assert terminal.logical_chunks == (3, 4)
|
||||
assert terminal.terminal_atomic is True
|
||||
assert terminal.status == "conflict"
|
||||
assert terminal.logical_reference_slot_ids == (("R1",), ("R2",))
|
||||
assert terminal.reference_slot_ids is None
|
||||
assert schedule.logical_routes[2].reference_slot_ids == ("R1",)
|
||||
assert schedule.logical_routes[3].reference_slot_ids == ("R2",)
|
||||
|
||||
|
||||
def test_terminal_atomic_group_accepts_identical_routes_and_empty_route():
|
||||
consistent = compile_reference_routing_schedule(
|
||||
total_chunks=4,
|
||||
terminal_merge_enabled=True,
|
||||
mode="Custom",
|
||||
selectors_by_slot=_selectors(R7="3-4"),
|
||||
)
|
||||
empty = compile_reference_routing_schedule(
|
||||
total_chunks=4,
|
||||
terminal_merge_enabled=True,
|
||||
mode="Custom",
|
||||
selectors_by_slot=_selectors(),
|
||||
)
|
||||
|
||||
assert consistent.physical_routes[-1].status == "consistent"
|
||||
assert consistent.physical_routes[-1].reference_slot_ids == ("R7",)
|
||||
assert empty.physical_routes[-1].status == "empty"
|
||||
assert empty.physical_routes[-1].reference_slot_ids == ()
|
||||
|
||||
|
||||
def test_route_changes_between_separate_physical_groups_are_not_conflicts():
|
||||
schedule = compile_reference_routing_schedule(
|
||||
total_chunks=3,
|
||||
terminal_merge_enabled=False,
|
||||
mode="Custom",
|
||||
selectors_by_slot=_selectors(R1="1", R2="2-3"),
|
||||
)
|
||||
|
||||
assert tuple(route.status for route in schedule.physical_routes) == (
|
||||
"consistent",
|
||||
"consistent",
|
||||
"consistent",
|
||||
)
|
||||
assert tuple(route.reference_slot_ids for route in schedule.physical_routes) == (
|
||||
("R1",), ("R2",), ("R2",)
|
||||
)
|
||||
|
||||
|
||||
def test_custom_missing_selectors_unknown_slots_and_invalid_modes_are_classified():
|
||||
missing = compile_reference_routing_schedule(
|
||||
total_chunks=2,
|
||||
terminal_merge_enabled=False,
|
||||
mode="Custom",
|
||||
selectors_by_slot={"R1": "off"},
|
||||
)
|
||||
unknown = compile_reference_routing_schedule(
|
||||
total_chunks=2,
|
||||
terminal_merge_enabled=False,
|
||||
mode="Custom",
|
||||
selectors_by_slot=_selectors(R9="off", R10="all"),
|
||||
)
|
||||
invalid_mode = compile_reference_routing_schedule(
|
||||
total_chunks=2,
|
||||
terminal_merge_enabled=False,
|
||||
mode="Automatic",
|
||||
)
|
||||
|
||||
assert not missing.valid
|
||||
assert sum(issue.code == "missing_selector" for issue in missing.issues) == 8
|
||||
assert not unknown.valid
|
||||
assert any(issue.code == "unknown_reference_slot" for issue in unknown.issues)
|
||||
assert not invalid_mode.valid
|
||||
assert invalid_mode.issues[0].code == "invalid_mode"
|
||||
|
||||
|
||||
def test_invalid_terminal_merge_topology_is_classified():
|
||||
schedule = compile_reference_routing_schedule(
|
||||
total_chunks=1,
|
||||
terminal_merge_enabled=True,
|
||||
mode="All",
|
||||
)
|
||||
|
||||
assert not schedule.valid
|
||||
assert schedule.logical_routes == ()
|
||||
assert schedule.physical_routes == ()
|
||||
assert schedule.issues[0].code == "invalid_physical_groups"
|
||||
@@ -0,0 +1,289 @@
|
||||
"""RR-R3 CPU contracts for Reference slot and Core Picture correspondence."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from dataclasses import replace
|
||||
import hashlib
|
||||
|
||||
import pytest
|
||||
import torch
|
||||
|
||||
from ComfyUI_H3_Continuum_Join.reference import (
|
||||
REFERENCE_SIZE_MATCH_OUTPUT,
|
||||
build_hybrid_presentation_items,
|
||||
prepare_reference_assets,
|
||||
)
|
||||
from ComfyUI_H3_Continuum_Join.v3.reference_effective_plan import (
|
||||
compile_effective_reference_plan,
|
||||
)
|
||||
from ComfyUI_H3_Continuum_Join.v3.reference_routing import (
|
||||
REFERENCE_SLOT_IDS,
|
||||
compile_reference_routing_schedule,
|
||||
)
|
||||
|
||||
|
||||
def _selectors(**overrides: str) -> dict[str, str]:
|
||||
result = {slot_id: "off" for slot_id in REFERENCE_SLOT_IDS}
|
||||
result.update(overrides)
|
||||
return result
|
||||
|
||||
|
||||
def _schedule(*, chunks: int = 4, terminal: bool = False, mode=None, selectors=None):
|
||||
return compile_reference_routing_schedule(
|
||||
total_chunks=chunks,
|
||||
terminal_merge_enabled=terminal,
|
||||
mode=mode,
|
||||
selectors_by_slot=selectors,
|
||||
)
|
||||
|
||||
|
||||
def _hash(slot_id: str) -> str:
|
||||
return hashlib.sha256(slot_id.encode("ascii")).hexdigest()
|
||||
|
||||
|
||||
def _plan(schedule, slots=("R1", "R4", "R9"), *, first=False, last=False):
|
||||
return compile_effective_reference_plan(
|
||||
routing_schedule=schedule,
|
||||
source_slot_ids=slots,
|
||||
reference_image_hashes=tuple(_hash(slot_id) for slot_id in slots),
|
||||
reference_asset_count=len(slots),
|
||||
has_first_image=first,
|
||||
has_last_image=last,
|
||||
)
|
||||
|
||||
|
||||
def test_unset_routing_preserves_sparse_legacy_reference_order():
|
||||
schedule = _schedule(chunks=3)
|
||||
plan = _plan(schedule)
|
||||
|
||||
assert plan.valid and plan.legacy_fallback
|
||||
assert plan.connected_source_slot_ids == ("R1", "R4", "R9")
|
||||
assert tuple(route.logical_chunk for route in plan.logical_routes) == (1, 2, 3)
|
||||
for route in plan.logical_routes:
|
||||
assert route.requested_source_slot_ids == REFERENCE_SLOT_IDS
|
||||
assert [item.source_slot_id for item in route.picture_map.references] == ["R1", "R4", "R9"]
|
||||
assert [item.asset_index for item in route.picture_map.references] == [0, 1, 2]
|
||||
assert [item.image_sha256 for item in route.picture_map.references] == [
|
||||
_hash(slot_id) for slot_id in ("R1", "R4", "R9")
|
||||
]
|
||||
assert [item.picture_number for item in route.picture_map.references] == [1, 2, 3]
|
||||
assert all(group.status == "active" for group in plan.physical_routes)
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
("has_first", "has_last", "first_number", "last_number", "ref_numbers"),
|
||||
[
|
||||
(False, False, None, None, (1, 2)),
|
||||
(True, False, 1, None, (2, 3)),
|
||||
(False, True, None, 1, (2, 3)),
|
||||
(True, True, 1, 2, (3, 4)),
|
||||
],
|
||||
)
|
||||
def test_anchor_offsets_match_existing_core_presentation_order(
|
||||
has_first, has_last, first_number, last_number, ref_numbers
|
||||
):
|
||||
plan = _plan(_schedule(chunks=1), slots=("R4", "R9"), first=has_first, last=has_last)
|
||||
picture_map = plan.logical_routes[0].picture_map
|
||||
first = object() if has_first else None
|
||||
last = object() if has_last else None
|
||||
images = (object(), object())
|
||||
presentation = build_hybrid_presentation_items(
|
||||
[{"type": "image", "data": image} for image in images],
|
||||
first_image=first,
|
||||
last_image=last,
|
||||
)
|
||||
|
||||
assert plan.valid
|
||||
assert picture_map.first_picture_number == first_number
|
||||
assert picture_map.last_picture_number == last_number
|
||||
assert tuple(item.picture_number for item in picture_map.references) == ref_numbers
|
||||
assert tuple(item.asset_index for item in picture_map.references) == (0, 1)
|
||||
for item in picture_map.references:
|
||||
assert presentation[item.picture_number - 1]["data"] is images[item.asset_index]
|
||||
assert item.picture_tag == f"<Picture {item.picture_number}>"
|
||||
if first_number is not None:
|
||||
assert presentation[first_number - 1]["data"] is first
|
||||
if last_number is not None:
|
||||
assert presentation[last_number - 1]["data"] is last
|
||||
|
||||
|
||||
def test_custom_routes_recompact_pictures_without_losing_fixed_slot_identity():
|
||||
schedule = _schedule(
|
||||
mode="Custom",
|
||||
selectors=_selectors(R4="1,3", R9="2-3"),
|
||||
)
|
||||
plan = _plan(schedule, first=True)
|
||||
|
||||
assert plan.valid
|
||||
assert tuple(route.logical_chunk for route in plan.logical_routes) == (1, 2, 3, 4)
|
||||
assert [
|
||||
tuple((item.source_slot_id, item.asset_index, item.picture_number)
|
||||
for item in route.picture_map.references)
|
||||
for route in plan.logical_routes
|
||||
] == [
|
||||
(("R4", 1, 2),),
|
||||
(("R9", 2, 2),),
|
||||
(("R4", 1, 2), ("R9", 2, 3)),
|
||||
(),
|
||||
]
|
||||
assert plan.physical_routes[-1].status == "empty"
|
||||
assert plan.physical_routes[-1].picture_map.first_picture_number == 1
|
||||
|
||||
|
||||
def test_requested_but_disconnected_slot_stays_visible_as_an_empty_effective_route():
|
||||
schedule = _schedule(chunks=2, mode="Custom", selectors=_selectors(R5="1"))
|
||||
plan = _plan(schedule, slots=("R4", "R9"))
|
||||
|
||||
assert plan.valid
|
||||
assert plan.logical_routes[0].requested_source_slot_ids == ("R5",)
|
||||
assert plan.logical_routes[0].picture_map.references == ()
|
||||
assert plan.physical_routes[0].routing_status == "consistent"
|
||||
assert plan.physical_routes[0].status == "empty"
|
||||
assert plan.physical_routes[0].requested_source_slot_ids == ("R5",)
|
||||
|
||||
|
||||
def test_terminal_conflict_has_no_group_picture_map_but_retains_both_logical_maps():
|
||||
schedule = _schedule(
|
||||
chunks=3,
|
||||
terminal=True,
|
||||
mode="Custom",
|
||||
selectors=_selectors(R4="2", R9="3"),
|
||||
)
|
||||
plan = _plan(schedule, slots=("R4", "R9"), first=True, last=True)
|
||||
|
||||
assert plan.valid and plan.has_route_conflicts
|
||||
assert [item.source_slot_id for item in plan.logical_routes[1].picture_map.references] == ["R4"]
|
||||
assert [item.source_slot_id for item in plan.logical_routes[2].picture_map.references] == ["R9"]
|
||||
terminal = plan.physical_routes[-1]
|
||||
assert terminal.logical_chunks == (2, 3)
|
||||
assert terminal.terminal_atomic
|
||||
assert terminal.status == terminal.routing_status == "conflict"
|
||||
assert terminal.requested_source_slot_ids is None
|
||||
assert terminal.picture_map is None
|
||||
|
||||
|
||||
def test_consistent_terminal_route_has_one_shared_group_picture_map():
|
||||
schedule = _schedule(
|
||||
chunks=3, terminal=True, mode="Custom", selectors=_selectors(R4="2-3")
|
||||
)
|
||||
plan = _plan(schedule, slots=("R4", "R9"), first=True, last=True)
|
||||
|
||||
assert plan.valid and not plan.has_route_conflicts
|
||||
terminal = plan.physical_routes[-1]
|
||||
assert terminal.logical_chunks == (2, 3)
|
||||
assert terminal.status == "active"
|
||||
assert terminal.picture_map.first_picture_number == 1
|
||||
assert terminal.picture_map.last_picture_number == 2
|
||||
assert tuple((item.source_slot_id, item.asset_index, item.picture_number)
|
||||
for item in terminal.picture_map.references) == (("R4", 0, 3),)
|
||||
|
||||
|
||||
def test_explicit_custom_all_off_keeps_first_last_without_reference_pictures():
|
||||
schedule = _schedule(chunks=3, terminal=True, mode="Custom", selectors=_selectors())
|
||||
plan = _plan(schedule, slots=("R1",), first=True, last=True)
|
||||
|
||||
assert plan.valid and not plan.legacy_fallback
|
||||
assert all(route.picture_map.references == () for route in plan.logical_routes)
|
||||
assert all(group.status == "empty" for group in plan.physical_routes)
|
||||
assert plan.physical_routes[-1].picture_map.first_picture_number == 1
|
||||
assert plan.physical_routes[-1].picture_map.last_picture_number == 2
|
||||
|
||||
|
||||
def test_same_image_content_in_two_slots_retains_two_picture_identities():
|
||||
image = torch.full((1, 32, 32, 3), 0.5)
|
||||
assets = prepare_reference_assets(
|
||||
reference_image_1=image,
|
||||
reference_image_2=None,
|
||||
reference_image_4=image,
|
||||
output_width=32,
|
||||
output_height=32,
|
||||
size_mode=REFERENCE_SIZE_MATCH_OUTPUT,
|
||||
)
|
||||
assert assets is not None
|
||||
assert assets.image_hashes[0] == assets.image_hashes[1]
|
||||
plan = compile_effective_reference_plan(
|
||||
routing_schedule=_schedule(chunks=1),
|
||||
source_slot_ids=assets.source_slot_ids,
|
||||
reference_image_hashes=assets.image_hashes,
|
||||
reference_asset_count=assets.count,
|
||||
has_first_image=False,
|
||||
has_last_image=False,
|
||||
)
|
||||
assert plan.valid
|
||||
assert tuple((item.source_slot_id, item.asset_index, item.picture_number)
|
||||
for item in plan.logical_routes[0].picture_map.references) == (
|
||||
("R1", 0, 1), ("R4", 1, 2)
|
||||
)
|
||||
assert tuple(item.image_sha256 for item in plan.logical_routes[0].picture_map.references) == assets.image_hashes
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
("slots", "count", "expected_issue"),
|
||||
[
|
||||
((), 1, "missing_source_slots"),
|
||||
(("R1",), 2, "asset_count_mismatch"),
|
||||
(("R1", "R1"), 2, "duplicate_source_slot"),
|
||||
(("R9", "R4"), 2, "source_slot_order"),
|
||||
(("R10",), 1, "unknown_source_slot"),
|
||||
],
|
||||
)
|
||||
def test_broken_source_metadata_is_classified_without_a_partial_plan(slots, count, expected_issue):
|
||||
plan = compile_effective_reference_plan(
|
||||
routing_schedule=_schedule(chunks=2),
|
||||
source_slot_ids=slots,
|
||||
reference_image_hashes=tuple(_hash(slot_id) for slot_id in slots),
|
||||
reference_asset_count=count,
|
||||
has_first_image=False,
|
||||
has_last_image=False,
|
||||
)
|
||||
assert not plan.valid
|
||||
assert plan.logical_routes == plan.physical_routes == ()
|
||||
assert expected_issue in {issue.code for issue in plan.issues}
|
||||
|
||||
|
||||
def test_invalid_r2_schedule_and_malformed_logical_route_are_classified():
|
||||
invalid = _schedule(chunks=2, mode="Custom", selectors=_selectors(R1="3"))
|
||||
result = _plan(invalid)
|
||||
assert not result.valid
|
||||
assert any(issue.code == "routing_chunk_out_of_range" for issue in result.issues)
|
||||
|
||||
good = _schedule(chunks=2)
|
||||
bad_logical = replace(good.logical_routes[0], reference_slot_ids=("R10",))
|
||||
bad = replace(good, logical_routes=(bad_logical, *good.logical_routes[1:]))
|
||||
malformed = _plan(bad)
|
||||
assert not malformed.valid
|
||||
assert any(issue.code == "invalid_routing_schedule" for issue in malformed.issues)
|
||||
|
||||
|
||||
def test_anchor_flags_require_explicit_boolean_presence():
|
||||
result = compile_effective_reference_plan(
|
||||
routing_schedule=_schedule(chunks=1),
|
||||
source_slot_ids=(),
|
||||
reference_image_hashes=(),
|
||||
reference_asset_count=0,
|
||||
has_first_image=1,
|
||||
has_last_image=False,
|
||||
)
|
||||
assert not result.valid
|
||||
assert result.issues[0].code == "invalid_anchor_flags"
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
("hashes", "issue_code"),
|
||||
[
|
||||
((), "hash_count_mismatch"),
|
||||
(("not-a-sha",), "invalid_image_hash"),
|
||||
],
|
||||
)
|
||||
def test_invalid_reference_content_identity_does_not_create_a_partial_plan(hashes, issue_code):
|
||||
result = compile_effective_reference_plan(
|
||||
routing_schedule=_schedule(chunks=1),
|
||||
source_slot_ids=("R4",),
|
||||
reference_image_hashes=hashes,
|
||||
reference_asset_count=1,
|
||||
has_first_image=False,
|
||||
has_last_image=False,
|
||||
)
|
||||
assert not result.valid
|
||||
assert result.logical_routes == result.physical_routes == ()
|
||||
assert issue_code in {issue.code for issue in result.issues}
|
||||
@@ -0,0 +1,250 @@
|
||||
"""RR-R4 selected-Reference preparation and Qwen/DiT conditioning contracts."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import pytest
|
||||
import torch
|
||||
|
||||
from ComfyUI_H3_Continuum_Join.reference import REFERENCE_SIZE_MATCH_OUTPUT
|
||||
from ComfyUI_H3_Continuum_Join.v3.reference_routing import (
|
||||
REFERENCE_SLOT_IDS,
|
||||
compile_reference_routing_schedule,
|
||||
)
|
||||
from ComfyUI_H3_Continuum_Join.v3.reference_runtime import (
|
||||
ReferenceInputSet,
|
||||
ReferenceRoutingRuntime,
|
||||
ReferenceRuntimeContractError,
|
||||
rewrite_reference_tags,
|
||||
)
|
||||
from ComfyUI_H3_Continuum_Join.v3.reference_effective_plan import compile_group_picture_map
|
||||
from ComfyUI_H3_Continuum_Join.v3.reference_storage_contract import (
|
||||
ReferenceStorageContractError, build_reference_storage_plan,
|
||||
)
|
||||
|
||||
|
||||
def _image(value: float):
|
||||
return torch.full((1, 64, 64, 3), value, dtype=torch.float32)
|
||||
|
||||
|
||||
class _VAE:
|
||||
def __init__(self):
|
||||
self.values = []
|
||||
|
||||
def encode(self, image):
|
||||
value = float(image.mean())
|
||||
self.values.append(value)
|
||||
return torch.full((1, 24, 1, 4, 4), value)
|
||||
|
||||
|
||||
class _Clip:
|
||||
def __init__(self):
|
||||
self.calls = []
|
||||
|
||||
def tokenize(self, prompt, **kwargs):
|
||||
self.calls.append((prompt, kwargs))
|
||||
return prompt
|
||||
|
||||
def encode_from_tokens_scheduled(self, tokens):
|
||||
return [[torch.zeros((1, 1, 2)), {"prompt": tokens}]]
|
||||
|
||||
|
||||
def _selectors(**overrides):
|
||||
selectors = {slot_id: "off" for slot_id in REFERENCE_SLOT_IDS}
|
||||
selectors.update(overrides)
|
||||
return selectors
|
||||
|
||||
|
||||
def _runtime(*, slots, selectors, chunks=3, terminal=False):
|
||||
images = [None] * 9
|
||||
for slot_id, image in slots.items():
|
||||
images[int(slot_id[1:]) - 1] = image
|
||||
inputs = ReferenceInputSet(
|
||||
tuple(images), 64, 64, REFERENCE_SIZE_MATCH_OUTPUT,
|
||||
)
|
||||
schedule = compile_reference_routing_schedule(
|
||||
total_chunks=chunks,
|
||||
terminal_merge_enabled=terminal,
|
||||
mode="Custom",
|
||||
selectors_by_slot=_selectors(**selectors),
|
||||
)
|
||||
return ReferenceRoutingRuntime(schedule=schedule, inputs=inputs)
|
||||
|
||||
|
||||
def test_each_group_reaches_only_its_selected_image_in_vae_qwen_and_dit():
|
||||
a, b = _image(0.25), _image(0.75)
|
||||
# R9 is deliberately not a Tensor. An unselected image must not be validated.
|
||||
runtime = _runtime(
|
||||
slots={"R1": a, "R4": b, "R9": object()},
|
||||
selectors={"R1": "1", "R4": "2"},
|
||||
)
|
||||
vae, clip = _VAE(), _Clip()
|
||||
first = _image(0.1)
|
||||
|
||||
first_group = runtime.prepare_group(
|
||||
physical_group=1, prompt="@R1 runs; <Subject 1> watches",
|
||||
clip=clip, video_vae=vae, first_image=first, last_image=None,
|
||||
)
|
||||
assert first_group.selected_assets.source_slot_ids == ("R1",)
|
||||
assert first_group.effective_prompt == "<Picture 2> runs; <Subject 1> watches"
|
||||
assert first_group.picture_map.references[0].source_slot_id == "R1"
|
||||
assert first_group.picture_map.references[0].picture_number == 2
|
||||
assert len(vae.values) == 1 and vae.values[0] == pytest.approx(0.25)
|
||||
first_items = [item["data"] for item in clip.calls[0][1]["minimax_ref_items"]]
|
||||
assert first_items[0] is first and torch.equal(first_items[1], a)
|
||||
assert len(first_group.conditioning[0][1]["minimax_refs"]) == 1
|
||||
assert float(first_group.conditioning[0][1]["minimax_refs"][0]["latent"].mean()) == pytest.approx(0.25)
|
||||
|
||||
second_group = runtime.prepare_group(
|
||||
physical_group=2, prompt="@R4 runs; <Subject 1> watches",
|
||||
clip=clip, video_vae=vae, first_image=first, last_image=None,
|
||||
)
|
||||
assert second_group.selected_assets.source_slot_ids == ("R4",)
|
||||
assert second_group.effective_prompt == "<Picture 2> runs; <Subject 1> watches"
|
||||
assert vae.values == pytest.approx([0.25, 0.75])
|
||||
second_items = [item["data"] for item in clip.calls[1][1]["minimax_ref_items"]]
|
||||
assert second_items[0] is first and torch.equal(second_items[1], b)
|
||||
assert float(second_group.conditioning[0][1]["minimax_refs"][0]["latent"].mean()) == pytest.approx(0.75)
|
||||
|
||||
|
||||
def test_empty_custom_group_never_falls_back_to_all_references():
|
||||
runtime = _runtime(slots={"R1": _image(0.25)}, selectors={"R1": "1"})
|
||||
vae, clip = _VAE(), _Clip()
|
||||
result = runtime.prepare_group(
|
||||
physical_group=2, prompt="no reference here", clip=clip, video_vae=vae,
|
||||
first_image=None, last_image=None,
|
||||
)
|
||||
assert result.selected_assets is None
|
||||
assert result.picture_map.references == ()
|
||||
assert result.conditioning[0][1].get("minimax_refs") is None
|
||||
assert clip.calls == [("no reference here", {"images": []})]
|
||||
assert vae.values == []
|
||||
|
||||
|
||||
def test_empty_nonfinal_group_keeps_legacy_last_image_timing():
|
||||
runtime = _runtime(slots={}, selectors={}, chunks=2)
|
||||
first, last = _image(0.1), _image(0.9)
|
||||
clip = _Clip()
|
||||
initial = runtime.prepare_group(
|
||||
physical_group=1, prompt="running", clip=clip, video_vae=_VAE(),
|
||||
first_image=first, last_image=last, include_last_image=False,
|
||||
)
|
||||
final = runtime.prepare_group(
|
||||
physical_group=2, prompt="running", clip=clip, video_vae=_VAE(),
|
||||
first_image=first, last_image=last, include_last_image=True,
|
||||
)
|
||||
assert initial.picture_map.last_picture_number is None
|
||||
assert final.picture_map.last_picture_number == 2
|
||||
assert clip.calls[0][1]["images"] == [first]
|
||||
assert clip.calls[1][1]["images"] == [first, last]
|
||||
|
||||
|
||||
def test_same_prompt_different_group_reference_is_encoded_twice():
|
||||
runtime = _runtime(
|
||||
slots={"R1": _image(0.25), "R4": _image(0.75)},
|
||||
selectors={"R1": "1", "R4": "2"},
|
||||
)
|
||||
vae, clip = _VAE(), _Clip()
|
||||
results = [
|
||||
runtime.prepare_group(
|
||||
physical_group=group, prompt="running", clip=clip, video_vae=vae,
|
||||
first_image=None, last_image=None,
|
||||
)
|
||||
for group in (1, 2)
|
||||
]
|
||||
assert len(clip.calls) == 2
|
||||
assert results[0].picture_map.references[0].image_sha256 != results[1].picture_map.references[0].image_sha256
|
||||
assert results[0].conditioning is not results[1].conditioning
|
||||
|
||||
|
||||
def test_disconnected_selected_slot_warns_without_changing_prompt_or_sampling_contract():
|
||||
runtime = _runtime(slots={}, selectors={"R7": "1"}, chunks=1)
|
||||
result = runtime.prepare_group(
|
||||
physical_group=1, prompt="@R7 moves", clip=_Clip(), video_vae=_VAE(),
|
||||
first_image=None, last_image=None,
|
||||
)
|
||||
assert result.effective_prompt == "@R7 moves"
|
||||
assert result.selected_assets is None
|
||||
assert any("R7 is routed" in warning for warning in result.warnings)
|
||||
assert any("@R tag was left unchanged" in warning for warning in result.warnings)
|
||||
|
||||
|
||||
def test_duplicate_content_keeps_two_fixed_slot_identities_and_picture_numbers():
|
||||
image = _image(0.4)
|
||||
runtime = _runtime(
|
||||
slots={"R1": image, "R4": image},
|
||||
selectors={"R1": "all", "R4": "all"}, chunks=1,
|
||||
)
|
||||
result = runtime.prepare_group(
|
||||
physical_group=1, prompt="@R1 and @R4", clip=_Clip(), video_vae=_VAE(),
|
||||
first_image=None, last_image=None,
|
||||
)
|
||||
refs = result.picture_map.references
|
||||
assert [(item.source_slot_id, item.picture_number) for item in refs] == [
|
||||
("R1", 1), ("R4", 2)
|
||||
]
|
||||
assert refs[0].image_sha256 == refs[1].image_sha256
|
||||
assert result.effective_prompt == "<Picture 1> and <Picture 2>"
|
||||
|
||||
|
||||
def test_terminal_conflict_is_not_silently_merged_or_split():
|
||||
runtime = _runtime(
|
||||
slots={"R1": _image(0.25), "R4": _image(0.75)},
|
||||
selectors={"R1": "2", "R4": "3"}, terminal=True,
|
||||
)
|
||||
with pytest.raises(ReferenceRuntimeContractError, match="conflicting terminal"):
|
||||
runtime.check_physical_contract(chunks=3, terminal_merge_enabled=True)
|
||||
with pytest.raises(ReferenceRuntimeContractError, match="no single Reference route"):
|
||||
runtime.prepare_group(
|
||||
physical_group=2, prompt="running", clip=_Clip(), video_vae=_VAE(),
|
||||
first_image=None, last_image=None,
|
||||
)
|
||||
|
||||
|
||||
def test_raw_identity_excludes_never_selected_image_and_changes_with_route():
|
||||
bad_unselected = object()
|
||||
left = _runtime(
|
||||
slots={"R1": _image(0.25), "R9": bad_unselected},
|
||||
selectors={"R1": "1"}, chunks=1,
|
||||
)
|
||||
right = _runtime(
|
||||
slots={"R1": _image(0.25), "R9": bad_unselected},
|
||||
selectors={"R9": "1"}, chunks=1,
|
||||
)
|
||||
# Neither selected nor unselected raw image content is touched merely to
|
||||
# construct an RR-R4 queue identity; RR-R5 owns persistent reuse identity.
|
||||
assert len(left.global_identity("base")) == 64
|
||||
right._run_nonce = left._run_nonce
|
||||
assert left.global_identity("base") != right.global_identity("base")
|
||||
|
||||
|
||||
def test_reference_rewrite_is_exact_and_never_rewrites_subject_or_partial_tokens():
|
||||
picture_map = compile_group_picture_map(
|
||||
source_slot_ids=("R4",),
|
||||
reference_image_hashes=("a" * 64,),
|
||||
has_first_image=True,
|
||||
has_last_image=True,
|
||||
)
|
||||
effective, warnings = rewrite_reference_tags(
|
||||
"@R4 <Subject 4> @R5 @R10 X@R4 @R4suffix", picture_map
|
||||
)
|
||||
assert effective == "<Picture 3> <Subject 4> @R5 @R10 X@R4 @R4suffix"
|
||||
assert len(warnings) == 1 and "R5" in warnings[0]
|
||||
|
||||
|
||||
def test_rr_r5_changed_selected_image_is_rejected_before_vae_or_prompt_encode():
|
||||
image = _image(0.25)
|
||||
runtime = _runtime(slots={"R1": image}, selectors={"R1": "1"}, chunks=1)
|
||||
plan = build_reference_storage_plan(
|
||||
runtime=runtime, prompts=["@R1 runs"],
|
||||
first_frame_hash="none", last_frame_hash="none",
|
||||
)
|
||||
image.fill_(0.75)
|
||||
vae, clip = _VAE(), _Clip()
|
||||
with pytest.raises(ReferenceStorageContractError, match="changed after"):
|
||||
runtime.prepare_group(
|
||||
physical_group=1, prompt="@R1 runs", clip=clip, video_vae=vae,
|
||||
first_image=None, last_image=None,
|
||||
expected_group_contract=plan.group_for(1),
|
||||
)
|
||||
assert vae.values == []
|
||||
assert clip.calls == []
|
||||
@@ -0,0 +1,204 @@
|
||||
"""RR-R4 hidden Sequence integration; public V3.8 remains on its old path."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import copy
|
||||
from types import SimpleNamespace
|
||||
|
||||
import pytest
|
||||
import torch
|
||||
|
||||
from ComfyUI_H3_Continuum_Join.constants import (
|
||||
DIAGNOSTICS_BASIC,
|
||||
DIAGNOSTICS_OFF,
|
||||
PROMPT_MODE_FIXED,
|
||||
V2_CONTINUITY_OPTIONS,
|
||||
)
|
||||
from ComfyUI_H3_Continuum_Join.temporal import audio_latent_t, video_latent_t
|
||||
from ComfyUI_H3_Continuum_Join.v2 import sequence
|
||||
from ComfyUI_H3_Continuum_Join.v2.h3_builder import IdentityAssets, _tensor_fingerprint
|
||||
from ComfyUI_H3_Continuum_Join.v2.prompts import make_prompt_plan
|
||||
from ComfyUI_H3_Continuum_Join.v3.reference_routing import (
|
||||
REFERENCE_SLOT_IDS,
|
||||
compile_reference_routing_schedule,
|
||||
)
|
||||
from ComfyUI_H3_Continuum_Join.v3.reference_runtime import (
|
||||
ReferenceInputSet,
|
||||
ReferenceRoutingRuntime,
|
||||
)
|
||||
|
||||
|
||||
class _Nested:
|
||||
def __init__(self, parts):
|
||||
self.parts = tuple(parts)
|
||||
|
||||
def unbind(self):
|
||||
return self.parts
|
||||
|
||||
|
||||
class _Clip:
|
||||
def __init__(self):
|
||||
self.calls = []
|
||||
|
||||
def tokenize(self, prompt, **kwargs):
|
||||
self.calls.append((prompt, kwargs))
|
||||
return prompt
|
||||
|
||||
def encode_from_tokens_scheduled(self, tokens):
|
||||
return [[torch.zeros((1, 1, 2)), {"prompt": tokens}]]
|
||||
|
||||
|
||||
class _VAE:
|
||||
def __init__(self):
|
||||
self.values = []
|
||||
|
||||
def encode(self, image):
|
||||
value = float(image.mean())
|
||||
self.values.append(value)
|
||||
return torch.full((1, 24, 1, 4, 4), value)
|
||||
|
||||
|
||||
def _image(value):
|
||||
return torch.full((1, 64, 64, 3), value)
|
||||
|
||||
|
||||
def _runtime(monkeypatch, *, first=None, last=None):
|
||||
first_latent = torch.full((1, 24, 1, 4, 4), 0.1) if first is not None else None
|
||||
last_latent = torch.full((1, 24, 1, 4, 4), 0.9) if last is not None else None
|
||||
identity = IdentityAssets(first, first_latent, last, last_latent, _tensor_fingerprint(first))
|
||||
model = SimpleNamespace(
|
||||
model=SimpleNamespace(diffusion_model=SimpleNamespace()),
|
||||
model_options={}, wrappers={},
|
||||
model_dtype=lambda: torch.bfloat16,
|
||||
model_size=lambda: 0,
|
||||
)
|
||||
samples = []
|
||||
|
||||
def empty_latent(width, height, frames):
|
||||
return {"samples": _Nested((
|
||||
torch.zeros((1, 24, video_latent_t(frames), height // 16, width // 16)),
|
||||
torch.zeros((1, 32, 2, audio_latent_t(frames))),
|
||||
))}
|
||||
|
||||
def sample_chunk(**kwargs):
|
||||
metadata = kwargs["conditioning"][0][1]
|
||||
refs = metadata.get("minimax_refs") or []
|
||||
samples.append({
|
||||
"prompt": metadata["prompt"],
|
||||
"refs": [float(item["latent"].mean()) for item in refs if item.get("kind") == "image"],
|
||||
"physical_group": len(samples) + 1,
|
||||
})
|
||||
video, audio = kwargs["latent"]["samples"].unbind()
|
||||
return {"samples": _Nested((video.clone(), audio.clone()))}
|
||||
|
||||
monkeypatch.setattr(sequence, "check_comfy_h3_runtime", lambda: [])
|
||||
monkeypatch.setattr(sequence, "prepare_identity_assets", lambda *a, **k: identity)
|
||||
monkeypatch.setattr(sequence, "encode_identity_latents", lambda *a, **k: identity)
|
||||
monkeypatch.setattr(sequence, "empty_h3_latent", empty_latent)
|
||||
monkeypatch.setattr(sequence, "accelerator_summary", lambda _model: "accelerators")
|
||||
monkeypatch.setattr(sequence, "clone_model_for_chunk", lambda model, **_kwargs: model)
|
||||
monkeypatch.setattr(sequence, "latent_from_cpu", lambda video, audio: {"samples": _Nested((video, audio))})
|
||||
monkeypatch.setattr(sequence, "sample_chunk", sample_chunk)
|
||||
return SimpleNamespace(model=model, clip=_Clip(), vae=_VAE(), samples=samples)
|
||||
|
||||
|
||||
def _router(*, slots, selected_by_slot, chunks=3, terminal=False):
|
||||
images = [None] * 9
|
||||
for slot_id, image in slots.items():
|
||||
images[int(slot_id[1:]) - 1] = image
|
||||
selectors = {slot_id: "off" for slot_id in REFERENCE_SLOT_IDS}
|
||||
selectors.update(selected_by_slot)
|
||||
schedule = compile_reference_routing_schedule(
|
||||
total_chunks=chunks, terminal_merge_enabled=terminal,
|
||||
mode="Custom", selectors_by_slot=selectors,
|
||||
)
|
||||
inputs = ReferenceInputSet(tuple(images), 64, 64, "Match Output")
|
||||
return ReferenceRoutingRuntime(schedule=schedule, inputs=inputs)
|
||||
|
||||
|
||||
def _run(runtime, router, *, chunks=3, limit=None, first=None, last=None,
|
||||
session=None, script="running", diagnostics=DIAGNOSTICS_BASIC):
|
||||
prompt_plan = make_prompt_plan(
|
||||
mode=PROMPT_MODE_FIXED, script=script, chunks=chunks,
|
||||
chunk_seconds=5.0,
|
||||
)
|
||||
return sequence.run_sequence_with_reference_routing(
|
||||
reference_routing_runtime=router,
|
||||
model=runtime.model, clip=runtime.clip, video_vae=runtime.vae,
|
||||
audio_vae=None, sampler=object(), sigmas=torch.tensor([1.0, 0.0]),
|
||||
first_frame=first, last_frame=last, prompt_plan=prompt_plan,
|
||||
width=64, height=64, continuity=V2_CONTINUITY_OPTIONS[1],
|
||||
base_seed=42, audio_continuity=True, exact_total_duration=False,
|
||||
diagnostics_mode=diagnostics, reroll_from_chunk=0,
|
||||
reroll_nonce=0, strict_compatibility=False, debug=False,
|
||||
session=session, latent_only=True, max_new_physical_groups=limit,
|
||||
)
|
||||
|
||||
|
||||
def test_review_limited_sequence_prepares_only_groups_to_generate(monkeypatch):
|
||||
runtime = _runtime(monkeypatch)
|
||||
router = _router(
|
||||
slots={"R1": _image(0.2), "R4": _image(0.8), "R9": object()},
|
||||
selected_by_slot={"R1": "1", "R4": "2", "R9": "3"},
|
||||
)
|
||||
entries, _last_state, _session, _report = _run(runtime, router, limit=2)
|
||||
assert len(entries) == 2
|
||||
assert runtime.vae.values == pytest.approx([0.2, 0.8])
|
||||
assert all(len(sample["refs"]) == 1 for sample in runtime.samples)
|
||||
assert [sample["refs"][0] for sample in runtime.samples] == pytest.approx([0.2, 0.8])
|
||||
assert len(runtime.clip.calls) == 2
|
||||
assert [call[1]["minimax_ref_items"][0]["data"].mean().item() for call in runtime.clip.calls] == pytest.approx([0.2, 0.8])
|
||||
|
||||
|
||||
def test_custom_all_off_sequence_samples_without_any_reference(monkeypatch):
|
||||
runtime = _runtime(monkeypatch)
|
||||
router = _router(slots={"R1": object()}, selected_by_slot={}, chunks=1)
|
||||
entries, _last_state, _session, _report = _run(runtime, router, chunks=1)
|
||||
assert len(entries) == 1 and len(runtime.samples) == 1
|
||||
assert runtime.samples[0]["refs"] == []
|
||||
assert runtime.vae.values == []
|
||||
assert runtime.clip.calls[0][1] == {"images": []}
|
||||
|
||||
|
||||
def test_terminal_physical_pair_uses_one_shared_reference_set(monkeypatch):
|
||||
first, last = _image(0.1), _image(0.9)
|
||||
runtime = _runtime(monkeypatch, first=first, last=last)
|
||||
router = _router(
|
||||
slots={"R1": _image(0.2), "R4": _image(0.8)},
|
||||
selected_by_slot={"R1": "1", "R4": "2-3"}, terminal=True,
|
||||
)
|
||||
entries, _last_state, _session, _report = _run(
|
||||
runtime, router, first=first, last=last,
|
||||
)
|
||||
assert len(entries) == 3
|
||||
assert len(runtime.samples) == 2
|
||||
assert runtime.vae.values == pytest.approx([0.2, 0.8])
|
||||
assert all(len(sample["refs"]) == 1 for sample in runtime.samples)
|
||||
assert [sample["refs"][0] for sample in runtime.samples] == pytest.approx([0.2, 0.8])
|
||||
assert [len(call[1]["minimax_ref_items"]) for call in runtime.clip.calls] == [3, 3]
|
||||
|
||||
|
||||
def test_routed_session_without_rr_r5_evidence_is_ignored(monkeypatch):
|
||||
runtime = _runtime(monkeypatch)
|
||||
router = _router(slots={}, selected_by_slot={}, chunks=1)
|
||||
_, _, session, _ = _run(runtime, router, chunks=1)
|
||||
legacy_session = copy.deepcopy(session)
|
||||
legacy_session["settings"].pop("reference_routing_v1")
|
||||
runtime.samples.clear()
|
||||
entries, _, _, report = _run(runtime, router, chunks=1, session=legacy_session)
|
||||
assert len(entries) == 1 and len(runtime.samples) == 1
|
||||
assert "saved routed Session was ignored" in report
|
||||
assert sequence._REFERENCE_ROUTING_RUNTIME.get() is None
|
||||
|
||||
|
||||
def test_inactive_reference_tag_is_warning_only_even_when_diagnostics_off(monkeypatch):
|
||||
runtime = _runtime(monkeypatch)
|
||||
router = _router(slots={}, selected_by_slot={"R7": "1"}, chunks=1)
|
||||
entries, _state, _session, report = _run(
|
||||
runtime, router, chunks=1, script="@R7 runs",
|
||||
diagnostics=DIAGNOSTICS_OFF,
|
||||
)
|
||||
assert len(entries) == 1
|
||||
assert runtime.samples[0]["prompt"] == "@R7 runs"
|
||||
assert "RR-R4 Warning: group 1" in report
|
||||
assert "R7 is not active" in report
|
||||
@@ -0,0 +1,205 @@
|
||||
"""RR-R5 effective group identity and explicit Session evidence."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import copy
|
||||
import hashlib
|
||||
import json
|
||||
|
||||
import pytest
|
||||
import torch
|
||||
|
||||
from ComfyUI_H3_Continuum_Join.reference import REFERENCE_SIZE_MATCH_OUTPUT
|
||||
from ComfyUI_H3_Continuum_Join.v3.reference_routing import (
|
||||
REFERENCE_SLOT_IDS,
|
||||
compile_reference_routing_schedule,
|
||||
)
|
||||
from ComfyUI_H3_Continuum_Join.v3.reference_runtime import ReferenceInputSet, ReferenceRoutingRuntime
|
||||
from ComfyUI_H3_Continuum_Join.v3.reference_plan_inspector import project_reference_plan
|
||||
from ComfyUI_H3_Continuum_Join.v3 import reference_storage_contract as storage_contract
|
||||
from ComfyUI_H3_Continuum_Join.v3.reference_storage_contract import (
|
||||
ReferenceStorageContractError,
|
||||
ReferenceStoragePlan,
|
||||
build_reference_storage_plan,
|
||||
compatible_session_prefix,
|
||||
routed_session_identity,
|
||||
session_routing_settings,
|
||||
validate_reference_group_contracts,
|
||||
)
|
||||
|
||||
|
||||
def _image(value):
|
||||
return torch.full((1, 64, 64, 3), value, dtype=torch.float32)
|
||||
|
||||
|
||||
def _runtime(*, routes, images=None, chunks=3, terminal=False):
|
||||
selectors = {slot: "off" for slot in REFERENCE_SLOT_IDS}
|
||||
selectors.update(routes)
|
||||
slots = [None] * 9
|
||||
for slot, image in (images or {}).items():
|
||||
slots[int(slot[1:]) - 1] = image
|
||||
return ReferenceRoutingRuntime(
|
||||
schedule=compile_reference_routing_schedule(
|
||||
total_chunks=chunks,
|
||||
terminal_merge_enabled=terminal,
|
||||
mode="Custom",
|
||||
selectors_by_slot=selectors,
|
||||
),
|
||||
inputs=ReferenceInputSet(tuple(slots), 64, 64, REFERENCE_SIZE_MATCH_OUTPUT),
|
||||
)
|
||||
|
||||
|
||||
def _plan(runtime, *, prompts=None, terminal_prompt=None, policy=None, through=None, last="none"):
|
||||
return build_reference_storage_plan(
|
||||
runtime=runtime,
|
||||
prompts=prompts or ["person walks", "person turns", "person speaks"],
|
||||
first_frame_hash="none",
|
||||
last_frame_hash=last,
|
||||
terminal_prompt=terminal_prompt,
|
||||
terminal_prompt_policy=policy,
|
||||
through_chunk=through,
|
||||
)
|
||||
|
||||
|
||||
def test_reused_group_keeps_planned_disconnected_and_prompt_warnings():
|
||||
kwargs = {"routes": {"R1": "1"}, "chunks": 1}
|
||||
generated = _runtime(**kwargs)
|
||||
generated.storage_plan = _plan(generated, prompts=["@R1 runs"])
|
||||
generated.accepted_chunks = 1
|
||||
generated.generated_groups = (1,)
|
||||
expected = project_reference_plan(generated)["groups"][0]
|
||||
|
||||
reused = _runtime(**kwargs)
|
||||
reused.storage_plan = _plan(reused, prompts=["@R1 runs"])
|
||||
reused.accepted_chunks = 1
|
||||
actual = project_reference_plan(reused)["groups"][0]
|
||||
assert expected["contract_sha256"] == actual["contract_sha256"]
|
||||
assert expected["warnings"] == actual["warnings"]
|
||||
assert expected["warnings"] == [
|
||||
"R1 is routed to physical group 1 but no image is connected",
|
||||
"R1 is not active in this physical group; R1's @R tag was left unchanged",
|
||||
]
|
||||
|
||||
|
||||
def test_plan_warning_publication_is_atomic_and_observed_warnings_win():
|
||||
runtime = _runtime(routes={"R1": "1"}, chunks=3, terminal=True)
|
||||
runtime.group_warnings[1] = ("observed warning",)
|
||||
runtime.observed_group_contracts[1] = {"descriptor": {}, "sha256": "a" * 64}
|
||||
with pytest.raises(ReferenceStorageContractError, match="terminal physical prompt"):
|
||||
_plan(runtime, prompts=["@R1", "second", "third"], policy="last")
|
||||
assert runtime.group_warnings == {1: ("observed warning",)}
|
||||
|
||||
_plan(runtime, prompts=["@R1", "second", "third"],
|
||||
terminal_prompt="terminal", policy="last")
|
||||
assert runtime.group_warnings[1] == ("observed warning",)
|
||||
|
||||
|
||||
def test_group_lookup_decodes_one_record_and_returns_independent_values(monkeypatch):
|
||||
payloads = tuple(json.dumps({"physical_group": group, "references": []})
|
||||
for group in (1, 2, 3))
|
||||
plan = ReferenceStoragePlan(payloads, "a" * 64, ((), (), ()))
|
||||
original_loads = storage_contract.json.loads
|
||||
calls = []
|
||||
|
||||
def counting_loads(payload, *args, **kwargs):
|
||||
calls.append(payload)
|
||||
return original_loads(payload, *args, **kwargs)
|
||||
|
||||
monkeypatch.setattr(storage_contract.json, "loads", counting_loads)
|
||||
expected = {
|
||||
"descriptor": json.loads(payloads[2]),
|
||||
"sha256": hashlib.sha256(payloads[2].encode("utf-8")).hexdigest(),
|
||||
}
|
||||
calls.clear()
|
||||
first = plan.group_for(3)
|
||||
assert calls == [payloads[2]]
|
||||
assert first == expected
|
||||
first["descriptor"]["references"].append("changed")
|
||||
first["sha256"] = "0" * 64
|
||||
assert plan.group_for(3) == expected
|
||||
calls.clear()
|
||||
assert len(plan.group_contracts) == 3
|
||||
assert calls == list(payloads)
|
||||
with pytest.raises(ReferenceStorageContractError, match="physical group 4"):
|
||||
plan.group_for(4)
|
||||
|
||||
|
||||
def test_only_effective_groups_change_and_unselected_image_is_not_prepared():
|
||||
images = {"R1": _image(0.1), "R4": _image(0.4), "R9": object()}
|
||||
before = _plan(_runtime(routes={"R1": "all"}, images=images))
|
||||
after = _plan(_runtime(routes={"R1": "1-2", "R4": "3"}, images=images))
|
||||
assert [item["sha256"] for item in before.group_contracts[:2]] == [
|
||||
item["sha256"] for item in after.group_contracts[:2]
|
||||
]
|
||||
assert before.group_contracts[2]["sha256"] != after.group_contracts[2]["sha256"]
|
||||
assert after.group_for(3)["descriptor"]["references"][0]["source_slot_id"] == "R4"
|
||||
assert after.group_for(3)["descriptor"]["picture_order"] == ["R4"]
|
||||
validate_reference_group_contracts(after.group_contracts, chunk_count=3, terminal_merge_enabled=False)
|
||||
|
||||
|
||||
def test_raw_selector_spelling_and_disconnected_request_do_not_change_group_hash():
|
||||
images = {"R1": _image(0.1)}
|
||||
a = _plan(_runtime(routes={"R1": "1,2"}, images=images))
|
||||
b = _plan(_runtime(routes={"R1": "1-2", "R9": "3"}, images=images))
|
||||
assert [record["sha256"] for record in a.group_contracts] == [
|
||||
record["sha256"] for record in b.group_contracts
|
||||
]
|
||||
|
||||
|
||||
def test_session_evidence_preserves_only_complete_compatible_group_prefix():
|
||||
images = {"R1": _image(0.1), "R4": _image(0.4)}
|
||||
old = _plan(_runtime(routes={"R1": "all"}, images=images))
|
||||
new = _plan(_runtime(routes={"R1": "1-2", "R4": "3"}, images=images))
|
||||
evidence = session_routing_settings(old, 3)
|
||||
assert compatible_session_prefix(evidence, new, saved_chunks=3) == 2
|
||||
assert compatible_session_prefix(session_routing_settings(old, 2), new, saved_chunks=2) == 2
|
||||
assert routed_session_identity("a" * 64) != "a" * 64
|
||||
assert routed_session_identity("a" * 64) == routed_session_identity("a" * 64)
|
||||
bad = copy.deepcopy(evidence)
|
||||
bad["accepted_groups"][1]["logical_chunks"] = [3]
|
||||
with pytest.raises(ReferenceStorageContractError):
|
||||
compatible_session_prefix(bad, new, saved_chunks=3)
|
||||
|
||||
|
||||
def test_terminal_pair_is_one_identity_and_prompt_policy_is_group_local():
|
||||
images = {"R1": _image(0.1)}
|
||||
runtime = _runtime(routes={"R1": "all"}, images=images, chunks=4, terminal=True)
|
||||
prompts = ["one", "two", "three", "four"]
|
||||
shared = _plan(runtime, prompts=prompts, terminal_prompt="one shared", policy="shared")
|
||||
timeline = _plan(runtime, prompts=prompts, terminal_prompt="timeline pair", policy="timeline")
|
||||
assert len(shared.group_contracts) == 3
|
||||
assert [r["sha256"] for r in shared.group_contracts[:2]] == [
|
||||
r["sha256"] for r in timeline.group_contracts[:2]
|
||||
]
|
||||
assert shared.group_contracts[2]["sha256"] != timeline.group_contracts[2]["sha256"]
|
||||
with pytest.raises(ReferenceStorageContractError):
|
||||
session_routing_settings(shared, 3)
|
||||
assert session_routing_settings(shared, 4)["accepted_groups"][-1]["logical_chunks"] == [3, 4]
|
||||
validate_reference_group_contracts(shared.group_contracts, chunk_count=4, terminal_merge_enabled=True)
|
||||
|
||||
|
||||
def test_last_image_is_only_in_groups_where_qwen_presents_it():
|
||||
images = {"R1": _image(0.1)}
|
||||
no_references = _runtime(routes={}, images=images)
|
||||
before = _plan(no_references, last="a" * 64)
|
||||
after = _plan(no_references, last="b" * 64)
|
||||
assert [r["sha256"] for r in before.group_contracts[:2]] == [
|
||||
r["sha256"] for r in after.group_contracts[:2]
|
||||
]
|
||||
assert before.group_contracts[2]["sha256"] != after.group_contracts[2]["sha256"]
|
||||
with_references = _runtime(routes={"R1": "all"}, images=images)
|
||||
first = _plan(with_references, last="a" * 64)
|
||||
changed = _plan(with_references, last="b" * 64)
|
||||
assert first.group_contracts[0]["sha256"] != changed.group_contracts[0]["sha256"]
|
||||
|
||||
|
||||
def test_tampered_group_digest_or_boundary_is_rejected():
|
||||
plan = _plan(_runtime(routes={"R1": "all"}, images={"R1": _image(0.1)}))
|
||||
records = copy.deepcopy(plan.group_contracts)
|
||||
records[1]["descriptor"]["references"][0]["picture_number"] = 99
|
||||
with pytest.raises(ReferenceStorageContractError):
|
||||
validate_reference_group_contracts(records, chunk_count=3, terminal_merge_enabled=False)
|
||||
records = copy.deepcopy(plan.group_contracts)
|
||||
records[1]["descriptor"]["logical_chunks"] = [2, 3]
|
||||
with pytest.raises(ReferenceStorageContractError):
|
||||
validate_reference_group_contracts(records, chunk_count=3, terminal_merge_enabled=False)
|
||||
@@ -0,0 +1,308 @@
|
||||
"""RR-R6 public boundary and read-only Reference Plan contracts."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from copy import deepcopy
|
||||
import json
|
||||
from pathlib import Path
|
||||
from types import SimpleNamespace
|
||||
from uuid import UUID
|
||||
import zipfile
|
||||
|
||||
import pytest
|
||||
import torch
|
||||
|
||||
from ComfyUI_H3_Continuum_Join import nodes as public_nodes
|
||||
from ComfyUI_H3_Continuum_Join.v3 import driving_nodes
|
||||
from ComfyUI_H3_Continuum_Join.v3.reference_images_v39 import (
|
||||
H3ContinuumReferenceImagesV39,
|
||||
REFERENCE_IMAGES_V39_TYPE,
|
||||
ReferenceImagesV39Bundle,
|
||||
effective_reference_inputs,
|
||||
)
|
||||
from ComfyUI_H3_Continuum_Join.v3.reference_plan_inspector import (
|
||||
format_reference_plan,
|
||||
project_reference_plan,
|
||||
)
|
||||
from ComfyUI_H3_Continuum_Join.v3.reference_routing import (
|
||||
REFERENCE_SLOT_IDS,
|
||||
compile_reference_routing_schedule,
|
||||
)
|
||||
from ComfyUI_H3_Continuum_Join.v3.reference_runtime import (
|
||||
ReferenceInputSet,
|
||||
ReferenceRoutingRuntime,
|
||||
)
|
||||
from ComfyUI_H3_Continuum_Join.v3.reference_storage_contract import canonical_sha256
|
||||
from ComfyUI_H3_Continuum_Join.v3.refine_context import (
|
||||
RefineContextError,
|
||||
make_refine_context,
|
||||
make_refine_group,
|
||||
validate_refine_context,
|
||||
)
|
||||
from ComfyUI_H3_Continuum_Join.v3.second_pass import run_second_pass_groups
|
||||
|
||||
|
||||
def test_v39_has_one_typed_reference_input_and_v38_is_unchanged():
|
||||
assert public_nodes.NODE_CLASS_MAPPINGS["H3ContinuumSamplerV39"] is (
|
||||
driving_nodes.H3ContinuumSamplerV39
|
||||
)
|
||||
old = driving_nodes.H3ContinuumSamplerV38.INPUT_TYPES()
|
||||
new = driving_nodes.H3ContinuumSamplerV39.INPUT_TYPES()
|
||||
assert new["required"] == old["required"]
|
||||
assert "reference_routing_mode" not in new["required"]
|
||||
assert not any(f"reference_r{index}_chunks" in new["required"]
|
||||
for index in range(1, 10))
|
||||
assert set(new["optional"]) == (set(old["optional"])
|
||||
- {"reference_image_1", "reference_image_2", "reference_image_3", "image_references", "reference_image_4", "reference_image_5"}
|
||||
| {"reference_images"})
|
||||
assert new["optional"]["reference_images"][0] == H3ContinuumReferenceImagesV39.RETURN_TYPES[0]
|
||||
assert public_nodes.NODE_CLASS_MAPPINGS["H3ContinuumReferenceImagesV39"] is H3ContinuumReferenceImagesV39
|
||||
assert tuple(H3ContinuumReferenceImagesV39.INPUT_TYPES()["optional"]) == tuple(
|
||||
f"reference_image_{index}" for index in range(1, 10)
|
||||
)
|
||||
|
||||
|
||||
def test_all_uses_the_same_routed_engine(monkeypatch):
|
||||
calls = []
|
||||
plan = {"mode": "Custom", "accepted_chunks": 0, "connected_slots": ["R1"], "groups": []}
|
||||
outputs = (object(), object(), {"reference_routing_v1": plan}, "status", object())
|
||||
|
||||
def old_run(_self, **kwargs):
|
||||
calls.append(kwargs)
|
||||
return outputs
|
||||
|
||||
monkeypatch.setattr(driving_nodes.H3ContinuumSamplerV38, "run", old_run)
|
||||
image = object()
|
||||
bundle = ReferenceImagesV39Bundle((image, *(None for _ in range(8))), "All chunks", ("off",) * 9)
|
||||
result = driving_nodes.H3ContinuumSamplerV39().run(reference_images=bundle, chunks=3, marker=7)
|
||||
assert result["result"] is outputs
|
||||
assert calls[0]["marker"] == 7
|
||||
assert calls[0]["reference_image_1"] is image
|
||||
assert calls[0]["_reference_routing_settings"] == {
|
||||
"R1": "all", **{f"R{index}": "off" for index in range(2, 10)}
|
||||
}
|
||||
|
||||
|
||||
def test_custom_passes_selectors_privately_and_displays_verified_backend_plan(monkeypatch):
|
||||
calls = []
|
||||
plan = {
|
||||
"mode": "Custom", "accepted_chunks": 1,
|
||||
"connected_slots": ["R1"],
|
||||
"groups": [{
|
||||
"physical_group": 1, "logical_chunks": [1], "status": "generated",
|
||||
"descriptor": {"references": [{"source_slot_id": "R1", "picture_number": 2}]},
|
||||
"contract_sha256": "a" * 64, "warnings": [],
|
||||
}],
|
||||
}
|
||||
|
||||
def old_run(_self, **kwargs):
|
||||
calls.append(kwargs)
|
||||
return ([], [], {"reference_routing_v1": plan}, "status", None)
|
||||
|
||||
monkeypatch.setattr(driving_nodes.H3ContinuumSamplerV38, "run", old_run)
|
||||
image = object()
|
||||
bundle = ReferenceImagesV39Bundle((image, *(None for _ in range(8))), "Per chunk", ("2-3", *("off" for _ in range(8))))
|
||||
result = driving_nodes.H3ContinuumSamplerV39().run(
|
||||
reference_images=bundle, chunks=3, marker=7,
|
||||
)
|
||||
assert calls[0]["marker"] == 7
|
||||
assert calls[0]["_reference_routing_settings"] == {
|
||||
**{f"R{index}": "off" for index in range(1, 10)},
|
||||
"R1": "2,3", "R9": "off",
|
||||
}
|
||||
assert result["ui"]["h3_reference_plan"] == [format_reference_plan(plan)]
|
||||
assert "R1=<Picture 2>" in result["ui"]["h3_reference_plan"][0]
|
||||
|
||||
|
||||
def test_plan_inspector_uses_observed_or_frozen_contract_not_a_frontend_guess():
|
||||
selectors = {slot: "off" for slot in REFERENCE_SLOT_IDS}
|
||||
selectors.update(R1="1", R4="2")
|
||||
schedule = compile_reference_routing_schedule(
|
||||
total_chunks=3, terminal_merge_enabled=False,
|
||||
mode="Custom", selectors_by_slot=selectors,
|
||||
)
|
||||
runtime = ReferenceRoutingRuntime(
|
||||
schedule=schedule,
|
||||
inputs=ReferenceInputSet((None,) * 9, 64, 64, "Match Output"),
|
||||
)
|
||||
first = {
|
||||
"descriptor": {"references": [{"source_slot_id": "R1", "picture_number": 1}]},
|
||||
"sha256": "a" * 64,
|
||||
}
|
||||
second = {
|
||||
"descriptor": {"references": [{"source_slot_id": "R4", "picture_number": 1}]},
|
||||
"sha256": "b" * 64,
|
||||
}
|
||||
runtime.storage_plan = SimpleNamespace(group_for=lambda group: {1: first, 2: second}[group])
|
||||
runtime.observed_group_contracts[2] = deepcopy(second)
|
||||
runtime.group_warnings[2] = ("R9 is disconnected",)
|
||||
runtime.accepted_chunks = 2
|
||||
runtime.generated_groups = (2,)
|
||||
projected = project_reference_plan(runtime)
|
||||
assert [item["status"] for item in projected["groups"]] == [
|
||||
"reused", "generated", "pending",
|
||||
]
|
||||
assert projected["groups"][0]["contract_sha256"] == "a" * 64
|
||||
assert projected["groups"][1]["warnings"] == ["R9 is disconnected"]
|
||||
assert "descriptor" not in projected["groups"][2]
|
||||
assert "configured no References" in format_reference_plan(projected)
|
||||
assert first["descriptor"]["references"][0]["picture_number"] == 1
|
||||
|
||||
|
||||
def test_invalid_bundle_mode_does_not_call_v38(monkeypatch):
|
||||
monkeypatch.setattr(
|
||||
driving_nodes.H3ContinuumSamplerV38, "run",
|
||||
lambda *_args, **_kwargs: pytest.fail("legacy path was called"),
|
||||
)
|
||||
bad = ReferenceImagesV39Bundle((None,) * 9, "Other", ("off",) * 9)
|
||||
with pytest.raises(ValueError, match="nine-slot V3.9 bundle"):
|
||||
driving_nodes.H3ContinuumSamplerV39().run(reference_images=bad)
|
||||
|
||||
|
||||
def test_inline_helper_keeps_sparse_slot_ids_and_saved_future_chunks():
|
||||
image1, image4, image9 = object(), object(), object()
|
||||
values = {"reference_use": "Per chunk", "reference_image_1": image1,
|
||||
"reference_image_4": image4, "reference_image_9": image9,
|
||||
"reference_r1_chunks": "1,3,6", "reference_r4_chunks": "2-4",
|
||||
"reference_r9_chunks": "all"}
|
||||
(bundle,) = H3ContinuumReferenceImagesV39().pack(**values)
|
||||
assert bundle.images[3] is image4 and bundle.images[8] is image9
|
||||
assert bundle.selectors[3] == "2,3,4"
|
||||
first, extra, routes = effective_reference_inputs(bundle, chunks=3)
|
||||
assert first[0] is image1 and extra.images[0] is image4 and extra.images[5] is image9
|
||||
assert routes["R1"] == "1,3"
|
||||
assert routes["R4"] == "2,3"
|
||||
assert routes["R9"] == "1,2,3"
|
||||
assert effective_reference_inputs(bundle, chunks=6)[2]["R1"] == "1,3,6"
|
||||
assert bundle.selectors[0] == "1,3,6"
|
||||
|
||||
|
||||
def test_new_workflow_rewires_all_nine_slots_and_isolates_saved_runs():
|
||||
directory = Path(__file__).resolve().parents[1] / "examples" / "workflows"
|
||||
old = json.loads((directory / "MiniMax_H3_Continuum_V38X2.json").read_text(encoding="utf-8"))
|
||||
name = "MiniMax_H3_Continuum_V39_Reference_Inline.json"
|
||||
new_bytes = (directory / name).read_bytes()
|
||||
new = json.loads(new_bytes)
|
||||
with zipfile.ZipFile(directory / name.replace(".json", ".zip")) as archive:
|
||||
assert archive.namelist() == [name]
|
||||
assert archive.read(name) == new_bytes
|
||||
assert len(old["nodes"]) == len(new["nodes"])
|
||||
assert len(old["links"]) == len(new["links"])
|
||||
old_sampler = next(node for node in old["nodes"] if node["id"] == 312)
|
||||
sampler = next(node for node in new["nodes"] if node["id"] == 312)
|
||||
helper = next(node for node in new["nodes"] if node["id"] == 348)
|
||||
assert sampler["type"] == "H3ContinuumSamplerV39"
|
||||
# The user-supplied V38X2+Decode Cache Helper graph has an appended
|
||||
# Timeline Video mode that the earlier repository template lacked.
|
||||
project_id = sampler["widgets_values_named"]["project_id"]
|
||||
assert UUID(project_id).version == 4
|
||||
assert project_id != old_sampler["widgets_values_named"]["project_id"]
|
||||
expected_values = old_sampler["widgets_values"].copy()
|
||||
project_index = expected_values.index(old_sampler["widgets_values_named"]["project_id"])
|
||||
expected_values[project_index] = project_id
|
||||
assert sampler["widgets_values"][:-1] == expected_values
|
||||
assert sampler["widgets_values"][-1] == "Repeat Reference"
|
||||
assert sampler["widgets_values_named"]["video_reference_mode"] == "Repeat Reference"
|
||||
assert "reference_routing_mode" not in sampler["widgets_values_named"]
|
||||
assert not any(item["name"].startswith("reference_image_") for item in sampler["inputs"])
|
||||
assert helper["type"] == "H3ContinuumReferenceImagesV39"
|
||||
assert helper["widgets_values"] == ["All chunks", *(["off"] * 9)]
|
||||
assert [item["name"] for item in helper["inputs"]] == [
|
||||
f"reference_image_{index}" for index in range(1, 10)
|
||||
]
|
||||
links = {item[0]: item for item in new["links"]}
|
||||
for slot, link_id in enumerate((351, 350, 349, 393, 394, 395), start=0):
|
||||
assert links[link_id][3:5] == [348, slot]
|
||||
assert links[392][3:6] == [312, len(sampler["inputs"]) - 1, REFERENCE_IMAGES_V39_TYPE]
|
||||
nodes = {node["id"]: node for node in new["nodes"]}
|
||||
assert nodes[344]["type"] == "H3DecodeCacheHelper"
|
||||
assert nodes[317]["mode"] == 4 # Preserve the supplied image loader bypass.
|
||||
assert nodes[355]["widgets_values"] == ["MiniMax_H3_00001_.mp4", "image"]
|
||||
assert nodes[315]["widgets_values"] == ["prnas_.mp3", None, None]
|
||||
assert sampler["inputs"][8]["name"] == "reference_video_1"
|
||||
assert sampler["inputs"][9]["name"] == "driving_audio"
|
||||
|
||||
|
||||
def _routed_refine_fixture():
|
||||
descriptor = {
|
||||
"physical_group": 1, "logical_chunks": [1],
|
||||
"references": [{"source_slot_id": "R4", "picture_number": 1}],
|
||||
}
|
||||
route = {"descriptor": descriptor, "sha256": canonical_sha256(descriptor)}
|
||||
conditioning = [[torch.zeros((1, 1, 2)), {"minimax_frame_count": 124}]]
|
||||
captured = make_refine_group(
|
||||
conditioning=conditioning, group_id=0, logical_chunks=(1,),
|
||||
physical_frames=124, prompt_policy="single", physical_prompt="@R4 runs",
|
||||
source_video_shape=(1, 24, 37, 2, 3), physical_clip_index=1,
|
||||
context_frames=0, reference_routing_group_contract=route,
|
||||
)
|
||||
context = make_refine_context(
|
||||
[captured], source_width=48, source_height=32,
|
||||
conditioning_mode="t2va",
|
||||
)
|
||||
group = {
|
||||
"group_id": 0, "logical_chunks": [1], "physical_frames": 124,
|
||||
"physical_prompt": "@R4 runs", "prompt_policy": "single",
|
||||
"trim_prefix_frames": 0, "terminal_merged": False,
|
||||
"source_width": 48, "source_height": 32,
|
||||
"source_batch": 1, "latent_channels": 24,
|
||||
"source_latent_t": 37, "source_latent_h": 2,
|
||||
"source_latent_w": 3, "source_audio_shape": [1, 8, 148],
|
||||
}
|
||||
plan = {
|
||||
"width": 48, "height": 32,
|
||||
"second_pass_contract": {"version": 1, "physical_groups": [group]},
|
||||
"reference_routing_v1": {"groups": [{
|
||||
"contract_sha256": route["sha256"], "descriptor": deepcopy(descriptor),
|
||||
}]},
|
||||
}
|
||||
return context, plan, route
|
||||
|
||||
|
||||
def test_refine_capture_is_bound_to_the_exact_first_pass_route():
|
||||
context, plan, route = _routed_refine_fixture()
|
||||
assert validate_refine_context(context, assembly_plan=plan) is context
|
||||
assert context["groups"][0]["reference_routing_v1"] == route
|
||||
changed = deepcopy(plan)
|
||||
changed["reference_routing_v1"]["groups"][0]["contract_sha256"] = "0" * 64
|
||||
with pytest.raises(RefineContextError, match="differs from First Pass Plan"):
|
||||
validate_refine_context(context, assembly_plan=changed)
|
||||
|
||||
|
||||
@pytest.mark.parametrize("with_context,status", [
|
||||
(True, "verified"), (False, "not_inherited"),
|
||||
])
|
||||
def test_second_pass_reports_reference_inheritance_only_for_matching_context(
|
||||
with_context, status,
|
||||
):
|
||||
context, plan, route = _routed_refine_fixture()
|
||||
video = {"samples": torch.zeros((1, 24, 37, 2, 3))}
|
||||
audio = {"samples": torch.zeros((1, 8, 148))}
|
||||
calls = []
|
||||
|
||||
def encode_prompt(_clip, prompt, **_kwargs):
|
||||
calls.append(prompt)
|
||||
return [[torch.zeros((1, 1, 2)), {}]]
|
||||
|
||||
result = run_second_pass_groups(
|
||||
model=object(), clip=object(), sampler=object(),
|
||||
sigmas=torch.tensor([0.2, 0.0]),
|
||||
video_latents=[video], audio_latents=[audio], assembly_plan=plan,
|
||||
refine_seed=123, refine_context=context if with_context else None,
|
||||
encode_prompt_fn=encode_prompt,
|
||||
clone_model_fn=lambda model, **_kwargs: model,
|
||||
adapt_group_conditioning_fn=lambda group, **_kwargs: (
|
||||
[[item[0], dict(item[1])] for item in group["conditioning"]],
|
||||
{"warnings": ()},
|
||||
),
|
||||
latent_builder=lambda v, a: {"video": v, "audio": a},
|
||||
sample_fn=lambda **kwargs: kwargs["latent"],
|
||||
stream_extractor=lambda sampled: (sampled["video"], sampled["audio"]),
|
||||
)
|
||||
_refined, output_audio, updated, report = result
|
||||
record = updated["second_pass_contract"]["reference_inheritance"][0]
|
||||
assert record["status"] == status
|
||||
assert record["contract_sha256"] == (route["sha256"] if with_context else None)
|
||||
assert output_audio[0] is audio
|
||||
assert f"reference_inheritance={status}" in report
|
||||
assert calls == ([] if with_context else ["@R4 runs"])
|
||||
@@ -10,15 +10,17 @@ from pathlib import Path
|
||||
|
||||
EXPECTED_PUBLIC_NODE_DISPLAY_NAMES = {
|
||||
"H3ContinuumSamplerV38": "H3 Continuum Sampler V3.8",
|
||||
"H3ContinuumSamplerV39": "H3 Continuum Sampler V3.9",
|
||||
"H3ContinuumReferenceAudios": "H3 Continuum Reference Audios",
|
||||
"H3ContinuumReferenceImages": "H3 Continuum Reference Images",
|
||||
"H3ContinuumReferenceImagesV39": "H3 Continuum Reference Images V3.9",
|
||||
"H3ContinuumAssembleSeamV35": "H3 Continuum Finalize",
|
||||
"H3EasyLoadImage": "H3 Continuum Load Image",
|
||||
"H3EasyLoadAudio": "H3 Continuum Load Audio",
|
||||
"H3ContinuumLoadVideo": "H3 Continuum Load Video",
|
||||
"H3ContinuumVideoAdapter": "H3 Continuum Video Adapter",
|
||||
"H3ContinuumSecondPassV35": "H3 Continuum Second Pass",
|
||||
"H3DecodeCacheHelper": "Decode Cache Helper",
|
||||
"H3ContinuumVideoAdapter": "H3 Continuum Video Adapter",
|
||||
}
|
||||
|
||||
|
||||
@@ -38,7 +40,7 @@ def load_package(root: Path):
|
||||
|
||||
|
||||
def public_registration_issues(module) -> list[str]:
|
||||
"""Return exact public-surface differences for the installed V3.8X2 package."""
|
||||
"""Return exact public-surface differences for this local candidate."""
|
||||
|
||||
expected = EXPECTED_PUBLIC_NODE_DISPLAY_NAMES
|
||||
actual_classes = set(getattr(module, "NODE_CLASS_MAPPINGS", {}))
|
||||
@@ -110,7 +112,7 @@ def main() -> int:
|
||||
|
||||
registration_issues = public_registration_issues(module)
|
||||
if registration_issues:
|
||||
print("H3 Continuum V3.8X2 public-node verification FAILED:")
|
||||
print("H3 Continuum local public-node verification FAILED:")
|
||||
for issue in registration_issues:
|
||||
print(f" - {issue}")
|
||||
return 1
|
||||
|
||||
+40
-1
@@ -330,6 +330,7 @@ class H3ContinuumSamplerV2:
|
||||
continuation_transport="reference_context_v1",
|
||||
max_new_physical_groups=None,
|
||||
_diagnostic_continuation_policy=None,
|
||||
reference_routing_request=None,
|
||||
**clip_prompt_inputs,
|
||||
):
|
||||
(
|
||||
@@ -369,7 +370,45 @@ class H3ContinuumSamplerV2:
|
||||
for index in range(1, int(chunks) + 1)
|
||||
],
|
||||
)
|
||||
return run_sequence(
|
||||
sequence_runner = run_sequence
|
||||
if reference_routing_request is not None:
|
||||
from .sequence import (
|
||||
_terminal_flf_merge_enabled,
|
||||
run_sequence_with_reference_routing,
|
||||
)
|
||||
from ..v3.reference_routing import compile_reference_routing_schedule
|
||||
from ..v3.reference_runtime import (
|
||||
ReferenceRoutingRequest,
|
||||
ReferenceRoutingRuntime,
|
||||
)
|
||||
if not isinstance(reference_routing_request, ReferenceRoutingRequest):
|
||||
raise ValueError("invalid private Reference Routing request")
|
||||
routing_schedule = compile_reference_routing_schedule(
|
||||
total_chunks=int(chunks),
|
||||
terminal_merge_enabled=_terminal_flf_merge_enabled(
|
||||
multi_chunk_flf=bool(
|
||||
int(chunks) >= 2 and first_frame is not None and last_frame is not None
|
||||
),
|
||||
chunks=int(chunks),
|
||||
chunk_seconds=float(chunk_seconds),
|
||||
prompt_hashes=list(prompt_plan["hashes"]),
|
||||
timeline_video_source=timeline_video_source,
|
||||
),
|
||||
mode="Custom",
|
||||
selectors_by_slot=reference_routing_request.selectors_by_slot,
|
||||
)
|
||||
if not routing_schedule.valid:
|
||||
details = "; ".join(issue.message for issue in routing_schedule.issues)
|
||||
raise ValueError(f"Reference Routing is invalid: {details}")
|
||||
routing_runtime = ReferenceRoutingRuntime(
|
||||
schedule=routing_schedule,
|
||||
inputs=reference_routing_request.inputs,
|
||||
)
|
||||
reference_routing_request.runtime = routing_runtime
|
||||
sequence_runner = lambda **values: run_sequence_with_reference_routing(
|
||||
reference_routing_runtime=routing_runtime, **values
|
||||
)
|
||||
return sequence_runner(
|
||||
model=model,
|
||||
clip=clip,
|
||||
video_vae=video_vae,
|
||||
|
||||
+253
-27
@@ -5,8 +5,9 @@ orchestration only: all text/image conditioning is prepared first, H3 sampling
|
||||
runs for every chunk without intermediate VAE decoding, and decoding/assembly
|
||||
happens after the sampling phase.
|
||||
"""
|
||||
from __future__ import annotations
|
||||
from __future__ import annotations
|
||||
import copy, hashlib, logging
|
||||
from contextvars import ContextVar
|
||||
from typing import Any
|
||||
import torch
|
||||
from ..branch_provenance import physical_groups
|
||||
@@ -56,6 +57,13 @@ from .session import (
|
||||
LOG=logging.getLogger("h3_continuum_join")
|
||||
class SequenceRuntimeError(RuntimeError): pass
|
||||
|
||||
# RR-R4 is internal until its public and saved-run contracts are defined.
|
||||
# A ContextVar keeps the established 41-keyword run_sequence signatures intact
|
||||
# and isolates concurrent queue calls without a mutable module-global router.
|
||||
_REFERENCE_ROUTING_RUNTIME: ContextVar[Any | None] = ContextVar(
|
||||
"h3_continuum_reference_routing_runtime", default=None,
|
||||
)
|
||||
|
||||
REFERENCE_CONTEXT_V1="reference_context_v1"
|
||||
MASKED_VIDEO_PREFIX_V1="masked_video_prefix_v1"
|
||||
MASKED_AV_PREFIX_22_V1="masked_av_prefix_22_v1"
|
||||
@@ -84,7 +92,7 @@ def _check_decode_memory_budget(*,width,height,chunks,chunk_seconds):
|
||||
def _clone_entry_for_reuse(entry):
|
||||
entry=validate_chunk_entry(entry); result=dict(entry); result["plan"]=copy.deepcopy(entry["plan"]); result["reused"]=True; return result
|
||||
|
||||
def _preserved_prefix(*,session,prompt_hashes,chunks,reroll_from_chunk,width,height,chunk_seconds,identity_hash,last_frame_hash):
|
||||
def _preserved_prefix(*,session,prompt_hashes,chunks,reroll_from_chunk,width,height,chunk_seconds,identity_hash,last_frame_hash,reference_storage_plan=None):
|
||||
if session is None: return [],[]
|
||||
notes=[]
|
||||
try: session=validate_session(session)
|
||||
@@ -92,10 +100,27 @@ def _preserved_prefix(*,session,prompt_hashes,chunks,reroll_from_chunk,width,hei
|
||||
if int(session["width"])!=int(width) or int(session["height"])!=int(height): return [],["saved session resolution differs; generated a fresh run"]
|
||||
if abs(float(session["chunk_seconds"])-float(chunk_seconds))>1e-6: return [],["saved session chunk duration differs; generated a fresh run"]
|
||||
if str(session.get("identity_hash","none"))!=str(identity_hash): return [],["saved session identity differs; generated a fresh run"]
|
||||
saved_last_frame_hash=(session.get("settings") or {}).get("last_frame_hash")
|
||||
if str(saved_last_frame_hash or "none")!=str(last_frame_hash or "none"): return [],["saved session Last Frame differs; generated a fresh run"]
|
||||
routed_limit=None
|
||||
if reference_storage_plan is not None:
|
||||
from ..v3.reference_storage_contract import (
|
||||
ReferenceStorageContractError, compatible_session_prefix,
|
||||
)
|
||||
try:
|
||||
routed_limit=compatible_session_prefix(
|
||||
(session.get("settings") or {}).get("reference_routing_v1"),
|
||||
reference_storage_plan,
|
||||
saved_chunks=len(session["chunks"]),
|
||||
)
|
||||
except ReferenceStorageContractError as exc:
|
||||
return [],[f"saved routed Session was ignored; generated a fresh run ({exc})"]
|
||||
if routed_limit<len(session["chunks"]):
|
||||
notes.append(f"routed Session reuse stopped after logical chunk {routed_limit}: Reference group changed")
|
||||
else:
|
||||
saved_last_frame_hash=(session.get("settings") or {}).get("last_frame_hash")
|
||||
if str(saved_last_frame_hash or "none")!=str(last_frame_hash or "none"): return [],["saved session Last Frame differs; generated a fresh run"]
|
||||
if reroll_from_chunk<0 or reroll_from_chunk>chunks: raise SessionValidationError("reroll_from_chunk must be 0 or a valid one-based chunk index")
|
||||
limit=min(len(session["chunks"]),chunks)
|
||||
limit=min(len(session["chunks"]),chunks)
|
||||
if routed_limit is not None: limit=min(limit,routed_limit)
|
||||
if reroll_from_chunk>0: limit=min(limit,reroll_from_chunk-1)
|
||||
preserved=[]
|
||||
for index in range(limit):
|
||||
@@ -448,7 +473,10 @@ def _attach_terminal_flf_keyframes(
|
||||
return conditioning
|
||||
|
||||
def _run_runtime_internal(*,model:Any,clip:Any,video_vae:Any,audio_vae:Any,sampler:Any,sigmas:torch.Tensor,first_frame:torch.Tensor|None,last_frame:torch.Tensor|None,prompt_plan:dict[str,Any],width:int,height:int,continuity:str,base_seed:int,audio_continuity:bool,exact_total_duration:bool,diagnostics_mode:str,reroll_from_chunk:int,reroll_nonce:int,strict_compatibility:bool,debug:bool,seam_correction:str=SEAM_CORRECTION_OFF,enable_preview:bool=True,session:dict[str,Any]|None=None,initial_state:dict[str,Any]|None=None,latent_only:bool=False,reference_assets=None,reference_audio_source=None,reference_audio_vae=None,driving_audio_source=None,driving_audio_vae=None,reference_video_source=None,timeline_video_source=None,guide_source=None,capture_refine_context:bool=False,memory_attribution:bool=False,prompt_conditioning_cache:bool=False,reference_encode_cache:bool=False,continuation_transport:str=REFERENCE_CONTEXT_V1,max_new_physical_groups:int|None=None,_memory_attribution_collector:Any=None,_diagnostic_continuation_policy:Any=None):
|
||||
from ..conditioning import detect_conditioning_mode, conditioning_display_label
|
||||
from ..conditioning import (
|
||||
conditioning_display_label, conditioning_mode_from_presence,
|
||||
detect_conditioning_mode,
|
||||
)
|
||||
from ..run_storage import get_active_run_storage
|
||||
from ..v3.runtime_coordinator import (
|
||||
InternalRuntimeCoordinator,
|
||||
@@ -458,8 +486,18 @@ def _run_runtime_internal(*,model:Any,clip:Any,video_vae:Any,audio_vae:Any,sampl
|
||||
from ..video_reference_modes import (
|
||||
FOLLOW_PLAN_KEY, FollowVideoSource, build_follow_group_conditioning,
|
||||
)
|
||||
_reference_routing_runtime = _REFERENCE_ROUTING_RUNTIME.get()
|
||||
following_video = isinstance(reference_video_source, FollowVideoSource)
|
||||
storage_controller=get_active_run_storage()
|
||||
if _reference_routing_runtime is not None:
|
||||
from ..v3.reference_runtime import ReferenceRoutingRuntime
|
||||
if not isinstance(_reference_routing_runtime, ReferenceRoutingRuntime):
|
||||
raise SequenceRuntimeError("RR-R4 requires an internal ReferenceRoutingRuntime")
|
||||
if any((reference_assets is not None, initial_state is not None)):
|
||||
raise SequenceRuntimeError(
|
||||
"RR-R4 internal routing cannot combine with legacy Reference assets, "
|
||||
"or initial State"
|
||||
)
|
||||
runtime_coordinator=InternalRuntimeCoordinator(
|
||||
storage_controller=storage_controller,
|
||||
input_session=session,
|
||||
@@ -505,9 +543,13 @@ def _run_runtime_internal(*,model:Any,clip:Any,video_vae:Any,audio_vae:Any,sampl
|
||||
runtime_coordinator.validate_initial_state_reroll(reroll_from_chunk)
|
||||
except RuntimeCoordinatorError as exc:
|
||||
raise SequenceRuntimeError(str(exc)) from exc
|
||||
try: conditioning_mode=detect_conditioning_mode(first_frame=first_frame,last_frame=last_frame,reference_assets=reference_assets)
|
||||
except ValueError as exc: raise SequenceRuntimeError(str(exc)) from exc
|
||||
conditioning_display=conditioning_display_label(has_first=first_frame is not None,has_last=last_frame is not None,has_reference=reference_assets is not None)
|
||||
reference_mode_source=(
|
||||
reference_assets if _reference_routing_runtime is None
|
||||
else (_reference_routing_runtime if _reference_routing_runtime.has_selected_references else None)
|
||||
)
|
||||
try: conditioning_mode=detect_conditioning_mode(first_frame=first_frame,last_frame=last_frame,reference_assets=reference_mode_source)
|
||||
except ValueError as exc: raise SequenceRuntimeError(str(exc)) from exc
|
||||
conditioning_display=conditioning_display_label(has_first=first_frame is not None,has_last=last_frame is not None,has_reference=reference_mode_source is not None)
|
||||
reference_warning=""
|
||||
if reference_assets is not None:
|
||||
from ..reference import validate_reference_prompts
|
||||
@@ -533,13 +575,43 @@ def _run_runtime_internal(*,model:Any,clip:Any,video_vae:Any,audio_vae:Any,sampl
|
||||
issues=check_comfy_h3_runtime()
|
||||
assets=prepare_identity_assets(video_vae,width=width,height=height,first_frame=first_frame,last_frame=last_frame,encode_latents=False)
|
||||
multi_chunk_flf=bool(chunks>=2 and first_frame is not None and last_frame is not None)
|
||||
terminal_merge_enabled=_terminal_flf_merge_enabled(multi_chunk_flf=multi_chunk_flf,chunks=chunks,chunk_seconds=chunk_seconds,prompt_hashes=prompt_hashes,timeline_video_source=timeline_video_source)
|
||||
terminal_merge_enabled=_terminal_flf_merge_enabled(multi_chunk_flf=multi_chunk_flf,chunks=chunks,chunk_seconds=chunk_seconds,prompt_hashes=prompt_hashes,timeline_video_source=timeline_video_source)
|
||||
if _reference_routing_runtime is not None:
|
||||
try:
|
||||
_reference_routing_runtime.check_physical_contract(
|
||||
chunks=chunks, terminal_merge_enabled=terminal_merge_enabled,
|
||||
)
|
||||
except ValueError as exc:
|
||||
raise SequenceRuntimeError(str(exc)) from exc
|
||||
terminal_prompt=None
|
||||
terminal_prompt_policy=None
|
||||
if terminal_merge_enabled:
|
||||
terminal_prompt,terminal_prompt_policy=_terminal_pair_prompt(prompts,pair_start=chunks-2,chunk_seconds=chunk_seconds)
|
||||
from ..reference import combine_hybrid_visual_identity
|
||||
visual_identity_hash=combine_hybrid_visual_identity(keyframe_identity_hash=assets.identity_hash,reference_assets=reference_assets,has_first=first_frame is not None,has_last=last_frame is not None)
|
||||
if terminal_merge_enabled:
|
||||
terminal_prompt,terminal_prompt_policy=_terminal_pair_prompt(prompts,pair_start=chunks-2,chunk_seconds=chunk_seconds)
|
||||
reference_storage_plan=None
|
||||
if _reference_routing_runtime is not None and (storage_controller is not None or session is not None):
|
||||
from ..v3.reference_storage_contract import (
|
||||
ReferenceStorageContractError, build_reference_storage_plan,
|
||||
)
|
||||
try:
|
||||
reference_storage_plan=build_reference_storage_plan(
|
||||
runtime=_reference_routing_runtime,
|
||||
prompts=prompts,
|
||||
first_frame_hash=assets.first_frame_hash,
|
||||
last_frame_hash=assets.last_frame_hash,
|
||||
terminal_prompt=terminal_prompt,
|
||||
terminal_prompt_policy=terminal_prompt_policy,
|
||||
)
|
||||
except (ReferenceStorageContractError, ValueError) as exc:
|
||||
raise SequenceRuntimeError(f"RR-R5 Reference plan is invalid: {exc}") from exc
|
||||
_reference_routing_runtime.storage_plan = reference_storage_plan
|
||||
from ..reference import combine_hybrid_visual_identity
|
||||
if _reference_routing_runtime is not None:
|
||||
from ..v3.reference_storage_contract import routed_session_identity
|
||||
visual_identity_hash=(
|
||||
routed_session_identity(assets.identity_hash)
|
||||
if _reference_routing_runtime is not None else
|
||||
combine_hybrid_visual_identity(keyframe_identity_hash=assets.identity_hash,reference_assets=reference_assets,has_first=first_frame is not None,has_last=last_frame is not None)
|
||||
)
|
||||
sequence_identity_hash=combine_reference_audio_identity(visual_identity_hash,reference_audio_source)
|
||||
sequence_identity_hash=combine_driving_audio_identity(sequence_identity_hash,driving_audio_source)
|
||||
sequence_identity_hash=combine_reference_video_identity(sequence_identity_hash,reference_video_source)
|
||||
@@ -551,7 +623,14 @@ def _run_runtime_internal(*,model:Any,clip:Any,video_vae:Any,audio_vae:Any,sampl
|
||||
current_model_fingerprint=model_fingerprint(model,extra_wrapper_keys=("h3_continuum_join.apply_model.v1",))
|
||||
if storage_controller is not None:
|
||||
runtime_coordinator.assert_storage_session_compatible()
|
||||
stored_session=storage_controller.prepare(model=model,model_fingerprint_value=current_model_fingerprint,clip=clip,video_vae=video_vae,sampler=sampler,sigmas=sigmas,prompt_plan=plan,width=width,height=height,chunk_seconds=chunk_seconds,continuity=continuity,audio_continuity=audio_continuity,base_seed=base_seed,reroll_from_chunk=reroll_from_chunk,reroll_nonce=reroll_nonce,first_frame_hash=assets.first_frame_hash,last_frame_hash=assets.last_frame_hash,identity_hash=sequence_identity_hash,strict_compatibility=strict_compatibility,existing_session=session,reference_contract=reference_assets.contract if reference_assets is not None else None,conditioning_mode=conditioning_mode,reference_audio_contract=reference_audio_source.contract if reference_audio_source is not None else None,reference_audio_vae=reference_audio_vae,driving_audio_contract=driving_audio_source.contract if driving_audio_source is not None else None,driving_audio_vae=driving_audio_vae,reference_video_contract=reference_video_source.contract if reference_video_source is not None else None,timeline_video_contract=timeline_video_source.contract if timeline_video_source is not None else None,guide_contract=guide_source.contract if guide_source is not None else None,execution_semantics=_terminal_execution_semantics(merge_enabled=terminal_merge_enabled,prompt_policy=terminal_prompt_policy,continuation_transport=continuation_transport))
|
||||
storage_conditioning_mode=(
|
||||
conditioning_mode_from_presence(
|
||||
has_first=first_frame is not None,
|
||||
has_last=last_frame is not None,
|
||||
has_reference=False,
|
||||
) if reference_storage_plan is not None else conditioning_mode
|
||||
)
|
||||
stored_session=storage_controller.prepare(model=model,model_fingerprint_value=current_model_fingerprint,clip=clip,video_vae=video_vae,sampler=sampler,sigmas=sigmas,prompt_plan=plan,width=width,height=height,chunk_seconds=chunk_seconds,continuity=continuity,audio_continuity=audio_continuity,base_seed=base_seed,reroll_from_chunk=reroll_from_chunk,reroll_nonce=reroll_nonce,first_frame_hash=assets.first_frame_hash,last_frame_hash=assets.last_frame_hash,identity_hash=sequence_identity_hash,strict_compatibility=strict_compatibility,existing_session=session,reference_contract=reference_assets.contract if reference_assets is not None else None,conditioning_mode=storage_conditioning_mode,reference_audio_contract=reference_audio_source.contract if reference_audio_source is not None else None,reference_audio_vae=reference_audio_vae,driving_audio_contract=driving_audio_source.contract if driving_audio_source is not None else None,driving_audio_vae=driving_audio_vae,reference_video_contract=reference_video_source.contract if reference_video_source is not None else None,timeline_video_contract=timeline_video_source.contract if timeline_video_source is not None else None,guide_contract=guide_source.contract if guide_source is not None else None,execution_semantics=_terminal_execution_semantics(merge_enabled=terminal_merge_enabled,prompt_policy=terminal_prompt_policy,continuation_transport=continuation_transport),reference_storage_plan=reference_storage_plan)
|
||||
reroll_nonce=storage_controller.effective_reroll_nonce
|
||||
review_execution=getattr(storage_controller,"review_execution",None)
|
||||
if review_execution is not None:
|
||||
@@ -589,7 +668,7 @@ def _run_runtime_internal(*,model:Any,clip:Any,video_vae:Any,audio_vae:Any,sampl
|
||||
except Exception as exc:
|
||||
adaptive_observer_unavailable=f"{type(exc).__name__}: {exc}"
|
||||
effective_reroll_from_chunk=0 if storage_controller is not None and session is not None and bool((session.get("settings") or {}).get("run_storage_validated_prefix")) else int(reroll_from_chunk)
|
||||
preserved,reuse_notes=_preserved_prefix(session=session,prompt_hashes=prompt_hashes,chunks=chunks,reroll_from_chunk=effective_reroll_from_chunk,width=width,height=height,chunk_seconds=chunk_seconds,identity_hash=sequence_identity_hash,last_frame_hash=assets.last_frame_hash)
|
||||
preserved,reuse_notes=_preserved_prefix(session=session,prompt_hashes=prompt_hashes,chunks=chunks,reroll_from_chunk=effective_reroll_from_chunk,width=width,height=height,chunk_seconds=chunk_seconds,identity_hash=sequence_identity_hash,last_frame_hash=assets.last_frame_hash,reference_storage_plan=reference_storage_plan)
|
||||
if _terminal_strategy_mismatch(session,merge_enabled=terminal_merge_enabled):
|
||||
preserved=[]
|
||||
reuse_notes.append("FLF chunk contract changed; regenerated the requested FLF sequence.")
|
||||
@@ -604,9 +683,17 @@ def _run_runtime_internal(*,model:Any,clip:Any,video_vae:Any,audio_vae:Any,sampl
|
||||
reuse_notes.insert(0,"FLF execution: terminal merged 10s seed v2; the final two 5-second logical chunks share one physical sample and are split back into normal chunk entries.")
|
||||
else:
|
||||
reuse_notes.insert(0,"FLF execution: terminal merge unavailable for this request; retained one sampling pass per logical chunk.")
|
||||
if reference_assets is not None:
|
||||
reuse_notes.insert(0,f"Reference conditioning: {reference_assets.count} image(s), size={reference_assets.size_mode}; persistent across all chunks.")
|
||||
if reference_warning: reuse_notes.append(reference_warning)
|
||||
if reference_assets is not None:
|
||||
reuse_notes.insert(0,f"Reference conditioning: {reference_assets.count} image(s), size={reference_assets.size_mode}; persistent across all chunks.")
|
||||
if reference_warning: reuse_notes.append(reference_warning)
|
||||
if _reference_routing_runtime is not None:
|
||||
reuse_notes.insert(0,
|
||||
"V3.9 Custom Reference routing: group-local conditioning and "
|
||||
"complete-group saved-prefix verification; the verified effective Plan "
|
||||
"is available after Queue."
|
||||
if reference_storage_plan is not None else
|
||||
"V3.9 Custom Reference routing: group-local conditioning."
|
||||
)
|
||||
if reference_audio_source is not None:
|
||||
if isinstance(reference_audio_source, ReferenceAudioBundle):
|
||||
reuse_notes.insert(0,f"Reference Audio conditioning: {reference_audio_source.count} ordered item(s); persistent across all chunks.")
|
||||
@@ -680,14 +767,52 @@ def _run_runtime_internal(*,model:Any,clip:Any,video_vae:Any,audio_vae:Any,sampl
|
||||
)
|
||||
except ExecutionPlanningError as exc:
|
||||
raise SequenceRuntimeError(str(exc)) from exc
|
||||
if _reference_routing_runtime is not None:
|
||||
_reference_routing_runtime.generated_groups = tuple(
|
||||
group.physical_group for group in execution_plan.groups_to_generate
|
||||
)
|
||||
if storage_controller is not None:
|
||||
# Queue-local planning result only. No Run Storage schema or persisted
|
||||
# metadata is changed in R3.
|
||||
storage_controller.execution_plan=execution_plan
|
||||
|
||||
def follow_group_cache(group_prompt, include_last, start_frame, net_frames):
|
||||
routing_warnings=[]
|
||||
|
||||
def follow_group_cache(group_prompt, include_last, start_frame, net_frames, physical_group=None):
|
||||
# A new prompt-cache dict per physical interval prevents equal-prompt
|
||||
# chunks from accidentally reusing another interval's Qwen conditioning.
|
||||
if _reference_routing_runtime is not None:
|
||||
from ..video_reference_modes import encode_follow_video_group
|
||||
group_video, window = encode_follow_video_group(
|
||||
video_vae, reference_video_source,
|
||||
start_frame=int(start_frame), visible_frames=int(net_frames),
|
||||
cache_enabled=reference_encode_cache,
|
||||
cache_event=reference_encode_cache_events.append,
|
||||
)
|
||||
group_result=_reference_routing_runtime.prepare_group(
|
||||
physical_group=int(physical_group), prompt=group_prompt,
|
||||
clip=clip, video_vae=video_vae,
|
||||
first_image=assets.first_image, last_image=assets.last_image,
|
||||
include_last_image=bool(include_last),
|
||||
reference_audio_assets=reference_audio_assets,
|
||||
timeline_video_assets=group_video,
|
||||
reference_encode_cache=reference_encode_cache,
|
||||
cache_event=reference_encode_cache_events.append,
|
||||
expected_group_contract=(reference_storage_plan.group_for(int(physical_group))
|
||||
if reference_storage_plan is not None else None),
|
||||
first_frame_hash=assets.first_frame_hash,
|
||||
last_frame_hash=assets.last_frame_hash,
|
||||
terminal_prompt_policy=None,
|
||||
)
|
||||
routing_warnings.extend(
|
||||
f"RR-R4 Warning: group {physical_group}: {warning}"
|
||||
for warning in group_result.warnings
|
||||
)
|
||||
sampling_reports.append(window.report())
|
||||
key=_conditioning_cache_key(
|
||||
group_prompt, include_last=include_last, reference_assets=None,
|
||||
)
|
||||
return {key: group_result.conditioning}, window.contract
|
||||
group_cache, window = build_follow_group_conditioning(
|
||||
reference_video_source,
|
||||
video_vae,
|
||||
@@ -774,7 +899,7 @@ def _run_runtime_internal(*,model:Any,clip:Any,video_vae:Any,audio_vae:Any,sampl
|
||||
)
|
||||
if memory_collector is not None:
|
||||
capture_memory(memory_collector, "finish_phase", phase="conditioning_reference_video_vae")
|
||||
if timeline_video_source is None and not following_video:
|
||||
if timeline_video_source is None and not following_video and _reference_routing_runtime is None:
|
||||
if memory_collector is not None:
|
||||
capture_memory(memory_collector, "start_phase", phase="conditioning_prompt_clip")
|
||||
planned_normal_indices=tuple(
|
||||
@@ -872,13 +997,38 @@ def _run_runtime_internal(*,model:Any,clip:Any,video_vae:Any,audio_vae:Any,sampl
|
||||
if memory_collector is not None:
|
||||
capture_memory(memory_collector, "finish_phase", phase="conditioning_timeline_video_vae")
|
||||
chunk_assets=assets
|
||||
if timeline_video_source is not None:
|
||||
if timeline_video_source is not None and _reference_routing_runtime is None:
|
||||
if memory_collector is not None:
|
||||
capture_memory(memory_collector, "start_phase", phase="conditioning_prompt_clip")
|
||||
chunk_cache=_conditioning_cache(clip=clip,prompts=[prompt],assets=assets,final_has_last_frame=bool(last_frame is not None and is_final),reference_assets=reference_assets,reference_audio_assets=reference_audio_assets,timeline_video_assets=timeline_video_assets,prompt_conditioning_cache=prompt_conditioning_cache,prompt_cache_event=prompt_cache_events.append)
|
||||
if memory_collector is not None:
|
||||
capture_memory(memory_collector, "finish_phase", phase="conditioning_prompt_clip")
|
||||
capture_memory(memory_collector, "finish_phase", phase="conditioning")
|
||||
if _reference_routing_runtime is not None and not following_video:
|
||||
group_result=_reference_routing_runtime.prepare_group(
|
||||
physical_group=sequence_index+1, prompt=prompt,
|
||||
clip=clip, video_vae=video_vae,
|
||||
first_image=assets.first_image, last_image=assets.last_image,
|
||||
include_last_image=bool(last_frame is not None and is_final),
|
||||
reference_audio_assets=reference_audio_assets,
|
||||
timeline_video_assets=timeline_video_assets,
|
||||
reference_encode_cache=reference_encode_cache,
|
||||
cache_event=reference_encode_cache_events.append,
|
||||
expected_group_contract=(reference_storage_plan.group_for(sequence_index+1)
|
||||
if reference_storage_plan is not None else None),
|
||||
first_frame_hash=assets.first_frame_hash,
|
||||
last_frame_hash=assets.last_frame_hash,
|
||||
terminal_prompt_policy=None,
|
||||
)
|
||||
routing_warnings.extend(
|
||||
f"RR-R4 Warning: group {sequence_index+1}: {warning}"
|
||||
for warning in group_result.warnings
|
||||
)
|
||||
group_key=_conditioning_cache_key(
|
||||
prompt, include_last=bool(last_frame is not None and is_final),
|
||||
reference_assets=None,
|
||||
)
|
||||
chunk_cache={group_key:group_result.conditioning}
|
||||
if previous_state is None:
|
||||
include_chunk_last=bool(last_frame is not None and is_final)
|
||||
conditioning_key=_conditioning_cache_key(prompt,include_last=include_chunk_last,reference_assets=reference_assets)
|
||||
@@ -886,6 +1036,7 @@ def _run_runtime_internal(*,model:Any,clip:Any,video_vae:Any,audio_vae:Any,sampl
|
||||
if following_video:
|
||||
chunk_cache, follow_slice_contract = follow_group_cache(
|
||||
prompt, include_chunk_last, retained_frames, total_frames,
|
||||
physical_group=sequence_index+1,
|
||||
)
|
||||
conditioning=attach_keyframes(chunk_cache[conditioning_key],frame_count=total_frames,first_latent=chunk_assets.first_latent,last_latent=chunk_assets.last_latent if include_chunk_last else None); clip_index=1; context_frames=0
|
||||
chunk_plan=make_plan(continuation=False,clip_index=clip_index,total_frames=total_frames,trim_frames=0,width=width,height=height,context_frames=5,state_capacity_frames=largest_context_capacity(total_frames),requested_extend_seconds=chunk_seconds,debug=debug); reason="initial clip"
|
||||
@@ -896,6 +1047,7 @@ def _run_runtime_internal(*,model:Any,clip:Any,video_vae:Any,audio_vae:Any,sampl
|
||||
if following_video:
|
||||
chunk_cache, follow_slice_contract = follow_group_cache(
|
||||
prompt, include_chunk_last, retained_frames, shape.net_new_frames,
|
||||
physical_group=sequence_index+1,
|
||||
)
|
||||
continuation_first_latent=None if continuation_transport in (MASKED_VIDEO_PREFIX_V1,MASKED_AV_PREFIX_22_V1,MASKED_AV_PREFIX_39_V1) else chunk_assets.first_latent
|
||||
base_conditioning=attach_keyframes(chunk_cache[conditioning_key],frame_count=shape.total_frames,first_latent=continuation_first_latent,last_latent=chunk_assets.last_latent if include_chunk_last else None)
|
||||
@@ -1022,6 +1174,10 @@ def _run_runtime_internal(*,model:Any,clip:Any,video_vae:Any,audio_vae:Any,sampl
|
||||
if guide_target is not None and guide_assets is not None
|
||||
else None
|
||||
),
|
||||
reference_routing_group_contract=(
|
||||
_reference_routing_runtime.group_contract_for(sequence_index + 1)
|
||||
if _reference_routing_runtime is not None else None
|
||||
),
|
||||
))
|
||||
del source_video,_
|
||||
if memory_collector is not None:
|
||||
@@ -1151,7 +1307,40 @@ def _run_runtime_internal(*,model:Any,clip:Any,video_vae:Any,audio_vae:Any,sampl
|
||||
conditioning_key=_conditioning_cache_key(prompt,include_last=True,reference_assets=reference_assets)
|
||||
terminal_cache = cache
|
||||
terminal_follow_slice = None
|
||||
if following_video:
|
||||
if _reference_routing_runtime is not None:
|
||||
terminal_video_assets=reference_video_assets
|
||||
if following_video:
|
||||
from ..video_reference_modes import encode_follow_video_group
|
||||
terminal_video_assets, window=encode_follow_video_group(
|
||||
video_vae, reference_video_source,
|
||||
start_frame=int(retained_frames),
|
||||
visible_frames=physical_frames-physical_context_frames,
|
||||
cache_enabled=reference_encode_cache,
|
||||
cache_event=reference_encode_cache_events.append,
|
||||
)
|
||||
terminal_follow_slice=window.contract
|
||||
sampling_reports.append(window.report())
|
||||
group_result=_reference_routing_runtime.prepare_group(
|
||||
physical_group=terminal_physical_group, prompt=prompt,
|
||||
clip=clip, video_vae=video_vae,
|
||||
first_image=assets.first_image, last_image=assets.last_image,
|
||||
include_last_image=True,
|
||||
reference_audio_assets=reference_audio_assets,
|
||||
timeline_video_assets=terminal_video_assets,
|
||||
reference_encode_cache=reference_encode_cache,
|
||||
cache_event=reference_encode_cache_events.append,
|
||||
expected_group_contract=(reference_storage_plan.group_for(terminal_physical_group)
|
||||
if reference_storage_plan is not None else None),
|
||||
first_frame_hash=assets.first_frame_hash,
|
||||
last_frame_hash=assets.last_frame_hash,
|
||||
terminal_prompt_policy=terminal_prompt_policy,
|
||||
)
|
||||
routing_warnings.extend(
|
||||
f"RR-R4 Warning: group {terminal_physical_group}: {warning}"
|
||||
for warning in group_result.warnings
|
||||
)
|
||||
terminal_cache={conditioning_key:group_result.conditioning}
|
||||
elif following_video:
|
||||
terminal_cache, terminal_follow_slice = follow_group_cache(
|
||||
prompt, True, retained_frames,
|
||||
physical_frames - physical_context_frames,
|
||||
@@ -1302,6 +1491,10 @@ def _run_runtime_internal(*,model:Any,clip:Any,video_vae:Any,audio_vae:Any,sampl
|
||||
if guide_target is not None and guide_assets is not None
|
||||
else None
|
||||
),
|
||||
reference_routing_group_contract=(
|
||||
_reference_routing_runtime.group_contract_for(terminal_physical_group)
|
||||
if _reference_routing_runtime is not None else None
|
||||
),
|
||||
))
|
||||
del source_video,_
|
||||
if memory_collector is not None:
|
||||
@@ -1443,6 +1636,27 @@ def _run_runtime_internal(*,model:Any,clip:Any,video_vae:Any,audio_vae:Any,sampl
|
||||
raise SequenceRuntimeError(f"internal sequence length mismatch: expected {chunks}, got {len(entries)}")
|
||||
if not entries:
|
||||
raise SequenceRuntimeError("physical review execution returned an empty prefix")
|
||||
if _reference_routing_runtime is not None:
|
||||
from ..v3.reference_storage_contract import (
|
||||
ReferenceStorageContractError, build_reference_storage_plan,
|
||||
session_routing_settings,
|
||||
)
|
||||
if reference_storage_plan is None:
|
||||
try:
|
||||
reference_storage_plan=build_reference_storage_plan(
|
||||
runtime=_reference_routing_runtime,
|
||||
prompts=prompts,
|
||||
first_frame_hash=assets.first_frame_hash,
|
||||
last_frame_hash=assets.last_frame_hash,
|
||||
terminal_prompt=terminal_prompt,
|
||||
terminal_prompt_policy=terminal_prompt_policy,
|
||||
through_chunk=len(entries),
|
||||
)
|
||||
except (ReferenceStorageContractError, ValueError) as exc:
|
||||
raise SequenceRuntimeError(f"RR-R5 accepted Session evidence is invalid: {exc}") from exc
|
||||
routed_session_settings=session_routing_settings(reference_storage_plan,len(entries))
|
||||
_reference_routing_runtime.storage_plan = reference_storage_plan
|
||||
_reference_routing_runtime.accepted_chunks = len(entries)
|
||||
if latent_only:
|
||||
last_state=entry_to_state(entries[-1]); parent_id=session.get("session_id") if session is not None else None
|
||||
settings={"continuity":continuity,"audio_continuity":bool(audio_continuity),"exact_total_duration":False,"prompt_mode":plan["mode"],"conditioning_mode":conditioning_mode,"base_seed":int(base_seed),"reroll_nonce":int(reroll_nonce),"diagnostics_mode":diagnostics_mode,"initial_state_source":initial_state is not None,"latent_first":True,"first_frame_hash":assets.first_frame_hash,"last_frame_hash":assets.last_frame_hash,"reference_contract":reference_assets.contract if reference_assets is not None else None}
|
||||
@@ -1453,8 +1667,9 @@ def _run_runtime_internal(*,model:Any,clip:Any,video_vae:Any,audio_vae:Any,sampl
|
||||
if reference_video_source is not None: settings["reference_video_contract"]=reference_video_source.contract
|
||||
if timeline_video_source is not None: settings["timeline_video_contract"]=timeline_video_source.contract
|
||||
if guide_source is not None: settings["guide_contract"]=dict(guide_source.contract)
|
||||
new_session=make_session(chunks=entries,width=width,height=height,chunk_seconds=chunk_seconds,identity_hash=sequence_identity_hash,model_fingerprint_value=current_model_fingerprint,parent_session_id=parent_id,reroll_from_chunk=int(reroll_from_chunk),settings=settings)
|
||||
report_lines=[f"H3 Continuum V3 {PACKAGE_VERSION}",f"Conditioning mode: {conditioning_display}.",prompt_plan_report(plan),"Decode: external ComfyUI Core VAE nodes; full raw AV chunks retained.",accelerators,"Execution: conditioning precomputed; single call-local MODEL clone per chunk; no internal VAE decode.",*reuse_notes]
|
||||
if reference_storage_plan is not None: settings["reference_routing_v1"]=routed_session_settings
|
||||
new_session=make_session(chunks=entries,width=width,height=height,chunk_seconds=chunk_seconds,identity_hash=sequence_identity_hash,model_fingerprint_value=current_model_fingerprint,parent_session_id=parent_id,reroll_from_chunk=int(reroll_from_chunk),settings=settings)
|
||||
report_lines=[f"H3 Continuum V3 {PACKAGE_VERSION}",f"Conditioning mode: {conditioning_display}.",prompt_plan_report(plan),"Decode: external ComfyUI Core VAE nodes; full raw AV chunks retained.",accelerators,"Execution: conditioning precomputed; single call-local MODEL clone per chunk; no internal VAE decode.",*reuse_notes,*routing_warnings]
|
||||
if max_new_physical_groups is not None:
|
||||
report_lines.append(
|
||||
"Physical review execution: "
|
||||
@@ -1512,9 +1727,10 @@ def _run_runtime_internal(*,model:Any,clip:Any,video_vae:Any,audio_vae:Any,sampl
|
||||
if multi_chunk_flf: settings["flf_execution"]=FLF_STRATEGY
|
||||
if continuation_transport!=REFERENCE_CONTEXT_V1: settings["continuation_transport"]=continuation_transport
|
||||
if guide_source is not None: settings["guide_contract"]=dict(guide_source.contract)
|
||||
new_session=make_session(chunks=entries,width=width,height=height,chunk_seconds=chunk_seconds,identity_hash=sequence_identity_hash,model_fingerprint_value=current_model_fingerprint,parent_session_id=parent_id,reroll_from_chunk=int(reroll_from_chunk),settings=settings)
|
||||
if reference_storage_plan is not None: settings["reference_routing_v1"]=routed_session_settings
|
||||
new_session=make_session(chunks=entries,width=width,height=height,chunk_seconds=chunk_seconds,identity_hash=sequence_identity_hash,model_fingerprint_value=current_model_fingerprint,parent_session_id=parent_id,reroll_from_chunk=int(reroll_from_chunk),settings=settings)
|
||||
decoded_gib=float(images.shape[0])*float(width)*float(height)*3.0*4.0/(1024.0**3)
|
||||
report_lines=[f"H3 Continuum V2 {PACKAGE_VERSION}",prompt_plan_report(plan),f"Seam correction: {seam_correction}.",accelerators,"Execution: conditioning precomputed; single call-local MODEL clone per chunk; decode deferred until sampling completed.",*reuse_notes]
|
||||
report_lines=[f"H3 Continuum V2 {PACKAGE_VERSION}",prompt_plan_report(plan),f"Seam correction: {seam_correction}.",accelerators,"Execution: conditioning precomputed; single call-local MODEL clone per chunk; decode deferred until sampling completed.",*reuse_notes,*routing_warnings]
|
||||
if diagnostics_mode!=DIAGNOSTICS_OFF: report_lines.extend([f"Decode RAM estimate: {decode_estimate_gib:.2f} GiB including transient headroom"+(f"; available at start {available_ram_gib:.2f} GiB." if available_ram_gib is not None else "."),*sampling_reports,*decode_reports])
|
||||
if duration_report: report_lines.append(duration_report)
|
||||
report_lines.extend([session_summary(new_session),f"Output: {images.shape[0]} frames ({images.shape[0]/FPS:.3f}s), audio samples={audio['waveform'].shape[-1]}, decoded tensor≈{decoded_gib:.2f} GiB."])
|
||||
@@ -1573,3 +1789,13 @@ def run_sequence(*,model:Any,clip:Any,video_vae:Any,audio_vae:Any,sampler:Any,si
|
||||
"_diagnostic_continuation_policy":_diagnostic_continuation_policy,
|
||||
},
|
||||
)
|
||||
|
||||
|
||||
def run_sequence_with_reference_routing(*, reference_routing_runtime, **sequence_kwargs):
|
||||
"""RR-R4-only caller; do not expose through the V3.8 public node."""
|
||||
|
||||
token = _REFERENCE_ROUTING_RUNTIME.set(reference_routing_runtime)
|
||||
try:
|
||||
return run_sequence(**sequence_kwargs)
|
||||
finally:
|
||||
_REFERENCE_ROUTING_RUNTIME.reset(token)
|
||||
|
||||
@@ -28,6 +28,11 @@ from ..reference_video import (
|
||||
REFERENCE_VIDEO_SIZE_OPTIONS,
|
||||
)
|
||||
from ..reference import H3ContinuumReferenceImages, REFERENCE_IMAGES_TYPE
|
||||
from .reference_images_v39 import (
|
||||
H3ContinuumReferenceImagesV39,
|
||||
REFERENCE_IMAGES_V39_TYPE,
|
||||
effective_reference_inputs,
|
||||
)
|
||||
from ..reference_audio import (
|
||||
H3ContinuumReferenceAudios,
|
||||
REFERENCE_AUDIOS_TYPE,
|
||||
@@ -800,6 +805,61 @@ class H3ContinuumSamplerV38(H3ContinuumSamplerV37):
|
||||
)
|
||||
|
||||
|
||||
class H3ContinuumSamplerV39(H3ContinuumSamplerV38):
|
||||
"""Single nine-image input using the existing group-local routing engine."""
|
||||
|
||||
DESCRIPTION = (
|
||||
"H3 Continuum V3.9. Connect Reference Images V3.9 to assign fixed "
|
||||
"images 1–9 to all chunks or selected chunks."
|
||||
)
|
||||
SEARCH_ALIASES = ["H3 Continuum Sampler V3.9", "MiniMax H3 Reference Routing"]
|
||||
|
||||
@classmethod
|
||||
def INPUT_TYPES(cls):
|
||||
schema = super().INPUT_TYPES()
|
||||
schema["required"] = dict(schema["required"])
|
||||
optional = dict(schema["optional"])
|
||||
for index in range(1, 4):
|
||||
optional.pop(f"reference_image_{index}", None)
|
||||
optional.pop("image_references", None)
|
||||
optional.pop("reference_image_4", None)
|
||||
optional.pop("reference_image_5", None)
|
||||
optional["reference_images"] = (
|
||||
REFERENCE_IMAGES_V39_TYPE,
|
||||
{"display_name": "Reference Images (Optional)",
|
||||
"tooltip": "Connect H3 Continuum Reference Images V3.9; assign chunks there."},
|
||||
)
|
||||
schema["optional"] = optional
|
||||
return schema
|
||||
|
||||
def run(self, reference_images=None, **kwargs):
|
||||
# The public V3.9 schema owns a single Reference input. Stale API
|
||||
# keys must not create a second route around that input.
|
||||
for name in (
|
||||
*(f"reference_image_{index}" for index in range(1, 6)),
|
||||
"image_references", "reference_routing_mode",
|
||||
*(f"reference_r{index}_chunks" for index in range(1, 10)),
|
||||
):
|
||||
kwargs.pop(name, None)
|
||||
direct, extra, selectors = effective_reference_inputs(
|
||||
reference_images, chunks=int(kwargs.get("chunks", 3)),
|
||||
)
|
||||
kwargs.update({f"reference_image_{index}": image
|
||||
for index, image in enumerate(direct, start=1)})
|
||||
kwargs["image_references"] = extra
|
||||
outputs = super().run(_reference_routing_settings=selectors, **kwargs)
|
||||
if not isinstance(outputs, tuple) or len(outputs) < 4:
|
||||
return outputs
|
||||
from .reference_plan_inspector import format_reference_plan
|
||||
plan = outputs[2].get("reference_routing_v1")
|
||||
if not isinstance(plan, dict):
|
||||
raise RuntimeError("V3.9 Reference Routing has no verified output Plan")
|
||||
return {
|
||||
"ui": {"h3_reference_plan": [format_reference_plan(plan)]},
|
||||
"result": outputs,
|
||||
}
|
||||
|
||||
|
||||
class H3ContinuumMemoryActionPolicyExperimental:
|
||||
"""Explicit opt-in Reference sizing policy for the A7b experiment."""
|
||||
|
||||
@@ -1091,8 +1151,10 @@ NODE_CLASS_MAPPINGS = {
|
||||
"H3ContinuumStillImageGuideV37": H3ContinuumStillImageGuideV37,
|
||||
"H3ContinuumSamplerV37": H3ContinuumSamplerV37,
|
||||
"H3ContinuumSamplerV38": H3ContinuumSamplerV38,
|
||||
"H3ContinuumSamplerV39": H3ContinuumSamplerV39,
|
||||
"H3ContinuumReferenceAudios": H3ContinuumReferenceAudios,
|
||||
"H3ContinuumReferenceImages": H3ContinuumReferenceImages,
|
||||
"H3ContinuumReferenceImagesV39": H3ContinuumReferenceImagesV39,
|
||||
"H3ContinuumMemoryActionPolicyExperimental": (
|
||||
H3ContinuumMemoryActionPolicyExperimental
|
||||
),
|
||||
@@ -1110,8 +1172,10 @@ NODE_DISPLAY_NAME_MAPPINGS = {
|
||||
"H3ContinuumStillImageGuideV37": "H3 Continuum Still Image Guide V3.7",
|
||||
"H3ContinuumSamplerV37": "H3 Continuum Sampler V3.7",
|
||||
"H3ContinuumSamplerV38": "H3 Continuum Sampler V3.8",
|
||||
"H3ContinuumSamplerV39": "H3 Continuum Sampler V3.9",
|
||||
"H3ContinuumReferenceAudios": "H3 Continuum Reference Audios",
|
||||
"H3ContinuumReferenceImages": "H3 Continuum Reference Images",
|
||||
"H3ContinuumReferenceImagesV39": "H3 Continuum Reference Images V3.9",
|
||||
"H3ContinuumMemoryActionPolicyExperimental": (
|
||||
"H3 Continuum Memory Action Policy (Experimental)"
|
||||
),
|
||||
|
||||
@@ -130,6 +130,12 @@ def execute_v38_runtime_request(
|
||||
if request.diagnostics_mode == diagnostics_off:
|
||||
return output.as_public_tuple()
|
||||
|
||||
# The V3.8 reliability summary counts every connected Reference image.
|
||||
# A Custom V3.9 group intentionally prepares only its selected images, so
|
||||
# that legacy summary would describe a different conditioning path.
|
||||
if "_reference_routing_settings" in request.runtime_kwargs:
|
||||
return output.as_public_tuple()
|
||||
|
||||
try:
|
||||
inputs = request.diagnostics_inputs
|
||||
diagnostics = build_diagnostics(
|
||||
|
||||
+63
-18
@@ -220,6 +220,12 @@ def _apply_review_decode_scope(
|
||||
terminal_merged=selected_terminal_merged,
|
||||
terminal_initial_pair=(start == 1),
|
||||
)
|
||||
# Projection narrows the AV decode view, not the already-verified routing
|
||||
# decision. Keep that Queue-local plan available to the public Inspector.
|
||||
route_plan = assembly_plan.get("reference_routing_v1")
|
||||
if isinstance(route_plan, dict):
|
||||
scoped_plan = dict(scoped_plan)
|
||||
scoped_plan["reference_routing_v1"] = route_plan
|
||||
scoped_video = [{"samples": entry["video"]} for entry in decode_entries]
|
||||
scoped_audio = [{"samples": entry["audio"]} for entry in decode_entries]
|
||||
scoped_result = dict(result)
|
||||
@@ -528,6 +534,7 @@ class H3ContinuumSamplerV3:
|
||||
reference_encode_cache=False,
|
||||
continuation_transport="reference_context_v1",
|
||||
max_new_physical_groups=None,
|
||||
reference_routing_request=None,
|
||||
):
|
||||
if prompt_overrides is not None and not isinstance(prompt_overrides, dict):
|
||||
prompt_overrides = None
|
||||
@@ -615,6 +622,7 @@ class H3ContinuumSamplerV3:
|
||||
reference_encode_cache=bool(reference_encode_cache),
|
||||
continuation_transport=str(continuation_transport),
|
||||
max_new_physical_groups=max_new_physical_groups,
|
||||
reference_routing_request=reference_routing_request,
|
||||
_diagnostic_continuation_policy=advanced_values[
|
||||
"_diagnostic_continuation_policy"
|
||||
],
|
||||
@@ -642,7 +650,7 @@ class H3ContinuumSamplerV3:
|
||||
prompt_hashes=[str(entry["prompt_hash"]) for entry in entries],
|
||||
timeline_video_source=timeline_video_source,
|
||||
)
|
||||
decode_entries, assembly_plan = prepare_physical_decode_entries(
|
||||
decode_entries, assembly_plan = prepare_physical_decode_entries(
|
||||
entries,
|
||||
chunk_seconds=float(chunk_seconds),
|
||||
preserve_final_frame=(
|
||||
@@ -650,6 +658,13 @@ class H3ContinuumSamplerV3:
|
||||
),
|
||||
terminal_merged=terminal_merged,
|
||||
)
|
||||
if reference_routing_request is not None:
|
||||
from .reference_plan_inspector import project_reference_plan
|
||||
runtime = reference_routing_request.runtime
|
||||
if runtime is None:
|
||||
raise RuntimeError("Reference Routing completed without its runtime Plan")
|
||||
assembly_plan = dict(assembly_plan)
|
||||
assembly_plan["reference_routing_v1"] = project_reference_plan(runtime)
|
||||
video_latents = [{"samples": entry["video"]} for entry in decode_entries]
|
||||
audio_latents = [{"samples": entry["audio"]} for entry in decode_entries]
|
||||
if terminal_merged:
|
||||
@@ -1027,6 +1042,7 @@ class H3ContinuumSamplerProduction(H3ContinuumSamplerV3):
|
||||
reference_image_4=None,
|
||||
reference_image_5=None,
|
||||
image_references=None,
|
||||
_reference_routing_settings=None,
|
||||
):
|
||||
runtime_started_at = time.perf_counter()
|
||||
from ..reference import prepare_reference_assets
|
||||
@@ -1047,26 +1063,54 @@ class H3ContinuumSamplerProduction(H3ContinuumSamplerV3):
|
||||
)
|
||||
if take_requested and generation_mode != "Review Each Chunk":
|
||||
raise ValueError("Take selection requires Review Each Chunk")
|
||||
reference_assets = prepare_reference_assets(
|
||||
reference_image_1=reference_image_1,
|
||||
reference_image_2=reference_image_2,
|
||||
output_width=int(width),
|
||||
output_height=int(height),
|
||||
size_mode=reference_size,
|
||||
reference_image_3=reference_image_3,
|
||||
reference_image_4=reference_image_4,
|
||||
reference_image_5=reference_image_5,
|
||||
image_references=image_references,
|
||||
)
|
||||
reference_routing_request = None
|
||||
if _reference_routing_settings is None:
|
||||
reference_assets = prepare_reference_assets(
|
||||
reference_image_1=reference_image_1,
|
||||
reference_image_2=reference_image_2,
|
||||
output_width=int(width),
|
||||
output_height=int(height),
|
||||
size_mode=reference_size,
|
||||
reference_image_3=reference_image_3,
|
||||
reference_image_4=reference_image_4,
|
||||
reference_image_5=reference_image_5,
|
||||
image_references=image_references,
|
||||
)
|
||||
else:
|
||||
from .reference_runtime import ReferenceInputSet, ReferenceRoutingRequest
|
||||
reference_assets = None
|
||||
reference_routing_request = ReferenceRoutingRequest(
|
||||
selectors_by_slot=dict(_reference_routing_settings),
|
||||
inputs=ReferenceInputSet.from_inputs(
|
||||
reference_image_1=reference_image_1,
|
||||
reference_image_2=reference_image_2,
|
||||
reference_image_3=reference_image_3,
|
||||
reference_image_4=reference_image_4,
|
||||
reference_image_5=reference_image_5,
|
||||
image_references=image_references,
|
||||
output_width=int(width),
|
||||
output_height=int(height),
|
||||
size_mode=reference_size,
|
||||
),
|
||||
)
|
||||
reference_audio_source, resolved_reference_audio_vae = resolve_reference_audio_input(
|
||||
reference_audio_1,
|
||||
reference_audio_vae,
|
||||
audio_references,
|
||||
)
|
||||
def mark_runtime_start(assembly_plan):
|
||||
marked = dict(assembly_plan)
|
||||
marked["_runtime_started_at"] = runtime_started_at
|
||||
return marked
|
||||
def mark_runtime_start(assembly_plan):
|
||||
marked = dict(assembly_plan)
|
||||
marked["_runtime_started_at"] = runtime_started_at
|
||||
return marked
|
||||
|
||||
def append_reference_plan(report, assembly_plan):
|
||||
if reference_routing_request is None:
|
||||
return str(report)
|
||||
from .reference_plan_inspector import format_reference_plan
|
||||
plan_view = assembly_plan.get("reference_routing_v1")
|
||||
if not isinstance(plan_view, dict):
|
||||
raise RuntimeError("Reference Routing output has no verified Plan")
|
||||
return str(report).rstrip() + "\n" + format_reference_plan(plan_view)
|
||||
|
||||
def execute():
|
||||
return super(H3ContinuumSamplerProduction, self).run(
|
||||
@@ -1097,6 +1141,7 @@ class H3ContinuumSamplerProduction(H3ContinuumSamplerV3):
|
||||
memory_attribution=bool(memory_attribution),
|
||||
prompt_conditioning_cache=bool(prompt_conditioning_cache),
|
||||
reference_encode_cache=bool(reference_encode_cache),
|
||||
reference_routing_request=reference_routing_request,
|
||||
continuation_transport=str(continuation_transport),
|
||||
max_new_physical_groups=max_new_physical_groups,
|
||||
advanced={
|
||||
@@ -1134,7 +1179,7 @@ class H3ContinuumSamplerProduction(H3ContinuumSamplerV3):
|
||||
video_latents,
|
||||
audio_latents,
|
||||
mark_runtime_start(assembly_plan),
|
||||
str(result["report"]),
|
||||
append_reference_plan(result["report"], assembly_plan),
|
||||
)
|
||||
if bool(capture_refine_context):
|
||||
return (*outputs, refine_context)
|
||||
@@ -1179,7 +1224,7 @@ class H3ContinuumSamplerProduction(H3ContinuumSamplerV3):
|
||||
else:
|
||||
video_latents, audio_latents, assembly_plan, result = execute_outputs
|
||||
result = dict(result)
|
||||
report = str(result["report"]) + "\n" + storage.summary(
|
||||
report = append_reference_plan(result["report"], assembly_plan) + "\n" + storage.summary(
|
||||
detailed=diagnostics == DIAGNOSTICS_FULL
|
||||
)
|
||||
warning = _partial_review_warning(
|
||||
|
||||
@@ -0,0 +1,287 @@
|
||||
"""Pure RR-R3 plan joining fixed Reference identities to Core Picture numbers.
|
||||
|
||||
The caller supplies only immutable routing and Reference metadata. This module
|
||||
does not encode images, rewrite prompts, select runtime sources, or sample.
|
||||
"""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from dataclasses import dataclass
|
||||
from typing import Any
|
||||
|
||||
from .reference_routing import REFERENCE_SLOT_IDS, ReferenceRoutingSchedule
|
||||
|
||||
|
||||
_SLOT_ORDER = {slot_id: index for index, slot_id in enumerate(REFERENCE_SLOT_IDS)}
|
||||
|
||||
|
||||
@dataclass(frozen=True, slots=True)
|
||||
class EffectivePlanIssue:
|
||||
code: str
|
||||
message: str
|
||||
source_slot_id: str | None = None
|
||||
|
||||
|
||||
@dataclass(frozen=True, slots=True)
|
||||
class ReferencePicture:
|
||||
"""A fixed source slot, compact asset, content hash, and Qwen Picture number."""
|
||||
|
||||
source_slot_id: str
|
||||
asset_index: int
|
||||
image_sha256: str
|
||||
picture_number: int
|
||||
|
||||
@property
|
||||
def picture_tag(self) -> str:
|
||||
return f"<Picture {self.picture_number}>"
|
||||
|
||||
|
||||
@dataclass(frozen=True, slots=True)
|
||||
class PictureMap:
|
||||
"""Core's image presentation order; First/Last are not Reference assets."""
|
||||
|
||||
first_picture_number: int | None
|
||||
last_picture_number: int | None
|
||||
references: tuple[ReferencePicture, ...]
|
||||
|
||||
@property
|
||||
def source_slot_ids(self) -> tuple[str, ...]:
|
||||
return tuple(item.source_slot_id for item in self.references)
|
||||
|
||||
|
||||
@dataclass(frozen=True, slots=True)
|
||||
class LogicalEffectiveRoute:
|
||||
logical_chunk: int
|
||||
requested_source_slot_ids: tuple[str, ...]
|
||||
picture_map: PictureMap
|
||||
|
||||
|
||||
@dataclass(frozen=True, slots=True)
|
||||
class PhysicalEffectiveRoute:
|
||||
physical_group: int
|
||||
logical_chunks: tuple[int, ...]
|
||||
terminal_atomic: bool
|
||||
routing_status: str
|
||||
status: str
|
||||
requested_source_slot_ids: tuple[str, ...] | None
|
||||
picture_map: PictureMap | None
|
||||
|
||||
|
||||
@dataclass(frozen=True, slots=True)
|
||||
class EffectiveReferencePlan:
|
||||
mode: str
|
||||
legacy_fallback: bool
|
||||
connected_source_slot_ids: tuple[str, ...]
|
||||
logical_routes: tuple[LogicalEffectiveRoute, ...] = ()
|
||||
physical_routes: tuple[PhysicalEffectiveRoute, ...] = ()
|
||||
issues: tuple[EffectivePlanIssue, ...] = ()
|
||||
|
||||
@property
|
||||
def valid(self) -> bool:
|
||||
return not self.issues
|
||||
|
||||
@property
|
||||
def has_route_conflicts(self) -> bool:
|
||||
return any(group.status == "conflict" for group in self.physical_routes)
|
||||
|
||||
|
||||
def _schedule_issues(schedule: ReferenceRoutingSchedule) -> tuple[EffectivePlanIssue, ...]:
|
||||
if not schedule.valid:
|
||||
return tuple(
|
||||
EffectivePlanIssue(f"routing_{issue.code}", issue.message, issue.slot_id)
|
||||
for issue in schedule.issues
|
||||
)
|
||||
total = schedule.total_chunks
|
||||
if isinstance(total, bool) or not isinstance(total, int) or total < 1:
|
||||
return (EffectivePlanIssue("invalid_routing_schedule", "missing logical chunk count"),)
|
||||
if tuple(route.logical_chunk for route in schedule.logical_routes) != tuple(range(1, total + 1)):
|
||||
return (EffectivePlanIssue("invalid_routing_schedule", "logical chunks are not the full project sequence"),)
|
||||
|
||||
logical_slots = {route.logical_chunk: route.reference_slot_ids for route in schedule.logical_routes}
|
||||
for route in schedule.logical_routes:
|
||||
if any(slot_id not in _SLOT_ORDER for slot_id in route.reference_slot_ids):
|
||||
return (EffectivePlanIssue("invalid_routing_schedule", "logical route has an unknown Reference slot"),)
|
||||
if len(set(route.reference_slot_ids)) != len(route.reference_slot_ids):
|
||||
return (EffectivePlanIssue("invalid_routing_schedule", "logical route repeats a Reference slot"),)
|
||||
if tuple(sorted(route.reference_slot_ids, key=_SLOT_ORDER.get)) != route.reference_slot_ids:
|
||||
return (EffectivePlanIssue("invalid_routing_schedule", "logical Reference slots are not ordered"),)
|
||||
|
||||
covered = tuple(chunk for group in schedule.physical_routes for chunk in group.logical_chunks)
|
||||
if covered != tuple(range(1, total + 1)):
|
||||
return (EffectivePlanIssue("invalid_routing_schedule", "physical groups do not cover the logical sequence"),)
|
||||
for group in schedule.physical_routes:
|
||||
if group.terminal_atomic != (len(group.logical_chunks) > 1):
|
||||
return (EffectivePlanIssue("invalid_routing_schedule", "physical group atomicity disagrees with its chunks"),)
|
||||
members = tuple(logical_slots[chunk] for chunk in group.logical_chunks)
|
||||
if group.logical_reference_slot_ids != members:
|
||||
return (EffectivePlanIssue("invalid_routing_schedule", "physical group member routes disagree with logical routes"),)
|
||||
consistent = all(member == members[0] for member in members[1:])
|
||||
if consistent:
|
||||
expected_status = "empty" if not members[0] else "consistent"
|
||||
if group.status != expected_status or group.reference_slot_ids != members[0]:
|
||||
return (EffectivePlanIssue("invalid_routing_schedule", "physical group route is not its shared member route"),)
|
||||
elif group.status != "conflict" or group.reference_slot_ids is not None:
|
||||
return (EffectivePlanIssue("invalid_routing_schedule", "conflicting physical group has an effective route"),)
|
||||
return ()
|
||||
|
||||
|
||||
def _source_issues(
|
||||
source_slot_ids: Any, image_hashes: Any, asset_count: Any
|
||||
) -> tuple[EffectivePlanIssue, ...]:
|
||||
issues: list[EffectivePlanIssue] = []
|
||||
if isinstance(asset_count, bool) or not isinstance(asset_count, int) or asset_count < 0:
|
||||
issues.append(EffectivePlanIssue("invalid_asset_count", "Reference asset count must be a non-negative integer"))
|
||||
if not isinstance(source_slot_ids, tuple):
|
||||
issues.append(EffectivePlanIssue("invalid_source_slots", "source_slot_ids must be a tuple"))
|
||||
return tuple(issues)
|
||||
if not isinstance(image_hashes, tuple):
|
||||
issues.append(EffectivePlanIssue("invalid_image_hashes", "Reference image hashes must be a tuple"))
|
||||
elif len(image_hashes) != len(source_slot_ids):
|
||||
issues.append(EffectivePlanIssue("hash_count_mismatch", "Reference image hashes do not align with fixed source slots"))
|
||||
elif any(not isinstance(value, str) or len(value) != 64 or
|
||||
any(char not in "0123456789abcdef" for char in value) for value in image_hashes):
|
||||
issues.append(EffectivePlanIssue("invalid_image_hash", "Reference image hashes must be lowercase SHA-256 values"))
|
||||
if isinstance(asset_count, int) and not isinstance(asset_count, bool):
|
||||
if asset_count > 0 and not source_slot_ids:
|
||||
issues.append(EffectivePlanIssue("missing_source_slots", "connected Reference assets have no fixed source slot IDs"))
|
||||
elif asset_count != len(source_slot_ids):
|
||||
issues.append(EffectivePlanIssue("asset_count_mismatch", "source slot IDs do not align with compact Reference assets"))
|
||||
for slot_id in source_slot_ids:
|
||||
if not isinstance(slot_id, str) or slot_id not in _SLOT_ORDER:
|
||||
issues.append(EffectivePlanIssue("unknown_source_slot", f"unknown Reference source slot: {slot_id!r}", str(slot_id)))
|
||||
if not any(issue.code == "unknown_source_slot" for issue in issues):
|
||||
if len(set(source_slot_ids)) != len(source_slot_ids):
|
||||
issues.append(EffectivePlanIssue("duplicate_source_slot", "a fixed Reference source slot occurs more than once"))
|
||||
elif tuple(sorted(source_slot_ids, key=_SLOT_ORDER.get)) != source_slot_ids:
|
||||
issues.append(EffectivePlanIssue("source_slot_order", "source slot IDs do not follow the compact R1-R9 order"))
|
||||
return tuple(issues)
|
||||
|
||||
|
||||
def _picture_map(
|
||||
requested_source_slot_ids: tuple[str, ...],
|
||||
connected_asset_indices: dict[str, int],
|
||||
image_hashes: tuple[str, ...],
|
||||
*,
|
||||
has_first_image: bool,
|
||||
has_last_image: bool,
|
||||
) -> PictureMap:
|
||||
first_number = 1 if has_first_image else None
|
||||
last_number = 1 + int(has_first_image) if has_last_image else None
|
||||
picture_offset = int(has_first_image) + int(has_last_image)
|
||||
selected = tuple(slot_id for slot_id in requested_source_slot_ids if slot_id in connected_asset_indices)
|
||||
references = tuple(
|
||||
ReferencePicture(
|
||||
slot_id, connected_asset_indices[slot_id],
|
||||
image_hashes[connected_asset_indices[slot_id]], picture_offset + index,
|
||||
)
|
||||
for index, slot_id in enumerate(selected, start=1)
|
||||
)
|
||||
return PictureMap(first_number, last_number, references)
|
||||
|
||||
|
||||
def compile_group_picture_map(
|
||||
*,
|
||||
source_slot_ids: tuple[str, ...],
|
||||
reference_image_hashes: tuple[str, ...],
|
||||
has_first_image: bool,
|
||||
has_last_image: bool,
|
||||
) -> PictureMap:
|
||||
"""Use RR-R3's Picture numbering for one already-selected physical group."""
|
||||
|
||||
issues = _source_issues(source_slot_ids, reference_image_hashes, len(source_slot_ids))
|
||||
if issues or type(has_first_image) is not bool or type(has_last_image) is not bool:
|
||||
raise ValueError("invalid internal Reference group identity or anchor flags")
|
||||
return _picture_map(
|
||||
source_slot_ids,
|
||||
{slot_id: index for index, slot_id in enumerate(source_slot_ids)},
|
||||
reference_image_hashes,
|
||||
has_first_image=has_first_image,
|
||||
has_last_image=has_last_image,
|
||||
)
|
||||
|
||||
|
||||
def compile_effective_reference_plan(
|
||||
*,
|
||||
routing_schedule: ReferenceRoutingSchedule,
|
||||
source_slot_ids: tuple[str, ...],
|
||||
reference_image_hashes: tuple[str, ...],
|
||||
reference_asset_count: int,
|
||||
has_first_image: bool,
|
||||
has_last_image: bool,
|
||||
) -> EffectiveReferencePlan:
|
||||
"""Map full logical routes to compact assets and Core Qwen Picture numbers.
|
||||
|
||||
Anchor flags describe the presentation being planned. The caller retains
|
||||
responsibility for choosing when First/Last are supplied to conditioning.
|
||||
"""
|
||||
|
||||
if not isinstance(routing_schedule, ReferenceRoutingSchedule):
|
||||
return EffectiveReferencePlan(
|
||||
mode="invalid", legacy_fallback=False, connected_source_slot_ids=(),
|
||||
issues=(EffectivePlanIssue("invalid_routing_schedule", "expected an RR-R2 routing schedule"),),
|
||||
)
|
||||
issues = [
|
||||
*_schedule_issues(routing_schedule),
|
||||
*_source_issues(source_slot_ids, reference_image_hashes, reference_asset_count),
|
||||
]
|
||||
if type(has_first_image) is not bool or type(has_last_image) is not bool:
|
||||
issues.append(EffectivePlanIssue("invalid_anchor_flags", "First/Last presence flags must be booleans"))
|
||||
if issues:
|
||||
return EffectiveReferencePlan(
|
||||
mode=routing_schedule.mode,
|
||||
legacy_fallback=routing_schedule.legacy_fallback,
|
||||
connected_source_slot_ids=source_slot_ids if isinstance(source_slot_ids, tuple) else (),
|
||||
issues=tuple(issues),
|
||||
)
|
||||
|
||||
asset_indices = {slot_id: index for index, slot_id in enumerate(source_slot_ids)}
|
||||
logical_routes = tuple(
|
||||
LogicalEffectiveRoute(
|
||||
logical_chunk=route.logical_chunk,
|
||||
requested_source_slot_ids=route.reference_slot_ids,
|
||||
picture_map=_picture_map(
|
||||
route.reference_slot_ids, asset_indices, reference_image_hashes,
|
||||
has_first_image=has_first_image, has_last_image=has_last_image,
|
||||
),
|
||||
)
|
||||
for route in routing_schedule.logical_routes
|
||||
)
|
||||
physical_routes: list[PhysicalEffectiveRoute] = []
|
||||
for group in routing_schedule.physical_routes:
|
||||
if group.status == "conflict":
|
||||
physical_routes.append(
|
||||
PhysicalEffectiveRoute(
|
||||
physical_group=group.physical_group,
|
||||
logical_chunks=group.logical_chunks,
|
||||
terminal_atomic=group.terminal_atomic,
|
||||
routing_status=group.status,
|
||||
status="conflict",
|
||||
requested_source_slot_ids=None,
|
||||
picture_map=None,
|
||||
)
|
||||
)
|
||||
continue
|
||||
requested = group.reference_slot_ids
|
||||
assert requested is not None
|
||||
picture_map = _picture_map(
|
||||
requested, asset_indices, reference_image_hashes,
|
||||
has_first_image=has_first_image, has_last_image=has_last_image,
|
||||
)
|
||||
physical_routes.append(
|
||||
PhysicalEffectiveRoute(
|
||||
physical_group=group.physical_group,
|
||||
logical_chunks=group.logical_chunks,
|
||||
terminal_atomic=group.terminal_atomic,
|
||||
routing_status=group.status,
|
||||
status="active" if picture_map.references else "empty",
|
||||
requested_source_slot_ids=requested,
|
||||
picture_map=picture_map,
|
||||
)
|
||||
)
|
||||
return EffectiveReferencePlan(
|
||||
mode=routing_schedule.mode,
|
||||
legacy_fallback=routing_schedule.legacy_fallback,
|
||||
connected_source_slot_ids=source_slot_ids,
|
||||
logical_routes=logical_routes,
|
||||
physical_routes=tuple(physical_routes),
|
||||
)
|
||||
@@ -0,0 +1,111 @@
|
||||
"""Fixed nine-slot Reference Images input for the V3.9 sampler."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from dataclasses import dataclass
|
||||
|
||||
import torch
|
||||
|
||||
from ..reference import ReferenceImageBundle
|
||||
from .reference_routing import REFERENCE_SLOT_IDS, parse_chunk_selector
|
||||
|
||||
|
||||
REFERENCE_IMAGES_V39_TYPE = "H3_CONTINUUM_REFERENCE_IMAGES_V39"
|
||||
REFERENCE_USE_ALL = "All chunks"
|
||||
REFERENCE_USE_PER_CHUNK = "Per chunk"
|
||||
REFERENCE_USE_OPTIONS = (REFERENCE_USE_ALL, REFERENCE_USE_PER_CHUNK)
|
||||
MAX_CHUNKS = 16 # Current Sampler schema limit; checked in integration tests.
|
||||
|
||||
|
||||
@dataclass(frozen=True, slots=True)
|
||||
class ReferenceImagesV39Bundle:
|
||||
images: tuple[torch.Tensor | None, ...]
|
||||
reference_use: str
|
||||
selectors: tuple[str, ...]
|
||||
|
||||
|
||||
def _canonical_selector(value: str) -> str:
|
||||
parsed = parse_chunk_selector(value, total_chunks=MAX_CHUNKS)
|
||||
if not parsed.valid:
|
||||
details = "; ".join(issue.message for issue in parsed.issues)
|
||||
raise ValueError(f"invalid V3.9 Reference chunk selection: {details}")
|
||||
return ",".join(map(str, parsed.logical_chunks)) or "off"
|
||||
|
||||
|
||||
def effective_reference_inputs(bundle: ReferenceImagesV39Bundle | None, *, chunks: int):
|
||||
"""Return legacy-shaped images and private selectors without changing saved data."""
|
||||
if not isinstance(chunks, int) or isinstance(chunks, bool) or not 1 <= chunks <= MAX_CHUNKS:
|
||||
raise ValueError(f"V3.9 Reference Chunks must be within 1..{MAX_CHUNKS}")
|
||||
if bundle is None:
|
||||
images = (None,) * 9
|
||||
mode = REFERENCE_USE_ALL
|
||||
selections = ("off",) * 9
|
||||
elif (not isinstance(bundle, ReferenceImagesV39Bundle)
|
||||
or len(bundle.images) != 9 or len(bundle.selectors) != 9
|
||||
or bundle.reference_use not in REFERENCE_USE_OPTIONS):
|
||||
raise ValueError("V3.9 Reference Images requires its nine-slot V3.9 bundle")
|
||||
else:
|
||||
images = bundle.images
|
||||
mode = bundle.reference_use
|
||||
selections = bundle.selectors
|
||||
selectors = {}
|
||||
for index, (image, selection) in enumerate(zip(images, selections, strict=True), start=1):
|
||||
if image is None:
|
||||
selectors[f"R{index}"] = "off"
|
||||
elif mode == REFERENCE_USE_ALL:
|
||||
selectors[f"R{index}"] = "all"
|
||||
else:
|
||||
parsed = parse_chunk_selector(selection, total_chunks=MAX_CHUNKS)
|
||||
if not parsed.valid:
|
||||
details = "; ".join(issue.message for issue in parsed.issues)
|
||||
raise ValueError(f"R{index} chunk selection: {details}")
|
||||
active = (n for n in parsed.logical_chunks if n <= chunks)
|
||||
selectors[f"R{index}"] = ",".join(map(str, active)) or "off"
|
||||
if tuple(selectors) != REFERENCE_SLOT_IDS:
|
||||
raise ValueError("V3.9 Reference slot ordering changed")
|
||||
return images[:3], ReferenceImageBundle(images[3:]), selectors
|
||||
|
||||
|
||||
class H3ContinuumReferenceImagesV39:
|
||||
CATEGORY = "MiniMax H3/Continuum/Input"
|
||||
DESCRIPTION = "Connect up to nine fixed Reference Images; choose chunks in this node."
|
||||
RETURN_TYPES = (REFERENCE_IMAGES_V39_TYPE,)
|
||||
RETURN_NAMES = ("reference_images",)
|
||||
FUNCTION = "pack"
|
||||
|
||||
@classmethod
|
||||
def INPUT_TYPES(cls):
|
||||
return {
|
||||
"required": {
|
||||
"reference_use": (REFERENCE_USE_OPTIONS, {
|
||||
"default": REFERENCE_USE_ALL,
|
||||
"display_name": "Reference Use",
|
||||
"tooltip": "All chunks uses connected images throughout. Per chunk uses the assignments below.",
|
||||
}),
|
||||
**{
|
||||
f"reference_r{index}_chunks": ("STRING", {
|
||||
"default": "off", "advanced": True,
|
||||
"display_name": f"Image {index} chunks",
|
||||
"tooltip": f"Saved assignments for Reference Image {index}; use the in-node table.",
|
||||
}) for index in range(1, 10)
|
||||
},
|
||||
},
|
||||
"optional": {
|
||||
f"reference_image_{index}": ("IMAGE", {
|
||||
"display_name": f"Reference Image {index} (Optional)",
|
||||
"tooltip": f"Fixed Image {index} / @R{index}. Its number never changes with other connections.",
|
||||
}) for index in range(1, 10)
|
||||
},
|
||||
}
|
||||
|
||||
def pack(self, reference_use=REFERENCE_USE_ALL, **kwargs):
|
||||
if reference_use not in REFERENCE_USE_OPTIONS:
|
||||
raise ValueError("Reference Use must be All chunks or Per chunk")
|
||||
images = tuple(kwargs.get(f"reference_image_{index}") for index in range(1, 10))
|
||||
selectors = tuple(
|
||||
(_canonical_selector(kwargs.get(f"reference_r{index}_chunks", "off"))
|
||||
if reference_use == REFERENCE_USE_PER_CHUNK else
|
||||
str(kwargs.get(f"reference_r{index}_chunks", "off")))
|
||||
for index in range(1, 10)
|
||||
)
|
||||
return (ReferenceImagesV39Bundle(images, reference_use, selectors),)
|
||||
@@ -0,0 +1,69 @@
|
||||
"""Read-only V3.9 projection of the Reference contract used by this Queue.
|
||||
|
||||
This module never selects images or changes a route. Pending groups are shown
|
||||
as settings only; accepted groups use the frozen/observed RR-R5 descriptor.
|
||||
"""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Any
|
||||
|
||||
from .reference_runtime import ReferenceRoutingRuntime
|
||||
|
||||
|
||||
def project_reference_plan(runtime: ReferenceRoutingRuntime) -> dict[str, Any]:
|
||||
if not isinstance(runtime, ReferenceRoutingRuntime):
|
||||
raise TypeError("Reference Plan Inspector requires the active routing runtime")
|
||||
accepted = int(runtime.accepted_chunks)
|
||||
generated = set(runtime.generated_groups)
|
||||
groups: list[dict[str, Any]] = []
|
||||
for route in runtime.schedule.physical_routes:
|
||||
group = int(route.physical_group)
|
||||
complete = route.logical_chunks[-1] <= accepted
|
||||
item: dict[str, Any] = {
|
||||
"physical_group": group,
|
||||
"logical_chunks": list(route.logical_chunks),
|
||||
"requested_slots": list(route.reference_slot_ids or ()),
|
||||
"status": (
|
||||
"pending" if not complete else
|
||||
"generated" if group in generated else "reused"
|
||||
),
|
||||
}
|
||||
if complete:
|
||||
contract = runtime.group_contract_for(group)
|
||||
item["contract_sha256"] = contract["sha256"]
|
||||
item["descriptor"] = contract["descriptor"]
|
||||
item["warnings"] = list(runtime.group_warnings.get(group, ()))
|
||||
groups.append(item)
|
||||
return {
|
||||
"version": 1,
|
||||
"mode": runtime.schedule.mode,
|
||||
"accepted_chunks": accepted,
|
||||
"connected_slots": list(runtime.inputs.connected_source_slot_ids),
|
||||
"groups": groups,
|
||||
}
|
||||
|
||||
|
||||
def format_reference_plan(plan: dict[str, Any]) -> str:
|
||||
lines = [
|
||||
"Reference Plan Inspector (last Queue, runtime verified)",
|
||||
f"Mode: {plan['mode']}; accepted chunks: {plan['accepted_chunks']}",
|
||||
"Connected: " + (", ".join(plan["connected_slots"]) or "none"),
|
||||
]
|
||||
for group in plan["groups"]:
|
||||
label = ",".join(str(chunk) for chunk in group["logical_chunks"])
|
||||
head = f"Group {group['physical_group']} [C{label}] {group['status']}"
|
||||
descriptor = group.get("descriptor")
|
||||
if descriptor is None:
|
||||
lines.append(head + " — configured " + (
|
||||
", ".join(group["requested_slots"]) or "no References"
|
||||
))
|
||||
continue
|
||||
mapping = ", ".join(
|
||||
f"{ref['source_slot_id']}=<Picture {ref['picture_number']}>"
|
||||
for ref in descriptor["references"]
|
||||
) or "no References"
|
||||
lines.append(head + " — " + mapping + f"; contract={group['contract_sha256'][:12]}")
|
||||
for warning in group["warnings"]:
|
||||
lines.append(" Warning: " + warning)
|
||||
return "\n".join(lines)
|
||||
@@ -0,0 +1,365 @@
|
||||
"""Pure V3.9 Reference selector parsing and group schedule planning.
|
||||
|
||||
V3.9 Custom consumes this plan through the Reference runtime and storage
|
||||
contracts. Planning here remains free of Sampling and persistence side effects.
|
||||
"""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from collections.abc import Mapping
|
||||
from dataclasses import dataclass
|
||||
import re
|
||||
from typing import Any
|
||||
|
||||
from ..branch_provenance import BranchProvenanceError, physical_groups
|
||||
|
||||
|
||||
REFERENCE_SLOT_IDS = tuple(f"R{index}" for index in range(1, 10))
|
||||
|
||||
_INTEGER_TOKEN = re.compile(r"^[0-9]+$")
|
||||
_RANGE_TOKEN = re.compile(r"^([0-9]+)\s*-\s*([0-9]+)$")
|
||||
|
||||
|
||||
@dataclass(frozen=True, slots=True)
|
||||
class RoutingIssue:
|
||||
"""A classified parser/planner issue; it does not itself stop execution."""
|
||||
|
||||
code: str
|
||||
message: str
|
||||
slot_id: str | None = None
|
||||
selector: str | None = None
|
||||
|
||||
|
||||
@dataclass(frozen=True, slots=True)
|
||||
class ChunkSelectorResult:
|
||||
"""Parsed selector with all/off kept distinct from explicit chunk lists."""
|
||||
|
||||
kind: str
|
||||
logical_chunks: tuple[int, ...]
|
||||
issues: tuple[RoutingIssue, ...] = ()
|
||||
|
||||
@property
|
||||
def valid(self) -> bool:
|
||||
return self.kind != "invalid" and not self.issues
|
||||
|
||||
|
||||
@dataclass(frozen=True, slots=True)
|
||||
class LogicalReferenceRoute:
|
||||
"""Reference identities selected for one project-wide logical chunk."""
|
||||
|
||||
logical_chunk: int
|
||||
reference_slot_ids: tuple[str, ...]
|
||||
|
||||
|
||||
@dataclass(frozen=True, slots=True)
|
||||
class PhysicalReferenceRoute:
|
||||
"""Routing facts for one authoritative atomic physical sampling group."""
|
||||
|
||||
physical_group: int
|
||||
logical_chunks: tuple[int, ...]
|
||||
terminal_atomic: bool
|
||||
logical_reference_slot_ids: tuple[tuple[str, ...], ...]
|
||||
status: str
|
||||
reference_slot_ids: tuple[str, ...] | None
|
||||
|
||||
|
||||
@dataclass(frozen=True, slots=True)
|
||||
class ReferenceRoutingSchedule:
|
||||
"""Full logical schedule plus its physical-group compatibility view."""
|
||||
|
||||
mode: str
|
||||
legacy_fallback: bool
|
||||
total_chunks: int | None
|
||||
terminal_merge_enabled: bool | None
|
||||
logical_routes: tuple[LogicalReferenceRoute, ...] = ()
|
||||
physical_routes: tuple[PhysicalReferenceRoute, ...] = ()
|
||||
issues: tuple[RoutingIssue, ...] = ()
|
||||
|
||||
@property
|
||||
def valid(self) -> bool:
|
||||
return not self.issues
|
||||
|
||||
|
||||
def _invalid_selector(code: str, message: str, selector: str | None) -> ChunkSelectorResult:
|
||||
return ChunkSelectorResult(
|
||||
kind="invalid",
|
||||
logical_chunks=(),
|
||||
issues=(RoutingIssue(code=code, message=message, selector=selector),),
|
||||
)
|
||||
|
||||
|
||||
def parse_chunk_selector(selector: Any, *, total_chunks: int) -> ChunkSelectorResult:
|
||||
"""Parse all/off, a one-based chunk, inclusive ranges, and their combinations.
|
||||
|
||||
Invalid values are returned as structured issues so callers can inspect
|
||||
them without introducing a new runtime execution stop.
|
||||
"""
|
||||
|
||||
if isinstance(total_chunks, bool) or not isinstance(total_chunks, int) or total_chunks < 1:
|
||||
return _invalid_selector(
|
||||
"invalid_chunk_count",
|
||||
"total_chunks must be a positive integer",
|
||||
selector if isinstance(selector, str) else None,
|
||||
)
|
||||
if not isinstance(selector, str):
|
||||
return _invalid_selector(
|
||||
"selector_not_string",
|
||||
"selector must be a string",
|
||||
None,
|
||||
)
|
||||
|
||||
text = selector.strip()
|
||||
normalized = text.casefold()
|
||||
if not normalized:
|
||||
return _invalid_selector("selector_empty", "selector is empty", selector)
|
||||
if normalized == "all":
|
||||
return ChunkSelectorResult("all", tuple(range(1, total_chunks + 1)))
|
||||
if normalized == "off":
|
||||
return ChunkSelectorResult("off", ())
|
||||
|
||||
selected: set[int] = set()
|
||||
issues: list[RoutingIssue] = []
|
||||
for raw_token in text.split(","):
|
||||
token = raw_token.strip()
|
||||
if not token:
|
||||
issues.append(
|
||||
RoutingIssue(
|
||||
"empty_selector_item",
|
||||
"selector contains an empty comma-separated item",
|
||||
selector=selector,
|
||||
)
|
||||
)
|
||||
continue
|
||||
|
||||
if _INTEGER_TOKEN.fullmatch(token):
|
||||
start = end = int(token)
|
||||
else:
|
||||
match = _RANGE_TOKEN.fullmatch(token)
|
||||
if match is None:
|
||||
issues.append(
|
||||
RoutingIssue(
|
||||
"invalid_selector_item",
|
||||
f"invalid selector item: {token!r}",
|
||||
selector=selector,
|
||||
)
|
||||
)
|
||||
continue
|
||||
start, end = int(match.group(1)), int(match.group(2))
|
||||
if start > end:
|
||||
issues.append(
|
||||
RoutingIssue(
|
||||
"reversed_range",
|
||||
f"range start {start} exceeds end {end}",
|
||||
selector=selector,
|
||||
)
|
||||
)
|
||||
continue
|
||||
|
||||
if start < 1 or end > total_chunks:
|
||||
issues.append(
|
||||
RoutingIssue(
|
||||
"chunk_out_of_range",
|
||||
f"selector item {token!r} is outside 1..{total_chunks}",
|
||||
selector=selector,
|
||||
)
|
||||
)
|
||||
continue
|
||||
|
||||
values = set(range(start, end + 1))
|
||||
if selected.intersection(values):
|
||||
issues.append(
|
||||
RoutingIssue(
|
||||
"duplicate_chunk",
|
||||
f"selector item {token!r} overlaps an earlier item",
|
||||
selector=selector,
|
||||
)
|
||||
)
|
||||
continue
|
||||
selected.update(values)
|
||||
|
||||
if issues:
|
||||
return ChunkSelectorResult("invalid", (), tuple(issues))
|
||||
return ChunkSelectorResult("chunks", tuple(sorted(selected)))
|
||||
|
||||
|
||||
def _invalid_schedule(
|
||||
*,
|
||||
mode: str,
|
||||
legacy_fallback: bool,
|
||||
total_chunks: int | None,
|
||||
terminal_merge_enabled: bool | None,
|
||||
issues: tuple[RoutingIssue, ...],
|
||||
) -> ReferenceRoutingSchedule:
|
||||
return ReferenceRoutingSchedule(
|
||||
mode=mode,
|
||||
legacy_fallback=legacy_fallback,
|
||||
total_chunks=total_chunks,
|
||||
terminal_merge_enabled=terminal_merge_enabled,
|
||||
issues=issues,
|
||||
)
|
||||
|
||||
|
||||
def compile_reference_routing_schedule(
|
||||
*,
|
||||
total_chunks: int,
|
||||
terminal_merge_enabled: bool,
|
||||
mode: Any = None,
|
||||
selectors_by_slot: Any = None,
|
||||
) -> ReferenceRoutingSchedule:
|
||||
"""Compile routing over full logical chunk numbers and physical groups.
|
||||
|
||||
An absent mode preserves legacy All behavior. Custom mode requires an
|
||||
explicit selector for each fixed R1-R9 slot; explicit all-off is valid and
|
||||
remains distinct from an absent mode. Terminal atomic groups with
|
||||
different member routes are surfaced as conflicts without auto-correction.
|
||||
"""
|
||||
|
||||
legacy_fallback = mode is None
|
||||
normalized_mode = "all" if legacy_fallback else None
|
||||
issues: list[RoutingIssue] = []
|
||||
|
||||
if isinstance(total_chunks, bool) or not isinstance(total_chunks, int) or total_chunks < 1:
|
||||
issues.append(RoutingIssue("invalid_chunk_count", "total_chunks must be a positive integer"))
|
||||
if type(terminal_merge_enabled) is not bool:
|
||||
issues.append(
|
||||
RoutingIssue("invalid_terminal_merge", "terminal_merge_enabled must be a boolean")
|
||||
)
|
||||
|
||||
if not legacy_fallback:
|
||||
if not isinstance(mode, str):
|
||||
issues.append(RoutingIssue("invalid_mode", "mode must be All or Custom"))
|
||||
else:
|
||||
token = mode.strip().casefold()
|
||||
if token == "all":
|
||||
normalized_mode = "all"
|
||||
elif token == "custom":
|
||||
normalized_mode = "custom"
|
||||
else:
|
||||
issues.append(RoutingIssue("invalid_mode", "mode must be All or Custom"))
|
||||
|
||||
if issues:
|
||||
return _invalid_schedule(
|
||||
mode=normalized_mode or "invalid",
|
||||
legacy_fallback=legacy_fallback,
|
||||
total_chunks=total_chunks if isinstance(total_chunks, int) and not isinstance(total_chunks, bool) else None,
|
||||
terminal_merge_enabled=terminal_merge_enabled if type(terminal_merge_enabled) is bool else None,
|
||||
issues=tuple(issues),
|
||||
)
|
||||
|
||||
slot_selectors: dict[str, ChunkSelectorResult] = {}
|
||||
if normalized_mode == "custom":
|
||||
if not isinstance(selectors_by_slot, Mapping):
|
||||
issues.append(
|
||||
RoutingIssue(
|
||||
"selectors_required",
|
||||
"Custom mode requires an explicit selector map for R1-R9",
|
||||
)
|
||||
)
|
||||
else:
|
||||
for slot_id in selectors_by_slot:
|
||||
if slot_id not in REFERENCE_SLOT_IDS:
|
||||
issues.append(
|
||||
RoutingIssue(
|
||||
"unknown_reference_slot",
|
||||
f"unknown Reference slot: {slot_id!r}",
|
||||
slot_id=str(slot_id),
|
||||
)
|
||||
)
|
||||
for slot_id in REFERENCE_SLOT_IDS:
|
||||
if slot_id not in selectors_by_slot:
|
||||
issues.append(
|
||||
RoutingIssue(
|
||||
"missing_selector",
|
||||
f"Custom mode has no selector for {slot_id}",
|
||||
slot_id=slot_id,
|
||||
)
|
||||
)
|
||||
continue
|
||||
parsed = parse_chunk_selector(
|
||||
selectors_by_slot[slot_id], total_chunks=total_chunks
|
||||
)
|
||||
if not parsed.valid:
|
||||
issues.extend(
|
||||
RoutingIssue(
|
||||
issue.code,
|
||||
issue.message,
|
||||
slot_id=slot_id,
|
||||
selector=issue.selector,
|
||||
)
|
||||
for issue in parsed.issues
|
||||
)
|
||||
else:
|
||||
slot_selectors[slot_id] = parsed
|
||||
|
||||
if issues:
|
||||
return _invalid_schedule(
|
||||
mode=normalized_mode or "invalid",
|
||||
legacy_fallback=legacy_fallback,
|
||||
total_chunks=total_chunks,
|
||||
terminal_merge_enabled=terminal_merge_enabled,
|
||||
issues=tuple(issues),
|
||||
)
|
||||
|
||||
logical_routes: list[LogicalReferenceRoute] = []
|
||||
for logical_chunk in range(1, total_chunks + 1):
|
||||
if normalized_mode == "all":
|
||||
selected_slots = REFERENCE_SLOT_IDS
|
||||
else:
|
||||
selected_slots = tuple(
|
||||
slot_id
|
||||
for slot_id in REFERENCE_SLOT_IDS
|
||||
if logical_chunk in slot_selectors[slot_id].logical_chunks
|
||||
)
|
||||
logical_routes.append(
|
||||
LogicalReferenceRoute(logical_chunk, tuple(selected_slots))
|
||||
)
|
||||
|
||||
try:
|
||||
groups = physical_groups(
|
||||
chunks=total_chunks,
|
||||
terminal_merge_enabled=terminal_merge_enabled,
|
||||
)
|
||||
except BranchProvenanceError as exc:
|
||||
return _invalid_schedule(
|
||||
mode=normalized_mode or "invalid",
|
||||
legacy_fallback=legacy_fallback,
|
||||
total_chunks=total_chunks,
|
||||
terminal_merge_enabled=terminal_merge_enabled,
|
||||
issues=(RoutingIssue("invalid_physical_groups", str(exc)),),
|
||||
)
|
||||
|
||||
routes_by_chunk = {route.logical_chunk: route.reference_slot_ids for route in logical_routes}
|
||||
physical_routes: list[PhysicalReferenceRoute] = []
|
||||
for group in groups:
|
||||
chunks = tuple(range(group.start, group.end + 1))
|
||||
member_routes = tuple(routes_by_chunk[chunk] for chunk in chunks)
|
||||
first_route = member_routes[0]
|
||||
consistent = all(route == first_route for route in member_routes[1:])
|
||||
if not consistent:
|
||||
group_status = "conflict"
|
||||
group_slots = None
|
||||
elif not first_route:
|
||||
group_status = "empty"
|
||||
group_slots = ()
|
||||
else:
|
||||
group_status = "consistent"
|
||||
group_slots = first_route
|
||||
physical_routes.append(
|
||||
PhysicalReferenceRoute(
|
||||
physical_group=int(group.physical_group),
|
||||
logical_chunks=chunks,
|
||||
terminal_atomic=group.start != group.end,
|
||||
logical_reference_slot_ids=member_routes,
|
||||
status=group_status,
|
||||
reference_slot_ids=group_slots,
|
||||
)
|
||||
)
|
||||
|
||||
return ReferenceRoutingSchedule(
|
||||
mode=normalized_mode or "invalid",
|
||||
legacy_fallback=legacy_fallback,
|
||||
total_chunks=total_chunks,
|
||||
terminal_merge_enabled=terminal_merge_enabled,
|
||||
logical_routes=tuple(logical_routes),
|
||||
physical_routes=tuple(physical_routes),
|
||||
)
|
||||
@@ -0,0 +1,342 @@
|
||||
"""V3.9 Custom group-local Reference conditioning.
|
||||
|
||||
The V3.9 caller supplies this adapter after routing is resolved. V3.8 and
|
||||
V3.9 All retain the legacy path; saved-run compatibility is handled by the
|
||||
separate Reference storage contract.
|
||||
"""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from dataclasses import dataclass
|
||||
import hashlib
|
||||
import json
|
||||
import re
|
||||
import uuid
|
||||
from typing import Any
|
||||
|
||||
import torch
|
||||
|
||||
from ..reference import (
|
||||
ReferenceAssets,
|
||||
ReferenceImageBundle,
|
||||
encode_reference_latents,
|
||||
encode_reference_latents_cached,
|
||||
encode_reference_prompt,
|
||||
prepare_reference_assets,
|
||||
resolve_reference_image_inputs,
|
||||
)
|
||||
from ..v2.h3_builder import encode_prompt_conditioning
|
||||
from .reference_effective_plan import PictureMap, compile_group_picture_map
|
||||
from .reference_routing import REFERENCE_SLOT_IDS, ReferenceRoutingSchedule
|
||||
|
||||
|
||||
_REFERENCE_TAG = re.compile(r"(?<![A-Za-z0-9_])@R([1-9])(?![A-Za-z0-9_])")
|
||||
|
||||
|
||||
class ReferenceRuntimeContractError(ValueError):
|
||||
"""An internal RR-R4 caller supplied an unusable routing contract."""
|
||||
|
||||
|
||||
@dataclass(slots=True)
|
||||
class ReferenceRoutingRequest:
|
||||
"""Private V3.9 node-to-V2 request; never part of a saved node schema."""
|
||||
|
||||
selectors_by_slot: dict[str, str]
|
||||
inputs: ReferenceInputSet
|
||||
runtime: ReferenceRoutingRuntime | None = None
|
||||
|
||||
|
||||
@dataclass(frozen=True, slots=True)
|
||||
class ReferenceInputSet:
|
||||
"""Raw R1-R9 sockets; no image is validated, resized, or VAE-encoded here."""
|
||||
|
||||
images: tuple[torch.Tensor | None, ...]
|
||||
output_width: int
|
||||
output_height: int
|
||||
size_mode: str
|
||||
|
||||
@classmethod
|
||||
def from_inputs(
|
||||
cls,
|
||||
*,
|
||||
reference_image_1: torch.Tensor | None = None,
|
||||
reference_image_2: torch.Tensor | None = None,
|
||||
reference_image_3: torch.Tensor | None = None,
|
||||
reference_image_4: torch.Tensor | None = None,
|
||||
reference_image_5: torch.Tensor | None = None,
|
||||
image_references: ReferenceImageBundle | None = None,
|
||||
output_width: int,
|
||||
output_height: int,
|
||||
size_mode: str,
|
||||
) -> ReferenceInputSet:
|
||||
images = resolve_reference_image_inputs(
|
||||
reference_image_1, reference_image_2, reference_image_3,
|
||||
reference_image_4, reference_image_5, image_references,
|
||||
)
|
||||
return cls(images, int(output_width), int(output_height), str(size_mode))
|
||||
|
||||
@property
|
||||
def connected_source_slot_ids(self) -> tuple[str, ...]:
|
||||
return tuple(
|
||||
slot_id for slot_id, image in zip(REFERENCE_SLOT_IDS, self.images, strict=True)
|
||||
if image is not None
|
||||
)
|
||||
|
||||
def prepare_selected(self, selected_source_slot_ids: tuple[str, ...]) -> ReferenceAssets | None:
|
||||
return prepare_reference_assets(
|
||||
reference_image_1=self.images[0],
|
||||
reference_image_2=self.images[1],
|
||||
reference_image_3=self.images[2],
|
||||
image_references=ReferenceImageBundle(self.images[3:]),
|
||||
output_width=self.output_width,
|
||||
output_height=self.output_height,
|
||||
size_mode=self.size_mode,
|
||||
selected_source_slot_ids=selected_source_slot_ids,
|
||||
)
|
||||
|
||||
|
||||
@dataclass(frozen=True, slots=True)
|
||||
class GroupReferenceConditioning:
|
||||
physical_group: int
|
||||
logical_chunks: tuple[int, ...]
|
||||
requested_source_slot_ids: tuple[str, ...]
|
||||
selected_assets: ReferenceAssets | None
|
||||
picture_map: PictureMap
|
||||
effective_prompt: str
|
||||
conditioning: list[list[Any]]
|
||||
warnings: tuple[str, ...]
|
||||
|
||||
|
||||
def rewrite_reference_tags(prompt: str, picture_map: PictureMap) -> tuple[str, tuple[str, ...]]:
|
||||
"""Rewrite active @R tags only; inactive tags are diagnostic, never blocking."""
|
||||
|
||||
tags = {item.source_slot_id: item.picture_tag for item in picture_map.references}
|
||||
inactive: set[str] = set()
|
||||
|
||||
def replace_tag(match: re.Match[str]) -> str:
|
||||
slot_id = f"R{match.group(1)}"
|
||||
replacement = tags.get(slot_id)
|
||||
if replacement is None:
|
||||
inactive.add(slot_id)
|
||||
return match.group(0)
|
||||
return replacement
|
||||
|
||||
effective = _REFERENCE_TAG.sub(replace_tag, str(prompt))
|
||||
warnings = tuple(
|
||||
f"{slot_id} is not active in this physical group; {slot_id}'s @R tag was left unchanged"
|
||||
for slot_id in REFERENCE_SLOT_IDS if slot_id in inactive
|
||||
)
|
||||
return effective, warnings
|
||||
|
||||
|
||||
def resolve_reference_group_prompt(
|
||||
*, physical_group: int, prompt: str,
|
||||
requested_source_slot_ids: tuple[str, ...],
|
||||
connected_source_slot_ids: tuple[str, ...],
|
||||
picture_map: PictureMap,
|
||||
) -> tuple[str, tuple[str, ...]]:
|
||||
"""Use the same prompt and warning rules for planned and sampled groups."""
|
||||
|
||||
effective_prompt, prompt_warnings = rewrite_reference_tags(prompt, picture_map)
|
||||
connected = set(connected_source_slot_ids)
|
||||
disconnected_warnings = tuple(
|
||||
f"{slot_id} is routed to physical group {physical_group} but no image is connected"
|
||||
for slot_id in requested_source_slot_ids if slot_id not in connected
|
||||
)
|
||||
return effective_prompt, disconnected_warnings + prompt_warnings
|
||||
|
||||
|
||||
class ReferenceRoutingRuntime:
|
||||
"""Prepare and encode only the images selected by a physical group."""
|
||||
|
||||
def __init__(self, *, schedule: ReferenceRoutingSchedule, inputs: ReferenceInputSet):
|
||||
if not isinstance(schedule, ReferenceRoutingSchedule) or not schedule.valid:
|
||||
raise ReferenceRuntimeContractError("RR-R4 requires a valid RR-R2 routing schedule")
|
||||
if not isinstance(inputs, ReferenceInputSet) or len(inputs.images) != len(REFERENCE_SLOT_IDS):
|
||||
raise ReferenceRuntimeContractError("RR-R4 requires nine fixed raw Reference slots")
|
||||
self.schedule = schedule
|
||||
self.inputs = inputs
|
||||
# RR-R4 has no saved-run/prefix contract. Keep its session identity
|
||||
# queue-local without reading images assigned only to later groups.
|
||||
self._run_nonce = uuid.uuid4().hex
|
||||
self.storage_plan: Any = None
|
||||
self.generated_groups: tuple[int, ...] = ()
|
||||
self.accepted_chunks = 0
|
||||
self.observed_group_contracts: dict[int, dict[str, Any]] = {}
|
||||
self.group_warnings: dict[int, tuple[str, ...]] = {}
|
||||
|
||||
def group_contract_for(self, physical_group: int) -> dict[str, Any]:
|
||||
group = int(physical_group)
|
||||
observed = self.observed_group_contracts.get(group)
|
||||
if observed is not None:
|
||||
return observed
|
||||
if self.storage_plan is not None:
|
||||
return self.storage_plan.group_for(group)
|
||||
raise ReferenceRuntimeContractError(
|
||||
f"physical group {group} has no observed Reference contract"
|
||||
)
|
||||
|
||||
def check_physical_contract(self, *, chunks: int, terminal_merge_enabled: bool) -> None:
|
||||
if self.schedule.total_chunks != int(chunks) or self.schedule.terminal_merge_enabled != bool(terminal_merge_enabled):
|
||||
raise ReferenceRuntimeContractError(
|
||||
"RR-R4 routing schedule does not match the current physical group topology"
|
||||
)
|
||||
if any(route.status == "conflict" for route in self.schedule.physical_routes):
|
||||
raise ReferenceRuntimeContractError(
|
||||
"RR-R4 cannot select one Reference set for a conflicting terminal physical group"
|
||||
)
|
||||
|
||||
@property
|
||||
def has_selected_references(self) -> bool:
|
||||
connected = set(self.inputs.connected_source_slot_ids)
|
||||
return any(
|
||||
slot_id in connected
|
||||
for route in self.schedule.physical_routes
|
||||
for slot_id in (route.reference_slot_ids or ())
|
||||
)
|
||||
|
||||
def global_identity(self, keyframe_identity_hash: str) -> str:
|
||||
"""Queue-local identity; RR-R5 will define persistent prefix reuse."""
|
||||
|
||||
payload = {
|
||||
"rr_r4_identity_version": 1,
|
||||
"run_nonce": self._run_nonce,
|
||||
"keyframe_identity_hash": str(keyframe_identity_hash),
|
||||
"mode": self.schedule.mode,
|
||||
"logical_routes": [
|
||||
(route.logical_chunk, route.reference_slot_ids)
|
||||
for route in self.schedule.logical_routes
|
||||
],
|
||||
"physical_groups": [
|
||||
(route.physical_group, route.logical_chunks)
|
||||
for route in self.schedule.physical_routes
|
||||
],
|
||||
"connected_source_slot_ids": self.inputs.connected_source_slot_ids,
|
||||
"size_mode": self.inputs.size_mode,
|
||||
"output_size": (self.inputs.output_width, self.inputs.output_height),
|
||||
}
|
||||
return hashlib.sha256(
|
||||
json.dumps(payload, sort_keys=True, separators=(",", ":")).encode("utf-8")
|
||||
).hexdigest()
|
||||
|
||||
def _route(self, physical_group: int):
|
||||
for route in self.schedule.physical_routes:
|
||||
if route.physical_group == physical_group:
|
||||
if route.status == "conflict" or route.reference_slot_ids is None:
|
||||
raise ReferenceRuntimeContractError(
|
||||
f"physical group {physical_group} has no single Reference route"
|
||||
)
|
||||
return route
|
||||
raise ReferenceRuntimeContractError(f"unknown physical group {physical_group}")
|
||||
|
||||
def prepare_group(
|
||||
self,
|
||||
*,
|
||||
physical_group: int,
|
||||
prompt: str,
|
||||
clip: Any,
|
||||
video_vae: Any,
|
||||
first_image: torch.Tensor | None,
|
||||
last_image: torch.Tensor | None,
|
||||
include_last_image: bool = True,
|
||||
reference_audio_assets: Any = None,
|
||||
timeline_video_assets: Any = None,
|
||||
reference_encode_cache: bool = False,
|
||||
cache_event: Any = None,
|
||||
expected_group_contract: dict[str, Any] | None = None,
|
||||
first_frame_hash: str = "none",
|
||||
last_frame_hash: str = "none",
|
||||
terminal_prompt_policy: str | None = None,
|
||||
) -> GroupReferenceConditioning:
|
||||
route = self._route(int(physical_group))
|
||||
requested = route.reference_slot_ids
|
||||
connected = set(self.inputs.connected_source_slot_ids)
|
||||
selected = tuple(slot_id for slot_id in requested if slot_id in connected)
|
||||
assets = self.inputs.prepare_selected(selected)
|
||||
if assets is not None and assets.source_slot_ids != selected:
|
||||
raise ReferenceRuntimeContractError("prepared Reference slots differ from the selected route")
|
||||
# The legacy no-Reference path presents Last Image only to the final
|
||||
# group. With References, Core's hybrid Qwen presentation includes it
|
||||
# in every group even though the Last keyframe is attached only at end.
|
||||
presented_last_image = last_image if assets is not None or include_last_image else None
|
||||
picture_map = compile_group_picture_map(
|
||||
source_slot_ids=assets.source_slot_ids if assets is not None else (),
|
||||
reference_image_hashes=assets.image_hashes if assets is not None else (),
|
||||
has_first_image=first_image is not None,
|
||||
has_last_image=presented_last_image is not None,
|
||||
)
|
||||
effective_prompt, warnings = resolve_reference_group_prompt(
|
||||
physical_group=int(physical_group), prompt=prompt,
|
||||
requested_source_slot_ids=requested,
|
||||
connected_source_slot_ids=self.inputs.connected_source_slot_ids,
|
||||
picture_map=picture_map,
|
||||
)
|
||||
# Direct RR-R4 callers predate the saved-plan fingerprints. The normal
|
||||
# V3.9 Sequence supplies both hashes; for an unsaved direct call only,
|
||||
# derive a truthful anchor from the exact image being presented.
|
||||
if expected_group_contract is None and self.storage_plan is None:
|
||||
from ..v2.h3_builder import _tensor_fingerprint
|
||||
if first_image is not None and first_frame_hash == "none":
|
||||
first_frame_hash = _tensor_fingerprint(first_image)
|
||||
if presented_last_image is not None and last_frame_hash == "none":
|
||||
last_frame_hash = _tensor_fingerprint(presented_last_image)
|
||||
from .reference_storage_contract import (
|
||||
ReferenceStorageContractError, canonical_sha256, descriptor_from_facts,
|
||||
)
|
||||
descriptor = descriptor_from_facts(
|
||||
physical_group=int(physical_group),
|
||||
logical_chunks=route.logical_chunks,
|
||||
selected_source_slot_ids=assets.source_slot_ids if assets is not None else (),
|
||||
prepared_image_hashes=assets.image_hashes if assets is not None else (),
|
||||
picture_map=picture_map,
|
||||
first_frame_hash=first_frame_hash,
|
||||
last_frame_hash=last_frame_hash,
|
||||
effective_prompt=effective_prompt,
|
||||
size_mode=self.inputs.size_mode,
|
||||
terminal_prompt_policy=terminal_prompt_policy,
|
||||
)
|
||||
group_contract = {"descriptor": descriptor, "sha256": canonical_sha256(descriptor)}
|
||||
if expected_group_contract is not None:
|
||||
if (canonical_sha256(descriptor) != expected_group_contract.get("sha256")
|
||||
or descriptor != expected_group_contract.get("descriptor")):
|
||||
raise ReferenceStorageContractError(
|
||||
f"physical group {physical_group} Reference inputs changed after the "
|
||||
"saved-run preflight; no VAE, Prompt, or Sampling was started"
|
||||
)
|
||||
if assets is not None:
|
||||
assets = (
|
||||
encode_reference_latents_cached(video_vae, assets, cache_event=cache_event)
|
||||
if reference_encode_cache else encode_reference_latents(video_vae, assets)
|
||||
)
|
||||
conditioning = encode_reference_prompt(
|
||||
clip, effective_prompt, assets,
|
||||
first_image=first_image,
|
||||
last_image=presented_last_image,
|
||||
reference_audio_assets=reference_audio_assets,
|
||||
timeline_video_assets=timeline_video_assets,
|
||||
)
|
||||
else:
|
||||
conditioning = encode_prompt_conditioning(
|
||||
clip, effective_prompt,
|
||||
first_image=first_image,
|
||||
last_image=presented_last_image,
|
||||
reference_audio_assets=reference_audio_assets,
|
||||
timeline_video_assets=timeline_video_assets,
|
||||
)
|
||||
existing = self.observed_group_contracts.get(int(physical_group))
|
||||
if existing is not None and existing != group_contract:
|
||||
raise ReferenceRuntimeContractError(
|
||||
f"physical group {physical_group} Reference contract changed within one Queue"
|
||||
)
|
||||
self.observed_group_contracts[int(physical_group)] = group_contract
|
||||
self.group_warnings[int(physical_group)] = warnings
|
||||
return GroupReferenceConditioning(
|
||||
physical_group=int(physical_group),
|
||||
logical_chunks=route.logical_chunks,
|
||||
requested_source_slot_ids=requested,
|
||||
selected_assets=assets,
|
||||
picture_map=picture_map,
|
||||
effective_prompt=effective_prompt,
|
||||
conditioning=conditioning,
|
||||
warnings=warnings,
|
||||
)
|
||||
@@ -0,0 +1,379 @@
|
||||
"""Private RR-R5 physical-group Reference persistence contract.
|
||||
|
||||
The stored descriptor records *effective* conditioning, not selector spelling.
|
||||
No VAE, CLIP, Sampling, or saved-run operation is performed here.
|
||||
"""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from dataclasses import dataclass, field
|
||||
import hashlib
|
||||
import json
|
||||
from typing import Any
|
||||
|
||||
from ..branch_provenance import physical_groups
|
||||
from ..reference import HYBRID_PRESENTATION_VERSION, REFERENCE_PREPROCESS_VERSION
|
||||
from .reference_effective_plan import PictureMap, compile_group_picture_map
|
||||
from .reference_routing import REFERENCE_SLOT_IDS
|
||||
|
||||
|
||||
REFERENCE_ROUTING_CONTRACT_VERSION = 1
|
||||
SESSION_ROUTING_IDENTITY_VERSION = 1
|
||||
_HEX = frozenset("0123456789abcdef")
|
||||
|
||||
|
||||
class ReferenceStorageContractError(ValueError):
|
||||
"""A routed producer or accepted-prefix contract cannot be trusted."""
|
||||
|
||||
|
||||
def canonical_json(value: Any) -> str:
|
||||
return json.dumps(value, sort_keys=True, separators=(",", ":"), ensure_ascii=True)
|
||||
|
||||
|
||||
def canonical_sha256(value: Any) -> str:
|
||||
return hashlib.sha256(canonical_json(value).encode("utf-8")).hexdigest()
|
||||
|
||||
|
||||
def routed_session_identity(base_identity_hash: str) -> str:
|
||||
return canonical_sha256({
|
||||
"rr_r5_session_identity_version": SESSION_ROUTING_IDENTITY_VERSION,
|
||||
"base_identity_hash": str(base_identity_hash),
|
||||
})
|
||||
|
||||
|
||||
def _valid_sha(value: Any) -> bool:
|
||||
return isinstance(value, str) and len(value) == 64 and all(c in _HEX for c in value)
|
||||
|
||||
|
||||
def _anchor(value: str, present: bool) -> str | None:
|
||||
if not present:
|
||||
return None
|
||||
if not _valid_sha(value):
|
||||
raise ReferenceStorageContractError("routed First/Last image fingerprint is invalid")
|
||||
return value
|
||||
|
||||
|
||||
def _present(value: str) -> bool:
|
||||
if str(value).lower() in {"", "none", "null"}:
|
||||
return False
|
||||
if not _valid_sha(value):
|
||||
raise ReferenceStorageContractError("routed First/Last image fingerprint is invalid")
|
||||
return True
|
||||
|
||||
|
||||
def descriptor_from_facts(
|
||||
*, physical_group: int, logical_chunks: tuple[int, ...],
|
||||
selected_source_slot_ids: tuple[str, ...],
|
||||
prepared_image_hashes: tuple[str, ...], picture_map: PictureMap,
|
||||
first_frame_hash: str, last_frame_hash: str,
|
||||
effective_prompt: str, size_mode: str,
|
||||
terminal_prompt_policy: str | None,
|
||||
) -> dict[str, Any]:
|
||||
if len(selected_source_slot_ids) != len(prepared_image_hashes):
|
||||
raise ReferenceStorageContractError("selected Reference slots and image hashes differ")
|
||||
if picture_map.source_slot_ids != selected_source_slot_ids:
|
||||
raise ReferenceStorageContractError("Reference Picture map differs from selected source slots")
|
||||
if any(slot not in REFERENCE_SLOT_IDS for slot in selected_source_slot_ids):
|
||||
raise ReferenceStorageContractError("selected Reference slot is unknown")
|
||||
if tuple(sorted(selected_source_slot_ids, key=REFERENCE_SLOT_IDS.index)) != selected_source_slot_ids:
|
||||
raise ReferenceStorageContractError("selected Reference slots are not in fixed R1-R9 order")
|
||||
if len(set(selected_source_slot_ids)) != len(selected_source_slot_ids):
|
||||
raise ReferenceStorageContractError("selected Reference slot is duplicated")
|
||||
if any(not _valid_sha(value) for value in prepared_image_hashes):
|
||||
raise ReferenceStorageContractError("prepared Reference image hash is invalid")
|
||||
if any(item.image_sha256 != prepared_image_hashes[index]
|
||||
for index, item in enumerate(picture_map.references)):
|
||||
raise ReferenceStorageContractError("Reference Picture map image hash is inconsistent")
|
||||
if not logical_chunks or tuple(range(logical_chunks[0], logical_chunks[-1] + 1)) != logical_chunks:
|
||||
raise ReferenceStorageContractError("physical group logical chunks are not contiguous")
|
||||
if int(physical_group) != logical_chunks[0]:
|
||||
raise ReferenceStorageContractError("physical group number differs from its first logical chunk")
|
||||
if (len(logical_chunks) > 1) != (terminal_prompt_policy is not None):
|
||||
raise ReferenceStorageContractError("terminal prompt policy does not match physical group")
|
||||
first_present = picture_map.first_picture_number is not None
|
||||
last_present = picture_map.last_picture_number is not None
|
||||
order = []
|
||||
if first_present:
|
||||
order.append("first_frame")
|
||||
if last_present:
|
||||
order.append("last_frame")
|
||||
order.extend(selected_source_slot_ids)
|
||||
descriptor: dict[str, Any] = {
|
||||
"version": REFERENCE_ROUTING_CONTRACT_VERSION,
|
||||
"physical_group": int(physical_group),
|
||||
"logical_chunks": list(logical_chunks),
|
||||
"terminal_atomic": len(logical_chunks) > 1,
|
||||
"references": [
|
||||
{
|
||||
"source_slot_id": slot_id,
|
||||
"prepared_sha256": prepared_image_hashes[index],
|
||||
"picture_number": picture_map.references[index].picture_number,
|
||||
}
|
||||
for index, slot_id in enumerate(selected_source_slot_ids)
|
||||
],
|
||||
"first_anchor": _anchor(first_frame_hash, first_present),
|
||||
"last_anchor": _anchor(last_frame_hash, last_present),
|
||||
"picture_order": order,
|
||||
"picture_presentation_version": HYBRID_PRESENTATION_VERSION,
|
||||
"effective_prompt_sha256": hashlib.sha256(str(effective_prompt).encode("utf-8")).hexdigest(),
|
||||
"terminal_prompt_policy": str(terminal_prompt_policy) if len(logical_chunks) > 1 else None,
|
||||
}
|
||||
if selected_source_slot_ids:
|
||||
descriptor["reference_size_mode"] = str(size_mode)
|
||||
descriptor["reference_preprocess_version"] = REFERENCE_PREPROCESS_VERSION
|
||||
return descriptor
|
||||
|
||||
|
||||
@dataclass(frozen=True, slots=True)
|
||||
class ReferenceStoragePlan:
|
||||
"""Canonical JSON is immutable even if the caller's source dicts are not."""
|
||||
|
||||
descriptor_jsons: tuple[str, ...]
|
||||
routing_config_sha256: str
|
||||
requested_routes: tuple[tuple[str, ...], ...]
|
||||
_group_index: dict[int, int] = field(init=False, repr=False, compare=False, hash=False)
|
||||
|
||||
def __post_init__(self) -> None:
|
||||
index: dict[int, int] = {}
|
||||
for position, payload in enumerate(self.descriptor_jsons):
|
||||
descriptor = json.loads(payload)
|
||||
# Preserve the former first-match lookup for duplicate group IDs.
|
||||
index.setdefault(int(descriptor["physical_group"]), position)
|
||||
object.__setattr__(self, "_group_index", index)
|
||||
|
||||
def _record_at(self, position: int) -> dict[str, Any]:
|
||||
payload = self.descriptor_jsons[position]
|
||||
return {
|
||||
"descriptor": json.loads(payload),
|
||||
"sha256": hashlib.sha256(payload.encode("utf-8")).hexdigest(),
|
||||
}
|
||||
|
||||
@property
|
||||
def group_contracts(self) -> list[dict[str, Any]]:
|
||||
return [self._record_at(position) for position in range(len(self.descriptor_jsons))]
|
||||
|
||||
def group_for(self, physical_group: int) -> dict[str, Any]:
|
||||
position = self._group_index.get(int(physical_group))
|
||||
if position is None:
|
||||
raise ReferenceStorageContractError(
|
||||
f"physical group {physical_group} has no frozen Reference contract"
|
||||
)
|
||||
return self._record_at(position)
|
||||
|
||||
def audit(self) -> dict[str, Any]:
|
||||
return {
|
||||
"version": REFERENCE_ROUTING_CONTRACT_VERSION,
|
||||
"routing_config_sha256": self.routing_config_sha256,
|
||||
"requested_routes": [list(route) for route in self.requested_routes],
|
||||
}
|
||||
|
||||
|
||||
def build_reference_storage_plan(
|
||||
*, runtime: Any, prompts: list[str], first_frame_hash: str,
|
||||
last_frame_hash: str, terminal_prompt: str | None = None,
|
||||
terminal_prompt_policy: str | None = None,
|
||||
through_chunk: int | None = None,
|
||||
) -> ReferenceStoragePlan:
|
||||
"""Prehash only connected R slots selected by the requested group prefix."""
|
||||
from .reference_runtime import ReferenceRoutingRuntime, resolve_reference_group_prompt
|
||||
|
||||
if not isinstance(runtime, ReferenceRoutingRuntime):
|
||||
raise ReferenceStorageContractError("routed storage requires ReferenceRoutingRuntime")
|
||||
schedule = runtime.schedule
|
||||
total = int(schedule.total_chunks or 0)
|
||||
if total < 1 or len(prompts) != total:
|
||||
raise ReferenceStorageContractError("Reference schedule and prompt count differ")
|
||||
runtime.check_physical_contract(
|
||||
chunks=total, terminal_merge_enabled=bool(schedule.terminal_merge_enabled),
|
||||
)
|
||||
limit = total if through_chunk is None else int(through_chunk)
|
||||
if limit < 1 or limit > total:
|
||||
raise ReferenceStorageContractError("Reference plan prefix is outside configured chunks")
|
||||
routes = [route for route in schedule.physical_routes if route.logical_chunks[-1] <= limit]
|
||||
if not routes or routes[-1].logical_chunks[-1] != limit:
|
||||
raise ReferenceStorageContractError("Reference plan prefix ends inside a physical group")
|
||||
connected = set(runtime.inputs.connected_source_slot_ids)
|
||||
selected = {slot for route in routes for slot in (route.reference_slot_ids or ()) if slot in connected}
|
||||
image_hashes: dict[str, str] = {}
|
||||
for slot in REFERENCE_SLOT_IDS:
|
||||
if slot not in selected:
|
||||
continue
|
||||
assets = runtime.inputs.prepare_selected((slot,))
|
||||
if assets is None or assets.source_slot_ids != (slot,) or len(assets.image_hashes) != 1:
|
||||
raise ReferenceStorageContractError(f"selected {slot} cannot be prepared")
|
||||
image_hashes[slot] = assets.image_hashes[0]
|
||||
del assets
|
||||
descriptor_jsons: list[str] = []
|
||||
requested_routes: list[tuple[str, ...]] = []
|
||||
pending_group_warnings: dict[int, tuple[str, ...]] = {}
|
||||
for route in routes:
|
||||
requested = route.reference_slot_ids
|
||||
if requested is None:
|
||||
raise ReferenceStorageContractError("conflicting terminal Reference route")
|
||||
requested_routes.append(requested)
|
||||
source_slots = tuple(slot for slot in requested if slot in connected)
|
||||
hashes = tuple(image_hashes[slot] for slot in source_slots)
|
||||
final = route.logical_chunks[-1] == total
|
||||
has_first = _present(first_frame_hash)
|
||||
has_last = _present(last_frame_hash) and (bool(source_slots) or final)
|
||||
picture_map = compile_group_picture_map(
|
||||
source_slot_ids=source_slots,
|
||||
reference_image_hashes=hashes,
|
||||
has_first_image=has_first,
|
||||
has_last_image=has_last,
|
||||
)
|
||||
prompt = (
|
||||
terminal_prompt if len(route.logical_chunks) > 1
|
||||
else prompts[route.logical_chunks[0] - 1]
|
||||
)
|
||||
if prompt is None:
|
||||
raise ReferenceStorageContractError("terminal physical prompt is unavailable")
|
||||
effective_prompt, warnings = resolve_reference_group_prompt(
|
||||
physical_group=int(route.physical_group), prompt=prompt,
|
||||
requested_source_slot_ids=requested,
|
||||
connected_source_slot_ids=runtime.inputs.connected_source_slot_ids,
|
||||
picture_map=picture_map,
|
||||
)
|
||||
pending_group_warnings[int(route.physical_group)] = warnings
|
||||
descriptor = descriptor_from_facts(
|
||||
physical_group=route.physical_group,
|
||||
logical_chunks=route.logical_chunks,
|
||||
selected_source_slot_ids=source_slots,
|
||||
prepared_image_hashes=hashes,
|
||||
picture_map=picture_map,
|
||||
first_frame_hash=first_frame_hash,
|
||||
last_frame_hash=last_frame_hash,
|
||||
effective_prompt=effective_prompt,
|
||||
size_mode=runtime.inputs.size_mode,
|
||||
terminal_prompt_policy=terminal_prompt_policy if len(route.logical_chunks) > 1 else None,
|
||||
)
|
||||
descriptor_jsons.append(canonical_json(descriptor))
|
||||
routing_config_sha256 = canonical_sha256({
|
||||
"version": REFERENCE_ROUTING_CONTRACT_VERSION,
|
||||
"mode": schedule.mode,
|
||||
"logical_routes": [
|
||||
[route.logical_chunk, list(route.reference_slot_ids)]
|
||||
for route in schedule.logical_routes
|
||||
],
|
||||
})
|
||||
plan = ReferenceStoragePlan(
|
||||
tuple(descriptor_jsons), routing_config_sha256, tuple(requested_routes)
|
||||
)
|
||||
runtime.group_warnings.update({
|
||||
group: warnings for group, warnings in pending_group_warnings.items()
|
||||
if group not in runtime.observed_group_contracts
|
||||
})
|
||||
return plan
|
||||
|
||||
|
||||
def validate_reference_group_contracts(
|
||||
records: Any, *, chunk_count: int, terminal_merge_enabled: bool,
|
||||
) -> list[dict[str, Any]]:
|
||||
"""Validate the complete routed stored plan, not just its declared hashes."""
|
||||
expected = physical_groups(chunks=chunk_count, terminal_merge_enabled=terminal_merge_enabled)
|
||||
if not isinstance(records, list) or len(records) != len(expected):
|
||||
raise ReferenceStorageContractError("stored Reference group count does not match physical topology")
|
||||
clean: list[dict[str, Any]] = []
|
||||
for record, group in zip(records, expected):
|
||||
if not isinstance(record, dict) or not isinstance(record.get("descriptor"), dict):
|
||||
raise ReferenceStorageContractError("stored Reference group descriptor is missing")
|
||||
descriptor = record["descriptor"]
|
||||
if descriptor.get("version") != REFERENCE_ROUTING_CONTRACT_VERSION:
|
||||
raise ReferenceStorageContractError("stored Reference group version is unsupported")
|
||||
if (descriptor.get("physical_group") != group.physical_group
|
||||
or descriptor.get("logical_chunks") != list(range(group.start, group.end + 1))
|
||||
or descriptor.get("terminal_atomic") is not (group.start != group.end)):
|
||||
raise ReferenceStorageContractError("stored Reference group boundary is invalid")
|
||||
if not _valid_sha(record.get("sha256")) or canonical_sha256(descriptor) != record["sha256"]:
|
||||
raise ReferenceStorageContractError("stored Reference group SHA-256 is invalid")
|
||||
refs = descriptor.get("references")
|
||||
if not isinstance(refs, list):
|
||||
raise ReferenceStorageContractError("stored Reference group source list is invalid")
|
||||
slots = [ref.get("source_slot_id") for ref in refs if isinstance(ref, dict)]
|
||||
if (len(slots) != len(refs) or any(slot not in REFERENCE_SLOT_IDS for slot in slots)
|
||||
or slots != sorted(set(slots), key=REFERENCE_SLOT_IDS.index)
|
||||
or any(not _valid_sha(ref.get("prepared_sha256")) for ref in refs)):
|
||||
raise ReferenceStorageContractError("stored Reference group source identity is invalid")
|
||||
expected_order = (["first_frame"] if descriptor.get("first_anchor") else [])
|
||||
expected_order += (["last_frame"] if descriptor.get("last_anchor") else [])
|
||||
expected_order += slots
|
||||
if descriptor.get("picture_order") != expected_order:
|
||||
raise ReferenceStorageContractError("stored Reference Picture order is invalid")
|
||||
if descriptor.get("picture_presentation_version") != HYBRID_PRESENTATION_VERSION:
|
||||
raise ReferenceStorageContractError("stored Reference Picture presentation version is invalid")
|
||||
offset = int(descriptor.get("first_anchor") is not None) + int(
|
||||
descriptor.get("last_anchor") is not None
|
||||
)
|
||||
if any(ref.get("picture_number") != offset + index + 1
|
||||
for index, ref in enumerate(refs)):
|
||||
raise ReferenceStorageContractError("stored Reference Picture numbers are invalid")
|
||||
if (group.start != group.end) != (descriptor.get("terminal_prompt_policy") is not None):
|
||||
raise ReferenceStorageContractError("stored terminal prompt policy is invalid")
|
||||
if any(not _valid_sha(descriptor.get(name)) for name in ("effective_prompt_sha256",)):
|
||||
raise ReferenceStorageContractError("stored Reference effective Prompt hash is invalid")
|
||||
if any(descriptor.get(name) is not None and not _valid_sha(descriptor[name])
|
||||
for name in ("first_anchor", "last_anchor")):
|
||||
raise ReferenceStorageContractError("stored Reference anchor hash is invalid")
|
||||
if refs and (descriptor.get("reference_preprocess_version") != REFERENCE_PREPROCESS_VERSION
|
||||
or not isinstance(descriptor.get("reference_size_mode"), str)):
|
||||
raise ReferenceStorageContractError("stored Reference preprocessing contract is invalid")
|
||||
if not refs and ("reference_preprocess_version" in descriptor or "reference_size_mode" in descriptor):
|
||||
raise ReferenceStorageContractError("empty Reference group has preprocessing metadata")
|
||||
clean.append(record)
|
||||
return clean
|
||||
|
||||
|
||||
def session_routing_settings(plan: ReferenceStoragePlan, accepted_chunks: int) -> dict[str, Any]:
|
||||
accepted: list[dict[str, Any]] = []
|
||||
for record in plan.group_contracts:
|
||||
descriptor = record["descriptor"]
|
||||
end = int(descriptor["logical_chunks"][-1])
|
||||
if end > accepted_chunks:
|
||||
break
|
||||
accepted.append({
|
||||
"physical_group": int(descriptor["physical_group"]),
|
||||
"logical_chunks": list(descriptor["logical_chunks"]),
|
||||
"sha256": record["sha256"],
|
||||
})
|
||||
if not accepted or accepted[-1]["logical_chunks"][-1] != accepted_chunks:
|
||||
raise ReferenceStorageContractError("accepted Session ends inside a physical group")
|
||||
return {
|
||||
"version": REFERENCE_ROUTING_CONTRACT_VERSION,
|
||||
"accepted_groups": accepted,
|
||||
"routing_config_sha256": plan.routing_config_sha256,
|
||||
}
|
||||
|
||||
|
||||
def compatible_session_prefix(
|
||||
evidence: Any, plan: ReferenceStoragePlan, *, saved_chunks: int,
|
||||
) -> int:
|
||||
"""Return a complete-group accepted prefix; malformed evidence is rejected."""
|
||||
if not isinstance(evidence, dict) or evidence.get("version") != REFERENCE_ROUTING_CONTRACT_VERSION:
|
||||
raise ReferenceStorageContractError("saved Session has no RR-R5 group evidence")
|
||||
groups = evidence.get("accepted_groups")
|
||||
if not isinstance(groups, list) or not groups:
|
||||
raise ReferenceStorageContractError("saved Session group evidence is missing")
|
||||
last_end = 0
|
||||
for position, item in enumerate(groups):
|
||||
if not isinstance(item, dict) or not _valid_sha(item.get("sha256")):
|
||||
raise ReferenceStorageContractError("saved Session group hash is invalid")
|
||||
chunks = item.get("logical_chunks")
|
||||
if (not isinstance(chunks, list) or not chunks or chunks[0] != last_end + 1
|
||||
or chunks != list(range(chunks[0], chunks[-1] + 1))
|
||||
or item.get("physical_group") != chunks[0]):
|
||||
raise ReferenceStorageContractError("saved Session group boundaries are invalid")
|
||||
last_end = chunks[-1]
|
||||
if last_end != saved_chunks:
|
||||
raise ReferenceStorageContractError("saved Session group evidence does not cover its chunks")
|
||||
preserved = 0
|
||||
current = plan.group_contracts
|
||||
for position, item in enumerate(groups):
|
||||
if position >= len(current):
|
||||
break
|
||||
now = current[position]
|
||||
if (item["physical_group"] != now["descriptor"]["physical_group"]
|
||||
or item["logical_chunks"] != now["descriptor"]["logical_chunks"]
|
||||
or item["sha256"] != now["sha256"]):
|
||||
break
|
||||
preserved = item["logical_chunks"][-1]
|
||||
return preserved
|
||||
@@ -9,6 +9,7 @@ without mutating the captured source context.
|
||||
from __future__ import annotations
|
||||
|
||||
from collections.abc import Mapping, Sequence
|
||||
import copy
|
||||
from types import MappingProxyType
|
||||
from typing import Any
|
||||
|
||||
@@ -141,6 +142,7 @@ def make_refine_group(
|
||||
first_image: torch.Tensor | None = None,
|
||||
last_image: torch.Tensor | None = None,
|
||||
guide_images: Mapping[int, torch.Tensor] | None = None,
|
||||
reference_routing_group_contract: Mapping[str, Any] | None = None,
|
||||
) -> dict[str, Any]:
|
||||
"""Capture one physical First Pass sampling group's effective conditioning."""
|
||||
|
||||
@@ -182,6 +184,15 @@ def make_refine_group(
|
||||
frozen_guides = _guide_image_map(guide_images)
|
||||
if frozen_guides:
|
||||
output["guide_images"] = frozen_guides
|
||||
if reference_routing_group_contract is not None:
|
||||
from .reference_storage_contract import canonical_sha256
|
||||
descriptor = reference_routing_group_contract.get("descriptor")
|
||||
digest = reference_routing_group_contract.get("sha256")
|
||||
if not isinstance(descriptor, dict) or canonical_sha256(descriptor) != digest:
|
||||
raise RefineContextError("refine group Reference contract SHA-256 is invalid")
|
||||
if descriptor.get("logical_chunks") != list(chunks):
|
||||
raise RefineContextError("refine group Reference contract has different logical chunks")
|
||||
output["reference_routing_v1"] = copy.deepcopy(dict(reference_routing_group_contract))
|
||||
return output
|
||||
|
||||
|
||||
@@ -307,6 +318,16 @@ def validate_refine_context(
|
||||
group.get("guide_images"),
|
||||
physical_frames=int(group["physical_frames"]),
|
||||
)
|
||||
route_contract = group.get("reference_routing_v1")
|
||||
if route_contract is not None:
|
||||
from .reference_storage_contract import canonical_sha256
|
||||
if not isinstance(route_contract, Mapping):
|
||||
raise RefineContextError("refine group Reference contract is invalid")
|
||||
descriptor = route_contract.get("descriptor")
|
||||
if (not isinstance(descriptor, dict)
|
||||
or canonical_sha256(descriptor) != route_contract.get("sha256")
|
||||
or descriptor.get("logical_chunks") != list(logical_chunks)):
|
||||
raise RefineContextError("refine group Reference contract differs from its content")
|
||||
|
||||
if assembly_plan is not None:
|
||||
if not isinstance(assembly_plan, Mapping):
|
||||
@@ -337,6 +358,21 @@ def validate_refine_context(
|
||||
f"refine group {group_id} has no matching assembly-plan group"
|
||||
)
|
||||
planned = plan_groups[group_id]
|
||||
route_view = assembly_plan.get("reference_routing_v1")
|
||||
if route_view is not None:
|
||||
view_groups = route_view.get("groups") if isinstance(route_view, Mapping) else None
|
||||
expected_route = (
|
||||
view_groups[group_id] if isinstance(view_groups, list)
|
||||
and group_id < len(view_groups) else None
|
||||
)
|
||||
captured_route = group.get("reference_routing_v1")
|
||||
if (not isinstance(expected_route, Mapping)
|
||||
or not isinstance(captured_route, Mapping)
|
||||
or captured_route.get("sha256") != expected_route.get("contract_sha256")
|
||||
or captured_route.get("descriptor") != expected_route.get("descriptor")):
|
||||
raise RefineContextError(
|
||||
f"refine group {group_id} Reference route differs from First Pass Plan"
|
||||
)
|
||||
comparisons = (
|
||||
("logical_chunks", tuple(int(v) for v in group["logical_chunks"]),
|
||||
tuple(int(v) for v in planned.get("logical_chunks", ()))),
|
||||
|
||||
@@ -376,6 +376,10 @@ def prepare_physical_refine_groups(
|
||||
"adaptation_stats": adaptation_stats,
|
||||
"physical_clip_index": physical_clip_index,
|
||||
"context_frames": context_frames,
|
||||
"reference_routing_v1": (
|
||||
captured_group.get("reference_routing_v1")
|
||||
if captured_group is not None else None
|
||||
),
|
||||
}
|
||||
if group_consumer_fn is not None:
|
||||
group_consumer_fn(
|
||||
@@ -472,7 +476,9 @@ def run_second_pass_groups(
|
||||
)
|
||||
group_seeds: list[int] = []
|
||||
conditioning_sources: list[str] = []
|
||||
reference_inheritance: list[dict[str, Any]] = []
|
||||
group_report_lines: list[str] = []
|
||||
routed_first_pass = isinstance(assembly_plan.get("reference_routing_v1"), Mapping)
|
||||
|
||||
def sample_prepared_group(
|
||||
group_index,
|
||||
@@ -492,6 +498,17 @@ def run_second_pass_groups(
|
||||
physical_seed = derive_refine_seed(int(refine_seed), group_index)
|
||||
group_seeds.append(physical_seed)
|
||||
conditioning_sources.append(conditioning_source)
|
||||
route_record = detail.get("reference_routing_v1")
|
||||
inheritance = (
|
||||
"verified" if conditioning_source == "refine_context" and route_record is not None
|
||||
else "not_inherited" if routed_first_pass
|
||||
else "not_applicable"
|
||||
)
|
||||
reference_inheritance.append({
|
||||
"physical_group": group_index + 1,
|
||||
"status": inheritance,
|
||||
"contract_sha256": route_record.get("sha256") if route_record is not None else None,
|
||||
})
|
||||
nested_latent = latent_builder(video_samples, audio_samples)
|
||||
sample_arguments = dict(
|
||||
model=chunk_model,
|
||||
@@ -530,6 +547,7 @@ def run_second_pass_groups(
|
||||
f"{group_index + 1}: logical_chunks={group.get('logical_chunks')}, "
|
||||
f"prompt_policy={group.get('prompt_policy', 'unknown')}, "
|
||||
f"conditioning_source={conditioning_source}, "
|
||||
f"reference_inheritance={inheritance}, "
|
||||
f"physical_clip_index={physical_clip_index}, "
|
||||
f"context_frames={context_frames}, "
|
||||
f"refine_seed={physical_seed}, shape={tuple(refined_video.shape)}, "
|
||||
@@ -607,6 +625,8 @@ def run_second_pass_groups(
|
||||
else:
|
||||
contract["execution"] = "t2va_physical_groups_audio_locked_v2"
|
||||
contract["conditioning_sources"] = conditioning_sources
|
||||
if any(item["status"] != "not_applicable" for item in reference_inheritance):
|
||||
contract["reference_inheritance"] = reference_inheritance
|
||||
contract["refine_seed_base"] = int(refine_seed)
|
||||
contract["refine_group_seeds"] = group_seeds
|
||||
contract["audio_output"] = "bit_exact_first_pass_passthrough"
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
"""Package version and public schema identifiers."""
|
||||
|
||||
PACKAGE_VERSION = "3.8.3"
|
||||
PACKAGE_VERSION = "3.9.0"
|
||||
STATE_SCHEMA_VERSION = 1
|
||||
PLAN_SCHEMA_VERSION = 1
|
||||
PUBLIC_API_VERSION = 3
|
||||
|
||||
+139
-20
@@ -1,6 +1,7 @@
|
||||
import { app } from "../../scripts/app.js";
|
||||
import { api } from "../../scripts/api.js";
|
||||
import { normalizeReferenceAudioLabels } from "./reference_audio_ui.js";
|
||||
import { configureV39ReferenceImages, connectedV39LegacyReferenceInputs, pruneV39LegacyReferenceInputs, refreshV39ReferenceImagesForSampler } from "./reference_images_v39.js";
|
||||
import { migrateReferenceImageInputs } from "./reference_image_ui.js";
|
||||
|
||||
const PRODUCTION_NODE_CLASS = "H3ContinuumSamplerProduction";
|
||||
@@ -12,6 +13,10 @@ const V35_NODE_CLASS = "H3ContinuumSamplerV35";
|
||||
const V36_NODE_CLASS = "H3ContinuumSamplerV36";
|
||||
const V37_NODE_CLASS = "H3ContinuumSamplerV37";
|
||||
const V38_NODE_CLASS = "H3ContinuumSamplerV38";
|
||||
const V39_NODE_CLASS = "H3ContinuumSamplerV39";
|
||||
const isModernSamplerClass = (name) => name === V38_NODE_CLASS || name === V39_NODE_CLASS;
|
||||
const V39_PLAN_WIDGET = "Reference Plan Inspector";
|
||||
const V39_UNVERIFIED_PLAN = "Configured only — Queue has not verified the effective Reference Plan.";
|
||||
const V35_ASSEMBLE_SEAM_NODE_CLASS = "H3ContinuumAssembleSeamV35";
|
||||
const PROJECT_WIDGET = "project_id";
|
||||
const LEGACY_RUN_NAME_WIDGET = "run_name";
|
||||
@@ -343,7 +348,7 @@ function linkedInput(node, names) {
|
||||
}
|
||||
|
||||
function removeUnusedLegacyInputs(node) {
|
||||
if (node.comfyClass !== V38_NODE_CLASS) return;
|
||||
if (!isModernSamplerClass(node.comfyClass)) return;
|
||||
for (const name of ["guide", "reference_audio_1", "reference_audio_vae"]) {
|
||||
if (!linkedInput(node, [name])) removeUnusedInput(node, name);
|
||||
}
|
||||
@@ -709,7 +714,7 @@ function setReviewSeedControlFixed(node) {
|
||||
}
|
||||
|
||||
function requireFixedSeedForReview(node) {
|
||||
if (node.comfyClass !== V38_NODE_CLASS) return;
|
||||
if (!isModernSamplerClass(node.comfyClass)) return;
|
||||
if (findWidget(node, GENERATION_MODE_WIDGET)?.value !== GENERATION_MODE_REVIEW) return;
|
||||
const control = String(baseSeedControlWidget(node)?.value || "").toLowerCase();
|
||||
if (control === "fixed") return;
|
||||
@@ -1000,7 +1005,7 @@ function moveNamedWidgetsToFront(node, orderedNames) {
|
||||
}
|
||||
|
||||
function configureIntuitiveV38Ux(node) {
|
||||
if (node.comfyClass !== V38_NODE_CLASS || typeof node.addWidget !== "function") return;
|
||||
if (!isModernSamplerClass(node.comfyClass) || typeof node.addWidget !== "function") return;
|
||||
const sourceOptions = (name) => {
|
||||
const widget = name === "control_after_generate"
|
||||
? baseSeedControlWidget(node)
|
||||
@@ -1227,7 +1232,8 @@ function configureIntuitiveV38Ux(node) {
|
||||
);
|
||||
const referenceConnected = activeLinkedInput(
|
||||
node,
|
||||
["reference_image_1", "reference_image_2", "reference_image_3", "reference_image_4", "reference_image_5", "image_references"],
|
||||
node.comfyClass === V39_NODE_CLASS ? ["reference_images"]
|
||||
: ["reference_image_1", "reference_image_2", "reference_image_3", "reference_image_4", "reference_image_5", "image_references"],
|
||||
);
|
||||
const videoConnected = activeLinkedInput(node, ["reference_video_1"]);
|
||||
const storageEnabled = findWidget(node, RUN_STORAGE_WIDGET)?.value === "Save + Auto Resume";
|
||||
@@ -2073,10 +2079,10 @@ function installReviewQueueAdapter() {
|
||||
const output = { ...(data?.output || {}) };
|
||||
const records = [];
|
||||
for (const [nodeId, item] of Object.entries(output)) {
|
||||
if (item?.class_type !== V38_NODE_CLASS || !reviewPromptIncludes(output, nodeId, options)) continue;
|
||||
if (!isModernSamplerClass(item?.class_type) || !reviewPromptIncludes(output, nodeId, options)) continue;
|
||||
const node = app.graph?.getNodeById?.(nodeId)
|
||||
|| app.graph?._nodes?.find(n => String(n.id) === nodeId);
|
||||
if (!node || node.comfyClass !== V38_NODE_CLASS) continue;
|
||||
if (!node || !isModernSamplerClass(node.comfyClass)) continue;
|
||||
requireFixedSeedForReview(node);
|
||||
const normalizedInputs = { ...(item.inputs || {}) };
|
||||
normalizeRunStorageState(node, normalizedInputs);
|
||||
@@ -2138,7 +2144,7 @@ async function synchronizeReviewQueue({discover = false} = {}) {
|
||||
for (const node of app.graph?._nodes || []) {
|
||||
const nodeId = String(node.id);
|
||||
const submitted = output[nodeId];
|
||||
if (node.comfyClass !== V38_NODE_CLASS || submitted?.class_type !== V38_NODE_CLASS
|
||||
if (!isModernSamplerClass(node.comfyClass) || submitted?.class_type !== node.comfyClass
|
||||
|| !reviewPromptIncludes(output, nodeId, {partialExecutionTargets: item[4]})
|
||||
|| reviewPromptRunName(submitted.inputs) !== takeRunName(node)) continue;
|
||||
records.push({node, nodeId, runName: takeRunName(node),
|
||||
@@ -2184,7 +2190,7 @@ async function synchronizeReviewQueue({discover = false} = {}) {
|
||||
|
||||
async function reloadReviewHistory() {
|
||||
for (const node of app.graph?._nodes || []) {
|
||||
if (node.comfyClass === V38_NODE_CLASS) await loadTakeHistory(node, {force: true});
|
||||
if (isModernSamplerClass(node.comfyClass)) await loadTakeHistory(node, {force: true});
|
||||
}
|
||||
await synchronizeReviewQueue({discover: true});
|
||||
}
|
||||
@@ -2227,7 +2233,7 @@ function attachTakeHistoryReload(node) {
|
||||
}
|
||||
|
||||
function configureProductionReviewUx(node) {
|
||||
if (node.comfyClass !== V38_NODE_CLASS || typeof node.addWidget !== "function") return;
|
||||
if (!isModernSamplerClass(node.comfyClass) || typeof node.addWidget !== "function") return;
|
||||
let statusWidget = transientProductionWidgets(node).find(
|
||||
(widget) => widget.name === PRODUCTION_STATUS_WIDGET,
|
||||
);
|
||||
@@ -2646,12 +2652,113 @@ function configureProductionReviewUx(node) {
|
||||
refresh();
|
||||
}
|
||||
|
||||
function configureV39ReferenceUx(node) {
|
||||
if (node.comfyClass !== V39_NODE_CLASS) return;
|
||||
let planWidget = transientProductionWidgets(node).find(
|
||||
(widget) => widget.name === V39_PLAN_WIDGET,
|
||||
);
|
||||
if (!planWidget) {
|
||||
const value = V39_UNVERIFIED_PLAN;
|
||||
planWidget = typeof node.addCustomWidget === "function"
|
||||
? node.addCustomWidget({
|
||||
type: "h3_continuum_reference_plan",
|
||||
name: V39_PLAN_WIDGET,
|
||||
value,
|
||||
serialize: false,
|
||||
options: { serialize: false },
|
||||
[PRODUCTION_TRANSIENT_WIDGET]: true,
|
||||
computeSize(width) {
|
||||
const count = String(this.value || "").split("\n").length;
|
||||
return [width, Math.min(220, Math.max(48, 14 + count * 16))];
|
||||
},
|
||||
draw(ctx, _node, width, y, height) {
|
||||
ctx.save();
|
||||
ctx.beginPath();
|
||||
ctx.rect(15, y + 4, Math.max(1, width - 30), Math.max(1, height - 8));
|
||||
ctx.clip();
|
||||
ctx.fillStyle = "#e7f4e9";
|
||||
ctx.font = "12px Arial";
|
||||
ctx.textAlign = "left";
|
||||
ctx.textBaseline = "top";
|
||||
const lines = String(this.value || "").split("\n");
|
||||
const count = Math.max(1, Math.floor((height - 12) / 16));
|
||||
for (let index = 0; index < Math.min(lines.length, count); index += 1) {
|
||||
ctx.fillText(lines[index], 18, y + 6 + index * 16, Math.max(1, width - 36));
|
||||
}
|
||||
ctx.restore();
|
||||
},
|
||||
})
|
||||
: addTransientProductionWidget(
|
||||
node, "text", V39_PLAN_WIDGET, value, null, { multiline: true },
|
||||
);
|
||||
if (planWidget) {
|
||||
planWidget.disabled = true;
|
||||
setWidgetTooltip(planWidget, (
|
||||
"Read-only. Before Queue this is only configured intent. After Queue the "
|
||||
+ "backend reports actual physical groups, reused/generated status, "
|
||||
+ "R1-R9 to Picture mapping, contract hashes, and warnings."
|
||||
));
|
||||
}
|
||||
installProductionSerializationGuard(node);
|
||||
}
|
||||
const routeKey = () => reviewSettingsSnapshot(node);
|
||||
const refresh = () => {
|
||||
const key = routeKey();
|
||||
if (node.__h3ContinuumReferenceRouteKey !== key) {
|
||||
node.__h3ContinuumReferenceRouteKey = key;
|
||||
node.__h3ContinuumReferencePlan = null;
|
||||
}
|
||||
const legacyConnections = connectedV39LegacyReferenceInputs(node);
|
||||
const reviewOpen = reviewReady(node)
|
||||
&& !node.__h3ContinuumReviewSettingsOpen
|
||||
&& !node.__h3ContinuumModeSetup;
|
||||
if (planWidget) {
|
||||
planWidget.value = legacyConnections.length
|
||||
? `Old Reference connection(s) ${legacyConnections.join(", ")} are not used by V3.9. Reconnect them through H3 Continuum Reference Images V3.9.`
|
||||
: node.__h3ContinuumReferencePlan || V39_UNVERIFIED_PLAN;
|
||||
setWidgetVisible(planWidget, !reviewOpen || legacyConnections.length > 0);
|
||||
}
|
||||
node.setDirtyCanvas?.(true, true);
|
||||
};
|
||||
if (!node.__h3ContinuumV39ReferenceUxInstalled) {
|
||||
const previousRefresh = node.__h3ContinuumIntuitiveUxRefresh;
|
||||
node.__h3ContinuumIntuitiveUxRefresh = () => {
|
||||
previousRefresh?.();
|
||||
refresh();
|
||||
};
|
||||
attachRefresh(findWidget(node, "chunks"), "__h3ContinuumV39ChunksRefresh", () => {
|
||||
refreshV39ReferenceImagesForSampler(node);
|
||||
refresh();
|
||||
});
|
||||
const previousExecuted = node.onExecuted;
|
||||
node.onExecuted = function(message, ...args) {
|
||||
const result = previousExecuted?.call(this, message, ...args);
|
||||
const text = message?.h3_reference_plan?.[0];
|
||||
if (typeof text === "string") {
|
||||
this.__h3ContinuumReferencePlan = text;
|
||||
refresh();
|
||||
}
|
||||
return result;
|
||||
};
|
||||
const previousConnectionsChange = node.onConnectionsChange;
|
||||
node.onConnectionsChange = function(...args) {
|
||||
const result = previousConnectionsChange?.apply(this, args);
|
||||
this.__h3ContinuumReferencePlan = null;
|
||||
refreshV39ReferenceImagesForSampler(this);
|
||||
refresh();
|
||||
return result;
|
||||
};
|
||||
node.__h3ContinuumV39ReferenceUxInstalled = true;
|
||||
}
|
||||
refresh();
|
||||
}
|
||||
|
||||
function normalizedV38View(node) {
|
||||
return node.__h3ContinuumAdvancedOpen ? V38_VIEW_PRODUCTION : V38_VIEW_BASIC;
|
||||
}
|
||||
|
||||
function applyV38View(node) {
|
||||
if (node.comfyClass !== V38_NODE_CLASS) return;
|
||||
if (!isModernSamplerClass(node.comfyClass)) return;
|
||||
node.__h3ContinuumIntuitiveUxRefresh?.();
|
||||
node.__h3ContinuumProductionUxRefresh?.();
|
||||
if (!node.__h3ContinuumTakeInitialLoad) {
|
||||
@@ -2662,7 +2769,7 @@ function applyV38View(node) {
|
||||
}
|
||||
|
||||
function configureV38ViewProperty(node) {
|
||||
if (node.comfyClass !== V38_NODE_CLASS) return V38_VIEW_BASIC;
|
||||
if (!isModernSamplerClass(node.comfyClass)) return V38_VIEW_BASIC;
|
||||
node.properties ||= {};
|
||||
if (!node.__h3ContinuumLegacyViewMigrated) {
|
||||
node.__h3ContinuumAdvancedOpen = (
|
||||
@@ -2713,7 +2820,7 @@ function configureConditionalWidgets(node) {
|
||||
const refresh = () => {
|
||||
removeUnusedLegacyInputs(node);
|
||||
const productionView = true;
|
||||
const storageEnabled = node.comfyClass === V38_NODE_CLASS
|
||||
const storageEnabled = isModernSamplerClass(node.comfyClass)
|
||||
? storageWidget?.value === "Save + Auto Resume"
|
||||
: normalizeRunStorageState(node);
|
||||
const explicitRegeneration = storageEnabled
|
||||
@@ -2725,7 +2832,9 @@ function configureConditionalWidgets(node) {
|
||||
setWidgetVisible(
|
||||
findWidget(node, REFERENCE_SIZE_WIDGET),
|
||||
productionView
|
||||
&& activeLinkedInput(node, ["reference_image_1", "reference_image_2", "reference_image_3", "reference_image_4", "reference_image_5", "image_references"]),
|
||||
&& activeLinkedInput(node, node.comfyClass === V39_NODE_CLASS
|
||||
? ["reference_images"]
|
||||
: ["reference_image_1", "reference_image_2", "reference_image_3", "reference_image_4", "reference_image_5", "image_references"]),
|
||||
);
|
||||
setWidgetVisible(
|
||||
findWidget(node, TIMELINE_SIZE_WIDGET),
|
||||
@@ -2752,7 +2861,7 @@ function configureConditionalWidgets(node) {
|
||||
}
|
||||
|
||||
function configureResolutionPresetWidgets(node) {
|
||||
if (node.comfyClass !== V38_NODE_CLASS) {
|
||||
if (!isModernSamplerClass(node.comfyClass)) {
|
||||
return;
|
||||
}
|
||||
const aspectWidget = findWidget(node, LEGACY_ASPECT_WIDGET);
|
||||
@@ -2893,7 +3002,7 @@ function isOneShotReviewAction(value) {
|
||||
}
|
||||
|
||||
function normalizeReviewActionOnLoad(node) {
|
||||
if (node.comfyClass !== V38_NODE_CLASS) {
|
||||
if (!isModernSamplerClass(node.comfyClass)) {
|
||||
return false;
|
||||
}
|
||||
delete node[REVIEW_PENDING_ACTION];
|
||||
@@ -2986,7 +3095,7 @@ function buildReviewQueueInputs(node, apiInputs) {
|
||||
}
|
||||
|
||||
function configureReviewControls(node) {
|
||||
if (node.comfyClass !== V38_NODE_CLASS) {
|
||||
if (!isModernSamplerClass(node.comfyClass)) {
|
||||
return;
|
||||
}
|
||||
const generationWidget = findWidget(node, GENERATION_MODE_WIDGET);
|
||||
@@ -3072,15 +3181,17 @@ function configureAssembler(node) {
|
||||
return true;
|
||||
}
|
||||
|
||||
function configureNode(node) {
|
||||
function configureNode(node) {
|
||||
const isProduction = node.comfyClass === PRODUCTION_NODE_CLASS;
|
||||
const isTimeline = node.comfyClass === TIMELINE_NODE_CLASS;
|
||||
const isV34 = node.comfyClass === V34_NODE_CLASS;
|
||||
const isV35 = node.comfyClass === V35_NODE_CLASS;
|
||||
const isV36 = node.comfyClass === V36_NODE_CLASS;
|
||||
const isV37 = node.comfyClass === V37_NODE_CLASS;
|
||||
const isV38 = node.comfyClass === V38_NODE_CLASS;
|
||||
const isV38 = isModernSamplerClass(node.comfyClass);
|
||||
if (node.comfyClass === V39_NODE_CLASS) pruneV39LegacyReferenceInputs(node);
|
||||
if (!isProduction && !isTimeline && !isV34 && !isV35 && !isV36 && !isV37 && !isV38) {
|
||||
configureV39ReferenceImages(node);
|
||||
if (node.comfyClass === "H3ContinuumReferenceAudios") {
|
||||
normalizeReferenceAudioLabels(node);
|
||||
}
|
||||
@@ -3114,6 +3225,7 @@ function configureNode(node) {
|
||||
configureReviewControls(node);
|
||||
configureIntuitiveV38Ux(node);
|
||||
configureProductionReviewUx(node);
|
||||
configureV39ReferenceUx(node);
|
||||
applyV38View(node);
|
||||
node.setDirtyCanvas?.(true, true);
|
||||
return projectWidget;
|
||||
@@ -3175,6 +3287,9 @@ app.registerExtension({
|
||||
},
|
||||
|
||||
loadedGraphNode(node) {
|
||||
if (node.comfyClass === V39_NODE_CLASS) {
|
||||
node.__h3ContinuumReferencePlan = null;
|
||||
}
|
||||
normalizeReviewActionOnLoad(node);
|
||||
configureNodeAfterSetup(node);
|
||||
},
|
||||
@@ -3191,6 +3306,10 @@ app.registerExtension({
|
||||
for (const node of app.graph?._nodes || []) {
|
||||
const projectWidget = configureNode(node);
|
||||
const apiNode = prompt.output?.[String(node.id)];
|
||||
if (node.comfyClass === V39_NODE_CLASS && apiNode?.inputs) {
|
||||
node.__h3ContinuumReferencePlan = null;
|
||||
configureV39ReferenceUx(node);
|
||||
}
|
||||
if (apiNode?.inputs) {
|
||||
if (
|
||||
node.comfyClass === PRODUCTION_NODE_CLASS
|
||||
@@ -3199,10 +3318,10 @@ app.registerExtension({
|
||||
|| node.comfyClass === V35_NODE_CLASS
|
||||
|| node.comfyClass === V36_NODE_CLASS
|
||||
|| node.comfyClass === V37_NODE_CLASS
|
||||
|| node.comfyClass === V38_NODE_CLASS
|
||||
|| isModernSamplerClass(node.comfyClass)
|
||||
) {
|
||||
node.__h3ContinuumResolutionUxRefresh?.();
|
||||
if (node.comfyClass !== V38_NODE_CLASS) {
|
||||
if (!isModernSamplerClass(node.comfyClass)) {
|
||||
normalizeRunStorageState(node, apiNode.inputs);
|
||||
}
|
||||
apiNode.inputs.diagnostics = settingValue(SETTINGS.detailedReport, false)
|
||||
|
||||
@@ -0,0 +1,242 @@
|
||||
const CLASS = "H3ContinuumReferenceImagesV39";
|
||||
const SAMPLER = "H3ContinuumSamplerV39";
|
||||
const MAX = 16;
|
||||
const LEGACY_SAMPLER_INPUTS = new Set([
|
||||
...Array.from({ length: 5 }, (_, index) => `reference_image_${index + 1}`),
|
||||
"image_references",
|
||||
]);
|
||||
const getWidget = (node, name) => node.widgets?.find((item) => item.name === name);
|
||||
const element = (tag, value = "") => {
|
||||
const item = document.createElement(tag);
|
||||
item.textContent = value;
|
||||
return item;
|
||||
};
|
||||
|
||||
function savedChunks(value) {
|
||||
const text = String(value ?? "off").trim().toLowerCase();
|
||||
if (text === "off") return new Set();
|
||||
if (text === "all") return new Set(Array.from({ length: MAX }, (_, i) => i + 1));
|
||||
const result = new Set();
|
||||
for (const token of text.split(",")) {
|
||||
const match = token.trim().match(/^(\d+)(?:\s*-\s*(\d+))?$/);
|
||||
if (!match) return null;
|
||||
const first = Number(match[1]);
|
||||
const last = Number(match[2] || match[1]);
|
||||
if (first < 1 || last > MAX || first > last) return null;
|
||||
for (let n = first; n <= last; n += 1) result.add(n);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
function linkedSamplers(node) {
|
||||
const output = node.outputs?.find((item) => item.name === "reference_images");
|
||||
return (output?.links || []).map((id) => {
|
||||
const link = node.graph?.links?.[id];
|
||||
return node.graph?.getNodeById?.(link?.target_id);
|
||||
}).filter((target) => target?.comfyClass === SAMPLER);
|
||||
}
|
||||
|
||||
function destination(node) {
|
||||
const targets = linkedSamplers(node);
|
||||
const counts = targets.map((target) => Number(getWidget(target, "chunks")?.value));
|
||||
const known = counts.length && counts.every((n) => Number.isInteger(n) && n >= 1 && n <= MAX && n === counts[0]);
|
||||
return { count: known ? counts[0] : MAX, known: Boolean(known) };
|
||||
}
|
||||
|
||||
function invalidate(node) {
|
||||
for (const target of linkedSamplers(node)) {
|
||||
target.__h3ContinuumReferencePlan = null;
|
||||
target.__h3ContinuumIntuitiveUxRefresh?.();
|
||||
target.setDirtyCanvas?.(true, true);
|
||||
}
|
||||
}
|
||||
|
||||
export function connectedV39LegacyReferenceInputs(node) {
|
||||
if (node?.comfyClass !== SAMPLER) return [];
|
||||
return (node.inputs || []).filter((input) =>
|
||||
LEGACY_SAMPLER_INPUTS.has(input.name) && input.link != null
|
||||
).map((input) => input.name);
|
||||
}
|
||||
|
||||
export function pruneV39LegacyReferenceInputs(node) {
|
||||
if (node?.comfyClass !== SAMPLER || typeof node.removeInput !== "function") return 0;
|
||||
let removed = 0;
|
||||
for (let index = (node.inputs?.length || 0) - 1; index >= 0; index -= 1) {
|
||||
const input = node.inputs[index];
|
||||
if (!LEGACY_SAMPLER_INPUTS.has(input.name) || input.link != null) continue;
|
||||
node.removeInput(index);
|
||||
removed += 1;
|
||||
}
|
||||
if (removed) {
|
||||
node.__h3ContinuumReferencePlan = null;
|
||||
node.setDirtyCanvas?.(true, true);
|
||||
}
|
||||
return removed;
|
||||
}
|
||||
|
||||
export function configureV39ReferenceImages(node) {
|
||||
if (node?.comfyClass !== CLASS || typeof document === "undefined") return;
|
||||
const mode = getWidget(node, "reference_use");
|
||||
const selectors = Array.from({ length: 9 }, (_, i) => getWidget(node, `reference_r${i + 1}_chunks`));
|
||||
if (!mode || selectors.some((item) => !item)) return;
|
||||
if (node.__h3ReferenceImagesRefresh) return node.__h3ReferenceImagesRefresh();
|
||||
if (typeof node.addDOMWidget !== "function") return;
|
||||
// The standard STRING widgets remain serializable; only their presentation is hidden.
|
||||
for (const item of selectors) {
|
||||
item.type = "hidden";
|
||||
item.hidden = true;
|
||||
item.options ||= {};
|
||||
item.options.hidden = true;
|
||||
item.computeSize = () => [0, 0];
|
||||
item.draw = () => {};
|
||||
}
|
||||
const panel = element("div");
|
||||
panel.style.cssText = "box-sizing:border-box;min-width:340px;max-height:360px;overflow:auto;padding:7px;color:#e7f4e9;background:#203827;font:12px Arial;pointer-events:auto";
|
||||
const host = element("div");
|
||||
host.style.cssText = "box-sizing:border-box;padding-top:8px;pointer-events:auto";
|
||||
host.append(panel);
|
||||
for (const name of ["pointerdown", "mousedown", "mouseup", "dblclick"]) {
|
||||
host.addEventListener(name, (event) => event.stopPropagation());
|
||||
}
|
||||
const display = node.addDOMWidget("reference_assignment", "h3_reference_assignment", host, { serialize: false });
|
||||
display.options ||= {};
|
||||
display.options.serialize = false;
|
||||
let panelHeight = 54;
|
||||
display.computeSize = (width) => [Math.max(340, Number(width) || Number(node.size?.[0]) || 340), panelHeight + 8];
|
||||
const reservePanelSpace = (height) => {
|
||||
panelHeight = height;
|
||||
panel.style.height = `${height}px`;
|
||||
const computedHeight = Number(node.computeSize?.()[1]);
|
||||
if (Number.isFinite(computedHeight) && typeof node.setSize === "function") {
|
||||
node.setSize([Number(node.size?.[0]) || 340, computedHeight]);
|
||||
}
|
||||
};
|
||||
let page = 0;
|
||||
let previousKey = null;
|
||||
const setSelection = (slot, selection) => {
|
||||
const target = selectors[slot - 1];
|
||||
target.value = [...selection].sort((a, b) => a - b).join(",") || "off";
|
||||
target.callback?.(target.value);
|
||||
invalidate(node);
|
||||
refresh();
|
||||
};
|
||||
const refresh = () => {
|
||||
const { count, known } = destination(node);
|
||||
const rows = Array.from({ length: 9 }, (_, i) => i + 1).filter((slot) =>
|
||||
node.inputs?.some((input) => input.name === `reference_image_${slot}` && input.link != null));
|
||||
const key = JSON.stringify([mode.value, count, known, rows, selectors.map((item) => item.value), page]);
|
||||
if (key === previousKey) return;
|
||||
previousKey = key;
|
||||
panel.replaceChildren();
|
||||
if (mode.value !== "Per chunk") {
|
||||
panel.append(element("div", "Connected images are used in all chunks."));
|
||||
reservePanelSpace(54);
|
||||
return;
|
||||
}
|
||||
panel.append(element("div", known ? `Per-chunk assignments · ${count} chunks` : "Destination unknown · show chunks 1–16"));
|
||||
if (!rows.length) {
|
||||
panel.append(element("div", "Connect Reference Images to assign them."));
|
||||
reservePanelSpace(64);
|
||||
return;
|
||||
}
|
||||
page = Math.min(page, Math.ceil(count / 6) - 1);
|
||||
const first = page * 6 + 1;
|
||||
const last = Math.min(first + 5, count);
|
||||
if (count > 6) {
|
||||
const nav = element("div");
|
||||
for (const [label, targetPage] of [["◀", page - 1], [`${first}–${last} / ${count}`, page], ["▶", page + 1]]) {
|
||||
const button = element("button", label);
|
||||
button.type = "button";
|
||||
button.disabled = targetPage < 0 || targetPage >= Math.ceil(count / 6) || targetPage === page;
|
||||
button.onclick = () => { page = targetPage; previousKey = null; refresh(); };
|
||||
nav.append(button);
|
||||
}
|
||||
panel.append(nav);
|
||||
}
|
||||
const table = element("table");
|
||||
table.style.cssText = "width:100%;border-collapse:collapse;text-align:center;color:#e7f4e9";
|
||||
const header = element("tr");
|
||||
header.append(element("th", "Image"));
|
||||
for (let n = first; n <= last; n += 1) header.append(element("th", String(n)));
|
||||
header.append(element("th", "All / Off"));
|
||||
table.append(header);
|
||||
for (const slot of rows) {
|
||||
const selected = savedChunks(selectors[slot - 1].value);
|
||||
const row = element("tr");
|
||||
row.append(element("td", `Image ${slot} · @R${slot}`));
|
||||
for (let n = first; n <= last; n += 1) {
|
||||
const cell = element("td");
|
||||
const checkbox = element("input");
|
||||
checkbox.type = "checkbox";
|
||||
checkbox.checked = selected?.has(n) || false;
|
||||
checkbox.disabled = selected === null;
|
||||
checkbox.setAttribute("aria-label", `Image ${slot}, Chunk ${n}`);
|
||||
checkbox.onchange = () => {
|
||||
const updated = new Set(selected);
|
||||
if (checkbox.checked) updated.add(n); else updated.delete(n);
|
||||
setSelection(slot, updated);
|
||||
};
|
||||
cell.append(checkbox);
|
||||
row.append(cell);
|
||||
}
|
||||
const actions = element("td");
|
||||
for (const [label, on] of [["All", true], ["Off", false]]) {
|
||||
const button = element("button", label);
|
||||
button.type = "button";
|
||||
button.disabled = selected === null;
|
||||
button.onclick = () => {
|
||||
const updated = new Set(selected);
|
||||
for (let n = 1; n <= count; n += 1) {
|
||||
if (on) updated.add(n); else updated.delete(n);
|
||||
}
|
||||
setSelection(slot, updated);
|
||||
};
|
||||
actions.append(button);
|
||||
}
|
||||
row.append(actions);
|
||||
table.append(row);
|
||||
}
|
||||
panel.append(table);
|
||||
for (const slot of rows) {
|
||||
const selected = savedChunks(selectors[slot - 1].value);
|
||||
if (selected === null) {
|
||||
panel.append(element("div", `Image ${slot}: invalid saved selection.`));
|
||||
continue;
|
||||
}
|
||||
const active = [...selected].filter((n) => n <= count).sort((a, b) => a - b);
|
||||
const future = [...selected].filter((n) => n > count).sort((a, b) => a - b);
|
||||
panel.append(element("div", `Image ${slot} → Chunks ${active.join(", ") || "none"}${future.length ? ` · saved beyond range: ${future.join(", ")}` : ""}`));
|
||||
}
|
||||
if (rows.every((slot) => ![...(savedChunks(selectors[slot - 1].value) || [])].some((n) => n <= count))) {
|
||||
panel.append(element("div", "No references assigned. Check the chunks to use."));
|
||||
}
|
||||
reservePanelSpace(Math.min(360, 77 + rows.length * 36 + (count > 6 ? 32 : 0)));
|
||||
node.setDirtyCanvas?.(true, true);
|
||||
};
|
||||
node.__h3ReferenceImagesRefresh = refresh;
|
||||
const oldConnections = node.onConnectionsChange;
|
||||
node.onConnectionsChange = function(...args) {
|
||||
const result = oldConnections?.apply(this, args);
|
||||
invalidate(this);
|
||||
refresh();
|
||||
return result;
|
||||
};
|
||||
for (const control of [mode, ...selectors]) {
|
||||
const previous = control.callback;
|
||||
control.callback = function(...args) {
|
||||
const result = previous?.apply(this, args);
|
||||
invalidate(node);
|
||||
refresh();
|
||||
return result;
|
||||
};
|
||||
}
|
||||
refresh();
|
||||
}
|
||||
|
||||
export function refreshV39ReferenceImagesForSampler(node) {
|
||||
if (node?.comfyClass !== SAMPLER) return;
|
||||
const input = node.inputs?.find((item) => item.name === "reference_images");
|
||||
const link = node.graph?.links?.[input?.link];
|
||||
const source = node.graph?.getNodeById?.(link?.origin_id);
|
||||
if (source?.comfyClass === CLASS) configureV39ReferenceImages(source);
|
||||
}
|
||||
Reference in New Issue
Block a user