Release V3.8 source, illustrated manual and Spectrum workflow
@@ -0,0 +1,40 @@
|
||||
tests/
|
||||
tools/*
|
||||
!tools/__init__.py
|
||||
!tools/p20_file_backed_tensor_poc.py
|
||||
!tools/verify_runtime.py
|
||||
.pytest_cache/
|
||||
**/__pycache__/
|
||||
*.pyc
|
||||
*.pyo
|
||||
# Local backup archives are not distribution assets. The official workflow
|
||||
# archive is re-included explicitly below.
|
||||
*.zip
|
||||
|
||||
# Internal source/development records and the source-tree Manifest are not part
|
||||
# of the Registry archive. REGISTRY_MANIFEST.sha256 covers the staged package.
|
||||
AGENTS.md
|
||||
PROJECT_STATE.md
|
||||
WORKLOG.md
|
||||
MANIFEST.sha256
|
||||
|
||||
# Repository-only automation and test configuration are not runtime assets.
|
||||
.github/
|
||||
.gitignore
|
||||
.gitattributes
|
||||
pytest.ini
|
||||
|
||||
# Ship only current V3.8 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
|
||||
|
||||
# One user-supplied Spectrum graph, in JSON and ZIP forms. External custom-node
|
||||
# dependencies are documented, not bundled. Historical examples stay in Git.
|
||||
examples/*
|
||||
!examples/workflows/
|
||||
examples/workflows/*
|
||||
!examples/workflows/MiniMax_H3_Continuum_V38.json
|
||||
!examples/workflows/MiniMax_H3_Continuum_V38.zip
|
||||
@@ -0,0 +1,3 @@
|
||||
# Release manifests and the user-supplied workflow ZIP hash exact file bytes.
|
||||
# Keep Git checkout/add from rewriting line endings on Windows or Linux.
|
||||
* -text
|
||||
@@ -1,27 +1,27 @@
|
||||
name: tests
|
||||
|
||||
on:
|
||||
push:
|
||||
pull_request:
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: "3.11"
|
||||
cache: pip
|
||||
- name: Install test dependencies
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
python -m pip install --index-url https://download.pytorch.org/whl/cpu torch
|
||||
name: tests
|
||||
|
||||
on:
|
||||
push:
|
||||
pull_request:
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: "3.11"
|
||||
cache: pip
|
||||
- name: Install test dependencies
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
python -m pip install --index-url https://download.pytorch.org/whl/cpu torch
|
||||
python -m pip install -r requirements.txt numpy safetensors pytest psutil
|
||||
- name: Compile Python
|
||||
run: python -m compileall -q .
|
||||
- name: Run tests
|
||||
run: python -m pytest -q -p no:cacheprovider
|
||||
- name: Compile Python
|
||||
run: python -m compileall -q .
|
||||
- name: Run tests
|
||||
run: python -m pytest -q -p no:cacheprovider
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
__pycache__/
|
||||
.pytest_cache/
|
||||
*.py[cod]
|
||||
*.safetensors
|
||||
*.tmp
|
||||
__pycache__/
|
||||
.pytest_cache/
|
||||
*.py[cod]
|
||||
*.safetensors
|
||||
*.tmp
|
||||
|
||||
@@ -1,54 +1,103 @@
|
||||
# AGENTS.md
|
||||
|
||||
# AGENTS.md
|
||||
|
||||
## Scope
|
||||
MiniMax H3 Continuum V3.7.0 for ComfyUI. Treat the accepted V3.6 generation defaults as the current Production baseline; preserve V3.6.1/V3.5.3/V3.4 node IDs, public contracts, and saved-workflow loading without letting legacy or Experimental controls change current behavior. Still Image Guide remains Experimental / Production HOLD.
|
||||
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.
|
||||
|
||||
## 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.
|
||||
- Do not implement a new user-facing hard stop. If execution is structurally impossible or continuing risks corrupting stored data, document the exact broken internal contract and obtain explicit approval before changing the stop.
|
||||
- Prompt content must never block execution. Empty, malformed, incomplete, or unknown prompt syntax falls back to a Fixed prompt and is passed through as entered. Valid Timeline/List/JSON syntax is still parsed normally.
|
||||
- Keep warnings diagnostic-only unless execution cannot continue safely. Hard stops are limited to corrupt internal contracts such as invalid latent/layout topology, incompatible Assembly Plan data, broken stored revision schema/hash, unusable required payloads, or decode formats that cannot be assembled.
|
||||
- Unknown upstream nodes, models, wrappers, or merged models must not be rejected solely because they are unknown.
|
||||
- Keep legacy `strict_compatibility` inputs loadable for old workflows, but ignore their value. They must never enable blocking behavior.
|
||||
- Before every change, run `tools\snapshot.ps1` against the authoritative source. Preserve the compact V3.4 UI unless the user explicitly approves a UI change.
|
||||
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.
|
||||
|
||||
## 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.
|
||||
- Do not implement a new user-facing hard stop. If execution is structurally impossible or continuing risks corrupting stored data, document the exact broken internal contract and obtain explicit approval before changing the stop.
|
||||
- Prompt content must never block execution. Empty, malformed, incomplete, or unknown prompt syntax falls back to a Fixed prompt and is passed through as entered. Valid Timeline/List/JSON syntax is still parsed normally.
|
||||
- Keep warnings diagnostic-only unless execution cannot continue safely. Hard stops are limited to corrupt internal contracts such as invalid latent/layout topology, incompatible Assembly Plan data, broken stored revision schema/hash, unusable required payloads, or decode formats that cannot be assembled.
|
||||
- Unknown upstream nodes, models, wrappers, or merged models must not be rejected solely because they are unknown.
|
||||
- Keep legacy `strict_compatibility` inputs loadable for old workflows, but ignore their value. They must never enable blocking behavior.
|
||||
- Before every change, run `tools\snapshot.ps1` against the authoritative source. Preserve the current V3.8 backend schema and serialized widget order until a separately approved UI/public-surface implementation changes them.
|
||||
- In public templates, connection examples, screenshots, and documentation, keep ComfyUI Core nodes on their standard display titles. Do not assign custom titles to Core nodes, because users must be able to distinguish Core nodes from Continuum and third-party custom nodes immediately.
|
||||
- Runtime tests must record the workflow, prompt, media inputs, model/LoRA/sampler/step settings, dimensions, chunk count/duration, elapsed time, and observed result. Inspect embedded workflow metadata when present.
|
||||
- Do not globally replace `PackedLayout`, `MiniMaxH3.extra_conds`, or other ComfyUI classes.
|
||||
- Keep SageAttention, Sol-Attn, and Spectrum external; integrate through public ComfyUI wrappers and H3 payload contracts.
|
||||
- Preserve the identity of `layout.position_ids` when changing MM-RoPE coordinates.
|
||||
- Never silently resize a continuation State or Session to a different resolution.
|
||||
- Unknown H3 layout contracts must fail clearly instead of rendering a subtly incorrect join.
|
||||
- State and Session files remain safetensors + JSON and are written atomically.
|
||||
- UI nodes call reusable non-UI modules. Legacy nodes and V3.4 must share temporal, state, continuation, and layout logic where their contracts overlap.
|
||||
- V2 must not decode Video/Audio VAE between H3 chunks.
|
||||
- Accepted full chunk latents remain on CPU; do not accumulate generated chunks in VRAM.
|
||||
- Spectrum history must remain run-scoped through its public sampler wrappers; never import Spectrum private runtime functions.
|
||||
- Changes must preserve V1 node identifiers and State schema unless an explicit migration is included.
|
||||
|
||||
- Do not globally replace `PackedLayout`, `MiniMaxH3.extra_conds`, or other ComfyUI classes.
|
||||
- Keep SageAttention, Sol-Attn, and Spectrum external; integrate through public ComfyUI wrappers and H3 payload contracts.
|
||||
- Preserve the identity of `layout.position_ids` when changing MM-RoPE coordinates.
|
||||
- Never silently resize a continuation State or Session to a different resolution.
|
||||
- Unknown H3 layout contracts must fail clearly instead of rendering a subtly incorrect join.
|
||||
- State and Session files remain safetensors + JSON and are written atomically.
|
||||
- UI nodes call reusable non-UI modules. Legacy nodes and V3.4 must share temporal, state, continuation, and layout logic where their contracts overlap.
|
||||
- V2 must not decode Video/Audio VAE between H3 chunks.
|
||||
- Accepted full chunk latents remain on CPU; do not accumulate generated chunks in VRAM.
|
||||
- Spectrum history must remain run-scoped through its public sampler wrappers; never import Spectrum private runtime functions.
|
||||
- Do not treat V1-V3.7 public Node IDs as V3.8 compatibility requirements. Removing their V3.8 registration still requires an explicit audited public-surface change; historical implementations may remain internally while V3.8 depends on them. Preserve State/Session data safely unless a separately approved migration replaces it.
|
||||
|
||||
## Project files
|
||||
|
||||
- `AGENTS.md`: durable rules and prohibitions only.
|
||||
- `PROJECT_STATE.md`: current paths, version, active direction, and known gaps.
|
||||
- `WORKLOG.md`: append-only summaries of completed work and evidence.
|
||||
|
||||
- `AGENTS.md`: durable rules and prohibitions only.
|
||||
- `PROJECT_STATE.md`: current paths, version, active direction, and known gaps.
|
||||
- `WORKLOG.md`: append-only summaries of completed work and evidence.
|
||||
- Do not duplicate long history across these files. Update `PROJECT_STATE.md` when facts change and append one concise entry to `WORKLOG.md` after completed work.
|
||||
|
||||
## Product direction
|
||||
|
||||
- Product definition: H3 Continuum is a Production Sampler that generates, reviews, partially regenerates, and resumes long-form video without restarting the entire work.
|
||||
- Keep one discoverable Main surface plus an in-node `Advanced` disclosure. Do not require users to discover a hidden node property before normal Production controls become usable.
|
||||
- Evaluate new work against three pillars: `Continuation Quality`, `Non-destructive Production`, and `Open Integration`. Prefer external integration or `Deferred` when work does not clearly strengthen one of them.
|
||||
- `Main / Production` must be simple by default and expose Production controls when expanded. Do not develop a separate Easy product path. Its primary flow is Continuation Quality, Review/Regenerate, Resume/Branch, and Finalize.
|
||||
- `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.
|
||||
- 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.
|
||||
- Main UI disclosure state is presentation-only. It must not enter Sampling or Run Storage identity, alter backend kwargs, or rewrite values of hidden widgets. Connection-specific size controls must be visible when their corresponding input is connected.
|
||||
- Keep the accepted V3.8 Main facade explicit rather than inference-driven. Its first controls are `Prompt Format`, `Continuity`, `Base Seed`, `Control After Generate`, and `Audio Continuity`, followed by independent `Chunks` and `Seconds per Chunk`, a read-only calculated `Total Length`, an always-visible `Size Source = First Image | Manual`, the applicable Resolution or exact Width/Height controls, Run, Progress, a clear Queue-ready summary, and one Advanced disclosure. Do not show permanent connected/unconnected input badges, infer an Input Mode, derive chunks from a total-duration selector, or automatically change Size Source when an upstream node is bypassed or disconnected. When the canonical backend revision is `review_ready`, replace the setup facade with the amber review status and the three explicit Queue actions; do not infer this state in the frontend.
|
||||
- Keep Main UI numbers compact: Chunks and pixel dimensions are integers, and Seconds per Chunk shows a decimal only when one is meaningful. Use user-facing `Full Video`, `Review by Chunk`, and `Resume & History` labels while preserving their existing backend values. Review action buttons must remain hidden until the canonical Run Storage revision reports `review_ready`; never infer readiness from frontend widgets alone. Hide empty Render History and keep Advanced settings behind the visible in-node disclosure.
|
||||
- Every visible V3.8 Main, Advanced, Review, and Render History control, plus every public Sampler input, must have non-empty mouse-over help. Context-sensitive controls must explain the currently selected behavior; `Output Size` must explicitly distinguish First Image for I2VA/FL2VA from Manual Width/Height for T2VA or workflows without a First Image.
|
||||
- Completed-review UI exception (2026-09-07, user-authorized repair): a canonical backend revision with status `complete` must retain its completion panel, Back to Settings/Return to Review, and non-empty Render History. Show Try this chunk again only when that revision carries a valid review_unit, as already supported by the backend. Hide the no-op Continue/Finish buttons on completion. This extends the earlier review_ready-only presentation rule; never rewrite backend status, infer readiness from widget counts, or invent a retry unit for a full-run completion.
|
||||
- Keep Core node display names unchanged in every public workflow.
|
||||
- User-approved distribution exception (2026-09-07): publish the supplied Spectrum graph as `MiniMax_H3_Continuum_V38.json` and the user's matching ZIP, byte-for-byte, including its existing titles, prompts, media names, and saved settings. It is one graph with external Spectrum, rgthree, KJNodes, and ComfyUI-Easy-Use dependencies, not a Core-only template. Document setup differences instead of silently rewriting the workflow. Keep unrelated backup ZIPs out of new commits/packages.
|
||||
- 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
|
||||
|
||||
- After every implementation or Gate is complete and its local validation report is ready, send that self-contained completion report to the pinned ChatGPT task titled `H3情報チェック` before starting the next phase.
|
||||
- The fixed current destination is task ID `6a94b91e-af7c-83e8-be18-ddc504f690c4` (pinned index 3). A second older task has the same title; do not send to the unpinned duplicate.
|
||||
- Wait for and read the review reply, then bring its conclusions and requested corrections back into the active Continuum task as feedback. Treat the reply as review input under the user's authority; preserve the repository rules and request approval where a proposed change expands scope.
|
||||
- Do not duplicate a handoff that the user explicitly says they already completed manually. If the destination is unavailable or the reply requires user judgment, stop and report that condition instead of silently skipping the review.
|
||||
|
||||
## 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; 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.
|
||||
- Exclude the failed Issue #13 candidates from A8b: effective 13-frame history, 22-frame Video prefix with 75% preservation, Soft Re-anchor, and Production Fixed Prefix/teacher forcing.
|
||||
- Before A8b GPU Sampling, either complete reporter-exact Issue #13 R3 or prove by static and replay evidence that the proposed intervention is independent of the recursive-feedback path. Then pass an A8a Shadow/Replay Gate with no unnecessary action, Terminal misclassification, or Run Storage replay difference.
|
||||
- Any approved A8b implementation starts Experimental and Default OFF. Existing Production must remain bit-exact, public schema changes require separate approval, and external Sage/Sol/Spectrum wrappers must remain intact.
|
||||
- Keep A5 Reference Video Influence Schedule/Fade on HOLD until reporter-exact Issue #13 R3 classifies Reference Video as unrelated, an amplification-only factor with a defined safe range, or a necessary/strong cause candidate. Only the first two outcomes may unlock Experimental A5 work; the last keeps A5 on HOLD.
|
||||
- A5 OFF must remain bit-exact with Production. Initial A5 may change only Reference Video influence; it must not change Video continuation, Audio, Seed, SIGMAS, Terminal Merge, Assembly, or Run Storage. Do not implement A5 and A8b concurrently.
|
||||
- A5 promotion requires at least `3x5` plus a long-form continuation GPU Gate covering trajectory, identity, saturation, contrast, sharpness, and highlight drift. Short-form evidence alone is insufficient.
|
||||
|
||||
## Validation
|
||||
|
||||
```bash
|
||||
powershell -ExecutionPolicy Bypass -File tools\validate.ps1
|
||||
```
|
||||
|
||||
Runtime installer verification must check native PackedLayout behavior and all registered nodes.
|
||||
|
||||
|
||||
```bash
|
||||
powershell -ExecutionPolicy Bypass -File tools\validate.ps1
|
||||
```
|
||||
|
||||
Runtime installer verification must check native PackedLayout behavior and all registered nodes.
|
||||
|
||||
GPU checks must cover Sage only, Sage+Sol, Sage+Spectrum, and Sage+Sol+Spectrum with identical prompts and seeds. V2 must also be compared against the equivalent V1 3×5-second graph.
|
||||
|
||||
## Reusable local environment
|
||||
|
||||
- Source repository: `D:\Codex\_git_push_work\ComfyUI-H3-Continuum`
|
||||
- Once the user has explicitly approved a GPU run, free-VRAM and process-RSS readings are advisory. Do not refuse to start or stop an otherwise healthy run solely because a numeric free-VRAM/RSS threshold was crossed. Continue unless an actual CUDA/PyTorch/Windows OOM or allocation failure, backend crash/health failure, NaN/Inf, or a structural layout/AV/duration integrity failure makes the run unsafe or invalid.
|
||||
|
||||
## Reusable local environment
|
||||
|
||||
- Source repository: `D:\Codex\_git_push_work\ComfyUI-H3-Continuum`
|
||||
- Primary tested runtime: `D:\StabilityMatrix\Data\Packages\ComfyUI_W\custom_nodes\ComfyUI-H3-Continuum`
|
||||
- Secondary runtime: `D:\StabilityMatrix\Data\Packages\ComfyUI_WAN\custom_nodes\ComfyUI-H3-Continuum`
|
||||
- User-organized V3.8 test videos and related test artifacts are under `D:\output\video\comfy_video\v38`. Reuse that path when inspecting prior V3.8 outputs; do not move, rename, or delete its contents without explicit approval.
|
||||
- Restart ComfyUI_W with `D:\StabilityMatrix\Data\Packages\ComfyUI_W\venv\Scripts\python.exe`. Do not launch the base executable reported by `Get-Process.Path`; it omits the venv dependencies even though it is the resolved process image.
|
||||
- When the source adds or changes runtime imports, do not synchronize only the visibly changed files. Install the complete current `REGISTRY_MANIFEST.sha256` set, or first prove a dependency-complete narrow set; then verify registration through the live ComfyUI `object_info` endpoint. A standalone verifier launched from the source checkout is not sufficient evidence for a mixed installed runtime.
|
||||
- Reuse the repository's existing pytest configuration and helper scripts instead of rediscovering paths on every task.
|
||||
- Read this file before each task. Record durable project decisions, paths, commands, failure causes, and validation methods here so later work reuses them instead of restarting from zero.
|
||||
- GitHub authentication for this repository is already configured. Do not request a new login or token unless an actual authentication command fails.
|
||||
- Commit and push only when the user explicitly requests publication.
|
||||
- Read this file before each task. Record durable project decisions, paths, commands, failure causes, and validation methods here so later work reuses them instead of restarting from zero.
|
||||
- GitHub authentication for this repository is already configured. Do not request a new login or token unless an actual authentication command fails.
|
||||
- Commit and push only when the user explicitly requests publication.
|
||||
|
||||
@@ -1,5 +1,33 @@
|
||||
# Changelog
|
||||
|
||||
## 3.8.0
|
||||
|
||||
### Added
|
||||
|
||||
- Established the seven-node V3.8 public surface: Sampler V3.8, Finalize, Load Image, Load Audio, Load Video, Second Pass, and the modular Reference Audios helper. Unreleased Easy facade prototypes remain in source but are not registered.
|
||||
- Added `H3 Continuum Sampler V3.8` with shared `Draft` 0.30 MP, `Balanced` 0.60 MP, `Native 768`, and `Custom MP` resolution presets.
|
||||
- Added `Review Each Chunk`, `Continue / Next`, `Regenerate Current`, and `Finish Remaining` controls backed by Run Storage review branches and canonical-head recovery.
|
||||
- Publish one user-supplied V3.8 Spectrum workflow unchanged as JSON and ZIP. It requires Spectrum, rgthree, KJNodes, and ComfyUI-Easy-Use; the same graph can be switched to a task-matched LightX2V Turbo LoRA.
|
||||
- Added Continuum Image, Audio, and Video loaders with explicit native bypass behavior for optional workflow inputs.
|
||||
- Added `H3 Continuum Reference Audios`, which bundles up to three ordered Core-native standalone audio references behind one appended V3.8 Sampler socket while preserving the legacy single-reference path.
|
||||
- Replaced the Main `Landscape / Portrait / Square` choice with a two-path `Size Source`: preserve the connected First Image aspect at the selected preset, or enter an exact aligned Manual Width and Height.
|
||||
|
||||
### Improved
|
||||
|
||||
- Integrated Driving Audio with Review, Smart Regenerate, Finish Remaining, and restart persistence.
|
||||
- Preserved FL2VA Long Terminal Merge as one atomic physical review unit, including Smart Regenerate of the complete terminal pair.
|
||||
- Reused one resolution resolver across Easy and normal V3.8 samplers while leaving the V3.7 schema and Production path unchanged.
|
||||
- Extended Run Storage with Review lifecycle metadata, prefix reuse, nonce branches, and latest canonical-head restoration without changing the sampling identity contract.
|
||||
- Added a frontend-only `Basic / Production` node property for Sampler V3.8. It changes presentation only and preserves the Python schema, widget order and values, backend inputs, Sampling identity, and Run Storage identity.
|
||||
- Added Registry packaging rules that exclude tests, tools, diagnostics, Labs assets, and historical workflows while retaining all runtime-imported implementation modules.
|
||||
- Kept the old V3.8 Aspect input as a hidden compatibility field. Saved Auto workflows migrate to First Image, while saved Landscape, Portrait, and Square workflows migrate to the same resolved Manual canvas.
|
||||
|
||||
### Notes
|
||||
|
||||
- Second Pass / `refine_context` is not supported on a partial Review sequence. Complete Review before running Second Pass.
|
||||
- The 16GB GPU Gate passed with small headroom: Strict Minimal peaked at `14.96 GiB`, and complex accepted gates reached about `15.5-15.6 GiB`. Results vary by environment and are not a universal 16GB guarantee.
|
||||
- Still Image Guide remains Experimental. V3.7 and earlier Node IDs are not exported by V3.8; workflows using them can appear with unknown nodes and should be opened with the matching historical Release/tag.
|
||||
|
||||
## 3.7.0
|
||||
|
||||
- Added `H3 Continuum Sampler V3.7` with one optional Still Image Guide input while preserving the V3.6 required-input schema, Production defaults, and saved-workflow compatibility.
|
||||
@@ -52,136 +80,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.
|
||||
|
||||
@@ -1,22 +1,36 @@
|
||||
ComfyUI-H3-Continuum 3.2.1 — インストール
|
||||
ComfyUI-H3-Continuum V3.8 — インストール
|
||||
|
||||
1. ComfyUIを終了します。
|
||||
2. ZIPを展開します。
|
||||
3. `ComfyUI-H3-Continuum` フォルダーを ComfyUI/custom_nodes/ に配置します。
|
||||
4. 旧 `ComfyUI-H3-Continuum-Join` が残っている場合は退避します。
|
||||
5. ComfyUIを再起動します。
|
||||
6. 旧UIが残る場合はブラウザをハードリロードします。
|
||||
2. 既存の `ComfyUI-H3-Continuum` を更新する場合は、作業中のworkflowとRun Storageを先に退避します。
|
||||
3. ZIPを展開し、`ComfyUI-H3-Continuum` フォルダーを `ComfyUI/custom_nodes/` に配置します。
|
||||
4. ComfyUIを再起動します。旧UIが残る場合はブラウザをハードリロードします。
|
||||
|
||||
StabilityMatrix標準例:
|
||||
D:\StabilityMatrix\Data\Packages\ComfyUI_W\custom_nodes\ComfyUI-H3-Continuum\
|
||||
StabilityMatrixの配置例:
|
||||
`D:\StabilityMatrix\Data\Packages\ComfyUI_W\custom_nodes\ComfyUI-H3-Continuum\`
|
||||
|
||||
自動インストール:
|
||||
install_windows.bat
|
||||
PowerShellによる自動インストール:
|
||||
`install_windows.ps1`
|
||||
|
||||
標準検証:
|
||||
V3.8の公開ノードは7個です。
|
||||
|
||||
- H3 Continuum Sampler V3.8
|
||||
- H3 Continuum Reference Audios
|
||||
- H3 Continuum Finalize
|
||||
- H3 Continuum Load Image
|
||||
- H3 Continuum Load Audio
|
||||
- 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を入力)で指定します。
|
||||
|
||||
配布Workflowは `examples/workflows/MiniMax_H3_Continuum_V38.json` と同じJSONを含む同名ZIPです。このZIPはWorkflowだけを格納しており、手順3のカスタムノード本体ZIPとは別物です。Spectrum初期設定のgraphをそのまま配布するため、Spectrum、rgthree、KJNodes、ComfyUI-Easy-Useを別途導入してください。Turboへ切り替えてもこれらのノードはgraphに残ります。モデルや画像・音声は含みません。保存済みファイル名は各自の入力へ置き換え、不要な入力はOFFにしてください。
|
||||
|
||||
最小確認:
|
||||
- chunks: 2 または 3
|
||||
- chunk_seconds: 5.0
|
||||
- continuity: Balanced — 22 frames
|
||||
- Audio Seam: Off(標準)/ Auto(音声境界補正を試す場合)
|
||||
- Sequence Prompt: Text (Multiline)を接続
|
||||
- 最終Video/Audio VAE DecodeはComfyUI Coreノードへ接続
|
||||
- 最終Video/Audio VAE Decodeと保存はComfyUI Coreノードへ接続
|
||||
- Reference Audioを複数使う場合は `H3 Continuum Reference Audios` helperへ最大3本を接続
|
||||
|
||||
同一機能の旧フォルダーや旧Manager導入版を重複配置しないでください。V3.7以前のNode IDを使う保存workflowは、その対応Release/tagで開いてください。
|
||||
|
||||
@@ -1,21 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2026 ukr8b3g-cmyk
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2026 ukr8b3g-cmyk
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
|
||||
@@ -1,188 +1,256 @@
|
||||
dca65fb1393e67f59c6f81f9411e3e745eb8f1097e9a2adf7ffc6f4e3901ca9f __init__.py
|
||||
4f6feeb2f63a9285b0e76fb2e2618058c7d7c279af1632e1a6ccabcc9ec9a45a .github/workflows/tests.yml
|
||||
0a2f69d4cec89d440f5d5aa1ec68a7c9a741382d313f80dcddf96d13f70b3e68 .gitignore
|
||||
53bab1717a2e87602a45837a13998ac3f251cda354e1f547a23f8631bd5f2456 AGENTS.md
|
||||
972c437a560f4fa096a663498b39688f98e68078bfd14c54342cf98ee5cc046e CHANGELOG.md
|
||||
e97e47c7585e81d9ec5fd32c0ca0b64699fd4610cd03e9d6575a91c30a10ca4e compatibility.py
|
||||
4d62508f900af9f93ec320afb900c27cc9a300d1e0c0a94714258498c5ede5fc conditioning.py
|
||||
64967f4987e3ad9316f3a47f0dcf582eeff39ee0c3485f4184d3532d495534ae constants.py
|
||||
cf255b8a635471229aebadc926acfdcacb65963adbcb9e0f9505d04eada2c6b5 continuation.py
|
||||
bf0556b076dbaca67c3405a7d86c333ca7fdf3d4381529b0a9edc906519943e9 guide_timeline.py
|
||||
f9375629fa1a2c4d3538442f0c3192d7ba2f46fe9544fb2e21f0c144b53d608c docs/AB_TEST_LOG_JA.md
|
||||
c93a3e52e4deabe5ef0db7f34a7605856a543089574ba17227e697e9a2c0139a docs/ARCHITECTURE.md
|
||||
7660570840229b6fcbe62f0fbb52966d0099d64d7e6f01a739fbf9899293c8e4 docs/FUTURE_ROADMAP.md
|
||||
9a634b4ff6c9ca98285f6b250402a3d0e67d29f031e134d9bfcab54c119ed337 docs/images/comfyui-manager-h3-continuum.png
|
||||
6c72d9a9e35648355c4dd4c8f060a6b7667e322f4b6c86690df9d6769ba182b7 docs/images/h3-continuum-advanced.png
|
||||
b9f1dca35706a1cd963ba892d218568ea30173c6cf6a3bdc896f7a2266eb9407 docs/images/h3-continuum-detailed-report.png
|
||||
de5f8fbce6bc423817acf7dc86bb0c8805a1fd962afdb2722cde7395f117eb56 docs/images/h3-continuum-image-scale.png
|
||||
a384e26f3b088607c616be1a2b038365147d92da0961d8f47060fed09f795062 docs/images/h3-continuum-sampler.png
|
||||
46c52e21c8f99a75c678e7abf20e381c8140860be2662bad528a6cbfc5f3295d docs/images/h3-continuum-v33-settings.png
|
||||
321311da5d2c30953dc2061ca8fdd6e10b84511a15a9bc87704f000dd687cd0a docs/images/h3-continuum-v33-streamlined-ui.png
|
||||
e93b6f4f8da5b2191f2d7715476eff1ab6c44fd96db689618a4bc0aa307c7b5d docs/images/v31b-auto-resume.png
|
||||
c9573d4393236276d032c4503f8ed8bd19c6ef24e84eec6f64f8a4c47aabc718 docs/images/v34-driving-audio-connection.png
|
||||
1b9bff0d32ab1928dd85d04700be563458484748a7bfafe4db293c4950ce6bc8 docs/images/v34-regenerate-from.png
|
||||
65efc844c3f116e0a46bc35390bb46e3968df44fd44ea65a63629a3953371605 docs/images/v34-sampler-spectrum-assemble.png
|
||||
ff8d901d05aa89f9b698c60b3d11534ef97982b3e22e9ede6255a85149a669c4 docs/images/v34-video-reference-separate-audio.png
|
||||
06c333b3dda41526da70d56f4aa25922aafa2f48ec2d99350b0ed6b428e92bad docs/images/v34-video-reference-with-audio.png
|
||||
301afedc3e0922a4bf3bcf445734b5adcdd5c35384132b24a38098c66750f499 docs/images/v34-workflow-overview.png
|
||||
4e0d904d3bad89cb8c3ffe17fb645bfb6fbc87fe49fe3c75c91094b983726025 docs/images/v35-assemble-seam-node.png
|
||||
a53796f7a904d675e80a2276c20d68502f03a3958529278e6ce9465baaf1c4af docs/images/v35-hires-fix-node.png
|
||||
5a23f232a8b795226e8255e6e2e3248b0130f1c7ce276d50370d0333d6a62ef0 docs/images/v35-second-pass-node.png
|
||||
04a34b1b55b627553d08b7b10de71295d55ea9e4ac9815b6dd8ce6d268098851 docs/images/v351-lbh-conditioning-bridge-flow.svg
|
||||
b16d63242b45fe1abef0a4dddd4fc5b9306aa30c2f84bbc3ddf334a1c0832957 docs/images/v351-reference-audio-permanent.png
|
||||
ed189c7f16ba1f6e48f557312066fdb5e1313b5ea7df853a99467fd0d7532ef5 docs/images/v351-video-guide-frames.png
|
||||
0c1dfd5acff349b98ecdfb57ae50941f6da26a462dfd2aaa9b7c7b0a34abf304 docs/images/v352-stabilization-optimization.png
|
||||
96395c3682fb0b6375dc23eacabea6ca9ee165078ff04e94458f178eef35c4ae docs/images/v36-masked-av-continuation.png
|
||||
925898dfe741fdbcc9b429133cfcbfb8ff718a3b476b368a063b46d39511e2f9 docs/images/v36-sampler-node.png
|
||||
edf8bcf1e9d76609a4e54ecd14a0ef6e82c9446c64355ff6ce5e25682e95a932 docs/images/v37-sampler-node.png
|
||||
a8defccf63167a1bbd5db3bcba56781887f6ac5ee3f41de29683e0266d850198 docs/images/v37-tail6-second-pass.png
|
||||
93f07aa727b34802bce3d333426b8ba2af522500882a6d222d00cf577ca82e49 docs/SEAM_TEST_SOURCE_JA.md
|
||||
2c13aefd137db92a3dbf5576e9442d58012b1f0de1240c07d039ceeb702e7c1f docs/V2_1_4_UI_SIMPLIFICATION.md
|
||||
b08022df068576c759c8bf80ac6b6519693f3c65c917f1822aeb06ea359aa5b1 docs/V2_1_5_UI_SERIALIZATION_STABILITY.md
|
||||
a032738b0bc5acb136e92d8bf7694643a5f518b9c7fc0fc878d66d81ba8b1b04 docs/V2_1_6_UNIFIED_UI.md
|
||||
384e3841603f7c6c8286ef147e93aaf7d056a286503a2a4fc21f397e4dec4876 docs/V34_DRIVING_AUDIO_VALIDATION.md
|
||||
1840c81b4090ff3c86c0c1b0acc2cc10d3d9839e383c81f262a5c59a67504cd6 docs/V35_HIRES_FIX.md
|
||||
f0806bb2b999794ddda072e98424dbd1b613df1cd8a096b12d979f124e066d8a docs/VALIDATION_JA.md
|
||||
3fec541a675c1e4e5e287cc8e498036001f34f7a62460321e16f9ba27b5e4c18 docs/VALIDATION_RESULTS.md
|
||||
cedd7b07901d6065079ef37380f0062d535a39c98c8f614e1b26582f549d7183 driving_audio.py
|
||||
6771c9905d35666121c4892d2ec26202505f96d244ce814ad9a87a02878952cd examples/H3_CONTINUUM_V1_WIRING.md
|
||||
f85ba3c69a473f0ac4bb96895c6d6532e8270121da65f858e364b19d31f05ef5 examples/H3_Continuum_V2_3x5s.json
|
||||
be419d6c773784823af7b58a3423ef2e21d3cc3e23c40e60e274560895ca034b examples/H3_Continuum_V2_README.txt
|
||||
4b94f779a98bfc555f6999113a694da07746cc3cf400bfc70ebc580592034d52 examples/H3_Continuum_V2_reference.webp
|
||||
c3cefcdf50df9d6609f583a008453b587c011a0fb41e290d5f1196ce62f58877 examples/H3_CONTINUUM_V2_WIRING_JA.md
|
||||
20f4e7c4ad085791f8b578f575d03e52ef09d0d4550aa58ad086c9857b59bf29 examples/H3_Continuum_V2.json
|
||||
f67febfdd7b2bfca2ad4e477c87a9a74dbe636231f9db3e1158b944d7b9f8397 examples/H3_Continuum_V2.zip
|
||||
68e1a724d3b99458b86b8f643dcb916183e7e8dd12d7b4b3850991feb8077694 examples/recommended_settings_v1.json
|
||||
5a26408c770381cdb259cb710de7dab12d7ddecca262bdbf35ba1566056050f5 examples/recommended_settings_v2.json
|
||||
b8275c8cecde12aee0418cea456d1e7f4b875cbb1bce32f1f3d9e06a44dd0be1 examples/v2_prompt_list_example.txt
|
||||
0e59ea821081cb93165aa3f88c6949736dd225837fe1cdcf1173aa5cd54c6d29 examples/v2_prompt_timeline_example.txt
|
||||
55bc60447d6cd783b9df049d04b6cebb6e4a633981434ac2b28e5a1527d4f4b4 examples/workflows/MiniMax_H3_Continuum_V32_turbo.json
|
||||
4e410aed8d7f6ebf11c98d4f71571e46855e4619c2bcbec921df70f29189b6b1 examples/workflows/MiniMax_H3_Continuum_V32.json
|
||||
55bc60447d6cd783b9df049d04b6cebb6e4a633981434ac2b28e5a1527d4f4b4 examples/workflows/MiniMax_H3_Continuum_V33_turbo.json
|
||||
4e410aed8d7f6ebf11c98d4f71571e46855e4619c2bcbec921df70f29189b6b1 examples/workflows/MiniMax_H3_Continuum_V33.json
|
||||
3d57fa510f98e0874b73ae74c9402f14611c167ef99269dc9ba025ffcaa34973 examples/workflows/MiniMax_H3_Continuum_V34_turbo.json
|
||||
a8460ca5092511f6d22da3363331ba8bff4feab01c569e539811049ea1add051 examples/workflows/MiniMax_H3_Continuum_V34.json
|
||||
ea8c245d36909672710bc9f535f37195e48d7151b0cb2217bcaaca5fcc6d02c0 examples/workflows/MiniMax_H3_Continuum_V35.json
|
||||
9f1a0766b97ead788989fb6eb69a6b36ad236d7a924eea4a88e4a1696e2db6d8 examples/workflows/MiniMax_H3_Continuum_V351_LBH_Conditioning_Bridge.json
|
||||
1c7f1810f0cdd0bdcee09fe9eb8cb052993dd7343753dc0ec0157e00fe702da3 examples/workflows/MiniMax_H3_Continuum_V36.json
|
||||
e8f41dee2240f1fcc6e8fd12448856513483ff3ae0427b2c554bb351f9ae8047 graph_contract.py
|
||||
3d14acac341c63207995e2bd45cd407fdb3e2308273b1c90605adfe6f2e0bd8f hardening.py
|
||||
6abdbc29472c7f9d447085b189fc47b69e110b94ef83192f9689d04000408843 INSTALL_JA.txt
|
||||
23bddc5a41d2e997f4fbf789c7128e32f4f197f1405b2aef1c76794f57482446 install_windows.bat
|
||||
d74073e7ee292ebeba913af4288284f9f197cd91fceed6c62bf6c66b784c7cec install_windows.ps1
|
||||
6aa3f5780baa7bb0c0672b5f01a2f77e5f209da93f6373468cb274ea2f643d4b layout_adapter.py
|
||||
c44abbd789091bbead01250dbd5453e60539d2665c69f162335fdbd2936019c2 LICENSE
|
||||
d3e213005670e94dee33a240349a4d245cf9a3b6602099f11ed30cf5a32e2c21 media.py
|
||||
3b3ed9c27bb29b9d77f146c4aada1ce20adb9ffc551465cdcad699971869c256 metadata.ini
|
||||
b08f4deb90628aa2cd6e219f59c3109fdda8c1e9a6571ba784a560d55b2b7f9d model_patch.py
|
||||
9332e48af66e5a179e142c377abd830a2b9f0e5baef0640d8ac907be33120cf2 nodes.py
|
||||
d2b235868cf6c21971f9ec7620c487382f3fb83c7cf7cbf87af0ed1cc0cdbd38 PACKAGE_INFO_JA.txt
|
||||
ddc9ec3c96cf8f00dc082e0c4576cbf4952f79d8a6990c2e69901cc45fa33c98 PACKAGE_VALIDATION.txt
|
||||
b470819f16fc179654dc1600721a63f0a5a14e777f4c004d574b499da6886ba5 public_api.py
|
||||
1840e43c3cdcea05c098a579e2dc9df4562f0aa0f00e12c42dd5bc5bb1efb8af pyproject.toml
|
||||
94fdc2d545b2d4077a4d70229fd22ba3ccac21d49d1097d2873f76d04e9a3c7a pytest.ini
|
||||
a2df354b9fccd7cf26c20dc917179ca8859b42a5cdb6891c05f73f6b5f8f1658 README_JA.md
|
||||
92114c808f65f24782b13fd00610883c0452cf32fb73bce0186f8beab84f94fc README.md
|
||||
5d89c366b4f076fa73a2695557e0af749bf95df1dad0d55dbb2fe5b1c2519ad7 reference_audio.py
|
||||
a0266ab4434b8e9844219d2b6dd8a168d198dd8f142775be01a39b81dc196b91 reference_video.py
|
||||
564f5f2bf29665059845a98b9ca3e9a1309566aab73bcaa96f95fab8251ab06c reference.py
|
||||
467edb2c188d024c2392aafe7423b3f835e16b10f570da76e2f7dda8a962c1c5 requirements.txt
|
||||
f28afe2c0033f1aa0ef3053e9005badd51242d4431a6d191af375ab2a59f50b3 run_storage.py
|
||||
6056de6c0a5322a8a51ba5a114538dca2ef67788cd1afba10fedd483b95f6afa state_io.py
|
||||
3a359a0467725cc292ccb4c86cf0c3d30bb6a114d01f5345792b09ea3d45441d state.py
|
||||
43ec4023dc06c941e5d7a04db4b8a89fb58d744ceb986f6eb9bf534d4fdcb87b temporal.py
|
||||
3eeed61b7ee519631825e5f89e9a441644c66e552fce4207927cb8536867c8b1 tests/conftest.py
|
||||
041289556cc621ea1857cbb8931ae41d817f69e084b2e8a7622e184a3197b61b tests/test_compatibility.py
|
||||
875ac33b5458ec5e8d845850ed495707c394436aaadb668a44f36f6a1b73764d tests/test_conditioning_modes.py
|
||||
2be669b6d21ec40a8b0e172b8ab431f82681f3c97c7de0935d87ad43b0ae8b4e tests/test_context_diagnostics.py
|
||||
c058f189d8e58fd48a80c20c0a857969737a8b13960eee60e5c17db2b9288bc1 tests/test_layout_adapter.py
|
||||
2dddf05bbb91b7aa803959a7a8ed78489792ea9c35c5634bfb7d5b1a6c81880f tests/test_model_patch.py
|
||||
45e8839cd82fd955df344b3bc6efa20092b8870ea378b0c898b073665d3e47d7 tests/test_nodes_logic.py
|
||||
b635d404ca67df69894c4fcf80d8782cc5699e946bfb55ae4c44fff9d930b018 tests/test_p20_file_backed_tensor_poc.py
|
||||
69a6155d3719d75bc9783d55c327100ca3097b2a8d71e6b82c1e5daf5191a568 tests/test_p21_memory_attribution.py
|
||||
2b097971258dd10f0df33e0f8cb5843ee6cd3e9ef9e7abb80b890c66baf22908 tests/test_p22_file_backed_buffer.py
|
||||
d09d2bae2fac04a058ebce22fa0e761d90b267107923ab8cd01a99cc547624e6 tests/test_p23_assembly_v35.py
|
||||
d2a02c120e01d360ddca17a92d5bc53b12c9f0734d06440b3fc2fad2e754e549 tests/test_p23_video_seam_patches.py
|
||||
114530f8bc4b0a6cd416581636c85d494a07e5dcca93afe9c82f4a5aaaed9dc7 tests/test_p31_prompt_conditioning_cache.py
|
||||
403a0ff300330ac1f97642bf0681e80b83eec18e8911c03952ddf203ce794e5a tests/test_p46a_reference_video_memory.py
|
||||
1ae0369943ba2fb13f21ad0cf56ee58621ba09bf20174379595e157a1775c7fd tests/test_public_api.py
|
||||
892d3e3e022a527652dd995508c8bbb650c370caf9ee66fa3eb1f7fd288bba38 tests/test_public_workflow_integrity.py
|
||||
7681e942fea293e863ae28aee11ba9e69af2e0b7e1f99ac2c9e82cbe77c10ff1 tests/test_release_metadata.py
|
||||
d4c53d2c260b635d70fa211029d608f63776e0a56c20253475fa47c58363f8a7 tests/test_state_io.py
|
||||
5af6a16a2337e3483bb0f9197fe04756decd309e4737520c5557b527d68d51bb tests/test_state.py
|
||||
a1f60f01e9d86c1f2a010752612e373e85112c7054ffc31185b9b459eb2b34a5 tests/test_temporal.py
|
||||
970e8206c033c60d241732fc86f37018ffad2d66483ba235dd0eb39936ff718e tests/test_timeline_video.py
|
||||
dc8b9cf0e77b4983ee4eecc60f4acde7d0e063f3b7569402feca8a56165107fd tests/test_v2_decoder.py
|
||||
3cc94a6a7957ef285f58d373fbab001d926d2b43a754d60bb00bfce98675f32d tests/test_v2_prompts.py
|
||||
5dfdd4b108ba7444c0f5f371c3b1e244b5735d23136127b9818fd60738c78b68 tests/test_v2_registration.py
|
||||
86314c190d4335586c18191dc095926909c67fe839eb29e65324acd16c44f24e tests/test_v2_seam.py
|
||||
74e623120a963cb96b68651b44f47a836ea8449d30ce89d749c71ffad4766d4e tests/test_v2_seeds_motion.py
|
||||
b42bcc0983147462d96c6b71cc4a38e846995dafa6eebefc3ae0d9bb36caf359 tests/test_v2_sequence_orchestration.py
|
||||
0b5b20a8318862d167f135720e0489b8d4f93406d67c6646e052e35b03dcb876 tests/test_v2_session.py
|
||||
58438c3ed814adf40cefde098a37cae00ddcb703b7e5548bbbb295e54bed5a6d tests/test_v2_widget_migration.py
|
||||
1db3b655866b70b297dee9c01e3d79d10b4f7efbc481a0edf5ac8bac12a56926 tests/test_v217_stable_facade.py
|
||||
78bc478a5e4edda902c80849c911782a99e75c06dfb04127391b6cc5b27b28e1 tests/test_v3_hardening.py
|
||||
eb5b27f8f0d79529c56ef344a5601703642c3cba5388c9768116223e2ed58a36 tests/test_v3_video_seam.py
|
||||
144433f5b5bca50e1933778ff1ba4a852b3e2c4a0108f8b50ef0be3bc9b14e5d tests/test_v31_run_storage.py
|
||||
3af78ab85c8e19dee8d0a98bfd11a2c0e88c30d87256da1f9699c49a19a684e9 tests/test_v32_reference.py
|
||||
72719bcd6686d84f518d80751e3754b875d34c2aa72e2183dfa05ac9158a9eb0 tests/test_v34_driving_audio.py
|
||||
47c07c57934d4194ad56da2559b97631fc98b061ba1eb1b8390eab99d13648a6 tests/test_v35_compact_ui_frontend.py
|
||||
cf1ca6342a89e4cb02b398b32edbe91b6c1353535383e9f51d459466305a0114 tests/test_v35_conditioning_bridge.py
|
||||
f41ebbb64a9cab7dd74e97a149b25d8a15681b3a38003ec00b5baf4b6003b905 tests/test_v35_context_sampler.py
|
||||
a21c0722907ebb08fe24efbcf8b51494de546cde748a24d536e72270a9b784d1 tests/test_v35_hires_fix.py
|
||||
9ceac8c3c6e4e57ec8b53b48f3b547c204df36a3f6281328aa9ab5ebc2e6a0b6 tests/test_v35_latent_resize.py
|
||||
59a07f2172014dfdc0a447775324d7cd049f20b823276dfaf9b7b3f79628f5a8 tests/test_v35_pixel_vae_resize.py
|
||||
05ba609fb948665f050d58fb087569a158c040d08bebad1d728b911673b95462 tests/test_v35_refine_context.py
|
||||
8ae5173eaec35adf9efcde2c464c95651c848248bdbdd6396ed2e3c3c1ac7965 tests/test_v35_refine_sampling.py
|
||||
98a9006ebc4cab2b61b38904e0043fab24e088a25b28ffd38012c29991b8550c tests/test_v35_second_pass_contract.py
|
||||
a11956a22f373d96f13b395971f39187d6bb12cdc153ce794b4729d258ce9725 tests/test_v35_second_pass_sampling.py
|
||||
63d18643701c7d8be7b45046e6dc76616565572180afa06b7582600bd6c32431 tests/test_v351_reference_audio_ui.py
|
||||
5003c5f5ce1a4b4c77deb47011431e4a15fe0cecaeb6d689e0d0878567c42f5a tests/test_v351_reference_audio.py
|
||||
5f70cf8bd5248120ffcbe75ff3a54e23030fa6eb318ab0de6e0b08ee20e25a87 tests/test_v36_chunk_duration.py
|
||||
bf69d1ac3fc30f963b6fed6cbd661f273593904b03275467427a954fbdc0a03f tests/test_v36_masked_video_prefix.py
|
||||
46531e6d505cc383b559994c2c74a1619d49715dc6fca838b1df29d575d9dea2 tests/test_v36_public_sampler.py
|
||||
324c213aba761e8989a78eadc0cfdcc54d098f50ed1fe84a5ea7aec26f0dc595 tests/test_v37_guide_production.py
|
||||
14ce0c7f78bcba9948e9e9930c4de5a8c7e8c453fcb6172066d43f593f7175ea tests/test_v37_guide_timeline.py
|
||||
70b2413ad779bdde05bb131ef19db881c48e02004287d99626467303e23f8af6 tests/test_v37_refine_schedule.py
|
||||
0dbe8a5f71c92f3523942343b40787104c8b96781461ba3ba82934a6bdbe5834 THIRD_PARTY_NOTICES.md
|
||||
f218e1a93c42467c6057c5c1d04d57cc82f6331b97ec9257e4e2dfb9c831876a timeline_video.py
|
||||
e5a84569953ee63b9625f4f2e3195ec368204fddcfc746564cfbd0e8449bb8e9 tools/p20_file_backed_tensor_poc.py
|
||||
71e5270fe0b0768c761a06eccdf61a600413802c17b6acf689647d09f1a93d67 tools/verify_runtime.py
|
||||
ffd61f3f31c9b6430e1169007ee906c8f5000eba63ee44e2976ad4f5f1112671 v2/__init__.py
|
||||
2003902c87bba09cfa143f5a9e4248f3a78c0fb544449a75fd40ba2cacb35655 v2/context_diagnostics.py
|
||||
cde27db19b677e318cc4dfb4235be7a11429c19945f4083052a91fe117e74c82 v2/decoder.py
|
||||
31012ec48a64c7467ad869c79982b7f8502c1785c33f51ee1b5727ce8b4243fb v2/diagnostics.py
|
||||
8fe649acb25c36361c042807b828c545d8febf760f9ba0187fbec3e69698064e v2/h3_builder.py
|
||||
aea01a48a8c03a25ed97ea05e5b137f89e388832d1be7d38f2da2be3d1b9830b v2/motion.py
|
||||
19249ea6b00be3a792f957aff85e2cc11422f8301f7391af1f7c269f33605314 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
|
||||
0003f5c609c05dd8688d8eed640cf3fcaf95dbd40c3804fae1c957afbad3b132 v2/sequence.py
|
||||
13213e7709fd02bb810af3c18e4cd7d010f8cdfb121a4b99866a9f2333331089 v2/session_io.py
|
||||
3ea23dbce6fcd217b6e81235855479b9b16fed7a21693cf156f9014555c4fe13 v2/session.py
|
||||
78c830cdf49034c6e3b2cd3da5914d5cfc5638eb63ec6dbd1bab13c50d6d4caf v3/__init__.py
|
||||
b3dc61503d35d9ef0a0dc7fed1c9b2fdc00fcb2072d4e39f64ae0826f9ec7dca v3/assembly_v35.py
|
||||
7815230e0a9540bc2edeaf818e940b7a1fdd817fd217ba8a4f9cb21aaf6a308e v3/assembly.py
|
||||
3f62fdb35e804f42d7cbf0828b4e87e69a2b99246c3f7467fe4fa698f1d803c9 v3/conditioning_bridge_nodes.py
|
||||
7ef3960e741a23ce3e34de56c8987104798e01475a57967da597d3bad6eab269 v3/driving_nodes.py
|
||||
6cc7ed74666084c55beb9075304e92a9defafd81b9c6678239ca3859a08cddd7 v3/file_backed_buffer.py
|
||||
cb53e1b104415032ec79b7e7aa1c99848e63da3eedaa251eeba102970e4172b5 v3/hires_fix_nodes.py
|
||||
0858487e2b8c0060a856273ffc65d23165b2f253d183f506e27e419aea0da561 v3/latent_resize_nodes.py
|
||||
5b8a54e67a608e757a505abc712effb33312636e3bb235835a485a506e80eeee v3/masked_continuation.py
|
||||
85477badd85281cfb77582fdd5b34228a9f6b68376f1b7743af2ca7d4b55aa36 v3/memory_attribution.py
|
||||
ef00dc62585a3581cc6641cb832abfc7dd01e02a45ebe8c438a463905052097d v3/nodes.py
|
||||
b7c4a35a5e73f528492bc6946b97b687c412f1d3f5f976c19d45c6dc20288c9a v3/pixel_vae_resize.py
|
||||
34ea38c03b6322288d88fc8595e3655a7a7afddb51709142a954eb7349f71ac2 v3/plan.py
|
||||
9076c47aa5145c81f34793d6c90410656065248f37d9990a92a6a4061b358811 v3/refine_context.py
|
||||
43f33f989eb70ca87b916fc33267732a2be3dd4581fc72af17c53f840b53ca49 v3/refine_schedule.py
|
||||
519586b1b3f48c73d329f7a2aaa8a1bfc6fe31ac2ecb64f2b1fdf9c19026001a v3/refine_sampling.py
|
||||
30cd7cd29cb804f9d5d85af49b1e4b9ebfa8bc7b485043ed745491dc1d99294b v3/second_pass_nodes.py
|
||||
5483328d9c76802f7883e74fa766585ea13a62606f41ea0691f33c7ec846d485 v3/second_pass.py
|
||||
4178dcfa442abdb06ce276e05bd7bcbaa6da28469ba5e57d3da3c663de4e4a9d v3/video_seam_v35.py
|
||||
2f07ace1462644f0bee553827b3571535de4d0c2d9ef847bd9e0ca73a4eed5cb v3/video_seam.py
|
||||
b5a8069934ed305688ebc07acda05a6d4d391365892cd6c9d6c9db651520f4cd version.py
|
||||
cdcf166531835a5256fd9fcbb02d02efacfb669253cb3ea280d868cefd7e5874 web/project_id.js
|
||||
0cf8d49bcb71b30437dc893f6218dc4cfb1cd244b647e4fbc2861dea2271a33a web/reference_audio_ui.js
|
||||
dca65fb1393e67f59c6f81f9411e3e745eb8f1097e9a2adf7ffc6f4e3901ca9f __init__.py
|
||||
3e7a1ec3380be2a222c8a3e9b8a6bb184d3a760478957f48186438f15235bdba branch_provenance.py
|
||||
4f6feeb2f63a9285b0e76fb2e2618058c7d7c279af1632e1a6ccabcc9ec9a45a .github/workflows/tests.yml
|
||||
0a2f69d4cec89d440f5d5aa1ec68a7c9a741382d313f80dcddf96d13f70b3e68 .gitignore
|
||||
e0d0093229dd4719e97e1ee2c0cf935f6692f323f97af49a6361fd9ffac8a3d2 AGENTS.md
|
||||
2a1340ac613def60f0a2c1c7e382c87486b49b14ebc3c6ef34ae14af633295d2 CHANGELOG.md
|
||||
c1ed3a0342730450958fb62fd21854a876991f3a4aefb24e5383b0c73cd2312d compatibility.py
|
||||
4d62508f900af9f93ec320afb900c27cc9a300d1e0c0a94714258498c5ede5fc conditioning.py
|
||||
64967f4987e3ad9316f3a47f0dcf582eeff39ee0c3485f4184d3532d495534ae constants.py
|
||||
cf255b8a635471229aebadc926acfdcacb65963adbcb9e0f9505d04eada2c6b5 continuation.py
|
||||
bf0556b076dbaca67c3405a7d86c333ca7fdf3d4381529b0a9edc906519943e9 guide_timeline.py
|
||||
f9375629fa1a2c4d3538442f0c3192d7ba2f46fe9544fb2e21f0c144b53d608c docs/AB_TEST_LOG_JA.md
|
||||
c93a3e52e4deabe5ef0db7f34a7605856a543089574ba17227e697e9a2c0139a docs/ARCHITECTURE.md
|
||||
b30fe4640359bebfcdeeb94dbeec94cb346c8e3646509e1dcdb87d7021ba04ff docs/N2B_BRANCH_PROVENANCE_CONTRACT_V1.md
|
||||
7660570840229b6fcbe62f0fbb52966d0099d64d7e6f01a739fbf9899293c8e4 docs/FUTURE_ROADMAP.md
|
||||
9a634b4ff6c9ca98285f6b250402a3d0e67d29f031e134d9bfcab54c119ed337 docs/images/comfyui-manager-h3-continuum.png
|
||||
6c72d9a9e35648355c4dd4c8f060a6b7667e322f4b6c86690df9d6769ba182b7 docs/images/h3-continuum-advanced.png
|
||||
b9f1dca35706a1cd963ba892d218568ea30173c6cf6a3bdc896f7a2266eb9407 docs/images/h3-continuum-detailed-report.png
|
||||
de5f8fbce6bc423817acf7dc86bb0c8805a1fd962afdb2722cde7395f117eb56 docs/images/h3-continuum-image-scale.png
|
||||
a384e26f3b088607c616be1a2b038365147d92da0961d8f47060fed09f795062 docs/images/h3-continuum-sampler.png
|
||||
46c52e21c8f99a75c678e7abf20e381c8140860be2662bad528a6cbfc5f3295d docs/images/h3-continuum-v33-settings.png
|
||||
321311da5d2c30953dc2061ca8fdd6e10b84511a15a9bc87704f000dd687cd0a docs/images/h3-continuum-v33-streamlined-ui.png
|
||||
e93b6f4f8da5b2191f2d7715476eff1ab6c44fd96db689618a4bc0aa307c7b5d docs/images/v31b-auto-resume.png
|
||||
c9573d4393236276d032c4503f8ed8bd19c6ef24e84eec6f64f8a4c47aabc718 docs/images/v34-driving-audio-connection.png
|
||||
1b9bff0d32ab1928dd85d04700be563458484748a7bfafe4db293c4950ce6bc8 docs/images/v34-regenerate-from.png
|
||||
65efc844c3f116e0a46bc35390bb46e3968df44fd44ea65a63629a3953371605 docs/images/v34-sampler-spectrum-assemble.png
|
||||
ff8d901d05aa89f9b698c60b3d11534ef97982b3e22e9ede6255a85149a669c4 docs/images/v34-video-reference-separate-audio.png
|
||||
06c333b3dda41526da70d56f4aa25922aafa2f48ec2d99350b0ed6b428e92bad docs/images/v34-video-reference-with-audio.png
|
||||
301afedc3e0922a4bf3bcf445734b5adcdd5c35384132b24a38098c66750f499 docs/images/v34-workflow-overview.png
|
||||
4e0d904d3bad89cb8c3ffe17fb645bfb6fbc87fe49fe3c75c91094b983726025 docs/images/v35-assemble-seam-node.png
|
||||
a53796f7a904d675e80a2276c20d68502f03a3958529278e6ce9465baaf1c4af docs/images/v35-hires-fix-node.png
|
||||
5a23f232a8b795226e8255e6e2e3248b0130f1c7ce276d50370d0333d6a62ef0 docs/images/v35-second-pass-node.png
|
||||
04a34b1b55b627553d08b7b10de71295d55ea9e4ac9815b6dd8ce6d268098851 docs/images/v351-lbh-conditioning-bridge-flow.svg
|
||||
b16d63242b45fe1abef0a4dddd4fc5b9306aa30c2f84bbc3ddf334a1c0832957 docs/images/v351-reference-audio-permanent.png
|
||||
ed189c7f16ba1f6e48f557312066fdb5e1313b5ea7df853a99467fd0d7532ef5 docs/images/v351-video-guide-frames.png
|
||||
0c1dfd5acff349b98ecdfb57ae50941f6da26a462dfd2aaa9b7c7b0a34abf304 docs/images/v352-stabilization-optimization.png
|
||||
96395c3682fb0b6375dc23eacabea6ca9ee165078ff04e94458f178eef35c4ae docs/images/v36-masked-av-continuation.png
|
||||
925898dfe741fdbcc9b429133cfcbfb8ff718a3b476b368a063b46d39511e2f9 docs/images/v36-sampler-node.png
|
||||
edf8bcf1e9d76609a4e54ecd14a0ef6e82c9446c64355ff6ce5e25682e95a932 docs/images/v37-sampler-node.png
|
||||
a8defccf63167a1bbd5db3bcba56781887f6ac5ee3f41de29683e0266d850198 docs/images/v37-tail6-second-pass.png
|
||||
93f07aa727b34802bce3d333426b8ba2af522500882a6d222d00cf577ca82e49 docs/SEAM_TEST_SOURCE_JA.md
|
||||
2c13aefd137db92a3dbf5576e9442d58012b1f0de1240c07d039ceeb702e7c1f docs/V2_1_4_UI_SIMPLIFICATION.md
|
||||
b08022df068576c759c8bf80ac6b6519693f3c65c917f1822aeb06ea359aa5b1 docs/V2_1_5_UI_SERIALIZATION_STABILITY.md
|
||||
a032738b0bc5acb136e92d8bf7694643a5f518b9c7fc0fc878d66d81ba8b1b04 docs/V2_1_6_UNIFIED_UI.md
|
||||
384e3841603f7c6c8286ef147e93aaf7d056a286503a2a4fc21f397e4dec4876 docs/V34_DRIVING_AUDIO_VALIDATION.md
|
||||
1840c81b4090ff3c86c0c1b0acc2cc10d3d9839e383c81f262a5c59a67504cd6 docs/V35_HIRES_FIX.md
|
||||
f0806bb2b999794ddda072e98424dbd1b613df1cd8a096b12d979f124e066d8a docs/VALIDATION_JA.md
|
||||
3fec541a675c1e4e5e287cc8e498036001f34f7a62460321e16f9ba27b5e4c18 docs/VALIDATION_RESULTS.md
|
||||
cedd7b07901d6065079ef37380f0062d535a39c98c8f614e1b26582f549d7183 driving_audio.py
|
||||
6771c9905d35666121c4892d2ec26202505f96d244ce814ad9a87a02878952cd examples/H3_CONTINUUM_V1_WIRING.md
|
||||
f85ba3c69a473f0ac4bb96895c6d6532e8270121da65f858e364b19d31f05ef5 examples/H3_Continuum_V2_3x5s.json
|
||||
be419d6c773784823af7b58a3423ef2e21d3cc3e23c40e60e274560895ca034b examples/H3_Continuum_V2_README.txt
|
||||
4b94f779a98bfc555f6999113a694da07746cc3cf400bfc70ebc580592034d52 examples/H3_Continuum_V2_reference.webp
|
||||
c3cefcdf50df9d6609f583a008453b587c011a0fb41e290d5f1196ce62f58877 examples/H3_CONTINUUM_V2_WIRING_JA.md
|
||||
20f4e7c4ad085791f8b578f575d03e52ef09d0d4550aa58ad086c9857b59bf29 examples/H3_Continuum_V2.json
|
||||
f67febfdd7b2bfca2ad4e477c87a9a74dbe636231f9db3e1158b944d7b9f8397 examples/H3_Continuum_V2.zip
|
||||
68e1a724d3b99458b86b8f643dcb916183e7e8dd12d7b4b3850991feb8077694 examples/recommended_settings_v1.json
|
||||
5a26408c770381cdb259cb710de7dab12d7ddecca262bdbf35ba1566056050f5 examples/recommended_settings_v2.json
|
||||
b8275c8cecde12aee0418cea456d1e7f4b875cbb1bce32f1f3d9e06a44dd0be1 examples/v2_prompt_list_example.txt
|
||||
0e59ea821081cb93165aa3f88c6949736dd225837fe1cdcf1173aa5cd54c6d29 examples/v2_prompt_timeline_example.txt
|
||||
55bc60447d6cd783b9df049d04b6cebb6e4a633981434ac2b28e5a1527d4f4b4 examples/workflows/MiniMax_H3_Continuum_V32_turbo.json
|
||||
4e410aed8d7f6ebf11c98d4f71571e46855e4619c2bcbec921df70f29189b6b1 examples/workflows/MiniMax_H3_Continuum_V32.json
|
||||
55bc60447d6cd783b9df049d04b6cebb6e4a633981434ac2b28e5a1527d4f4b4 examples/workflows/MiniMax_H3_Continuum_V33_turbo.json
|
||||
4e410aed8d7f6ebf11c98d4f71571e46855e4619c2bcbec921df70f29189b6b1 examples/workflows/MiniMax_H3_Continuum_V33.json
|
||||
3d57fa510f98e0874b73ae74c9402f14611c167ef99269dc9ba025ffcaa34973 examples/workflows/MiniMax_H3_Continuum_V34_turbo.json
|
||||
a8460ca5092511f6d22da3363331ba8bff4feab01c569e539811049ea1add051 examples/workflows/MiniMax_H3_Continuum_V34.json
|
||||
ea8c245d36909672710bc9f535f37195e48d7151b0cb2217bcaaca5fcc6d02c0 examples/workflows/MiniMax_H3_Continuum_V35.json
|
||||
9f1a0766b97ead788989fb6eb69a6b36ad236d7a924eea4a88e4a1696e2db6d8 examples/workflows/MiniMax_H3_Continuum_V351_LBH_Conditioning_Bridge.json
|
||||
1c7f1810f0cdd0bdcee09fe9eb8cb052993dd7343753dc0ec0157e00fe702da3 examples/workflows/MiniMax_H3_Continuum_V36.json
|
||||
9d88ffd2d8f7b4a037bfce0aee59afbe0ab77a27c1496aff34e9d08553772804 examples/workflows/MiniMax_H3_Continuum_V37.json
|
||||
e490c87e4995930f95c8fffc4c678111d7897e74003e1962b9b4a247ba43f4ac examples/workflows/MiniMax_H3_Continuum_V38.json
|
||||
d2d22c441f2a86a49277e3ff30f05678cf3383ca74207efeb81e74bb8b4a72ce examples/workflows/MiniMax_H3_Continuum_Easy_V38.json
|
||||
8c109973e5b49cf52b32e0ebb2b5ae6a4e349191e66c2696ff43ce76fefeb07c graph_contract.py
|
||||
1473c384082700f422f2cf9141e0d012d87d2b43ac8a8a433edc7172e6ca7bf6 hardening.py
|
||||
7c8b1226592dcd9d0ec6cc1579956e380fedc9b2672386c29db82169a6cf5f10 INSTALL_JA.txt
|
||||
23bddc5a41d2e997f4fbf789c7128e32f4f197f1405b2aef1c76794f57482446 install_windows.bat
|
||||
fcf80acf6479ece00066eeb59f75d5246cb7b17b75ba84938b73ae17a5083903 install_windows.ps1
|
||||
6aa3f5780baa7bb0c0672b5f01a2f77e5f209da93f6373468cb274ea2f643d4b layout_adapter.py
|
||||
c44abbd789091bbead01250dbd5453e60539d2665c69f162335fdbd2936019c2 LICENSE
|
||||
d3e213005670e94dee33a240349a4d245cf9a3b6602099f11ed30cf5a32e2c21 media.py
|
||||
8b360a1c47a8ee5a95656ffbc83bfc16de69678ecec2c1d8cace46b5ea4e911e metadata.ini
|
||||
2d611f7201889851eac6459f8aa2b37baf342b345241979ca6042b61b252dff9 model_patch.py
|
||||
a4ce23167b83e8d72b86a802dfde4f4045828433c7c13aab799bd64831dc04a4 nodes.py
|
||||
57dcb61cc3e83b2ca97616919ac6ee17d4c62caf845c38161573f56dad12f8fe PACKAGE_INFO_JA.txt
|
||||
000a56a942b13d11973994ab32cd2a1abc424a3fe1d95a323240077bd8092bdf PACKAGE_VALIDATION.txt
|
||||
b470819f16fc179654dc1600721a63f0a5a14e777f4c004d574b499da6886ba5 public_api.py
|
||||
96f98d727b72d6aefd431061572e187c303365a3e5b4d20cbb2bcf030aa30112 pyproject.toml
|
||||
94fdc2d545b2d4077a4d70229fd22ba3ccac21d49d1097d2873f76d04e9a3c7a pytest.ini
|
||||
88aa955161d04d14ebd8d90d6cb6c6206097160a671eb4d1bfe9b3e76ebc6c13 README_JA.md
|
||||
bd71498ddb59edc250ca623ee7cc6fb0c3a728025c879cda81390d435e5c6eac README.md
|
||||
44127adcfa30ee84bff9cd4b2d0c695355209550e76982d374122008728aa5bc reference_audio.py
|
||||
5cb9bfd6810d3a93a637451980a4cc5c1436e5b84cfd1c7a111cd192e876351b reference_video.py
|
||||
131bdfbb7a7173c9e7826859c0e648bfb69bd18bf20fa5528c0e18a63f888b26 reference.py
|
||||
467edb2c188d024c2392aafe7423b3f835e16b10f570da76e2f7dda8a962c1c5 requirements.txt
|
||||
a65d657466491aba8b2d1004e87071cee2819869813e646789df736a3ccf479e run_storage.py
|
||||
6056de6c0a5322a8a51ba5a114538dca2ef67788cd1afba10fedd483b95f6afa state_io.py
|
||||
3a359a0467725cc292ccb4c86cf0c3d30bb6a114d01f5345792b09ea3d45441d state.py
|
||||
43ec4023dc06c941e5d7a04db4b8a89fb58d744ceb986f6eb9bf534d4fdcb87b temporal.py
|
||||
db08ce77cc5c5835f2403d4d589394090fa5d25ff3b1840312b2808e1bc203b7 tests/fixtures/v38_a3c_selective_refine_saved_workflow.json
|
||||
3eeed61b7ee519631825e5f89e9a441644c66e552fce4207927cb8536867c8b1 tests/conftest.py
|
||||
041289556cc621ea1857cbb8931ae41d817f69e084b2e8a7622e184a3197b61b tests/test_compatibility.py
|
||||
875ac33b5458ec5e8d845850ed495707c394436aaadb668a44f36f6a1b73764d tests/test_conditioning_modes.py
|
||||
2be669b6d21ec40a8b0e172b8ab431f82681f3c97c7de0935d87ad43b0ae8b4e tests/test_context_diagnostics.py
|
||||
c058f189d8e58fd48a80c20c0a857969737a8b13960eee60e5c17db2b9288bc1 tests/test_layout_adapter.py
|
||||
2dddf05bbb91b7aa803959a7a8ed78489792ea9c35c5634bfb7d5b1a6c81880f tests/test_model_patch.py
|
||||
45e8839cd82fd955df344b3bc6efa20092b8870ea378b0c898b073665d3e47d7 tests/test_nodes_logic.py
|
||||
b635d404ca67df69894c4fcf80d8782cc5699e946bfb55ae4c44fff9d930b018 tests/test_p20_file_backed_tensor_poc.py
|
||||
0f18b8810b2899f87ce6d6bfeee46fcd90ba787fa09665bddd8fc128f1952c65 tests/test_p21_memory_attribution.py
|
||||
2b097971258dd10f0df33e0f8cb5843ee6cd3e9ef9e7abb80b890c66baf22908 tests/test_p22_file_backed_buffer.py
|
||||
d09d2bae2fac04a058ebce22fa0e761d90b267107923ab8cd01a99cc547624e6 tests/test_p23_assembly_v35.py
|
||||
d2a02c120e01d360ddca17a92d5bc53b12c9f0734d06440b3fc2fad2e754e549 tests/test_p23_video_seam_patches.py
|
||||
114530f8bc4b0a6cd416581636c85d494a07e5dcca93afe9c82f4a5aaaed9dc7 tests/test_p31_prompt_conditioning_cache.py
|
||||
403a0ff300330ac1f97642bf0681e80b83eec18e8911c03952ddf203ce794e5a tests/test_p46a_reference_video_memory.py
|
||||
1ae0369943ba2fb13f21ad0cf56ee58621ba09bf20174379595e157a1775c7fd tests/test_public_api.py
|
||||
892d3e3e022a527652dd995508c8bbb650c370caf9ee66fa3eb1f7fd288bba38 tests/test_public_workflow_integrity.py
|
||||
acf50045b69f59f42aa351c9d389e1f259ffa5714643487e899165158ca99893 tests/test_release_metadata.py
|
||||
d4c53d2c260b635d70fa211029d608f63776e0a56c20253475fa47c58363f8a7 tests/test_state_io.py
|
||||
5af6a16a2337e3483bb0f9197fe04756decd309e4737520c5557b527d68d51bb tests/test_state.py
|
||||
a1f60f01e9d86c1f2a010752612e373e85112c7054ffc31185b9b459eb2b34a5 tests/test_temporal.py
|
||||
f175e9ebf39d6fcaac578b640422676d7f7a54bfdf0f77ec44a3da6aafefd7cd tests/test_timeline_video.py
|
||||
dc8b9cf0e77b4983ee4eecc60f4acde7d0e063f3b7569402feca8a56165107fd tests/test_v2_decoder.py
|
||||
3cc94a6a7957ef285f58d373fbab001d926d2b43a754d60bb00bfce98675f32d tests/test_v2_prompts.py
|
||||
424a4b34fb391ff3729b38a9b202e36f5bc8b9689a2a9bbf9589254c6261d9c6 tests/test_v2_registration.py
|
||||
86314c190d4335586c18191dc095926909c67fe839eb29e65324acd16c44f24e tests/test_v2_seam.py
|
||||
74e623120a963cb96b68651b44f47a836ea8449d30ce89d749c71ffad4766d4e tests/test_v2_seeds_motion.py
|
||||
b42bcc0983147462d96c6b71cc4a38e846995dafa6eebefc3ae0d9bb36caf359 tests/test_v2_sequence_orchestration.py
|
||||
0b5b20a8318862d167f135720e0489b8d4f93406d67c6646e052e35b03dcb876 tests/test_v2_session.py
|
||||
58438c3ed814adf40cefde098a37cae00ddcb703b7e5548bbbb295e54bed5a6d tests/test_v2_widget_migration.py
|
||||
fc57dd687a3648f763afbd8badc139451fe64d644db06f81a7a38926cb6b9df7 tests/test_v217_stable_facade.py
|
||||
473abac48a57aa5f297c6e141a94de17ddcb9424a8744bae1c46e6a6a734a0ab tests/test_v3_hardening.py
|
||||
35b26c8cade7acb2eec35375d7dfa9a4a112f67a5cec6a842d61c69039de0d84 tests/test_v3_video_seam.py
|
||||
316a345f88dc424e0d5e017ca64bb0568d0b4e4ddebd076bdebf717028ddb4e4 tests/test_v31_run_storage.py
|
||||
3af78ab85c8e19dee8d0a98bfd11a2c0e88c30d87256da1f9699c49a19a684e9 tests/test_v32_reference.py
|
||||
43aef01fc587c9f9e87baf312eb4d588975aaaacab161a36bfcb638a4c11e31c tests/test_v34_driving_audio.py
|
||||
4279354d9ed046588d3a685f5150f1cd1891575ddbdcdba870062d8000c64f30 tests/test_v35_compact_ui_frontend.py
|
||||
75dbdd0d9694d82fab7da23f5cc03bc118c024abc865f6c282799aa8c57427fc tests/test_v35_conditioning_bridge.py
|
||||
7dabf482f1fdcb9d5d3deadc1b797f1be576bdf47e0c1008bd7d5be7819f9b30 tests/test_v35_context_sampler.py
|
||||
7380c2ea1eeb4fb212ef51ffdf6d14a33132d3ae6d4c7ed5015f28bba6b7e75b tests/test_v35_hires_fix.py
|
||||
09a6f88fe4f63b12b11d28a82df1ef8eaf01c756f7bb633a516061b93ae4f73b tests/test_v35_latent_resize.py
|
||||
59a07f2172014dfdc0a447775324d7cd049f20b823276dfaf9b7b3f79628f5a8 tests/test_v35_pixel_vae_resize.py
|
||||
05ba609fb948665f050d58fb087569a158c040d08bebad1d728b911673b95462 tests/test_v35_refine_context.py
|
||||
8ae5173eaec35adf9efcde2c464c95651c848248bdbdd6396ed2e3c3c1ac7965 tests/test_v35_refine_sampling.py
|
||||
98a9006ebc4cab2b61b38904e0043fab24e088a25b28ffd38012c29991b8550c tests/test_v35_second_pass_contract.py
|
||||
a11956a22f373d96f13b395971f39187d6bb12cdc153ce794b4729d258ce9725 tests/test_v35_second_pass_sampling.py
|
||||
63d18643701c7d8be7b45046e6dc76616565572180afa06b7582600bd6c32431 tests/test_v351_reference_audio_ui.py
|
||||
5003c5f5ce1a4b4c77deb47011431e4a15fe0cecaeb6d689e0d0878567c42f5a tests/test_v351_reference_audio.py
|
||||
5f70cf8bd5248120ffcbe75ff3a54e23030fa6eb318ab0de6e0b08ee20e25a87 tests/test_v36_chunk_duration.py
|
||||
bf69d1ac3fc30f963b6fed6cbd661f273593904b03275467427a954fbdc0a03f tests/test_v36_masked_video_prefix.py
|
||||
cb9ddd365ccf60693cef254685599bb002acda9986671c2ffa6a8083dae35008 tests/test_v36_public_sampler.py
|
||||
324c213aba761e8989a78eadc0cfdcc54d098f50ed1fe84a5ea7aec26f0dc595 tests/test_v37_guide_production.py
|
||||
14ce0c7f78bcba9948e9e9930c4de5a8c7e8c453fcb6172066d43f593f7175ea tests/test_v37_guide_timeline.py
|
||||
28adaed7d5a9ce74b91cecc37a8bb173832ef41827bdfdfc2f7ae79d96a4dc59 tests/test_v37_public_workflow.py
|
||||
70b2413ad779bdde05bb131ef19db881c48e02004287d99626467303e23f8af6 tests/test_v37_refine_schedule.py
|
||||
61484ca0552e8341301a481a87e12e44279dbeed68d4b841f4301a4f87ce4a29 tests/test_easy_load_audio.py
|
||||
4405c94cf190534fdabf5af3fd2ae9cc7cd1b2af6eb8b0d4ab73327cbcd455b9 tests/test_easy_load_image.py
|
||||
8ba1b07a4d2cdb21aba16a6c05791ec3e35ec7f4f3651e6de5e961be464b7074 tests/test_easy_load_video.py
|
||||
b7da41d7654aefaa06997720f7cbbaa7ddc3827b41ed365efd5992e399aa779c tests/test_v38_adaptive_continuity_observer.py
|
||||
1a24a0cb040a4effba3fcd2974df093597c1686923f0a84f0cd267305a96f7a5 tests/test_v38_audio_only_refine.py
|
||||
e813b5d21af2963a325862acd344b33caa124d0cd3940a940c58118cf27742e0 tests/test_v38_chunk_boundary_diagnostics.py
|
||||
8cdd5e14487a59ef333cf675fe3da52eb319480e69c5a6262377533cf7d0b160 tests/test_v38_chunk_scoped_refine.py
|
||||
c9577e9b2d430c9435a287bf679a920020192d51f780e02b47f286e2e4b6a615 tests/test_v38_easy_mode.py
|
||||
f84c1b4f31c2f45a2eff1b192945f84f08b009dcd2e27b029cd3c9666e59393c tests/test_v38_easy_public_workflow.py
|
||||
98eb59407741dd187dc22d94b4f433f341294d05cc38106fde15b580b1465001 tests/test_v38_memory_action_policy.py
|
||||
338371e7aefc0f303bf62899e5c7f15e1bead2ad3579eee7144f4681487f4014 tests/test_v38_public_workflow.py
|
||||
12337a491fa67b38b32aaeb16e0b209393960dbc46db2a8bf968b8c3902855ef tests/test_v38_packed_row_planner.py
|
||||
967ab1262a90b5ba5b19ad8fb8c9d74aef4a35b02b4a176144b6edc537547939 tests/test_v38_ref_encode_cache.py
|
||||
8b376f45261d045b584f02b4d14cd70c2d6269b9c814d4e62b5c612f6e30e36f tests/test_v38_refine_target.py
|
||||
0b2b1280a1217816984a99c0f948a52a8e2e6fdf924b5c4f2f578719b12b01ed tests/test_v38_video_audio_refine.py
|
||||
072c9b30a5edefacb4cd682808b9b04dd088f5b7bafce2c090def8dab0efc037 tests/test_v38_reliability.py
|
||||
cff84ae0562ba5fc48f3608ecaa433e74c0af9b689d7dca94ec8c3c4e9dc232f tests/test_v38_resolution_preset.py
|
||||
2ac395009e49f9554af8d1a251d93fc5d5e7070bf80f5a0b7b3f7e00cde15077 tests/test_v38_review_cache.py
|
||||
ee4dd8f6eb8114706b2625b4471b041a0ea66198f9f825c63e913c896ed87530 tests/test_v38_branch_provenance.py
|
||||
72a0e3cb334049b66dd36f52c826931067c242fa63557933fd667138b38d6e8d tests/test_v38_review_control.py
|
||||
83301839f08d275f5648d7782b6d96795e14b1ce79d722e83e57190fe52fb4aa tests/test_v38_review_execution_cap.py
|
||||
836b8264065886b929b098d26c3137e8e5f6fc1dbcfb91d53d0511be584b121e tests/test_v38_review_run_storage.py
|
||||
d4b06d4732920a662da722717b805868d2a737f83a111bc62086decbf7408382 tests/test_v38_review_ui.py
|
||||
75697036f361a9b8ea74f69b15e408670f686c8c0e8a6c1d48fe059cc837d12a tests/test_v38_selective_second_pass_node.py
|
||||
8026a241301dfc4de518649305458a538ef17a0b1567b113877a2af377738528 tests/test_v38_temporal_window_refine.py
|
||||
0dbe8a5f71c92f3523942343b40787104c8b96781461ba3ba82934a6bdbe5834 THIRD_PARTY_NOTICES.md
|
||||
f218e1a93c42467c6057c5c1d04d57cc82f6331b97ec9257e4e2dfb9c831876a timeline_video.py
|
||||
e5a84569953ee63b9625f4f2e3195ec368204fddcfc746564cfbd0e8449bb8e9 tools/p20_file_backed_tensor_poc.py
|
||||
cf9eaee6730fb15aa757b13d9a3c5775f398d845e4c7cb4be66f88f620f6a7e8 tools/v38_easy_driving_audio_gpu_gate_runner.py
|
||||
cc247c01a01efaf594c24c7ce36ca3357c092fc28dd742c7577093ee9d5efdef tools/v38_resolution_gpu_gate_runner.py
|
||||
ad8609a45ba818fb74245b30cb0a3a221d6b345c20671092cafd714d8b07aaea tools/v38_review_phase_f_gpu_gate_runner.py
|
||||
60e9bf2c7c40ef9dd71f08ec2ec8c25f7ae9b08e74c3b7be5964e1138848ae82 tools/v38_review_phase_f_recovery_runner.py
|
||||
556bce17d14303d1e8a36a85dc13da24c46eedd86f3eacdb102289574faf0626 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
|
||||
aea01a48a8c03a25ed97ea05e5b137f89e388832d1be7d38f2da2be3d1b9830b v2/motion.py
|
||||
aefa29b9d51a05f9a972d75404fd786300202251887e67f55530e97ccd9519f5 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
|
||||
3a98f8a21756f3813f52197946e761227507b14c40703c9fb1bb108c1e4ddbe7 v2/sequence.py
|
||||
13213e7709fd02bb810af3c18e4cd7d010f8cdfb121a4b99866a9f2333331089 v2/session_io.py
|
||||
3ea23dbce6fcd217b6e81235855479b9b16fed7a21693cf156f9014555c4fe13 v2/session.py
|
||||
78c830cdf49034c6e3b2cd3da5914d5cfc5638eb63ec6dbd1bab13c50d6d4caf v3/__init__.py
|
||||
ea2922567df90436dd6fa21696833a49dd0cbfeee142a5fedc3a7c303824d473 v3/adaptive_continuity.py
|
||||
b3dc61503d35d9ef0a0dc7fed1c9b2fdc00fcb2072d4e39f64ae0826f9ec7dca v3/assembly_v35.py
|
||||
7815230e0a9540bc2edeaf818e940b7a1fdd817fd217ba8a4f9cb21aaf6a308e v3/assembly.py
|
||||
3f62fdb35e804f42d7cbf0828b4e87e69a2b99246c3f7467fe4fa698f1d803c9 v3/conditioning_bridge_nodes.py
|
||||
92b92c51b87182d420ce0468f57797fbb6fe4123d04080b73d6d89581ff96c31 v3/driving_nodes.py
|
||||
2f395da6a41981713f99ba40b73d14f2274b8ca34a73cf2b275a444993765b99 v3/easy_audio_nodes.py
|
||||
64b3e54b42e5156642f9957ccc374fd190d9fc7145637984e702534fb1bf80b4 v3/easy_image_nodes.py
|
||||
ac859cb1a6e23b8ceae300d818c24fe1346b649a0d663017a9b3ac64aa96fca3 v3/easy_nodes.py
|
||||
bf6bae0c9e14883728860470af86e14395dba40a7377cd874d4dc4548ae53c65 v3/easy_video_nodes.py
|
||||
6cc7ed74666084c55beb9075304e92a9defafd81b9c6678239ca3859a08cddd7 v3/file_backed_buffer.py
|
||||
cb53e1b104415032ec79b7e7aa1c99848e63da3eedaa251eeba102970e4172b5 v3/hires_fix_nodes.py
|
||||
0858487e2b8c0060a856273ffc65d23165b2f253d183f506e27e419aea0da561 v3/latent_resize_nodes.py
|
||||
5b8a54e67a608e757a505abc712effb33312636e3bb235835a485a506e80eeee v3/masked_continuation.py
|
||||
91a868d2e392b018b01d0396209849c146b0d560ceb109fcdd87dea7f3d786aa v3/memory_action_policy.py
|
||||
85477badd85281cfb77582fdd5b34228a9f6b68376f1b7743af2ca7d4b55aa36 v3/memory_attribution.py
|
||||
b528e34e24407896e3728d693a40393b46ec7bce236d455721712dfe2fe75adb v3/nodes.py
|
||||
b7c4a35a5e73f528492bc6946b97b687c412f1d3f5f976c19d45c6dc20288c9a v3/pixel_vae_resize.py
|
||||
34ea38c03b6322288d88fc8595e3655a7a7afddb51709142a954eb7349f71ac2 v3/plan.py
|
||||
a3411c7a295308d21623551cf4aeca5bef511eb5f063f31ac84032e3bdf4e16d v3/packed_row_planner.py
|
||||
ec71e3965f445756d54d005c0e27bea520e26dbac44e1ee3d3867bfe2da100b0 v3/ref_encode_cache.py
|
||||
9076c47aa5145c81f34793d6c90410656065248f37d9990a92a6a4061b358811 v3/refine_context.py
|
||||
43f33f989eb70ca87b916fc33267732a2be3dd4581fc72af17c53f840b53ca49 v3/refine_schedule.py
|
||||
519586b1b3f48c73d329f7a2aaa8a1bfc6fe31ac2ecb64f2b1fdf9c19026001a v3/refine_sampling.py
|
||||
ac373d9783d3a7bb968e8117843d246d6a090b66a819015348bff84e7747442c v3/refine_target.py
|
||||
45ae91f13e8f71405d2f46045c8acc6eabbc9500c194cf5d0ba541bb085cd135 v3/refine_window.py
|
||||
afc149dc347b4c1502ddf32ea4229e633799cd34d2b2c6f98bf8a47910a9ef77 v3/refine_scope.py
|
||||
ae909b43ad17934c85881d3b0bea81e7b45c215eeb4d1f9f6a9ea72faf633ddf v3/reliability_v38.py
|
||||
520a4ae849f83450855ce0023c582db5f91d29d8694a99aa8cf491351c837cff v3/resolution.py
|
||||
c21602eb983d497f0eb559197f4f1408b9b5ebb8dcd3aab65e746641f77bcfd4 v3/review_control.py
|
||||
452022107cea233aa84d5366ec4943ac5aadbd5fcf786113f1d542a641eac8f7 v3/second_pass_nodes.py
|
||||
66501234756c2b558ce84f887bd540e7f843ed574c8a8b2522950bd1985d7acc 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
|
||||
d1957fa668a0332e483330bc79fc53095712420e401035a4f80cf6b532677d51 version.py
|
||||
c2883272b05a9a9146b5c6cf614ddae8a3e6893cd910902023aae61360195289 web/easy_bypass_toggle.js
|
||||
092088096307d33ac016b82b4774ca38845a2ff2f63b97ac6da8c5aca4fea413 web/easy_load_audio.js
|
||||
9db0aa94f634578a962d5db49e5c70356040a59df968e3a2e531b327a623081f web/easy_load_image.js
|
||||
873efcbd15c2d9fa10c9d5fc51a796ad3a18c0c6acceecf499c4b956aa845c6c web/easy_load_video.js
|
||||
0c68d13a1f8beb7431a32b471f8b0612c42fcc4bf72dd97611a025d158008662 web/easy_v38.js
|
||||
7b318be7e0a6ffa7a0b924f149ee90c10e4ebfb731da2bc40297bad0ecf63269 web/project_id.js
|
||||
be0b8d39e5343680ebea815c3a4fb6ce7a32e065f30e43e013040a40f702cef3 .comfyignore
|
||||
1d2838cc47694609289ea15132872ad48e1b6c8274da4b7bf188dd3ebf066121 docs/V38_RELEASE_AND_MIGRATION.md
|
||||
7a75ba760008ab0e58b164ebc628b5f1db7a8704e0bde5406d62ea0de2244f7b tests/test_v38_public_surface_cleanup.py
|
||||
0cf8d49bcb71b30437dc893f6218dc4cfb1cd244b647e4fbc2861dea2271a33a web/reference_audio_ui.js
|
||||
4f602b2ceae803fd08a4960a25082f6a79149edcf708161e6c288efe12a7a5dd REGISTRY_MANIFEST.sha256
|
||||
717577efdec5e61600504b77bc2a099ef022c4fe2333e936c3310c7182d8f2a0 docs/V38_OPEN_INTEGRATION_CONTRACT.md
|
||||
623d528a02b6712cba28c374ba3ad979bc84e2ac5318640692589a04ba6ab15f tests/test_v38_open_integration_contract.py
|
||||
0bc369ee428b8a5bc8e370a81fbab427262a1fdb7805a78c442c91698d65efba tools/__init__.py
|
||||
5960c6feb10df5b79d51711d46de55f2f850be69e4943b6c5d12df38b0cedd26 tests/test_v38_multi_reference_audio.py
|
||||
bb5a1530c890d357dc48ea74039340d746e876e8f85e06d4d9a19369f8ff5961 tests/test_v38_hover_help.py
|
||||
3d681ded5d4c50cc20c2382e29fdc98d8a48e76d552c41ad5a195d941e66e612 .gitattributes
|
||||
83d28cc0cd549066962dc21ceae05d2b189fe22391b556887eab2cc1800e1e80 examples/workflows/MiniMax_H3_Continuum_V38.zip
|
||||
|
||||
@@ -1,7 +1,22 @@
|
||||
ComfyUI-H3-Continuum V3.7.0
|
||||
|
||||
ComfyUI-H3-Continuum V3.8.0
|
||||
|
||||
MiniMax H3の5秒ChunkをAV latent contextで継続し、長尺映像として組み立てるComfyUIカスタムノードです。
|
||||
|
||||
V3.8.0:
|
||||
- 公開面はSampler V3.8、Finalize、Load Image、Load Audio、Load Video、Second Pass、Reference Audios helperの7ノード
|
||||
- Main Samplerへfrontend-onlyのBasic/Production表示propertyを追加。Python Schema、widget順・値、backend引数は不変
|
||||
- MainのAspect選択をSize Source(First Image/Manual)へ整理。ManualではWidth/Heightを表示し、旧Aspect値は同じcanvasへ移行
|
||||
- Draft 0.30 MP、Balanced 0.60 MP、Native 768、Custom MPのResolution Resolverを維持
|
||||
- Review Each Chunk、Continue、Regenerate Current、Finish RemainingをRun Storageへ統合
|
||||
- FL2VA Terminal Merge pairを1つのatomic review unitとして維持
|
||||
- Driving AudioをReview、Smart Regenerate、Finish Remaining、restart persistenceと併用可能
|
||||
- Image/Audio/Video Loaderはnative Bypass中もEnable行を明瞭に表示し、その場でONへ復帰可能
|
||||
- 公開WorkflowはMiniMax_H3_Continuum_V38.jsonと同じJSONを含む同名ZIP。Spectrum初期設定のgraphを変更せず配布。Spectrum、rgthree、KJNodes、ComfyUI-Easy-Useが必要
|
||||
- 16GB GPU GateはPASS。ただしVRAM headroomは小さく、Strict Minimal 14.96 GiB、複雑なGateは約15.5~15.6 GiB
|
||||
- Review途中のpartial sequenceではSecond Pass/refine_contextは正式対応外。Review完了後にSecond Passを実行
|
||||
- V3.7以前のNode IDはV3.8で非export。旧保存Workflowは対応するhistorical Release/tagを使用
|
||||
- Registry配布からtests、tools、diagnostics、Labs資産、旧Workflowを除外し、内部継承moduleは維持
|
||||
|
||||
V3.7.0:
|
||||
- H3 Continuum Sampler V3.7と、1枚のStill Image Guide用optional入力を追加
|
||||
- Conditioning AdapterでFirst/Last、Continuation context、Still Guide元画像をSecond Passのtarget解像度へ再構築
|
||||
@@ -41,28 +56,28 @@ V3.5.1:
|
||||
- 生成音声を置換しない任意のReference Audio conditioningと常設socket
|
||||
- Video loaderのIMAGE frame batchを示すVideo Guide Frames / Video Guide Size表示名
|
||||
- backend socket key、既存workflow接続、V3.4 sampling契約を維持
|
||||
|
||||
V3.5.0:
|
||||
- 外部加工したH3 latentをphysical group構造のまま再SamplingするSecond Pass
|
||||
- Pixel/VAE round tripを使うHi-Res Fix(Experimental)
|
||||
- Latent Resize utility(高倍率の直接latent補間はMain経路非推奨)
|
||||
- RAM / Disk-backed / Autoを選べるAssemble + Seam V3.5
|
||||
- Exact Duration、Seam、Terminal Merge、元音声passthroughを維持
|
||||
- V3.4ノードと保存済みワークフローの互換性を維持
|
||||
|
||||
安定範囲:
|
||||
- Advanced Second Pass Bridge
|
||||
- Assemble + Seam V3.5のRAM / Disk-backed / Auto
|
||||
|
||||
|
||||
V3.5.0:
|
||||
- 外部加工したH3 latentをphysical group構造のまま再SamplingするSecond Pass
|
||||
- Pixel/VAE round tripを使うHi-Res Fix(Experimental)
|
||||
- Latent Resize utility(高倍率の直接latent補間はMain経路非推奨)
|
||||
- RAM / Disk-backed / Autoを選べるAssemble + Seam V3.5
|
||||
- Exact Duration、Seam、Terminal Merge、元音声passthroughを維持
|
||||
- V3.4ノードと保存済みワークフローの互換性を維持
|
||||
|
||||
安定範囲:
|
||||
- Advanced Second Pass Bridge
|
||||
- Assemble + Seam V3.5のRAM / Disk-backed / Auto
|
||||
|
||||
Experimental:
|
||||
- Still Image Guide V3.7(Correctness PASS、hard-anchor qualityはProduction HOLD)
|
||||
- Main Hi-Res Fix V3.5
|
||||
- Main Hi-Res Fix 3x5 2x(RTX 5060 Ti 16 GiBではTerminal 77TでCUDA OOM)
|
||||
|
||||
|
||||
GPU受入済み:
|
||||
- Internal Tail 6 704×704(外部Tail 6比Video SSIM 0.982936、decoded Audio PCM bit-exact)
|
||||
- Still Guide元画像の1152×1152再Conditioning(Correctnessのみ。品質はProduction HOLD)
|
||||
- Main Hi-Res Fix 1x5、576から1152
|
||||
- Hybrid FL2VA + Reference 1x5の統合Hi-Res FixとAdvanced Second Pass
|
||||
|
||||
詳細: README.md および docs/VALIDATION_RESULTS.md
|
||||
- Hybrid FL2VA + Reference 1x5の統合Hi-Res FixとAdvanced Second Pass
|
||||
|
||||
詳細: README.md および docs/VALIDATION_RESULTS.md
|
||||
|
||||
@@ -1,53 +1,42 @@
|
||||
ComfyUI-H3-Continuum V3.7.0 package validation
|
||||
ComfyUI-H3-Continuum V3.8 — package validation record
|
||||
|
||||
Status: V3.7.0 release candidate. Conditioning Adapter and the internal RefineSchedule v1 are correctness-accepted without changing V3.6 Production defaults or the existing SIGMAS socket. Still Image Guide positioning, source ownership, Terminal Merge, Run Storage identity, and target-resolution reconditioning are correctness-accepted, but hard-anchor quality remains Experimental / Production HOLD. All V3.6/V3.5.3/V3.4 public node IDs and saved-workflow contracts remain available.
|
||||
Status: source-tree release-hygiene candidate. Release / Registry readiness remains HOLD until the separate final package-staging gate completes. This record is not a release artifact and does not authorize commit, push, tag, release, or Registry publication.
|
||||
|
||||
Required automated checks:
|
||||
- python -m compileall -q .
|
||||
- python -m pytest -q -p no:cacheprovider
|
||||
- python tools/verify_runtime.py --comfy-root <runtime-path>
|
||||
Public surface: exactly seven nodes
|
||||
- H3 Continuum Sampler V3.8
|
||||
- H3 Continuum Reference Audios
|
||||
- H3 Continuum Finalize
|
||||
- H3 Continuum Load Image
|
||||
- H3 Continuum Load Audio
|
||||
- H3 Continuum Load Video
|
||||
- H3 Continuum Second Pass
|
||||
|
||||
Validated runtime paths include:
|
||||
- H3 Continuum Sampler V3.7 required-input parity with V3.6 and one optional Still Image Guide input
|
||||
- Conditioning Adapter reconstruction of First/Last, continuation context, and owned Still Guide sources at target geometry
|
||||
- RefineSchedule v1 External / Full / Tail / Partial contracts with exact source schedule slicing
|
||||
- Internal Tail 6 at 704x704: six evaluations, decoded Video SSIM 0.982936 versus the external Tail 6 baseline, and bit-exact decoded Audio PCM
|
||||
- 1152x1152 Still Guide source reconditioning correctness with first-pass Audio passthrough preserved
|
||||
- Still Guide single-IMAGE validation and explicit source-role priority at First/Last endpoint collisions
|
||||
- V3.7 compact frontend parity for project identity, hidden widgets, Run Storage controls, queue normalization, diagnostics, and permanent Reference Audio sockets
|
||||
- V3.6.1 mixed Timeline/List Prompt diagnostics and fail-open normalization
|
||||
- V3.6.1 non-Balanced Audio Continuity fallback routing before Run Storage identity creation
|
||||
- V3.6.1 public-node Strong 39 / Audio Continuity fallback GPU Smoke on ComfyUI_W: 2x5 seconds, 576x576, 240 frames, 10.000-second video and audio
|
||||
- H3 Continuum Sampler V3.6 Standard / Compatibility backend mapping without exposing internal transport identifiers
|
||||
- Masked AV protected Video/Audio prefix bit-exact finalization
|
||||
- Run Storage Save, Auto Resume, and Regenerate From with backend-scoped revisions and atomic Terminal Merge reuse
|
||||
- Reference Image and Reference Audio retention in every Masked physical group
|
||||
- 3x5 FL2VA Long Terminal Merge Masked GPU acceptance and PIG-3 subjective Audio PASS
|
||||
- Shared 4.0-30.0 second chunk duration range; 5-15 seconds remains the recommended and validated range
|
||||
- V3.5 refine-context contract and Advanced Second Pass Bridge
|
||||
- Conditioning Bridge MODEL / CONDITIONING alignment per physical group without CONDITIONING-entry flattening
|
||||
- Permanent Python-defined Reference Audio sockets, workflow save/reload widget alignment, and conditioning retention
|
||||
- 1x5 T2VA, 3x5 T2VA, and 3x5 FL2VA Long Terminal Merge Second Pass GPU acceptance
|
||||
- First-pass audio LATENT object passthrough through Second Pass
|
||||
- H3 Continuum Assemble + Seam V3.5 RAM / Disk-backed output equivalence
|
||||
- Auto backend selection with RAM and 9.49 GiB disk-backed real-runtime cases
|
||||
- Exact Duration and Video Seam direct-write behavior
|
||||
- Experimental 1x5 FL2VA Pixel/VAE Hi-Res Fix GPU acceptance at 576 to 1152
|
||||
- Hybrid FL2VA + Reference 1x5 GPU acceptance through integrated 2x Hi-Res Fix and direct Advanced Second Pass
|
||||
- Production sampler and Core VAE Decode assembly
|
||||
- Reference Image 1-3
|
||||
- Driving Audio absolute-time guide conditioning with original-source final output
|
||||
- Persistent Video Guide Frames conditioning
|
||||
- Video Guide Size: Efficient 0.4 MP / Balanced 0.6 MP / Match Output
|
||||
- Run Storage save, checksum verification, and complete reuse
|
||||
- Run Storage identity coverage for Driving Audio and Video Guide Frames
|
||||
- Permissive prompt warning/fallback behavior
|
||||
- Spectrum Interop API v1 with Actual Prefix 2 on continuation chunks
|
||||
- Audio Seam Auto
|
||||
- Video Seam Auto guarded transient and micro-flash correction
|
||||
Protected contracts
|
||||
- Sampling Contract v5
|
||||
- Run Storage v3
|
||||
- State, Session, Assembly Plan, Driving Audio, and Second Pass/O1
|
||||
- Existing six public node IDs, sockets, and widget order
|
||||
- AUDIO-R1 adds only the Reference Audios helper and the Sampler's optional bundle socket
|
||||
|
||||
Latest verified automated result: 633 passed.
|
||||
Current verified source checks (2026-09-03)
|
||||
- Full pytest: 1117 passed, 0 failed (one external pynvml deprecation warning)
|
||||
- JavaScript syntax: 7/7
|
||||
- Python compileall: PASS
|
||||
- Development and Registry manifests: regenerated from their established file lists; verification requires missing, extra, and mismatch all equal to zero
|
||||
- Historical V3.8 workflow check: one Registry workflow only; no Hi-Res Fix standard path. The final 2026-09-07 distribution uses the supplied Spectrum graph in JSON and ZIP forms instead of the former Core-only template.
|
||||
- Public workflow graph: no orphan links or required-input validation errors
|
||||
- Runtime verifier, isolated import, public export/display, and protected-contract checks are recorded by the release-hygiene result report
|
||||
|
||||
Still Image Guide, legacy Main Hi-Res Fix, and Auto 2 remain experimental. Still Image Guide hard-anchor transition quality is not Production-accepted. Main 3x5 2x is not accepted on the tested RTX 5060 Ti 16 GiB because the terminal 77T Second Pass group exceeded VRAM; longer Reference/Hybrid acceptance remains pending.
|
||||
Registry package policy
|
||||
- Include production runtime modules, the two runtime-required tools modules, and tools/verify_runtime.py for package verification.
|
||||
- Exclude tests, runner/probe/diagnostic tools, internal state/worklog documents, development manifests, Labs assets, and historical workflows.
|
||||
- Include `examples/workflows/MiniMax_H3_Continuum_V38.json` and `examples/workflows/MiniMax_H3_Continuum_V38.zip`: one identical, user-supplied graph in two formats, not two workflow variants. Spectrum, rgthree, KJNodes, and ComfyUI-Easy-Use are external requirements, not bundled dependencies.
|
||||
- Preserve the supplied JSON and ZIP bytes, including prompt, media filenames, titles, and settings. Exclude unrelated backup ZIPs without deleting them.
|
||||
- The Development `MANIFEST.sha256` is a source integrity record and is excluded from the Registry archive. `REGISTRY_MANIFEST.sha256` must cover the actual staged archive files with zero missing, extra, or mismatched paths.
|
||||
|
||||
Detailed evidence: docs/VALIDATION_RESULTS.md
|
||||
Required final Release Track gate (not performed by this document)
|
||||
1. Build an isolated stage by the current `.comfyignore` rules.
|
||||
2. Import only from the stage; verify all seven public nodes and production helpers.
|
||||
3. Run the official comfy-cli validate and pack commands.
|
||||
4. Re-expand the archive and prove source/stage/archive SHA parity, no internal files, and no secrets or local-path leakage.
|
||||
5. Keep Release / Registry readiness HOLD unless every gate passes.
|
||||
|
||||
@@ -1,8 +1,150 @@
|
||||
# ComfyUI-H3-Continuum 3.7.0
|
||||
# ComfyUI-H3-Continuum 3.8.0
|
||||
|
||||
MiniMax H3を複数チャンクで連続生成し、直前チャンク末尾の**映像latent / 音声latentを直接**次チャンクへ継承するComfyUIカスタムノードです。チャンク間でVideo/Audio VAEのDecode→Encodeは行いません。
|
||||
|
||||
## V3.7 高解像度Refinement基盤
|
||||
## インストール・更新
|
||||
|
||||
新規導入:
|
||||
|
||||
```bash
|
||||
cd ComfyUI/custom_nodes
|
||||
git clone https://github.com/ukr8b3g-cmyk/ComfyUI-H3-Continuum.git
|
||||
```
|
||||
|
||||
既存のGit導入を更新:
|
||||
|
||||
```bash
|
||||
cd ComfyUI/custom_nodes/ComfyUI-H3-Continuum
|
||||
git pull --ff-only origin main
|
||||
```
|
||||
|
||||
ComfyUIを再起動してください。Managerから導入した場合はManagerのUpdateを使い、同じノードを重複配置しないでください。
|
||||
|
||||
V3.8 Workflow:[JSON](examples/workflows/MiniMax_H3_Continuum_V38.json)/[同じJSONを含むZIP](examples/workflows/MiniMax_H3_Continuum_V38.zip)。Spectrumを初期設定とする1本です。[LightX2V Turbo](https://github.com/ModelTC/Minimax-H3-Turbo)にも切り替えられますが、完全なgraphを開くにはSpectrum・rgthree・KJNodes・ComfyUI-Easy-Useが必要です。外部ノードは別途導入してください。
|
||||
|
||||
## V3.8の公開範囲
|
||||
|
||||
H3 Continuumは、長尺映像を最初からやり直さずに生成・確認・部分再生成・再開するProduction Samplerです。V3.8は`Main / Production`と`Advanced`の2層に整理しました。
|
||||
|
||||
V3.8で検索可能な公開ノードは次の7つです。
|
||||
|
||||
- `H3 Continuum Sampler V3.8`
|
||||
- `H3 Continuum Finalize`
|
||||
- `H3 Continuum Load Image`
|
||||
- `H3 Continuum Load Audio`
|
||||
- `H3 Continuum Load Video`
|
||||
- `H3 Continuum Second Pass`
|
||||
- `H3 Continuum Reference Audios`
|
||||
|
||||
Main Sampler内の`Show Advanced Settings`/`Hide Advanced Settings`で詳細設定を開閉します。旧node property `H3 Continuum View`を含む保存Workflowは対応する開閉状態へ移行し、旧propertyを削除します。これは表示状態だけの変更です。Python input、widget順、保存済みwidget値、backend引数、Sampling identity、Run Storage identityは変更しません。Frontend extensionが読み込まれない場合も、Python定義の全widgetが表示された状態で実行できます。
|
||||
|
||||
標準経路は`Sampler V3.8 -> Core Video/Audio Decode -> Finalize -> Create Video -> Save Video`です。Finalizeの`IMAGE`/`AUDIO`出力をCoreの`Create Video`で`VIDEO`へまとめてから保存します。Core Decode、Save、Upscalerは外付けとし、外部latent processorやupscalerはSecond Passをbridgeとして接続します。外部processorが変更できるのはVideo LATENTの空間解像度だけで、physical group、B/C/T、finite値、First Pass Audio、元のAssembly Planを維持する必要があります。Finalizeは公開`IMAGE`/`AUDIO`型を受け取り、特定decoder classへ依存しません。SageAttention、Sol-Attn、Spectrumは外部MODEL wrapperのままです。詳細は[V3.8 Open Integration Contract](docs/V38_OPEN_INTEGRATION_CONTRACT.md)を参照してください。旧Hi-Res FixはV3.8標準Workflowに含めません。
|
||||
|
||||
### Reference Audio 1/2/3
|
||||
|
||||
`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 support boundary:** V3.8からexportするのは上記7ノードだけです。Finalizeの`H3ContinuumAssembleSeamV35`、Second Passの`H3ContinuumSecondPassV35`など、公開ノードの一部は旧IDを維持していますが、すべての旧Workflowに互換性があるという意味ではありません。現在の7ノード以外のIDを含む保存Workflowはunknown nodeになる場合があります。その場合は対応する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での動作保証ではありません。
|
||||
|
||||
### サイズの決め方を直接選択
|
||||
|
||||
| Preset | 目安 |
|
||||
|---|---|
|
||||
| `Draft` | 約0.30 MP |
|
||||
| `Balanced` | 約0.60 MP |
|
||||
| `Native 768` | 短辺768を目標。極端なAspectでは長辺1344 capを優先 |
|
||||
| `Custom MP` | Megapixelを直接指定。Native 768のcapとは別 |
|
||||
|
||||
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やVideo Guideからサイズを暗黙取得することはありません。
|
||||
|
||||
旧V3.8の`Auto / Landscape / Portrait / Square`はWorkflow/API互換用として内部で受け付けます。FrontendはAutoをFirst Imageへ、3つの固定Aspectを同じ解決結果のManual Width/Heightへ移行します。
|
||||
|
||||
### 10秒を5秒ずつ確認しながら作る
|
||||
|
||||
ここでは、画面に表示される名前だけを使って手順を説明します。
|
||||
|
||||
#### 最初に知っておくこと
|
||||
|
||||
`Chunks = 2`、`Seconds per Chunk = 5`は、完成目標が合計10秒という意味です。ただし、`Run = Review Each Chunk`では10秒を一度に生成しません。最初のQueueでは、確認用に**Chunk 1の5秒だけ**を生成します。これは正常動作です。
|
||||
|
||||
Chunk 1を確認した後に操作を選び、もう一度QueueするとChunk 2へ進みます。`Chunks = 1`では最初の5秒が最後なので、次へ進む操作はありません。
|
||||
|
||||
#### 手順1:生成前の設定
|
||||
|
||||
`H3 Continuum Sampler V3.8`で、上から次の順に設定します。
|
||||
|
||||
1. `Control After Generate`を`fixed`にします。`randomize`、`increment`、`decrement`では続きを再利用できません。
|
||||
2. `Chunks`を`2`にします。
|
||||
3. `Seconds per Chunk`を`5`にします。
|
||||
4. `Total Length`が`10 seconds`になったことを確認します。`Total Length`は確認表示で、直接変更する項目ではありません。
|
||||
5. `Run`を`Review Each Chunk`にします。
|
||||
6. `Progress`を`On — Resume and Takes available`にします。
|
||||
7. 緑色の`Ready to Queue`欄に、`2 × 5s = 10 seconds`と`Review each chunk`が表示されていることを確認します。`Set Control After Generate to fixed`と表示された場合は、Queueする前に手順1を直します。
|
||||
|
||||
#### 手順2:最初の5秒を作る
|
||||
|
||||
1. ComfyUIの`Queue`を押します。
|
||||
2. Chunk 1だけが生成されます。出力動画が5秒でも正常です。
|
||||
3. Queueの処理が完了すると、Samplerの表示が自動的に`Chunk 1 is ready for review`へ切り替わります。
|
||||
|
||||
#### 手順3:Chunk 1の動画を確認する
|
||||
|
||||
保存された5秒の動画を再生し、そのまま採用するか、作り直すかを決めます。この時点ではまだ合計10秒の動画は完成していません。
|
||||
|
||||
#### 手順4:次の操作を1つ選ぶ
|
||||
|
||||
| 画面上のボタン | 次のQueueで行うこと |
|
||||
|---|---|
|
||||
| `Use it and continue` | 現在の5秒を採用し、次のChunkを1つ生成します。 |
|
||||
| `Try this chunk again` | 現在のChunkだけを別のTakeとして作り直します。 |
|
||||
| `Use it and finish the rest` | 現在までを採用し、残りのChunkをまとめて生成します。 |
|
||||
|
||||
ボタンを選んだだけでは生成は始まりません。選択したボタンに`✓`が付いたことを確認してから、ComfyUIの`Queue`を押します。
|
||||
|
||||
`Try this chunk again`はContinuum側で別Takeを作るため、作り直しでも`Control After Generate`は`fixed`のままにしてください。
|
||||
|
||||
#### 手順5:2本目の5秒を作り、10秒を完成させる
|
||||
|
||||
1. `Use it and continue`を選びます。
|
||||
2. ComfyUIの`Queue`をもう一度押します。
|
||||
3. 採用済みのChunk 1を再利用し、Chunk 2を生成します。
|
||||
4. Samplerから後ろのDecode、`H3 Continuum Finalize`、Save Videoまで通常どおり実行されると、合計10秒の完成動画が出力されます。
|
||||
|
||||
設定を確認し直したい場合は`Back to Settings`を押します。未処理のReviewへ戻る場合は`Return to Review`を押します。どちらも生成を自動開始せず、選択済みのTakeや保存済みChunkも削除しません。
|
||||
|
||||
#### 迷ったときの確認
|
||||
|
||||
- 最初のQueueで5秒だけ出た:`Review Each Chunk`の正常動作です。
|
||||
- 次へ進むボタンが出ない:Queueが完了しており、`Progress = On — Resume and Takes available`、`Chunks = 2`以上であることを確認してください。正常なら完了後に自動表示されます。
|
||||
- ボタンを押しても生成されない:操作を選んだ後、ComfyUIの`Queue`をもう一度押してください。
|
||||
- `Set Control After Generate to fixed`と表示された:`Control After Generate`を`fixed`にしてください。別SeedのChunk 1が増えることを防ぐ安全チェックです。
|
||||
- 1回で10秒すべて作りたい:`Run`を`Generate Full Video`にします。
|
||||
|
||||
Long Terminal Mergeのpairは分割せず、1つのReview単位として扱います。
|
||||
|
||||
Driving AudioはReview/Smart Regenerateと併用できます。Continuum Image/Audio/Video Loaderは任意入力向けのnative bypassに対応します。
|
||||
|
||||
> **Reviewの制限:** Review途中のpartial sequenceでは、Second Pass/`refine_context`を正式対応範囲に含めません。Reviewを完了してsequenceを確定してからSecond Passを実行してください。
|
||||
|
||||
### Take・Branch・安全な継続
|
||||
|
||||
Run Storageを有効にすると、Production表示に**Render History / Takes**が表示されます。
|
||||
Takeを選択してもcanonical結果は変わりません。**Use This Take**でそのrevisionを
|
||||
canonicalにし、**Continue From Here**で選択したTakeまでを保持して後続groupだけを
|
||||
再生成します。どちらの操作も自動Queueは行いません。
|
||||
|
||||
## 歴史的な実装・受入記録(V3.8標準Workflowではありません)
|
||||
|
||||
以下の節は旧リリースと互換性作業の記録です。上記のV3.8標準経路を変更するものではありません。
|
||||
|
||||
### V3.7 高解像度Refinement基盤
|
||||
|
||||
V3.7では`H3 Continuum Sampler V3.7`を追加し、解像度を変更するSecond Passに必要な2つの基盤を完成させました。V3.6のProduction初期値と既存SIGMAS socketは変更していません。
|
||||
|
||||
@@ -18,7 +160,7 @@ Conditioning Adapterは、First/Last Image、Continuation context、Still Imag
|
||||
|
||||
V3.7では、Still Image Guide 1枚をabsolute frameからowner physical groupへ割り当て、高解像度Second Passでも元画像から再encodeできます。位置変換、Terminal Merge ownership、Run Storage identity、non-owner groupの非干渉はCorrectness PASSです。一方、Core Add Guideはhard anchorとして働くため、anchor位置で急なtrajectory変化が起き、その後のmotionも別の軌道へ分岐する場合があります。**Still Image GuideはExperimentalで、Production昇格はHOLDです。** 滑らかなtransition制御としては扱わないでください。
|
||||
|
||||
## V3.6.1 Maintenance Hotfix
|
||||
### V3.6.1 Maintenance Hotfix
|
||||
|
||||
V3.6.1は、受入済みBalanced 22 Masked AV経路を変更せず、限定的なfail-open/互換性問題を修正します。Timeline/List記法が混在したPromptは`H3C-P105`を表示し、Timeline解析ではstandalone `---`行だけを除去します。未指定Chunkの既存fallbackとFixed Promptのfail-open動作は維持し、Prompt構文だけを理由に生成を停止しません。
|
||||
|
||||
@@ -26,7 +168,7 @@ V3.6.1は、受入済みBalanced 22 Masked AV経路を変更せず、限定的
|
||||
|
||||
Run Storageは、Last Frame未接続を表す値をすべて同じ空identityとして扱います。通常のLast Frameなし2チャンク生成を3チャンクへ延長すると、旧最終Chunkが`none`だったV3.6.1 cacheを含めて`2 reused, 1 generated`になります。実Last Frame接続時とLong Terminal Mergeのatomic pairは従来どおり厳密です。Run StorageをOffへ変更した場合は、Queue前にhiddenのRegenerate FromとVariation Nonceも`Auto`と`0`へ戻します。
|
||||
|
||||
## V3.6 Masked AV Continuation
|
||||
### V3.6 Masked AV Continuation
|
||||
|
||||
V3.6では`H3 Continuum Sampler V3.6`を追加しました。標準backendは、前Chunkで確定したVideo/Audio latent prefixを次のH3 Target内へ直接配置し、CoreのNoise Maskで保持します。V3.5のReference Context方式のように、同じ過去フレームを別Reference blockとして追加しないため、H3が処理するpacked sequenceを短縮できます。
|
||||
|
||||
@@ -80,7 +222,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.7.0が現在の公開版です。** V3.6.1はmaintenance/compatibility baselineとして維持します。旧Node ID、backend socket key、保存済みWorkflow読込は維持し、Production初期値は変更していません。Still Image GuideはExperimentalです。
|
||||
**V3.8.0が現在のRelease Candidateです。** V3.8が内部利用する旧module/classはsourceへ維持します。exportするのは現在の公開7ノードだけで、その一部は旧IDを維持しています。それ以外のIDを必要とする旧保存Workflowは、対応するhistorical Release/tagを使用してください。Still Image Guideは引き続きExperimentalです。
|
||||
|
||||
## V3.5.1 Reference Audio/互換性更新
|
||||
|
||||
@@ -92,146 +234,145 @@ V3.5.1ではV3.4のSampling、Conditioning、Terminal Merge、Assembly、Seam、
|
||||
Reference Audio socketはPython `INPUT_TYPES`で常設し、保存・再読込時の値ずれを防ぐため動的socket変更とUI-onlyの`Hidden`/`Show` controlを削除しました。V3.4のNode IDとbackend socket keyは保存済みWorkflow互換のため維持しており、既存V3.4/V3.5 Workflowの接続は変わりません。
|
||||
|
||||
### Reference系入力の違い
|
||||
|
||||
表示名は役割の違いを示しています。名前が似ていても同じ組み合わせではありません。
|
||||
|
||||
| 表示入力 | 接続元 | 用途 | 最終音声 |
|
||||
|---|---|---|---|
|
||||
| `reference_image_1`~`reference_image_3` | 静止画`IMAGE` | 人物、被写体、外観などの継続参照 | 音声なし |
|
||||
| `Video Guide Frames` | Video loaderの`IMAGE`フレームbatch | 全chunkでmotion、framing、timing、appearanceをガイド | 元動画の音声は含まない |
|
||||
| `Driving Audio` + `Driving Audio VAE` | Audio loader、またはVideo loaderの`AUDIO`と対応Audio VAE | 音声で生成をガイドし、入力音声を最終出力へ維持 | 生成音声を選択した元音声へ置換 |
|
||||
| `Reference Audio (Optional)` + `Reference Audio VAE (Optional)` | 単独Audioと対応Audio VAE | H3 native conditioning専用 | 生成音声をcopy・置換しない |
|
||||
|
||||
音声付き動画を使う通常の接続は、loaderの`IMAGE`を`Video Guide Frames`へ、`AUDIO`を`Driving Audio`へ接続します。conditioning専用動作が目的でない限り、動画の音声を`Reference Audio (Optional)`へ接続しないでください。
|
||||
|
||||

|
||||
|
||||
`Reference Audio (Optional)`と`Reference Audio VAE (Optional)`は、Pythonのinput schemaどおり常時表示します。V3.5.1ではこの2 socketをFrontendで動的に追加・削除せず、UI-onlyの`Hidden`/`Show` widgetも使用しません。これによりWorkflowを保存・再読込した際のwidget値の位置ずれを防ぎます。backend input keyと既存接続は変更しません。
|
||||
|
||||

|
||||
|
||||
### Conditioning Bridge V3.5
|
||||
|
||||
`H3 Continuum Conditioning Bridge V3.5`は外部sampling用のAdvanced接続点です。`model`、`clip`、外部処理後の`video_latents`、`assembly_plan`、`refine_context`を接続し、選択したconditioning経路で必要な場合だけ`video_vae`を接続します。出力`group_models`と`conditioning`はphysical group数と同数で、各要素は完全なComfyUI objectのままです。CONDITIONING内部entryをphysical-group listへflattenしません。
|
||||
|
||||
```text
|
||||
H3 Continuum Sampler V3.5.video_latents
|
||||
→ LBH等の外部H3 latent処理
|
||||
→ H3 Continuum Conditioning Bridge V3.5
|
||||
→ Core BasicGuider + 外部Sampler
|
||||
→ Core Video / Audio VAE Decode
|
||||
→ H3 Continuum Assemble + Seam V3.5
|
||||
```
|
||||
|
||||
AV LATENTの組、Noise、SIGMAS、Audio Lock、sampling、audio passthroughは外部workflow側の責任です。Bridgeは準備済み`MODEL`と`CONDITIONING`、更新済みAssembly Planだけを公開します。
|
||||
|
||||

|
||||
|
||||
完全な接続例: [V3.5.1 LBH+Conditioning Bridgeワークフロー](examples/workflows/MiniMax_H3_Continuum_V351_LBH_Conditioning_Bridge.json)
|
||||
|
||||
接続例ではCore標準名の`BasicGuider`、`BasicScheduler`、`SamplerCustomAdvanced`を変更していません。公開サンプルではCoreノードを独自タイトルへ変更せず、Continuumノードや外部カスタムノードと直感的に区別できる状態を維持します。LBH latent upscaler、AV LATENTの結合/分離、load/save、任意accelerationは外部ノードなので、各ComfyUI環境に合わせて導入または置換してください。
|
||||
|
||||
LBHはlatent geometryだけを変更し、Continuumのdenoise強度は持ちません。拡大後latentをどれだけ再生成するかは外部`BasicScheduler`のSIGMASで調整します。1.5x等へ上げても高速な場合がありますが、target canvasに応じてmemory、decode、sampling負荷は増加します。
|
||||
|
||||
## V3.5の主な追加機能
|
||||
|
||||
V3.5の大きな追加は2点です。
|
||||
|
||||
1. **Continuum対応Second Pass / Hi-Res Fix**: physical group構造を維持した再Samplingと、標準Pixel/VAE 2x経路。
|
||||
2. **低メモリAssemble + Seam**: Exact Duration、Seam、Terminal Merge、Audioを維持したRAM / Disk-backed / Auto出力。
|
||||
|
||||
### 1. Second Pass / Hi-Res Fix
|
||||
|
||||
`H3 Continuum Hi-Res Fix V3.5`はVideo VAE Decode → pixel resize → Encode → low-denoise Second Passを1ノード化したMain経路です。長尺2xではVRAM上限に達する場合があるためExperimentalです。
|
||||
|
||||

|
||||
|
||||
通常のHi-Res Fix接続:
|
||||
|
||||
```text
|
||||
H3 Continuum Sampler V3.5
|
||||
→ H3 Continuum Hi-Res Fix V3.5
|
||||
→ Core Video / Audio VAE Decode
|
||||
→ H3 Continuum Assemble + Seam V3.5
|
||||
```
|
||||
|
||||
`H3 Continuum Second Pass V3.5`は外部加工したH3 video latentをphysical group構造のまま再Samplingする安定版Advanced入口です。Issue #8への本体回答です。
|
||||
|
||||

|
||||
|
||||
外部latent upscaler接続:
|
||||
|
||||
```text
|
||||
H3 Continuum Sampler V3.5.video_latents
|
||||
→ LBH等の外部H3 latent処理
|
||||
→ H3 Continuum Second Pass V3.5
|
||||
→ Core Video / Audio VAE Decode
|
||||
→ H3 Continuum Assemble + Seam V3.5
|
||||
```
|
||||
|
||||
画像では`BasicScheduler`を省略していますが、Second Pass用`SIGMAS`の接続は必要です。GPU受入済み基準は`res_multistep`、`simple / 10 steps / denoise 0.35`、Lanczos pixel resize、FL2VA 1×5秒・576→1152です。Hybrid FL2VA + Referenceも1×5秒で、統合2x Hi-Res FixとAdvanced Second Pass直結の両方を受入しました。
|
||||
|
||||
Hi-Res Fixを接続しなければV3.4 Sampling経路は変わりません。強制CPU offloadや低VRAM samplerは追加していません。`enabled=false`ではResize、VAE、Second Passを評価せず、元のVideo/Audio LATENTとAssembly Planをそのまま返します。
|
||||
|
||||
### 2. 低メモリAssemble + Seam
|
||||
|
||||
`H3 Continuum Assemble + Seam V3.5`はRAM / Disk-backed / Autoを選択できます。Disk-backedでは完成Video IMAGEをWindows対応mapped fileへ直接writeし、AudioはRAMに維持します。
|
||||
|
||||
1536×1536・360 frames・完成IMAGE 9.49 GiBの実測では、RAM版とDisk-backed版の映像/音声hashが完全一致しました。
|
||||
|
||||
| Windows process指標 | RAM | Disk-backed | 削減 |
|
||||
|---|---:|---:|---:|
|
||||
| Private memory | 12.41 GiB | 2.91 GiB | **9.50 GiB** |
|
||||
| USS | 10.29 GiB | 0.80 GiB | **9.49 GiB** |
|
||||
|
||||
これはContinuum Assembly時の**システムRAM/private commitment削減**であり、SamplerのGPU VRAM削減値ではありません。Disk I/Oにより最終Assemblyが遅くなる可能性はありますが、前段のモデルSampling速度は変えません。
|
||||
|
||||
### GPU受入範囲
|
||||
|
||||
| 経路 | 条件 | 結果 |
|
||||
|---|---|---|
|
||||
| Main Hi-Res Fix | FL2VA 1×5秒、576→1152 | PASS |
|
||||
| Main Hi-Res Fix | Hybrid FL2VA + Reference 1×5秒、576→1152 | PASS |
|
||||
| Advanced Second Pass | Hybrid/Reference 1×5秒、576×576 | PASS |
|
||||
| Main Hi-Res Fix | FL2VA 3×5秒、576→1152、RTX 5060 Ti 16 GiB | **Terminal 77TでCUDA OOM** |
|
||||
|
||||
3×5秒2xではFirst Passと37T groupのSecond Passは完了し、最後のlogical `[2,3]`を維持した77T physical groupが1152×1152の最初の推論でVRAM上限に達しました。group構造の破損ではなく、16 GiB実機でのリソース上限です。
|
||||
|
||||
詳しいsocket接続・OFF時のpassthrough・既知の制限は[英語版V3.5接続ガイド](docs/V35_HIRES_FIX.md)を参照してください。
|
||||
|
||||
## 公開テンプレートワークフロー
|
||||
|
||||
表示名は役割の違いを示しています。名前が似ていても同じ組み合わせではありません。
|
||||
- [V3.8 Workflow JSON](examples/workflows/MiniMax_H3_Continuum_V38.json) — Spectrum初期設定の現行graph 1本
|
||||
- [V3.8 Workflow ZIP](examples/workflows/MiniMax_H3_Continuum_V38.zip) — 同じJSONのみを格納。カスタムノードのインストーラーではありません
|
||||
|
||||
| 表示入力 | 接続元 | 用途 | 最終音声 |
|
||||
|---|---|---|---|
|
||||
| `reference_image_1`~`reference_image_3` | 静止画`IMAGE` | 人物、被写体、外観などの継続参照 | 音声なし |
|
||||
| `Video Guide Frames` | Video loaderの`IMAGE`フレームbatch | 全chunkでmotion、framing、timing、appearanceをガイド | 元動画の音声は含まない |
|
||||
| `Driving Audio` + `Driving Audio VAE` | Audio loader、またはVideo loaderの`AUDIO`と対応Audio VAE | 音声で生成をガイドし、入力音声を最終出力へ維持 | 生成音声を選択した元音声へ置換 |
|
||||
| `Reference Audio (Optional)` + `Reference Audio VAE (Optional)` | 単独Audioと対応Audio VAE | H3 native conditioning専用 | 生成音声をcopy・置換しない |
|
||||
Registry配布予定の対象もこのJSONとZIPです。依存なしのテンプレートではなく、Spectrum・rgthree・KJNodes・ComfyUI-Easy-Useが必要です。Turboへ切り替えてもgraph内の外部ノードは残ります。SpectrumをOFFにし、用途に合うLightX2V Turbo LoRAを1本だけONにしてsampler/Stepsを合わせます。初期状態はSpectrum ON、Turbo LoRA OFF、res_multistep/simple/20 Stepsです。
|
||||
|
||||
音声付き動画を使う通常の接続は、loaderの`IMAGE`を`Video Guide Frames`へ、`AUDIO`を`Driving Audio`へ接続します。conditioning専用動作が目的でない限り、動画の音声を`Reference Audio (Optional)`へ接続しないでください。
|
||||
|
||||

|
||||
|
||||
`Reference Audio (Optional)`と`Reference Audio VAE (Optional)`は、Pythonのinput schemaどおり常時表示します。V3.5.1ではこの2 socketをFrontendで動的に追加・削除せず、UI-onlyの`Hidden`/`Show` widgetも使用しません。これによりWorkflowを保存・再読込した際のwidget値の位置ずれを防ぎます。backend input keyと既存接続は変更しません。
|
||||
|
||||

|
||||
|
||||
### Conditioning Bridge V3.5
|
||||
|
||||
`H3 Continuum Conditioning Bridge V3.5`は外部sampling用のAdvanced接続点です。`model`、`clip`、外部処理後の`video_latents`、`assembly_plan`、`refine_context`を接続し、選択したconditioning経路で必要な場合だけ`video_vae`を接続します。出力`group_models`と`conditioning`はphysical group数と同数で、各要素は完全なComfyUI objectのままです。CONDITIONING内部entryをphysical-group listへflattenしません。
|
||||
|
||||
```text
|
||||
H3 Continuum Sampler V3.5.video_latents
|
||||
→ LBH等の外部H3 latent処理
|
||||
→ H3 Continuum Conditioning Bridge V3.5
|
||||
→ Core BasicGuider + 外部Sampler
|
||||
→ Core Video / Audio VAE Decode
|
||||
→ H3 Continuum Assemble + Seam V3.5
|
||||
```
|
||||
|
||||
AV LATENTの組、Noise、SIGMAS、Audio Lock、sampling、audio passthroughは外部workflow側の責任です。Bridgeは準備済み`MODEL`と`CONDITIONING`、更新済みAssembly Planだけを公開します。
|
||||
|
||||

|
||||
|
||||
完全な接続例: [V3.5.1 LBH+Conditioning Bridgeワークフロー](examples/workflows/MiniMax_H3_Continuum_V351_LBH_Conditioning_Bridge.json)
|
||||
|
||||
接続例ではCore標準名の`BasicGuider`、`BasicScheduler`、`SamplerCustomAdvanced`を変更していません。公開サンプルではCoreノードを独自タイトルへ変更せず、Continuumノードや外部カスタムノードと直感的に区別できる状態を維持します。LBH latent upscaler、AV LATENTの結合/分離、load/save、任意accelerationは外部ノードなので、各ComfyUI環境に合わせて導入または置換してください。
|
||||
|
||||
LBHはlatent geometryだけを変更し、Continuumのdenoise強度は持ちません。拡大後latentをどれだけ再生成するかは外部`BasicScheduler`のSIGMASで調整します。1.5x等へ上げても高速な場合がありますが、target canvasに応じてmemory、decode、sampling負荷は増加します。
|
||||
|
||||
## V3.5の主な追加機能
|
||||
|
||||
V3.5の大きな追加は2点です。
|
||||
|
||||
1. **Continuum対応Second Pass / Hi-Res Fix**: physical group構造を維持した再Samplingと、標準Pixel/VAE 2x経路。
|
||||
2. **低メモリAssemble + Seam**: Exact Duration、Seam、Terminal Merge、Audioを維持したRAM / Disk-backed / Auto出力。
|
||||
|
||||
### 1. Second Pass / Hi-Res Fix
|
||||
|
||||
`H3 Continuum Hi-Res Fix V3.5`はVideo VAE Decode → pixel resize → Encode → low-denoise Second Passを1ノード化したMain経路です。長尺2xではVRAM上限に達する場合があるためExperimentalです。
|
||||
|
||||

|
||||
|
||||
通常のHi-Res Fix接続:
|
||||
|
||||
```text
|
||||
H3 Continuum Sampler V3.5
|
||||
→ H3 Continuum Hi-Res Fix V3.5
|
||||
→ Core Video / Audio VAE Decode
|
||||
→ H3 Continuum Assemble + Seam V3.5
|
||||
```
|
||||
|
||||
`H3 Continuum Second Pass V3.5`は外部加工したH3 video latentをphysical group構造のまま再Samplingする安定版Advanced入口です。Issue #8への本体回答です。
|
||||
|
||||

|
||||
|
||||
外部latent upscaler接続:
|
||||
|
||||
```text
|
||||
H3 Continuum Sampler V3.5.video_latents
|
||||
→ LBH等の外部H3 latent処理
|
||||
→ H3 Continuum Second Pass V3.5
|
||||
→ Core Video / Audio VAE Decode
|
||||
→ H3 Continuum Assemble + Seam V3.5
|
||||
```
|
||||
|
||||
画像では`BasicScheduler`を省略していますが、Second Pass用`SIGMAS`の接続は必要です。GPU受入済み基準は`res_multistep`、`simple / 10 steps / denoise 0.35`、Lanczos pixel resize、FL2VA 1×5秒・576→1152です。Hybrid FL2VA + Referenceも1×5秒で、統合2x Hi-Res FixとAdvanced Second Pass直結の両方を受入しました。
|
||||
|
||||
Hi-Res Fixを接続しなければV3.4 Sampling経路は変わりません。強制CPU offloadや低VRAM samplerは追加していません。`enabled=false`ではResize、VAE、Second Passを評価せず、元のVideo/Audio LATENTとAssembly Planをそのまま返します。
|
||||
|
||||
### 2. 低メモリAssemble + Seam
|
||||
|
||||
`H3 Continuum Assemble + Seam V3.5`はRAM / Disk-backed / Autoを選択できます。Disk-backedでは完成Video IMAGEをWindows対応mapped fileへ直接writeし、AudioはRAMに維持します。
|
||||
|
||||
1536×1536・360 frames・完成IMAGE 9.49 GiBの実測では、RAM版とDisk-backed版の映像/音声hashが完全一致しました。
|
||||
|
||||
| Windows process指標 | RAM | Disk-backed | 削減 |
|
||||
|---|---:|---:|---:|
|
||||
| Private memory | 12.41 GiB | 2.91 GiB | **9.50 GiB** |
|
||||
| USS | 10.29 GiB | 0.80 GiB | **9.49 GiB** |
|
||||
|
||||
これはContinuum Assembly時の**システムRAM/private commitment削減**であり、SamplerのGPU VRAM削減値ではありません。Disk I/Oにより最終Assemblyが遅くなる可能性はありますが、前段のモデルSampling速度は変えません。
|
||||
|
||||
### GPU受入範囲
|
||||
|
||||
| 経路 | 条件 | 結果 |
|
||||
|---|---|---|
|
||||
| Main Hi-Res Fix | FL2VA 1×5秒、576→1152 | PASS |
|
||||
| Main Hi-Res Fix | Hybrid FL2VA + Reference 1×5秒、576→1152 | PASS |
|
||||
| Advanced Second Pass | Hybrid/Reference 1×5秒、576×576 | PASS |
|
||||
| Main Hi-Res Fix | FL2VA 3×5秒、576→1152、RTX 5060 Ti 16 GiB | **Terminal 77TでCUDA OOM** |
|
||||
|
||||
3×5秒2xではFirst Passと37T groupのSecond Passは完了し、最後のlogical `[2,3]`を維持した77T physical groupが1152×1152の最初の推論でVRAM上限に達しました。group構造の破損ではなく、16 GiB実機でのリソース上限です。
|
||||
|
||||
詳しいsocket接続・OFF時のpassthrough・既知の制限は[英語版V3.5接続ガイド](docs/V35_HIRES_FIX.md)を参照してください。
|
||||
|
||||
## 推奨テンプレートワークフロー
|
||||
|
||||
- [V3.6推奨テンプレート](examples/workflows/MiniMax_H3_Continuum_V36.json)
|
||||
- [V3.5互換テンプレート](examples/workflows/MiniMax_H3_Continuum_V35.json)
|
||||
- [V3.5.1 LBH+Conditioning Bridge接続例](examples/workflows/MiniMax_H3_Continuum_V351_LBH_Conditioning_Bridge.json)
|
||||
|
||||
V3.6テンプレートはContinuation BackendがStandard、Hi-Res Fixが初期OFF、AssembleのBuffer BackendがAutoです。First Frame、Last Frame、Reference Image 1~3は1つのmegapixel設定を共有します。`Video Guide Size`は`Video Guide Frames`に使うframe batchを調整し、decodeとframe-rate変換はVideo loader側で行います。現在のProduction構成はV3.6 SamplerとV3.5の低メモリAssembleを組み合わせます。V3.5テンプレートは互換用として変更せず維持します。
|
||||
|
||||

|
||||
|
||||

|
||||
|
||||
## V3.4互換
|
||||
|
||||
V3.4ノードは保存済みワークフローを壊さないため残しています。Node ID、公開socket、Sampling、Conditioning、Terminal Merge、Assembly、Seam、Run StorageをV3.5へ置換していません。Second PassやDisk-backed Assembleを必要としない場合は、従来どおりV3.4を使用できます。
|
||||
|
||||
## V3.4.0 Stable
|
||||
|
||||
V3.4.0は、最大3枚のReference Image、Run Storage、Spectrum Interop、Decode後のAudio / Video Seam補正を維持し、`Driving Audio`と`Video Guide Frames`を正式な入力として追加します。
|
||||
|
||||
`Driving Audio`は入力音声を絶対時間で各Chunkのガイドに使い、最終出力には元音声を維持します。`Video Guide Frames`はVideo loaderが出力したIMAGE frame batchを全Chunkで継続使用し、`Efficient - 0.4 MP`、`Balanced - 0.6 MP`、`Match Output`から処理解像度を選択できます。青いIMAGE socketですが、通常の1枚の静止画参照ではなく動画フレーム列を接続します。
|
||||
|
||||
### Size項目の条件付き表示と内部Resize
|
||||
|
||||
V3.5のCompact UIでは、対応する入力を接続した時だけSize項目を表示します。
|
||||
|
||||
- `reference_image_1`~`reference_image_3`のいずれかを接続すると、`Reference Size`を表示します。
|
||||
- `Video Guide Frames`を接続すると、`Video Guide Size`を表示します。以前のWorkflowやIssueで`Video Reference Size`と記載されている項目と同じもので、V3.5.1では表示名だけを`Video Guide Size`へ明確化し、既存のbackend keyと保存済みWorkflowの互換性を維持しています。
|
||||
|
||||
したがって、新規ノードで見えないSize項目は欠落ではなく、未接続のため非表示になっています。Reference ImageとVideo Guide FramesはVAE Encode前に内部Resizeされます。Video Guide Framesはアスペクト比を維持してH3 canvasへ整列し、縮小が必要な場合はLanczosを使用します。小さい入力を自動的に拡大はしません。通常は外部Resizeノードを必要としませんが、意図的なcrop、小さい素材の強制upscale、独自のresize/upscale方式を使う場合には外部処理を利用できます。動画のdecodeとframe-rate変換は引き続きloader側の責任です。
|
||||
|
||||
Reference入力のバイパスされたソケットは無視され、有効な画像だけがPicture 1から連続採番されます。空欄や不完全なプロンプトも停止せず、警告とFixed fallbackで生成を続行します。未知のモデル、ノード、プロンプト形式を独自判断で拒否する制限も撤廃しました。
|
||||
配布元のprompt、画像・音声名、ノード表示名、設定は変更していません。手元にあるファイルを選び、不要な入力をOFFにし、promptを入力してください。モデルやメディアは同梱しません。`Save 3x5s Video`などの保存済み表示名は生成時間を決めません。実際の長さはSamplerのChunksとSeconds per Chunkで決まります。
|
||||
|
||||
旧Workflowは開発履歴としてsource repositoryへ保持しますが、V3.8 Registry packageからは除外します。旧保存Workflowは[Migration Policy](docs/V38_RELEASE_AND_MIGRATION.md)に従い、対応するhistorical Release/tagで開いてください。Registryの正式pack検証・公開はGitHub sourceの更新とは別工程です。
|
||||
|
||||
## V3.4互換
|
||||
|
||||
V3.4の実装moduleは内部継承とhistorical testのためsourceへ保持しています。V3.8からexportするのは現在の公開7ノードに含まれるIDだけです。それ以外のIDを必要とするV3.4保存Workflowは、対応するhistorical packageを使用してください。
|
||||
|
||||
## V3.4.0 Stable
|
||||
|
||||
V3.4.0は、最大3枚のReference Image、Run Storage、Spectrum Interop、Decode後のAudio / Video Seam補正を維持し、`Driving Audio`と`Video Guide Frames`を正式な入力として追加します。
|
||||
|
||||
`Driving Audio`は入力音声を絶対時間で各Chunkのガイドに使い、最終出力には元音声を維持します。`Video Guide Frames`はVideo loaderが出力したIMAGE frame batchを全Chunkで継続使用し、`Efficient - 0.4 MP`、`Balanced - 0.6 MP`、`Match Output`から処理解像度を選択できます。青いIMAGE socketですが、通常の1枚の静止画参照ではなく動画フレーム列を接続します。
|
||||
|
||||
### Size項目の条件付き表示と内部Resize
|
||||
|
||||
V3.5のCompact UIでは、対応する入力を接続した時だけSize項目を表示します。
|
||||
|
||||
- `reference_image_1`~`reference_image_3`のいずれかを接続すると、`Reference Size`を表示します。
|
||||
- `Video Guide Frames`を接続すると、`Video Guide Size`を表示します。以前のWorkflowやIssueで`Video Reference Size`と記載されている項目と同じもので、V3.5.1では表示名だけを`Video Guide Size`へ明確化し、既存のbackend keyと保存済みWorkflowの互換性を維持しています。
|
||||
|
||||
したがって、新規ノードで見えないSize項目は欠落ではなく、未接続のため非表示になっています。Reference ImageとVideo Guide FramesはVAE Encode前に内部Resizeされます。Video Guide Framesはアスペクト比を維持してH3 canvasへ整列し、縮小が必要な場合はLanczosを使用します。小さい入力を自動的に拡大はしません。通常は外部Resizeノードを必要としませんが、意図的なcrop、小さい素材の強制upscale、独自のresize/upscale方式を使う場合には外部処理を利用できます。動画のdecodeとframe-rate変換は引き続きloader側の責任です。
|
||||
|
||||
Reference入力のバイパスされたソケットは無視され、有効な画像だけがPicture 1から連続採番されます。空欄や不完全なプロンプトも停止せず、警告とFixed fallbackで生成を続行します。未知のモデル、ノード、プロンプト形式を独自判断で拒否する制限も撤廃しました。
|
||||
|
||||
## Run Storage:第2部分だけを再生成
|
||||
|
||||
通常のT2VA/I2VAを`2 chunks x 5 seconds`にした場合、Chunk 1が最初の5秒、Chunk 2が次の5秒です。
|
||||
@@ -246,7 +387,10 @@ Reference入力のバイパスされたソケットは無視され、有効な
|
||||
|
||||
1. Run Name、Base Seed、model、LoRA、解像度、sampler、SIGMAS/steps、Reference、Continuity設定を初回と同じに保ちます。
|
||||
2. `Regenerate From`を`Chunk 2`にします。
|
||||
3. Workflowをもう一度Queueします。
|
||||
3. `Variation Nonce = 0`なら、完了済みの再生成に対して新しいバリエーションを自動選択します。互換性のある未完了runを再開する場合は、既存のバリエーションを引き継ぎます。`1以上`は指定値を固定するため、同じ入力で別の結果を求める場合は別の正の値へ変更します。Base Seedは固定のままにします。
|
||||
4. Workflowをもう一度Queueします。
|
||||
|
||||
Review画面の`Try this chunk again`は、この手動指定とは別に、内部のバリエーションを自動で進めます。
|
||||
|
||||
Continuumは保存済みChunk 1を再Samplingせずに読み込み、その確定済み末尾をContinuation contextとして新しいChunk 2をSamplingします。Reportの目安は`1 reused, 1 generated`です。その後、10秒全体を再Decode/Assemblyします。第1ChunkのSampling結果は再利用され、境界のSeam処理は新しいAssembly時に再評価されます。
|
||||
|
||||
@@ -257,86 +401,92 @@ FL2VA Long Terminal Mergeは重要な例外です。最後の2つのlogical Chun
|
||||
Run Storageの保存契約にはDriving AudioとVideo Guide Framesのidentityを含め、入力変更後に古いChunkを誤再利用しないようにしています。
|
||||
|
||||
## Driving Audio / Video Guide Frames / Seam
|
||||
|
||||
Driving Audioだけを使う、Video Guide Framesだけを使う、Video Guide Framesと別音声を組み合わせる、という3通りの接続に対応します。Video Guide Framesは24 fps入力を基準とし、異なるfpsの素材はLoad Video側で24 fpsへ設定してください。
|
||||
|
||||
H3 Continuum Assemble + SeamはAudio Seam AutoとVideo Seam Autoを既定とし、フレーム削除を行わずに境界の一時的な露出・色変化を補正します。Auto 2は露出ランプ向けの実験的な追加モードです。
|
||||
|
||||
## Legacy V2.1.7 Stable Facade UI
|
||||
|
||||
V2.1.7では、V2.1.6の動的表示制御を廃止し、標準ComfyUI描画だけを使用する静的Facadeへ移行しました。生成処理は互換用`H3ContinuumSamplerV2`を再利用し、State、Session、Prompt Plan、Spectrum Interop、保存Schemaは変更していません。
|
||||
|
||||
通常表示は次を中心にします。
|
||||
|
||||
```text
|
||||
model / clip / video_vae / audio_vae / sampler / sigmas
|
||||
Sequence Prompt
|
||||
first_frame
|
||||
prompt_overrides(任意pack)
|
||||
advanced(任意pack)
|
||||
|
||||
Prompt Format
|
||||
chunks
|
||||
chunk_seconds
|
||||
width / height
|
||||
continuity
|
||||
base_seed
|
||||
control after generate
|
||||
Seam Correction
|
||||
Seam Correction
|
||||
|
||||
outputs: images / audio / result
|
||||
```
|
||||
|
||||
### 補助ノード
|
||||
|
||||
- `H3 Continuum Clip Overrides`: Clip別Promptを1本のpackへまとめます。
|
||||
- `H3 Continuum Advanced`: resume/session入力と低頻度設定をまとめます。
|
||||
- `H3 Continuum Result`: resultから`last_state / session / report`を展開します。
|
||||
- 補助ノードを使わない通常生成では、Sampler本体だけで動作します。
|
||||
|
||||
### Legacy互換
|
||||
|
||||
旧`H3ContinuumSamplerV2`は削除せずLegacy/Coreノードとして登録を維持します。既存WorkflowのノードID、入力順、出力順は変更していません。
|
||||
|
||||
## Continuity
|
||||
|
||||
- `Auto — conservative`
|
||||
- `Balanced — 22 frames`(標準)
|
||||
- `Fast — 5 frames`
|
||||
- `Strong — 39 frames (Experimental)`
|
||||
|
||||
5/22/39フレームはH3の時間latent周期`1,4,4,4,4`に対して、それぞれ2/7/12 temporal latent stepsです。
|
||||
|
||||
## Spectrum
|
||||
|
||||
Continuumは有効な前チャンクContextがある場合だけ`h3_continuum` Interop API v1をMODEL optionsへ付与し、対応Spectrumへ`min_actual_prefix_steps=2`を要求します。初回チャンクにはInterop keyを付与しません。未知・未対応Spectrumでは通常Spectrumとしてfail-openします。
|
||||
|
||||
## 推奨配線
|
||||
|
||||
```text
|
||||
UNET -> SageAttention -> Sol-Attn -> LoRA -> Spectrum -> H3 Continuum Sampler
|
||||
```
|
||||
|
||||
まず`chunks=2 / chunk_seconds=5 / Balanced 22f / Seam Correction=Off`でNative Continuityを確認し、その後`Seam Correction=Auto`を比較してください。
|
||||
|
||||
|
||||
Driving Audioだけを使う、Video Guide Framesだけを使う、Video Guide Framesと別音声を組み合わせる、という3通りの接続に対応します。Video Guide Framesは24 fps入力を基準とし、異なるfpsの素材はLoad Video側で24 fpsへ設定してください。
|
||||
|
||||
H3 Continuum Assemble + SeamはAudio Seam AutoとVideo Seam Autoを既定とし、フレーム削除を行わずに境界の一時的な露出・色変化を補正します。Auto 2は露出ランプ向けの実験的な追加モードです。
|
||||
|
||||
## Legacy V2.1.7 Stable Facade UI
|
||||
|
||||
V2.1.7では、V2.1.6の動的表示制御を廃止し、標準ComfyUI描画だけを使用する静的Facadeへ移行しました。生成処理は互換用`H3ContinuumSamplerV2`を再利用し、State、Session、Prompt Plan、Spectrum Interop、保存Schemaは変更していません。
|
||||
|
||||
通常表示は次を中心にします。
|
||||
|
||||
```text
|
||||
model / clip / video_vae / audio_vae / sampler / sigmas
|
||||
Sequence Prompt
|
||||
first_frame
|
||||
prompt_overrides(任意pack)
|
||||
advanced(任意pack)
|
||||
|
||||
Prompt Format
|
||||
chunks
|
||||
chunk_seconds
|
||||
width / height
|
||||
continuity
|
||||
base_seed
|
||||
control after generate
|
||||
Seam Correction
|
||||
Seam Correction
|
||||
|
||||
outputs: images / audio / result
|
||||
```
|
||||
|
||||
### 補助ノード
|
||||
|
||||
- `H3 Continuum Clip Overrides`: Clip別Promptを1本のpackへまとめます。
|
||||
- `H3 Continuum Advanced`: resume/session入力と低頻度設定をまとめます。
|
||||
- `H3 Continuum Result`: resultから`last_state / session / report`を展開します。
|
||||
- 補助ノードを使わない通常生成では、Sampler本体だけで動作します。
|
||||
|
||||
### Legacy互換
|
||||
|
||||
当時のV2.1.7では、旧`H3ContinuumSamplerV2`をLegacy/Coreノードとして登録し、既存WorkflowのノードID、入力順、出力順を維持していました。これはV3.8の公開範囲を示す説明ではありません。このIDを使う旧Workflowは対応するhistorical Release/tagで開いてください。
|
||||
|
||||
## Continuity
|
||||
|
||||
- `Auto — conservative`
|
||||
- `Balanced — 22 frames`(標準)
|
||||
- `Fast — 5 frames`
|
||||
- `Strong — 39 frames (Experimental)`
|
||||
|
||||
5/22/39フレームはH3の時間latent周期`1,4,4,4,4`に対して、それぞれ2/7/12 temporal latent stepsです。
|
||||
|
||||
## Spectrum
|
||||
|
||||
Continuumは有効な前チャンクContextがある場合だけ`h3_continuum` Interop API v1をMODEL optionsへ付与し、対応Spectrumへ`min_actual_prefix_steps=2`を要求します。初回チャンクにはInterop keyを付与しません。未知・未対応Spectrumでは通常Spectrumとしてfail-openします。
|
||||
|
||||
## 推奨配線
|
||||
|
||||
```text
|
||||
UNET -> SageAttention -> Sol-Attn -> LoRA -> Spectrum -> H3 Continuum Sampler
|
||||
```
|
||||
|
||||
まず`chunks=2 / chunk_seconds=5 / Balanced 22f / Seam Correction=Off`でNative Continuityを確認し、その後`Seam Correction=Auto`を比較してください。
|
||||
|
||||
## インストール
|
||||
|
||||
ComfyUI 0.32.0以上が必要です。ComfyUI 0.33.3でパッケージ検証、0.34.0でV3.6.1 GPU Smoke、0.34.2でV3.7 Conditioning/RefineSchedule Correctness Gateを検証済みです。ComfyUIの最新版は必須ではありません。
|
||||
V3.8はComfyUI 0.34.2で検証しています。以下の歴史的な受入記録には旧ComfyUI版も登場しますが、現在のインストール目標ではありません。V3.8の依存を満たす限り、ComfyUIの最新版は必須ではありません。
|
||||
|
||||
ZIPを展開して、`ComfyUI-H3-Continuum`フォルダーを`ComfyUI/custom_nodes/`へ置き、ComfyUIを再起動します。
|
||||
|
||||
旧`ComfyUI-H3-Continuum-Join`が残っている場合は同時ロードを避けるため削除または退避してください。同梱`install_windows.bat`は旧名・新名の既存フォルダーを日時付きでバックアップします。
|
||||
|
||||
再起動後は`H3 Continuum Sampler V3.8`を検索してください。V3.8の検索面は上記7ノードだけです。
|
||||
|
||||
旧`ComfyUI-H3-Continuum-Join`が残っている場合は同時ロードを避けるため削除または退避してください。同梱`install_windows.bat`は旧名・新名の既存フォルダーを日時付きでバックアップします。
|
||||
|
||||
## 検査
|
||||
|
||||
V3.6 release gateはPIG-0~PIG-5を完了し、backend別Run Storage、実cache Save/Resume/Regenerate From、Terminal Mergeのatomic再利用、Reference Image/Audio保持、保護prefix bit-exact、GPU Workflow、Audio Seam数値検証、実聴Audio PASSを含みます。最終自動検証は`527 passed`で、完全なpackage checklistは`PACKAGE_VALIDATION.txt`へ記録しています。source/runtime登録、PackedLayout、Fixed 3×5 Prompt Plan、JavaScript UI harness、Prompt/CLIP cache一致、Video Guide bit-exact A/B、V3.5 Second Pass/Hi-Res、V3.5.3配布整合性の回帰も維持します。
|
||||
現在のV3.8 Public Surface suiteは、正確な7 ID export、Spectrum graph 1本とZIP内JSONの同一性、外部依存、Registry除外、既存V3.8 widget/socket順を維持したAUDIO-R1 socket末尾追加、`Show Advanced Settings`/`Hide Advanced Settings`による表示切替と旧`H3 Continuum View` propertyからの移行を確認します。Registry配布対象のハッシュは`REGISTRY_MANIFEST.sha256`、source側の対象ファイルは`MANIFEST.sha256`で管理します。Gitの改行変換は無効にして配布バイト列を維持します。旧実装はmodule-local testで維持しますが、それによってV3.8の公開ノードが増えることはありません。
|
||||
|
||||
Main Hi-Res Fixの3×5秒2xは、RTX 5060 Ti 16 GiBで37T groupの1152×1152 Second Pass完了後、Terminal Mergeの77T group最初の推論時にCUDA OOMとなり未受入です。Reference/Hybrid固有の1×5秒Second Passは受入済みですが、長尺Reference/Hybridは未確認です。Disk-backedが保証する低メモリ範囲はContinuum Assemblyであり、Core Decodeや下流ノードが別の全量copyを作る可能性は残ります。
|
||||
**配布名の最終整理前のCPU総検証(2026-09-07):1,154/1,154 PASS。** failure、error、skip、記録されたCUDA初期化要求はいずれも0件でした。ComfyUI Core 0.34.5の隔離CPU検査で7ノード登録とnative PackedLayoutを確認し、旧Core-onlyテンプレートと提供されたSpectrum graphのgraph/schemaも確認しました。CUDAは未初期化のままです。最終配布ではSpectrum graphを変更せず汎用のV38ファイル名に統一します。これはCPU上のソフトウェア契約の検証であり、新たなGPU画質PASSや、起動中の実行環境へ最新版が反映されたことを示すものではありません。
|
||||
|
||||
```text
|
||||
python -m compileall -q .
|
||||
pytest -q
|
||||
```
|
||||
|
||||
MIT License。
|
||||
**過去のV3.6受入記録:** PIG-0~PIG-5を完了し、backend別Run Storage、実cache Save/Resume/Regenerate From、Terminal Mergeのatomic再利用、Reference Image/Audio保持、保護prefix bit-exact、GPU Workflow、Audio Seam数値検証、実聴Audio PASSを含みます。当時の自動検証は`527 passed`であり、現在のV3.8 CPUテスト件数ではありません。package checklistと過去の受入記録は`PACKAGE_VALIDATION.txt`にあります。source/runtime登録、PackedLayout、Fixed 3×5 Prompt Plan、JavaScript UI harness、Prompt/CLIP cache一致、Video Guide bit-exact A/B、V3.5 Second Pass/Hi-Res、V3.5.3配布整合性の回帰も維持します。
|
||||
|
||||
Main Hi-Res Fixの3×5秒2xは、RTX 5060 Ti 16 GiBで37T groupの1152×1152 Second Pass完了後、Terminal Mergeの77T group最初の推論時にCUDA OOMとなり未受入です。Reference/Hybrid固有の1×5秒Second Passは受入済みですが、長尺Reference/Hybridは未確認です。Disk-backedが保証する低メモリ範囲はContinuum Assemblyであり、Core Decodeや下流ノードが別の全量copyを作る可能性は残ります。
|
||||
|
||||
```text
|
||||
python -m compileall -q .
|
||||
pytest -q
|
||||
```
|
||||
|
||||
MIT License。
|
||||
|
||||
@@ -0,0 +1,105 @@
|
||||
dca65fb1393e67f59c6f81f9411e3e745eb8f1097e9a2adf7ffc6f4e3901ca9f __init__.py
|
||||
be0b8d39e5343680ebea815c3a4fb6ce7a32e065f30e43e013040a40f702cef3 .comfyignore
|
||||
3e7a1ec3380be2a222c8a3e9b8a6bb184d3a760478957f48186438f15235bdba branch_provenance.py
|
||||
2a1340ac613def60f0a2c1c7e382c87486b49b14ebc3c6ef34ae14af633295d2 CHANGELOG.md
|
||||
c1ed3a0342730450958fb62fd21854a876991f3a4aefb24e5383b0c73cd2312d compatibility.py
|
||||
4d62508f900af9f93ec320afb900c27cc9a300d1e0c0a94714258498c5ede5fc conditioning.py
|
||||
64967f4987e3ad9316f3a47f0dcf582eeff39ee0c3485f4184d3532d495534ae constants.py
|
||||
cf255b8a635471229aebadc926acfdcacb65963adbcb9e0f9505d04eada2c6b5 continuation.py
|
||||
b30fe4640359bebfcdeeb94dbeec94cb346c8e3646509e1dcdb87d7021ba04ff docs/N2B_BRANCH_PROVENANCE_CONTRACT_V1.md
|
||||
717577efdec5e61600504b77bc2a099ef022c4fe2333e936c3310c7182d8f2a0 docs/V38_OPEN_INTEGRATION_CONTRACT.md
|
||||
1d2838cc47694609289ea15132872ad48e1b6c8274da4b7bf188dd3ebf066121 docs/V38_RELEASE_AND_MIGRATION.md
|
||||
cedd7b07901d6065079ef37380f0062d535a39c98c8f614e1b26582f549d7183 driving_audio.py
|
||||
e490c87e4995930f95c8fffc4c678111d7897e74003e1962b9b4a247ba43f4ac examples/workflows/MiniMax_H3_Continuum_V38.json
|
||||
8c109973e5b49cf52b32e0ebb2b5ae6a4e349191e66c2696ff43ce76fefeb07c graph_contract.py
|
||||
bf0556b076dbaca67c3405a7d86c333ca7fdf3d4381529b0a9edc906519943e9 guide_timeline.py
|
||||
1473c384082700f422f2cf9141e0d012d87d2b43ac8a8a433edc7172e6ca7bf6 hardening.py
|
||||
7c8b1226592dcd9d0ec6cc1579956e380fedc9b2672386c29db82169a6cf5f10 INSTALL_JA.txt
|
||||
23bddc5a41d2e997f4fbf789c7128e32f4f197f1405b2aef1c76794f57482446 install_windows.bat
|
||||
fcf80acf6479ece00066eeb59f75d5246cb7b17b75ba84938b73ae17a5083903 install_windows.ps1
|
||||
6aa3f5780baa7bb0c0672b5f01a2f77e5f209da93f6373468cb274ea2f643d4b layout_adapter.py
|
||||
c44abbd789091bbead01250dbd5453e60539d2665c69f162335fdbd2936019c2 LICENSE
|
||||
d3e213005670e94dee33a240349a4d245cf9a3b6602099f11ed30cf5a32e2c21 media.py
|
||||
8b360a1c47a8ee5a95656ffbc83bfc16de69678ecec2c1d8cace46b5ea4e911e metadata.ini
|
||||
2d611f7201889851eac6459f8aa2b37baf342b345241979ca6042b61b252dff9 model_patch.py
|
||||
a4ce23167b83e8d72b86a802dfde4f4045828433c7c13aab799bd64831dc04a4 nodes.py
|
||||
57dcb61cc3e83b2ca97616919ac6ee17d4c62caf845c38161573f56dad12f8fe PACKAGE_INFO_JA.txt
|
||||
000a56a942b13d11973994ab32cd2a1abc424a3fe1d95a323240077bd8092bdf PACKAGE_VALIDATION.txt
|
||||
b470819f16fc179654dc1600721a63f0a5a14e777f4c004d574b499da6886ba5 public_api.py
|
||||
96f98d727b72d6aefd431061572e187c303365a3e5b4d20cbb2bcf030aa30112 pyproject.toml
|
||||
88aa955161d04d14ebd8d90d6cb6c6206097160a671eb4d1bfe9b3e76ebc6c13 README_JA.md
|
||||
bd71498ddb59edc250ca623ee7cc6fb0c3a728025c879cda81390d435e5c6eac README.md
|
||||
44127adcfa30ee84bff9cd4b2d0c695355209550e76982d374122008728aa5bc reference_audio.py
|
||||
5cb9bfd6810d3a93a637451980a4cc5c1436e5b84cfd1c7a111cd192e876351b reference_video.py
|
||||
131bdfbb7a7173c9e7826859c0e648bfb69bd18bf20fa5528c0e18a63f888b26 reference.py
|
||||
467edb2c188d024c2392aafe7423b3f835e16b10f570da76e2f7dda8a962c1c5 requirements.txt
|
||||
a65d657466491aba8b2d1004e87071cee2819869813e646789df736a3ccf479e run_storage.py
|
||||
6056de6c0a5322a8a51ba5a114538dca2ef67788cd1afba10fedd483b95f6afa state_io.py
|
||||
3a359a0467725cc292ccb4c86cf0c3d30bb6a114d01f5345792b09ea3d45441d state.py
|
||||
43ec4023dc06c941e5d7a04db4b8a89fb58d744ceb986f6eb9bf534d4fdcb87b temporal.py
|
||||
0dbe8a5f71c92f3523942343b40787104c8b96781461ba3ba82934a6bdbe5834 THIRD_PARTY_NOTICES.md
|
||||
f218e1a93c42467c6057c5c1d04d57cc82f6331b97ec9257e4e2dfb9c831876a timeline_video.py
|
||||
0bc369ee428b8a5bc8e370a81fbab427262a1fdb7805a78c442c91698d65efba tools/__init__.py
|
||||
e5a84569953ee63b9625f4f2e3195ec368204fddcfc746564cfbd0e8449bb8e9 tools/p20_file_backed_tensor_poc.py
|
||||
556bce17d14303d1e8a36a85dc13da24c46eedd86f3eacdb102289574faf0626 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
|
||||
aea01a48a8c03a25ed97ea05e5b137f89e388832d1be7d38f2da2be3d1b9830b v2/motion.py
|
||||
aefa29b9d51a05f9a972d75404fd786300202251887e67f55530e97ccd9519f5 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
|
||||
3a98f8a21756f3813f52197946e761227507b14c40703c9fb1bb108c1e4ddbe7 v2/sequence.py
|
||||
13213e7709fd02bb810af3c18e4cd7d010f8cdfb121a4b99866a9f2333331089 v2/session_io.py
|
||||
3ea23dbce6fcd217b6e81235855479b9b16fed7a21693cf156f9014555c4fe13 v2/session.py
|
||||
78c830cdf49034c6e3b2cd3da5914d5cfc5638eb63ec6dbd1bab13c50d6d4caf v3/__init__.py
|
||||
ea2922567df90436dd6fa21696833a49dd0cbfeee142a5fedc3a7c303824d473 v3/adaptive_continuity.py
|
||||
b3dc61503d35d9ef0a0dc7fed1c9b2fdc00fcb2072d4e39f64ae0826f9ec7dca v3/assembly_v35.py
|
||||
7815230e0a9540bc2edeaf818e940b7a1fdd817fd217ba8a4f9cb21aaf6a308e v3/assembly.py
|
||||
3f62fdb35e804f42d7cbf0828b4e87e69a2b99246c3f7467fe4fa698f1d803c9 v3/conditioning_bridge_nodes.py
|
||||
92b92c51b87182d420ce0468f57797fbb6fe4123d04080b73d6d89581ff96c31 v3/driving_nodes.py
|
||||
2f395da6a41981713f99ba40b73d14f2274b8ca34a73cf2b275a444993765b99 v3/easy_audio_nodes.py
|
||||
64b3e54b42e5156642f9957ccc374fd190d9fc7145637984e702534fb1bf80b4 v3/easy_image_nodes.py
|
||||
ac859cb1a6e23b8ceae300d818c24fe1346b649a0d663017a9b3ac64aa96fca3 v3/easy_nodes.py
|
||||
bf6bae0c9e14883728860470af86e14395dba40a7377cd874d4dc4548ae53c65 v3/easy_video_nodes.py
|
||||
6cc7ed74666084c55beb9075304e92a9defafd81b9c6678239ca3859a08cddd7 v3/file_backed_buffer.py
|
||||
cb53e1b104415032ec79b7e7aa1c99848e63da3eedaa251eeba102970e4172b5 v3/hires_fix_nodes.py
|
||||
0858487e2b8c0060a856273ffc65d23165b2f253d183f506e27e419aea0da561 v3/latent_resize_nodes.py
|
||||
5b8a54e67a608e757a505abc712effb33312636e3bb235835a485a506e80eeee v3/masked_continuation.py
|
||||
91a868d2e392b018b01d0396209849c146b0d560ceb109fcdd87dea7f3d786aa v3/memory_action_policy.py
|
||||
85477badd85281cfb77582fdd5b34228a9f6b68376f1b7743af2ca7d4b55aa36 v3/memory_attribution.py
|
||||
b528e34e24407896e3728d693a40393b46ec7bce236d455721712dfe2fe75adb v3/nodes.py
|
||||
a3411c7a295308d21623551cf4aeca5bef511eb5f063f31ac84032e3bdf4e16d v3/packed_row_planner.py
|
||||
b7c4a35a5e73f528492bc6946b97b687c412f1d3f5f976c19d45c6dc20288c9a v3/pixel_vae_resize.py
|
||||
34ea38c03b6322288d88fc8595e3655a7a7afddb51709142a954eb7349f71ac2 v3/plan.py
|
||||
ec71e3965f445756d54d005c0e27bea520e26dbac44e1ee3d3867bfe2da100b0 v3/ref_encode_cache.py
|
||||
9076c47aa5145c81f34793d6c90410656065248f37d9990a92a6a4061b358811 v3/refine_context.py
|
||||
519586b1b3f48c73d329f7a2aaa8a1bfc6fe31ac2ecb64f2b1fdf9c19026001a v3/refine_sampling.py
|
||||
43f33f989eb70ca87b916fc33267732a2be3dd4581fc72af17c53f840b53ca49 v3/refine_schedule.py
|
||||
afc149dc347b4c1502ddf32ea4229e633799cd34d2b2c6f98bf8a47910a9ef77 v3/refine_scope.py
|
||||
ac373d9783d3a7bb968e8117843d246d6a090b66a819015348bff84e7747442c v3/refine_target.py
|
||||
45ae91f13e8f71405d2f46045c8acc6eabbc9500c194cf5d0ba541bb085cd135 v3/refine_window.py
|
||||
ae909b43ad17934c85881d3b0bea81e7b45c215eeb4d1f9f6a9ea72faf633ddf v3/reliability_v38.py
|
||||
520a4ae849f83450855ce0023c582db5f91d29d8694a99aa8cf491351c837cff v3/resolution.py
|
||||
c21602eb983d497f0eb559197f4f1408b9b5ebb8dcd3aab65e746641f77bcfd4 v3/review_control.py
|
||||
452022107cea233aa84d5366ec4943ac5aadbd5fcf786113f1d542a641eac8f7 v3/second_pass_nodes.py
|
||||
71791b8032c9857b5fcdcaf1ce004a48c0e1c9e074a1de867ec0547e3ec5e313 v3/reference_video.py
|
||||
66501234756c2b558ce84f887bd540e7f843ed574c8a8b2522950bd1985d7acc 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
|
||||
d1957fa668a0332e483330bc79fc53095712420e401035a4f80cf6b532677d51 version.py
|
||||
c2883272b05a9a9146b5c6cf614ddae8a3e6893cd910902023aae61360195289 web/easy_bypass_toggle.js
|
||||
092088096307d33ac016b82b4774ca38845a2ff2f63b97ac6da8c5aca4fea413 web/easy_load_audio.js
|
||||
9db0aa94f634578a962d5db49e5c70356040a59df968e3a2e531b327a623081f web/easy_load_image.js
|
||||
873efcbd15c2d9fa10c9d5fc51a796ad3a18c0c6acceecf499c4b956aa845c6c web/easy_load_video.js
|
||||
0c68d13a1f8beb7431a32b471f8b0612c42fcc4bf72dd97611a025d158008662 web/easy_v38.js
|
||||
7b318be7e0a6ffa7a0b924f149ee90c10e4ebfb731da2bc40297bad0ecf63269 web/project_id.js
|
||||
0cf8d49bcb71b30437dc893f6218dc4cfb1cd244b647e4fbc2861dea2271a33a web/reference_audio_ui.js
|
||||
83d28cc0cd549066962dc21ceae05d2b189fe22391b556887eab2cc1800e1e80 examples/workflows/MiniMax_H3_Continuum_V38.zip
|
||||
@@ -0,0 +1,222 @@
|
||||
"""Pure Branch Provenance Contract v1 helpers.
|
||||
|
||||
The contract describes immutable physical-group revisions independently from
|
||||
the sampling contract that produced their tensors. A display label such as
|
||||
``Take B`` is deliberately not persisted as identity.
|
||||
"""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import hashlib
|
||||
import json
|
||||
from collections.abc import Iterable, Mapping
|
||||
from dataclasses import dataclass
|
||||
from typing import Any
|
||||
|
||||
|
||||
BRANCH_PROVENANCE_VERSION = 1
|
||||
TAKE_ACTION_AUTOMATIC = "Automatic"
|
||||
TAKE_ACTION_USE = "Use This Take"
|
||||
TAKE_ACTION_CONTINUE = "Continue From Here"
|
||||
TAKE_ACTION_OPTIONS = (
|
||||
TAKE_ACTION_AUTOMATIC,
|
||||
TAKE_ACTION_USE,
|
||||
TAKE_ACTION_CONTINUE,
|
||||
)
|
||||
|
||||
|
||||
class BranchProvenanceError(ValueError):
|
||||
"""Raised when persisted branch ancestry is ambiguous or inconsistent."""
|
||||
|
||||
|
||||
def _canonical(value: Any) -> str:
|
||||
return json.dumps(value, sort_keys=True, separators=(",", ":"), ensure_ascii=True)
|
||||
|
||||
|
||||
def _hash(value: Any) -> str:
|
||||
return hashlib.sha256(_canonical(value).encode("utf-8")).hexdigest()
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
class PhysicalGroup:
|
||||
start: int
|
||||
end: int
|
||||
physical_group: int
|
||||
|
||||
def as_metadata(self) -> dict[str, int]:
|
||||
return {
|
||||
"start": self.start,
|
||||
"end": self.end,
|
||||
"physical_group": self.physical_group,
|
||||
}
|
||||
|
||||
|
||||
def physical_groups(*, chunks: int, terminal_merge_enabled: bool) -> tuple[PhysicalGroup, ...]:
|
||||
if isinstance(chunks, bool) or not isinstance(chunks, int) or chunks < 1:
|
||||
raise BranchProvenanceError("chunks must be a positive integer")
|
||||
if type(terminal_merge_enabled) is not bool:
|
||||
raise BranchProvenanceError("terminal_merge_enabled must be a boolean")
|
||||
if terminal_merge_enabled and chunks < 2:
|
||||
raise BranchProvenanceError("Terminal Merge requires at least two chunks")
|
||||
terminal_start = chunks - 1 if terminal_merge_enabled else None
|
||||
groups: list[PhysicalGroup] = []
|
||||
chunk = 1
|
||||
while chunk <= chunks:
|
||||
if terminal_start is not None and chunk == terminal_start:
|
||||
groups.append(PhysicalGroup(chunk, chunks, chunk))
|
||||
break
|
||||
groups.append(PhysicalGroup(chunk, chunk, chunk))
|
||||
chunk += 1
|
||||
return tuple(groups)
|
||||
|
||||
|
||||
def _record_identity(record: Mapping[str, Any]) -> dict[str, Any]:
|
||||
entry = record.get("entry") or {}
|
||||
return {
|
||||
"sequence_index": int(record.get("sequence_index", -1)),
|
||||
"storage_revision_id": str(record.get("storage_revision_id", "")),
|
||||
"filename": str(record.get("filename", "")),
|
||||
"file_size": int(record.get("file_size", -1)),
|
||||
"file_sha256": str(record.get("file_sha256", "")),
|
||||
"seed": int(record.get("seed", entry.get("seed", -1))),
|
||||
"prompt_hash": str(record.get("prompt_hash", entry.get("prompt_hash", ""))),
|
||||
}
|
||||
|
||||
|
||||
def make_group_revision(
|
||||
*,
|
||||
parent_revision_id: str | None,
|
||||
group: PhysicalGroup,
|
||||
variation_nonce: int,
|
||||
created_utc: str,
|
||||
storage_revision_id: str,
|
||||
generation_contract_sha256: str,
|
||||
lineage_sha256: str,
|
||||
records: Iterable[Mapping[str, Any]],
|
||||
branch_cut: Mapping[str, Any] | None = None,
|
||||
) -> dict[str, Any]:
|
||||
if not isinstance(group, PhysicalGroup):
|
||||
raise BranchProvenanceError("group must be a PhysicalGroup")
|
||||
nonce = int(variation_nonce)
|
||||
if nonce < 0 or nonce > 0xFFFFFFFF:
|
||||
raise BranchProvenanceError("variation_nonce is outside uint32")
|
||||
record_values = [_record_identity(record) for record in records]
|
||||
expected_positions = list(range(group.start - 1, group.end))
|
||||
if [record["sequence_index"] for record in record_values] != expected_positions:
|
||||
raise BranchProvenanceError("physical group records are incomplete or non-atomic")
|
||||
if not all(record["storage_revision_id"] for record in record_values):
|
||||
raise BranchProvenanceError("physical group record source is missing")
|
||||
seed_identity = _hash(
|
||||
[
|
||||
{
|
||||
"sequence_index": record["sequence_index"],
|
||||
"seed": record["seed"],
|
||||
"prompt_hash": record["prompt_hash"],
|
||||
}
|
||||
for record in record_values
|
||||
]
|
||||
)
|
||||
identity = {
|
||||
"branch_provenance_version": BRANCH_PROVENANCE_VERSION,
|
||||
"parent_revision_id": None if parent_revision_id is None else str(parent_revision_id),
|
||||
"group": group.as_metadata(),
|
||||
"variation_nonce": nonce,
|
||||
"seed_identity": seed_identity,
|
||||
"storage_revision_id": str(storage_revision_id),
|
||||
"generation_contract_sha256": str(generation_contract_sha256),
|
||||
"lineage_sha256": str(lineage_sha256),
|
||||
"records": record_values,
|
||||
}
|
||||
revision_id = _hash(identity)[:24]
|
||||
result = {
|
||||
"revision_id": revision_id,
|
||||
**identity,
|
||||
"created_utc": str(created_utc),
|
||||
"revision_order": f"{created_utc}|{revision_id}",
|
||||
}
|
||||
if branch_cut is not None:
|
||||
result["branch_cut"] = {
|
||||
"selected_revision_id": str(branch_cut.get("selected_revision_id", "")),
|
||||
"after_physical_group": int(branch_cut.get("after_physical_group", 0)),
|
||||
}
|
||||
return result
|
||||
|
||||
|
||||
def validate_group_revision(value: Mapping[str, Any]) -> dict[str, Any]:
|
||||
if not isinstance(value, Mapping):
|
||||
raise BranchProvenanceError("group revision must be an object")
|
||||
if int(value.get("branch_provenance_version", -1)) != BRANCH_PROVENANCE_VERSION:
|
||||
raise BranchProvenanceError("group revision provenance version is unsupported")
|
||||
group_value = value.get("group")
|
||||
if not isinstance(group_value, Mapping):
|
||||
raise BranchProvenanceError("group revision physical group is missing")
|
||||
group = PhysicalGroup(
|
||||
start=int(group_value.get("start", 0)),
|
||||
end=int(group_value.get("end", 0)),
|
||||
physical_group=int(group_value.get("physical_group", 0)),
|
||||
)
|
||||
if group.start < 1 or group.end < group.start or group.physical_group != group.start:
|
||||
raise BranchProvenanceError("group revision physical group is invalid")
|
||||
rebuilt = make_group_revision(
|
||||
parent_revision_id=value.get("parent_revision_id"),
|
||||
group=group,
|
||||
variation_nonce=int(value.get("variation_nonce", -1)),
|
||||
created_utc=str(value.get("created_utc", "")),
|
||||
storage_revision_id=str(value.get("storage_revision_id", "")),
|
||||
generation_contract_sha256=str(value.get("generation_contract_sha256", "")),
|
||||
lineage_sha256=str(value.get("lineage_sha256", "")),
|
||||
records=value.get("records") or [],
|
||||
branch_cut=value.get("branch_cut"),
|
||||
)
|
||||
if str(value.get("revision_id", "")) != rebuilt["revision_id"]:
|
||||
raise BranchProvenanceError("group revision immutable identity is invalid")
|
||||
if str(value.get("seed_identity", "")) != rebuilt["seed_identity"]:
|
||||
raise BranchProvenanceError("group revision seed identity is invalid")
|
||||
rebuilt["revision_order"] = str(
|
||||
value.get("revision_order", rebuilt["revision_order"])
|
||||
)
|
||||
return rebuilt
|
||||
|
||||
|
||||
def resolve_chain(
|
||||
catalog: Mapping[str, Mapping[str, Any]],
|
||||
head_revision_id: str,
|
||||
) -> list[dict[str, Any]]:
|
||||
head = str(head_revision_id)
|
||||
if not head:
|
||||
raise BranchProvenanceError("selected revision ID is empty")
|
||||
reverse: list[dict[str, Any]] = []
|
||||
seen: set[str] = set()
|
||||
current: str | None = head
|
||||
while current is not None:
|
||||
if current in seen:
|
||||
raise BranchProvenanceError("group revision ancestry contains a cycle")
|
||||
seen.add(current)
|
||||
raw = catalog.get(current)
|
||||
if raw is None:
|
||||
raise BranchProvenanceError(
|
||||
f"group revision parent is missing: {current}"
|
||||
)
|
||||
revision = validate_group_revision(raw)
|
||||
reverse.append(revision)
|
||||
parent = revision.get("parent_revision_id")
|
||||
current = None if parent is None else str(parent)
|
||||
chain = list(reversed(reverse))
|
||||
expected_start = 1
|
||||
lineage = str(chain[0].get("lineage_sha256", ""))
|
||||
for revision in chain:
|
||||
group = revision["group"]
|
||||
if int(group["start"]) != expected_start:
|
||||
raise BranchProvenanceError("group revision ancestry is not a contiguous prefix")
|
||||
if str(revision.get("lineage_sha256", "")) != lineage:
|
||||
raise BranchProvenanceError("group revision ancestry crosses sampling lineages")
|
||||
expected_start = int(group["end"]) + 1
|
||||
return chain
|
||||
|
||||
|
||||
def active_revision_map(chain: Iterable[Mapping[str, Any]]) -> dict[str, str]:
|
||||
active: dict[str, str] = {}
|
||||
for revision in chain:
|
||||
validated = validate_group_revision(revision)
|
||||
active[str(validated["group"]["physical_group"])] = validated["revision_id"]
|
||||
return active
|
||||
@@ -184,9 +184,33 @@ def run_native_layout_self_test() -> str:
|
||||
va, _vb = target_video
|
||||
if not torch.equal(layout.position_ids[ra:rb], layout.position_ids[va : va + (rb - ra)]):
|
||||
raise CompatibilityError("layout self-test could not align video context")
|
||||
audio_refs = [
|
||||
{
|
||||
"kind": "audio",
|
||||
"ref_audio_t": length,
|
||||
"audio_latent": torch.zeros(1, 32, 2, length),
|
||||
}
|
||||
for length in (2, 3, 4)
|
||||
]
|
||||
audio_layout = h3_model.PackedLayout(
|
||||
3, 7, 2, 2, 10, keyframes=None, refs=audio_refs
|
||||
)
|
||||
audio_segments = [
|
||||
stop - start
|
||||
for start, stop, kind in audio_layout.segments
|
||||
if kind == "ref_audio"
|
||||
]
|
||||
packed_audio_rows = torch.cat(
|
||||
[h3_model.pack_audio(item["audio_latent"]) for item in audio_refs], dim=0
|
||||
).shape[0]
|
||||
if audio_segments != [4, 6, 8] or sum(audio_segments) != packed_audio_rows:
|
||||
raise CompatibilityError(
|
||||
"layout self-test found a multi-Reference-Audio packed-row mismatch"
|
||||
)
|
||||
return (
|
||||
f"native PackedLayout self-test passed; rows={layout.position_ids.shape[0]}, "
|
||||
f"position_ids_id={result['position_ids_id']}"
|
||||
f"position_ids_id={result['position_ids_id']}, "
|
||||
f"reference_audio_rows={packed_audio_rows}"
|
||||
)
|
||||
|
||||
def ensure_native_h3_base_model(base_model: Any) -> None:
|
||||
|
||||
@@ -1,105 +1,105 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Any
|
||||
|
||||
|
||||
CONDITIONING_MODE_T2VA = "t2va"
|
||||
CONDITIONING_MODE_I2VA = "i2va"
|
||||
CONDITIONING_MODE_LAST_ONLY = "last_only"
|
||||
CONDITIONING_MODE_FL2VA = "fl2va"
|
||||
CONDITIONING_MODE_REFERENCE = "reference"
|
||||
|
||||
CONDITIONING_MODES = frozenset(
|
||||
{
|
||||
CONDITIONING_MODE_T2VA,
|
||||
CONDITIONING_MODE_I2VA,
|
||||
CONDITIONING_MODE_LAST_ONLY,
|
||||
CONDITIONING_MODE_FL2VA,
|
||||
CONDITIONING_MODE_REFERENCE,
|
||||
}
|
||||
)
|
||||
|
||||
_MODE_LABELS = {
|
||||
CONDITIONING_MODE_T2VA: "T2VA + Continuation",
|
||||
CONDITIONING_MODE_I2VA: "I2VA + Continuation",
|
||||
CONDITIONING_MODE_LAST_ONLY: "Last Frame + Continuation",
|
||||
CONDITIONING_MODE_FL2VA: "FL2VA + Continuation",
|
||||
CONDITIONING_MODE_REFERENCE: "Reference + Continuation",
|
||||
}
|
||||
|
||||
|
||||
def conditioning_mode_from_presence(
|
||||
*, has_first: bool, has_last: bool, has_reference: bool
|
||||
) -> str:
|
||||
if has_reference:
|
||||
return CONDITIONING_MODE_REFERENCE
|
||||
if has_first and has_last:
|
||||
return CONDITIONING_MODE_FL2VA
|
||||
if has_first:
|
||||
return CONDITIONING_MODE_I2VA
|
||||
if has_last:
|
||||
return CONDITIONING_MODE_LAST_ONLY
|
||||
return CONDITIONING_MODE_T2VA
|
||||
|
||||
|
||||
def detect_conditioning_mode(
|
||||
*, first_frame: Any, last_frame: Any, reference_assets: Any
|
||||
) -> str:
|
||||
return conditioning_mode_from_presence(
|
||||
has_first=first_frame is not None,
|
||||
has_last=last_frame is not None,
|
||||
has_reference=reference_assets is not None,
|
||||
)
|
||||
|
||||
|
||||
def conditioning_mode_label(mode: str) -> str:
|
||||
try:
|
||||
return _MODE_LABELS[str(mode)]
|
||||
except KeyError as exc:
|
||||
raise ValueError(f"unknown conditioning mode: {mode!r}") from exc
|
||||
|
||||
|
||||
def conditioning_display_label(
|
||||
*,
|
||||
has_first: bool,
|
||||
has_last: bool,
|
||||
has_reference: bool,
|
||||
) -> str:
|
||||
"""Return a user-facing label without changing the runtime mode contract."""
|
||||
if has_reference:
|
||||
if has_first and has_last:
|
||||
return "Hybrid FL2VA + Reference + Continuation"
|
||||
if has_first:
|
||||
return "Hybrid I2VA + Reference + Continuation"
|
||||
if has_last:
|
||||
return "Hybrid L2VA + Reference + Continuation"
|
||||
return "Reference + Continuation"
|
||||
mode = conditioning_mode_from_presence(
|
||||
has_first=has_first,
|
||||
has_last=has_last,
|
||||
has_reference=False,
|
||||
)
|
||||
return conditioning_mode_label(mode)
|
||||
|
||||
|
||||
def conditioning_mode_display_label(
|
||||
mode: str,
|
||||
*,
|
||||
has_first: bool = False,
|
||||
has_last: bool = False,
|
||||
has_reference: bool = False,
|
||||
) -> str:
|
||||
"""Legacy display helper retained for existing callers and tests."""
|
||||
if has_first or has_last or has_reference:
|
||||
return conditioning_display_label(
|
||||
has_first=has_first,
|
||||
has_last=has_last,
|
||||
has_reference=has_reference,
|
||||
)
|
||||
return conditioning_mode_label(mode)
|
||||
|
||||
|
||||
def conditioning_mode_uses_video_vae(mode: str) -> bool:
|
||||
if mode not in CONDITIONING_MODES:
|
||||
raise ValueError(f"unknown conditioning mode: {mode!r}")
|
||||
return mode != CONDITIONING_MODE_T2VA
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Any
|
||||
|
||||
|
||||
CONDITIONING_MODE_T2VA = "t2va"
|
||||
CONDITIONING_MODE_I2VA = "i2va"
|
||||
CONDITIONING_MODE_LAST_ONLY = "last_only"
|
||||
CONDITIONING_MODE_FL2VA = "fl2va"
|
||||
CONDITIONING_MODE_REFERENCE = "reference"
|
||||
|
||||
CONDITIONING_MODES = frozenset(
|
||||
{
|
||||
CONDITIONING_MODE_T2VA,
|
||||
CONDITIONING_MODE_I2VA,
|
||||
CONDITIONING_MODE_LAST_ONLY,
|
||||
CONDITIONING_MODE_FL2VA,
|
||||
CONDITIONING_MODE_REFERENCE,
|
||||
}
|
||||
)
|
||||
|
||||
_MODE_LABELS = {
|
||||
CONDITIONING_MODE_T2VA: "T2VA + Continuation",
|
||||
CONDITIONING_MODE_I2VA: "I2VA + Continuation",
|
||||
CONDITIONING_MODE_LAST_ONLY: "Last Frame + Continuation",
|
||||
CONDITIONING_MODE_FL2VA: "FL2VA + Continuation",
|
||||
CONDITIONING_MODE_REFERENCE: "Reference + Continuation",
|
||||
}
|
||||
|
||||
|
||||
def conditioning_mode_from_presence(
|
||||
*, has_first: bool, has_last: bool, has_reference: bool
|
||||
) -> str:
|
||||
if has_reference:
|
||||
return CONDITIONING_MODE_REFERENCE
|
||||
if has_first and has_last:
|
||||
return CONDITIONING_MODE_FL2VA
|
||||
if has_first:
|
||||
return CONDITIONING_MODE_I2VA
|
||||
if has_last:
|
||||
return CONDITIONING_MODE_LAST_ONLY
|
||||
return CONDITIONING_MODE_T2VA
|
||||
|
||||
|
||||
def detect_conditioning_mode(
|
||||
*, first_frame: Any, last_frame: Any, reference_assets: Any
|
||||
) -> str:
|
||||
return conditioning_mode_from_presence(
|
||||
has_first=first_frame is not None,
|
||||
has_last=last_frame is not None,
|
||||
has_reference=reference_assets is not None,
|
||||
)
|
||||
|
||||
|
||||
def conditioning_mode_label(mode: str) -> str:
|
||||
try:
|
||||
return _MODE_LABELS[str(mode)]
|
||||
except KeyError as exc:
|
||||
raise ValueError(f"unknown conditioning mode: {mode!r}") from exc
|
||||
|
||||
|
||||
def conditioning_display_label(
|
||||
*,
|
||||
has_first: bool,
|
||||
has_last: bool,
|
||||
has_reference: bool,
|
||||
) -> str:
|
||||
"""Return a user-facing label without changing the runtime mode contract."""
|
||||
if has_reference:
|
||||
if has_first and has_last:
|
||||
return "Hybrid FL2VA + Reference + Continuation"
|
||||
if has_first:
|
||||
return "Hybrid I2VA + Reference + Continuation"
|
||||
if has_last:
|
||||
return "Hybrid L2VA + Reference + Continuation"
|
||||
return "Reference + Continuation"
|
||||
mode = conditioning_mode_from_presence(
|
||||
has_first=has_first,
|
||||
has_last=has_last,
|
||||
has_reference=False,
|
||||
)
|
||||
return conditioning_mode_label(mode)
|
||||
|
||||
|
||||
def conditioning_mode_display_label(
|
||||
mode: str,
|
||||
*,
|
||||
has_first: bool = False,
|
||||
has_last: bool = False,
|
||||
has_reference: bool = False,
|
||||
) -> str:
|
||||
"""Legacy display helper retained for existing callers and tests."""
|
||||
if has_first or has_last or has_reference:
|
||||
return conditioning_display_label(
|
||||
has_first=has_first,
|
||||
has_last=has_last,
|
||||
has_reference=has_reference,
|
||||
)
|
||||
return conditioning_mode_label(mode)
|
||||
|
||||
|
||||
def conditioning_mode_uses_video_vae(mode: str) -> bool:
|
||||
if mode not in CONDITIONING_MODES:
|
||||
raise ValueError(f"unknown conditioning mode: {mode!r}")
|
||||
return mode != CONDITIONING_MODE_T2VA
|
||||
|
||||
@@ -192,61 +192,61 @@ Spectrum ONの品質はSeed依存で変化する。結果確認なしの長尺
|
||||
- このMarkdownと機械可読なJSON/CSVを通常Gitへ追加する。
|
||||
- コンタクトシートは`docs/assets/ab-tests/`等へ追加する。
|
||||
- 大容量MP4は通常Gitへ直接追加せず、GitHub Release assetsまたはGit LFSを検討する。
|
||||
- 公開前にPrompt、Workflow、モデル、ComfyUI revision、Python/Torch/CUDA、GPU、生成時間を各サンプルへ紐付ける。
|
||||
|
||||
## 00048 / 00049: 0.5 MP Seam Off vs Auto
|
||||
|
||||
- 共通条件: 576x896 (約0.5 MP), 24 fps, 3 x 5秒, Spectrum On, Warmup 1, Actual Prefix 2, Balanced 22, base seed 1235。
|
||||
- 00048: Seam Off。5秒境界比 0.3583、10秒境界比 0.8562。
|
||||
- 00049: Seam Auto。5秒境界比 0.3709、10秒境界比 0.4271。
|
||||
- 視覚評価: 両方とも人物・衣装・肌は安定し、見た目の差は小さい。Autoは10秒境界を数値上改善した。
|
||||
- 音声: 両方ともほぼ無音のため、音声シーム効果は未評価。
|
||||
- 注意: 0.5 MP条件のため、0.6 MPで発生したSeed 1235の崩れをWarmup 1が解消したとは断定しない。
|
||||
|
||||
### 目視評価の補足
|
||||
|
||||
- ユーザー目視では00049(Seam Auto)の方がフリックが若干目立つ。
|
||||
- 00048(Seam Off)の方が境界変化を比較的抑えられている。
|
||||
- 境界指標の改善と主観的なフリック低減は一致しなかったため、本比較では目視評価を優先しSeam Offを採用候補とする。
|
||||
|
||||
|
||||
## 00050: 音声あり一貫性テスト
|
||||
|
||||
- 条件: 576x896(約0.5 MP)、24 fps、3 x 5秒、Spectrum On、Warmup 1、Balanced 22、base seed 1235、Seam Off。
|
||||
- 音声レベル: mean -19.9 dB、peak -6.4 dB。前回のほぼ無音サンプルより音声境界の評価に適する。
|
||||
- 目視: 3チャンクを通して人物、髪、衣装、背景、露出は安定。肌・顔の累積崩れも目立たない。
|
||||
- 5秒境界: 境界付近で瞬きが始まるためフレーム差はあるが、露出フリックより自然動作として見える。
|
||||
- 10秒境界: 口形、顔、背景の連続性が高く、明確な視覚ジャンプは小さい。
|
||||
- 未確認: 音声境界のクリック、F0、短時間RMS、スペクトル差の数値解析。
|
||||
- 次の比較: 同一Prompt・Seed・解像度・Warmupのまま、SeamだけAutoへ変更した1本と比較する。
|
||||
|
||||
### 00050 音声の目視・聴感補足
|
||||
|
||||
- ユーザー聴感で10秒(Chunk 2→3境界)に短いプチノイズを確認。
|
||||
- 同境界の映像連続性は良好であり、映像シームと音声シームの品質が一致しない例となった。
|
||||
- 暫定対策候補: Video Seam Off、Audio Seam Autoを独立設定にする。
|
||||
|
||||
|
||||
### 00050 実行レポート補足
|
||||
|
||||
- Prompt plan: Fixed、3 chunks、5.000秒。Seam correction Off。
|
||||
- Chunk seeds: 12362262848839836333 / 1129406137053299874 / 8524677167168820503。
|
||||
- Continuity motion: Chunk 2 = 0.378492、Chunk 3 = 0.388277。Continuation chunksはActual Prefix 2を要求。
|
||||
- Retained frames: 124 + 119 + 119 = 362。Exact-durationで360 framesへ末尾調整。
|
||||
- Audio: 480000 samples(32 kHz、15.000秒)。末尾補正 -2667 samplesは2 frames相当で、10秒境界のプチノイズ原因とは分離して扱う。
|
||||
- 判定: sample-boundary alignmentは尺を整合させているが、波形位相・振幅の連続性までは保証しない。Audio Seam Off基準として保存する。
|
||||
|
||||
### 00050 境界評価の訂正
|
||||
|
||||
- 5秒(Chunk 1→2): 映像フリックが確認できる。
|
||||
- 10秒(Chunk 2→3): 映像フリックは目立たないが、音声に短いプチノイズがある。
|
||||
- 映像と音声の問題位置は一致していないため、Video SeamとAudio Seamは独立評価・独立処理が必要。
|
||||
|
||||
- 公開前にPrompt、Workflow、モデル、ComfyUI revision、Python/Torch/CUDA、GPU、生成時間を各サンプルへ紐付ける。
|
||||
|
||||
## 00048 / 00049: 0.5 MP Seam Off vs Auto
|
||||
|
||||
- 共通条件: 576x896 (約0.5 MP), 24 fps, 3 x 5秒, Spectrum On, Warmup 1, Actual Prefix 2, Balanced 22, base seed 1235。
|
||||
- 00048: Seam Off。5秒境界比 0.3583、10秒境界比 0.8562。
|
||||
- 00049: Seam Auto。5秒境界比 0.3709、10秒境界比 0.4271。
|
||||
- 視覚評価: 両方とも人物・衣装・肌は安定し、見た目の差は小さい。Autoは10秒境界を数値上改善した。
|
||||
- 音声: 両方ともほぼ無音のため、音声シーム効果は未評価。
|
||||
- 注意: 0.5 MP条件のため、0.6 MPで発生したSeed 1235の崩れをWarmup 1が解消したとは断定しない。
|
||||
|
||||
### 目視評価の補足
|
||||
|
||||
- ユーザー目視では00049(Seam Auto)の方がフリックが若干目立つ。
|
||||
- 00048(Seam Off)の方が境界変化を比較的抑えられている。
|
||||
- 境界指標の改善と主観的なフリック低減は一致しなかったため、本比較では目視評価を優先しSeam Offを採用候補とする。
|
||||
|
||||
|
||||
## 00050: 音声あり一貫性テスト
|
||||
|
||||
- 条件: 576x896(約0.5 MP)、24 fps、3 x 5秒、Spectrum On、Warmup 1、Balanced 22、base seed 1235、Seam Off。
|
||||
- 音声レベル: mean -19.9 dB、peak -6.4 dB。前回のほぼ無音サンプルより音声境界の評価に適する。
|
||||
- 目視: 3チャンクを通して人物、髪、衣装、背景、露出は安定。肌・顔の累積崩れも目立たない。
|
||||
- 5秒境界: 境界付近で瞬きが始まるためフレーム差はあるが、露出フリックより自然動作として見える。
|
||||
- 10秒境界: 口形、顔、背景の連続性が高く、明確な視覚ジャンプは小さい。
|
||||
- 未確認: 音声境界のクリック、F0、短時間RMS、スペクトル差の数値解析。
|
||||
- 次の比較: 同一Prompt・Seed・解像度・Warmupのまま、SeamだけAutoへ変更した1本と比較する。
|
||||
|
||||
### 00050 音声の目視・聴感補足
|
||||
|
||||
- ユーザー聴感で10秒(Chunk 2→3境界)に短いプチノイズを確認。
|
||||
- 同境界の映像連続性は良好であり、映像シームと音声シームの品質が一致しない例となった。
|
||||
- 暫定対策候補: Video Seam Off、Audio Seam Autoを独立設定にする。
|
||||
|
||||
|
||||
### 00050 実行レポート補足
|
||||
|
||||
- Prompt plan: Fixed、3 chunks、5.000秒。Seam correction Off。
|
||||
- Chunk seeds: 12362262848839836333 / 1129406137053299874 / 8524677167168820503。
|
||||
- Continuity motion: Chunk 2 = 0.378492、Chunk 3 = 0.388277。Continuation chunksはActual Prefix 2を要求。
|
||||
- Retained frames: 124 + 119 + 119 = 362。Exact-durationで360 framesへ末尾調整。
|
||||
- Audio: 480000 samples(32 kHz、15.000秒)。末尾補正 -2667 samplesは2 frames相当で、10秒境界のプチノイズ原因とは分離して扱う。
|
||||
- 判定: sample-boundary alignmentは尺を整合させているが、波形位相・振幅の連続性までは保証しない。Audio Seam Off基準として保存する。
|
||||
|
||||
### 00050 境界評価の訂正
|
||||
|
||||
- 5秒(Chunk 1→2): 映像フリックが確認できる。
|
||||
- 10秒(Chunk 2→3): 映像フリックは目立たないが、音声に短いプチノイズがある。
|
||||
- 映像と音声の問題位置は一致していないため、Video SeamとAudio Seamは独立評価・独立処理が必要。
|
||||
|
||||
### 00050 最終訂正(この評価を優先)
|
||||
|
||||
- 5秒(Chunk 1→2): 映像フリックあり。
|
||||
- 10秒(Chunk 2→3): 映像フリックは目立たない。
|
||||
- 音声: 明確なプチノイズは確認できない。先行する「10秒に音声ノイズあり」という記録は取り消し、未検出として扱う。
|
||||
|
||||
- 5秒(Chunk 1→2): 映像フリックあり。
|
||||
- 10秒(Chunk 2→3): 映像フリックは目立たない。
|
||||
- 音声: 明確なプチノイズは確認できない。先行する「10秒に音声ノイズあり」という記録は取り消し、未検出として扱う。
|
||||
- 00050はAudio Seam不具合の根拠にはせず、音声は専用テストで改めて検証する。
|
||||
|
||||
## V3.2.1 Reference + Continuation 実機成績
|
||||
|
||||
@@ -0,0 +1,69 @@
|
||||
# Branch Provenance Contract v1
|
||||
|
||||
Status: V3.8 N2b implementation contract.
|
||||
|
||||
## Purpose
|
||||
|
||||
Branch Provenance records which immutable physical-group revision is active at
|
||||
each point in a Run Storage chain. It allows a user to select an older Take and
|
||||
generate only the physical groups after that Take without deleting the former
|
||||
branch or confusing equal nonces with equal ancestry.
|
||||
|
||||
Take labels are presentation only. Internal identity is always `revision_id`.
|
||||
|
||||
## Physical-group revision
|
||||
|
||||
Every completed physical group records:
|
||||
|
||||
- `revision_id`: immutable SHA-256-derived identity;
|
||||
- `parent_revision_id`: the immediately preceding physical-group revision;
|
||||
- `group`: one-based `start`, `end`, and `physical_group` values;
|
||||
- `variation_nonce` and `seed_identity`;
|
||||
- `storage_revision_id` and `generation_contract_sha256`;
|
||||
- `lineage_sha256` and immutable chunk record identities;
|
||||
- `created_utc` plus deterministic `revision_order`;
|
||||
- optional `branch_cut` metadata.
|
||||
|
||||
Terminal Merge `[N-1,N]` is one physical group. A chain that contains only one
|
||||
logical half is invalid.
|
||||
|
||||
## Canonical chain
|
||||
|
||||
`project.json` has exactly one `canonical_chain`, one
|
||||
`canonical_head_revision_id`, and an `active_revisions` map. Browsing Takes does
|
||||
not change them. `Use This Take` or `Continue From Here`, followed by the normal
|
||||
Queue action, creates a finalized Schema v3 storage revision and atomically
|
||||
switches the canonical chain.
|
||||
|
||||
`Continue From Here` keeps the selected prefix exactly and starts a new existing
|
||||
sampling nonce boundary at the next physical group. The Sampling Contract itself
|
||||
remains version 5 and is not extended with provenance fields.
|
||||
|
||||
## Run Storage Schema v3
|
||||
|
||||
Schema v3 separates `revision_id` (storage execution identity) from
|
||||
`sampling_revision_id` (the unchanged Sampling Contract identity). A finalized
|
||||
manifest contains Branch Provenance v1 metadata with its complete active chain,
|
||||
branch selection/cut when applicable, and a monotonic `canonical_sequence`.
|
||||
|
||||
The write order is:
|
||||
|
||||
1. save and fsync new chunk payloads;
|
||||
2. validate all logical records in the completed physical group;
|
||||
3. atomically write the finalized manifest and its active chain;
|
||||
4. atomically replace `project.json` with the new canonical head.
|
||||
|
||||
A failure before step 4 leaves the preceding canonical project head intact.
|
||||
If `project.json` is corrupt, the highest validated `canonical_sequence` in a
|
||||
finalized manifest is the recovery source. In-progress and interrupted revisions
|
||||
are not Render History Take candidates.
|
||||
|
||||
## Schema v2 compatibility
|
||||
|
||||
Schema v2 manifests remain readable and are never rewritten merely by loading
|
||||
them. Their contiguous records are interpreted in memory as a legacy chain with
|
||||
one canonical physical-group revision per group. The first Schema v3 save uses a
|
||||
separate storage revision directory, so the legacy manifest and payloads remain
|
||||
unchanged.
|
||||
|
||||
No automatic Take garbage collection is part of N2b.
|
||||
@@ -1,35 +1,35 @@
|
||||
# V2.1.4 UI Simplification
|
||||
|
||||
The integrated `H3 Continuum Sampler V2` is the primary workflow node.
|
||||
|
||||
## Default workflow
|
||||
|
||||
```text
|
||||
Text (Multiline) -> Sequence Prompt
|
||||
Image -> first_frame
|
||||
Sampler images/audio -> Create Video
|
||||
```
|
||||
|
||||
The default node surface shows Sequence Prompt, first frame, chunk timing,
|
||||
continuity, seed, and seam correction. Individual clip overrides and Advanced
|
||||
settings are collapsed.
|
||||
|
||||
## Advanced settings
|
||||
|
||||
Advanced settings expose `last_frame`, `initial_state`, `session`,
|
||||
`prompt_plan`, reroll controls, diagnostics, `last_state`, session output, and
|
||||
report output. A saved workflow with an existing Advanced connection expands
|
||||
the section automatically.
|
||||
|
||||
The Advanced Settings button remains the section header when expanded. The
|
||||
button is placed before the expanded controls instead of moving below them.
|
||||
|
||||
## Legacy nodes
|
||||
|
||||
V1 Join, Finish, Assemble, state utilities, and auxiliary V2 plan/session nodes
|
||||
remain registered for saved-workflow compatibility. They are marked deprecated
|
||||
and moved to `MiniMax H3/Continuum/Legacy`, so ComfyUI can omit them from the
|
||||
normal node picker.
|
||||
|
||||
No sampling, State/Session schema, output order, or accelerator behavior changes
|
||||
in V2.1.4.
|
||||
# V2.1.4 UI Simplification
|
||||
|
||||
The integrated `H3 Continuum Sampler V2` is the primary workflow node.
|
||||
|
||||
## Default workflow
|
||||
|
||||
```text
|
||||
Text (Multiline) -> Sequence Prompt
|
||||
Image -> first_frame
|
||||
Sampler images/audio -> Create Video
|
||||
```
|
||||
|
||||
The default node surface shows Sequence Prompt, first frame, chunk timing,
|
||||
continuity, seed, and seam correction. Individual clip overrides and Advanced
|
||||
settings are collapsed.
|
||||
|
||||
## Advanced settings
|
||||
|
||||
Advanced settings expose `last_frame`, `initial_state`, `session`,
|
||||
`prompt_plan`, reroll controls, diagnostics, `last_state`, session output, and
|
||||
report output. A saved workflow with an existing Advanced connection expands
|
||||
the section automatically.
|
||||
|
||||
The Advanced Settings button remains the section header when expanded. The
|
||||
button is placed before the expanded controls instead of moving below them.
|
||||
|
||||
## Legacy nodes
|
||||
|
||||
V1 Join, Finish, Assemble, state utilities, and auxiliary V2 plan/session nodes
|
||||
remain registered for saved-workflow compatibility. They are marked deprecated
|
||||
and moved to `MiniMax H3/Continuum/Legacy`, so ComfyUI can omit them from the
|
||||
normal node picker.
|
||||
|
||||
No sampling, State/Session schema, output order, or accelerator behavior changes
|
||||
in V2.1.4.
|
||||
|
||||
@@ -1,20 +1,20 @@
|
||||
# V2.1.5 UI Serialization Stability
|
||||
|
||||
V2.1.5 preserves the backend-defined Sampler V2 widget and slot structure.
|
||||
The frontend may change labels, computed height, and DOM/slot visibility only.
|
||||
|
||||
## Stability contract
|
||||
|
||||
- Backend widget type, serialization behavior, and relative order are unchanged.
|
||||
- Backend inputs and outputs are never removed or re-added for UI folding.
|
||||
- Individual Clip Overrides and Advanced buttons are appended non-serialized frontend widgets.
|
||||
- Prompt and advanced sockets remain registered in stable order while collapsed slots are hidden visually.
|
||||
- onNodeCreated and onConfigure are wrapped by one Sampler V2 extension only.
|
||||
|
||||
This release does not change Sampling, State, Session, Prompt Plan, Spectrum Interop, or project schemas.
|
||||
|
||||
## Browser regression
|
||||
|
||||
Set chunks=2, chunk_seconds=5.0, width=1344, height=768, Balanced 22 frames, Seam Correction Auto, and a fixed seed.
|
||||
Open and close Individual Clip Overrides and Advanced settings, change tabs, save, reload ComfyUI, and reload the workflow.
|
||||
All values and connections must remain in their original slots.
|
||||
# V2.1.5 UI Serialization Stability
|
||||
|
||||
V2.1.5 preserves the backend-defined Sampler V2 widget and slot structure.
|
||||
The frontend may change labels, computed height, and DOM/slot visibility only.
|
||||
|
||||
## Stability contract
|
||||
|
||||
- Backend widget type, serialization behavior, and relative order are unchanged.
|
||||
- Backend inputs and outputs are never removed or re-added for UI folding.
|
||||
- Individual Clip Overrides and Advanced buttons are appended non-serialized frontend widgets.
|
||||
- Prompt and advanced sockets remain registered in stable order while collapsed slots are hidden visually.
|
||||
- onNodeCreated and onConfigure are wrapped by one Sampler V2 extension only.
|
||||
|
||||
This release does not change Sampling, State, Session, Prompt Plan, Spectrum Interop, or project schemas.
|
||||
|
||||
## Browser regression
|
||||
|
||||
Set chunks=2, chunk_seconds=5.0, width=1344, height=768, Balanced 22 frames, Seam Correction Auto, and a fixed seed.
|
||||
Open and close Individual Clip Overrides and Advanced settings, change tabs, save, reload ComfyUI, and reload the workflow.
|
||||
All values and connections must remain in their original slots.
|
||||
|
||||
@@ -0,0 +1,254 @@
|
||||
# V3.8 初心者向けマニュアル設計・撮影台本
|
||||
|
||||
状態: Computer Use実画面検証PASS/4-step・0.30 MP・Spectrum OFFでContinue完走/README反映中(2026-09-07)
|
||||
|
||||
最新結果: 提供された00058を、Turbo4、実Steps 4、Euler/simple、Draft 0.30 MP、Spectrum OFF、2×5秒でUIから再検証した。Chunk 1の三択レビュー画面が出現し、`Use it and continue`選択後に右上の青い`Run`を押すと、受理済みChunk 1を再SamplingせずChunk 2だけをSampling(Sampler表示43.738秒)し、10秒の`Saved sequence is complete`へ到達した。修正後の`Try this chunk again`も別の実画面試験でPASS済み。現在フロントエンドの実行ボタンは右上の青い`Run`で、ノード内の`Run`設定やカード内の旧`Queue`表記と区別する。
|
||||
|
||||
## 現在の制作範囲(以下の旧撮影案より優先)
|
||||
|
||||
- 完成原稿は英語の `../README.md`。日本語READMEの翻訳は最終段階まで保留。単純な初回生成説明は増やさず、任意チャンク数での継続・再試行・残り生成・設定へ戻る・履歴・指定位置以降の再生成・完成後の延長を中心にする。
|
||||
- 継続操作だけでなく、V3.8が公開する7ノードの全ユーザー向けsocket/control/outputをREADMEで説明する。SamplerのMain/Advanced/Review状態、Continuum Settings、Load Image/Audio/Video、Reference Audios、Finalize、Second Passを省略しない。非表示の内部IDは「UI」扱いせず、frontend管理であることだけを示す。
|
||||
- UIの文字列、変更する値、維持する値、Queue操作、その回に新規生成される範囲、保存動画の長さを順番に説明する。2チャンクは例であり固定条件ではない。fixed seed、Chunksは追加数でなく合計数、Terminal Merge例外を省略しない。
|
||||
- 提供された実画面6枚を加工せず `images/v38-manual/` へ保存済み。`seed-fixed.png`、`review-settings.png`、`review-actions.png`、`continue-selected.png`、`return-to-review.png`、`full-video-progress.png`。Spectrum設定の画像はこの章に使用しない。元画像とのSHA一致・PNG形式・READMEリンクを確認済み。
|
||||
- 今回追加した公開用実画面はreview三択、continue選択、sequence完了、Back to Settings後の完了設定、Render History内部、Regenerate FromとVariation Nonce。既存画像を新規撮影と称さない。全画面ではなく操作部分の実スクリーンショットを使用する。finish選択は三択画面で場所と意味を説明し、必要になった場合だけ追加撮影する。
|
||||
- 追加提供された7枚を、Video/Audio loaderとbypass、Reference Image 1–3、First/Last Image、First Image + Draft 0.30 MP、LightX2V Turbo LoRA一覧、First Image tooltip、Manual Width/Heightとして無加工コピーした。LoRA loader、Spectrum、画像中のAudio Switch/Fast Groups Bypasserは外部workflow要素として分離し、Continuum公開UIと誤認させない。
|
||||
- README冒頭に「Web対応AIへこのREADMEを読ませる」案内を置く。ChatGPT/Gemini/Grokの現行公式情報に限定し、URLだけでrepository全文を読めるとは保証しない。GeminiのImport codeと、失敗時のREADME貼付/uploadを案内する。
|
||||
- Size Source/Resolution/Manual Width・HeightはV3.8 Sampler本体に搭載されたため、通常workflowに外部MP/size nodeは不要と説明する。32×32は音声だけを聴く診断用であり、映像品質の推奨値にはしない。
|
||||
- Issue #13はOpen、StandardにはProduction mitigationなし、R6-Aは一条件で改善したが最終4×8ではno-opだった、という証拠範囲を固定する。「解決済み」「全く改善方法がない」のどちらにも誇張しない。
|
||||
- ユーザーが `http://127.0.0.6:8188/` で起動した `00058` ワークフローを使用した。ユーザー所有backendは停止しない。
|
||||
- READMEの測定例は今回の4-step実測へ更新し、旧6-step値と混在させない。commit/pushは今後の明示依頼時のみ。
|
||||
|
||||
作成日: 2026-09-06
|
||||
|
||||
対象: `H3 Continuum Sampler V3.8`の現在のMain UI
|
||||
|
||||
再開時の正本: この文書と`PROJECT_STATE.md`
|
||||
|
||||
## この文書を読めば撮影準備から再開できる
|
||||
|
||||
この文書は、V3.8の初心者向け画像マニュアルを作るための設計書兼撮影台本です。完成マニュアルそのものではありません。ドリフト軽減策、公開UI、標準Workflowが固まったあと、この台本に沿ってComputer Useで実画面を確認し、スクリーンショットを撮影します。
|
||||
|
||||
撮影開始の指示を受けた担当者は、最初に次を読みます。
|
||||
|
||||
1. `AGENTS.md`
|
||||
2. `PROJECT_STATE.md`
|
||||
3. この文書
|
||||
4. `README_JA.md`の「10秒を5秒ずつ確認しながら作る」
|
||||
5. `examples/workflows/MiniMax_H3_Continuum_V38.json`
|
||||
|
||||
撮影開始前に、表示ラベル、標準Workflow、公開ノード数、Review/Take動作がこの台本と一致するか確認します。違いがある場合は、古い画面を撮影せず、先に台本を現在のUIへ合わせます。
|
||||
|
||||
## 完成マニュアルは初回手順と目的別の逆引きに分ける
|
||||
|
||||
読者はComfyUIの基本操作を知っているものの、Continuumのチャンク、Review、Take、保存再開は初めてという利用者を想定します。モデルの入手、ComfyUI本体の導入、一般的なSampler解説は別資料へ任せます。
|
||||
|
||||
完成版では、最初に読む範囲と必要時だけ読む範囲を分けます。
|
||||
|
||||
- 初回に読む: 1~4章
|
||||
- 必要なときに読む: 5章以降
|
||||
|
||||
予定する章は次のとおりです。
|
||||
|
||||
1. V3.8で最初の動画を作る
|
||||
2. 長さと出力サイズを決める
|
||||
3. 10秒を5秒ずつ確認しながら作る
|
||||
4. 完成動画をFinalizeして保存する
|
||||
5. 現在のチャンクだけを作り直す
|
||||
6. 保存されたTakeを選ぶ
|
||||
7. 選んだ地点から続きを作る
|
||||
8. List/Timeline Promptを使う
|
||||
9. Audio Continuityと参照素材を使う
|
||||
10. Second Passを完成後のsequenceへ使う
|
||||
11. 症状から原因を探す
|
||||
12. 用語集と報告テンプレート
|
||||
|
||||
マニュアル冒頭には、V3.8が「生成、チャンクごとの確認、部分再生成、保存再開」を行うProduction Samplerであることを短く示します。V3.7以前の画面やNode IDをV3.8の手順へ混ぜません。
|
||||
|
||||
## 1操作につき1枚の画面と1つの期待結果を示す
|
||||
|
||||
各手順は次の順番で書きます。
|
||||
|
||||
1. 目的を1文で示す
|
||||
2. 変更する項目を画面上の正確な表示名で示す
|
||||
3. 操作対象を番号付きスクリーンショットで示す
|
||||
4. なぜ必要かを1文で添える
|
||||
5. Queue後に見える正常な結果を示す
|
||||
6. 次に選べる操作へつなぐ
|
||||
7. 失敗時は対応する逆引き項目へ案内する
|
||||
|
||||
1枚へ多数の番号を詰め込みません。特にReviewでは「ボタンを選ぶ」と「ComfyUIのQueueを押す」を別ステップとして扱います。選択しただけで生成が始まらないことを、本文と画面の両方で明示します。
|
||||
|
||||
## 撮影はUIと長尺品質が固定されたあとに始める
|
||||
|
||||
本撮影は、次の条件がそろってから開始します。
|
||||
|
||||
- 公開対象のV3.8 UIラベルと配置が確定している
|
||||
- 標準Workflowが確定している
|
||||
- 現在進行中のドリフト調査について、ローンチ時の扱いが決まっている
|
||||
- READMEと実画面のReview手順が一致している
|
||||
- `Review Each Chunk`、再生成、Take選択、再開の正常系が通る
|
||||
- 画面更新、警告表示、失敗時の案内が確認済みである
|
||||
- 撮影に使うruntimeとsourceの一致を確認できる
|
||||
|
||||
構成と本文の下書きは先に進められます。UIが変わる可能性のある段階では、最終スクリーンショットと座標依存の注釈を確定しません。
|
||||
|
||||
## 撮影環境を固定して画面差し替えを減らす
|
||||
|
||||
撮影前に次の条件を記録します。
|
||||
|
||||
| 項目 | 撮影時に記録する内容 |
|
||||
|---|---|
|
||||
| Continuum | version、source commitまたはtree識別情報 |
|
||||
| ComfyUI | versionまたはcommit |
|
||||
| Workflow | 正本ファイル名とSHA-256 |
|
||||
| Browser | 種類、表示倍率 |
|
||||
| Viewport | 幅、高さ |
|
||||
| Theme | light/dark |
|
||||
| Sampler view | 現在のMain UIとAdvancedの開閉状態 |
|
||||
| Input | 使用する画像、音声、動画の識別名 |
|
||||
| Generation | Seed、Model、LoRA、Sampler、Steps、SIGMAS |
|
||||
| Output | Width、Height、fps、Chunks、Seconds per Chunk |
|
||||
|
||||
撮影用Workflowは、個人名、ローカルの機密パス、過去の不要な履歴を含まない専用コピーを使います。ComfyUI Coreノードは標準表示名のまま撮影し、Continuum専用に見える名前へ変更しません。
|
||||
|
||||
## 撮影台本はQuick Startから始める
|
||||
|
||||
最初の撮影セットは、`2 × 5s = 10 seconds`のReview手順です。以下のShot IDを画像名にも使います。
|
||||
|
||||
| Shot ID | 撮影する状態 | 画面で確認する要素 | 本文で伝えること |
|
||||
|---|---|---|---|
|
||||
| V38-M01 | 標準Workflow全体 | Sampler、Core Decode、Finalize、Core Save Video | 最小の接続全体 |
|
||||
| V38-M02 | Sampler初期Main | Prompt Format、Continuity、Base Seed、Control After Generate、Audio Continuity | 最初に確認する場所 |
|
||||
| V38-M03 | 長さ設定後 | Chunks `2`、Seconds per Chunk `5`、Total Length `10 seconds` | 合計10秒の指定 |
|
||||
| V38-M04 | 出力サイズ設定 | Size Sourceと適用中のWidth/Height | First ImageとManualの違い |
|
||||
| V38-M05 | Review準備完了 | Run `Review Each Chunk`、Progress On、緑色のReadyカード | 最初のQueue準備完了 |
|
||||
| V38-M06 | Chunk 1実行中 | ComfyUI Queueと進行表示 | 最初は5秒だけ作る |
|
||||
| V38-M07 | Review Ready | `Chunk 1 is ready for review`のアンバー表示 | 5秒出力は正常 |
|
||||
| V38-M08 | Reviewの3操作 | Use it and continue、Try this chunk again、Use it and finish the rest | 3つの分岐 |
|
||||
| V38-M09 | Continue選択後 | 選択ボタンの`✓` | 選択だけでは生成しない |
|
||||
| V38-M10 | 2回目のQueue | ComfyUI Queue | 採用済みChunk 1を再利用する |
|
||||
| V38-M11 | 10秒完成後 | 完成状態、Finalize、保存結果 | 2チャンクの完成 |
|
||||
| V38-M12 | Settingsへ戻る | Back to Settings | Reviewを失わず設定を見る |
|
||||
| V38-M13 | Reviewへ戻る | Return to Review | 保留中のReviewへ戻る |
|
||||
|
||||
Quick Startの撮影が終わったら、同じ撮影用Runを再利用して再生成と履歴を撮ります。
|
||||
|
||||
| Shot ID | 撮影する状態 | 画面で確認する要素 | 本文で伝えること |
|
||||
|---|---|---|---|
|
||||
| V38-R01 | 再生成選択前 | 現在のChunkとTake | 作り直す対象 |
|
||||
| V38-R02 | 再生成選択後 | Try this chunk againの`✓` | 同じChunkの別Takeを作る |
|
||||
| V38-R03 | 再生成完了後 | 新しいTakeとReview状態 | 前のTakeは消えない |
|
||||
| V38-H01 | Render Historyを開く | Take一覧と現在の選択 | 閲覧だけではcanonicalを変えない |
|
||||
| V38-H02 | 過去Takeを選ぶ | Previous/Nextまたは現在の選択表示 | 候補を比較する |
|
||||
| V38-H03 | Take採用前 | Use This Take | Queue後にcanonicalを変更する操作 |
|
||||
| V38-H04 | 途中から継続する前 | Continue From Hereと再利用範囲 | 選択地点より後ろだけを作り直す |
|
||||
|
||||
## サイズ・入力・Advancedは目的別に追加撮影する
|
||||
|
||||
Quick Startへすべてを詰め込まず、次の画面は独立した章で撮ります。
|
||||
|
||||
| Shot ID | 撮影する状態 | 必須の比較 |
|
||||
|---|---|---|
|
||||
| V38-S01 | Size Source `First Image` | 画像の縦横比と参照表示のWidth/Height |
|
||||
| V38-S02 | Size Source `Manual` | 編集可能な32-pixel単位のWidth/Height |
|
||||
| V38-I01 | First Image接続 | I2VA/FL2VAでのサイズ決定 |
|
||||
| V38-I02 | Reference Image接続 | First Imageとは異なる役割 |
|
||||
| V38-I03 | Video Guide接続 | Video Guide SizeとFrames |
|
||||
| V38-A01 | Reference Audios | Audio 1/2/3の順序 |
|
||||
| V38-A02 | Audio Continuity | On/Offの意味と最終音声との違い |
|
||||
| V38-X01 | Advancedを開く | Mainにない高度な項目の位置 |
|
||||
| V38-X02 | Second Pass接続 | Review完了後のsequenceに使うこと |
|
||||
|
||||
## 異常系は実際の表示を再現して撮る
|
||||
|
||||
正常系の撮影後、データを壊さない条件で次の状態を意図的に再現します。各ケースは、表示された文言と解決手順が現在の実装に一致することを確認してから掲載します。
|
||||
|
||||
| Shot ID | 症状または表示 | マニュアルで案内する確認 |
|
||||
|---|---|---|
|
||||
| V38-T01 | 最初のQueueで5秒だけ出た | Review Each Chunkの正常動作 |
|
||||
| V38-T02 | 次の操作が表示されない | Queue完了、Progress On、Chunks 2以上、画面更新 |
|
||||
| V38-T03 | 操作を選んでも生成されない | 選択後にQueueが必要 |
|
||||
| V38-T04 | Chunksが1 | 次のChunkが存在しない |
|
||||
| V38-T05 | fixedを求める案内 | Control After GenerateとSeed lineage |
|
||||
| V38-T06 | First Imageが届かない | 表示中のManual canvasへのfallback |
|
||||
| V38-T07 | 保存済みprefixを再利用しない | Run Name、Seed、Prompt Plan、生成契約の差 |
|
||||
| V38-T08 | Review途中でSecond Passを使おうとした | sequence確定後に実行 |
|
||||
| V38-T09 | 音声境界や冒頭語の欠落を報告する | Workflowと再現条件を保存して報告 |
|
||||
| V38-T10 | 長尺で色・質感・identityが変化する | 現行の既知制限と報告に必要な情報 |
|
||||
|
||||
T09とT10は原因を決めつけません。実際のバグ、設定差、説明不足を分けられるよう、報告テンプレートへ誘導します。
|
||||
|
||||
## スクリーンショットは同じ規則で保存する
|
||||
|
||||
画像は`docs/images/v38-manual/`へ置く想定です。撮影を始めるまでは空フォルダを作りません。
|
||||
|
||||
ファイル名は次の形式にします。
|
||||
|
||||
```text
|
||||
v38-m01-standard-workflow.png
|
||||
v38-m05-review-ready-to-queue.png
|
||||
v38-m08-review-actions.png
|
||||
v38-h04-continue-from-here.png
|
||||
v38-t05-control-after-generate-fixed.png
|
||||
```
|
||||
|
||||
元画像を保管する場合は`*-raw.png`、掲載用に注釈を加えた画像は通常名とします。注釈は番号、短いラベル、必要最小限の枠線に限定します。文字やsocketを覆わず、色だけに意味を持たせません。
|
||||
|
||||
## Computer Use撮影は観察と確認を1ステップずつ行う
|
||||
|
||||
撮影時はComputer Useで現在のComfyUIウィンドウを選び、操作前に画面状態を確認します。クリックや入力後は新しい画面状態を取得し、古い座標や要素番号を再利用しません。
|
||||
|
||||
各Shotは次の手順で確定します。
|
||||
|
||||
1. 台本の前提状態を作る
|
||||
2. 表示ラベルと値を画面上で読む
|
||||
3. スクリーンショットを取得する
|
||||
4. Shot ID、Workflow、設定、実行前後を記録する
|
||||
5. 画像と本文が同じ操作を示すか確認する
|
||||
6. 次のShotへ進む
|
||||
|
||||
ログイン、権限変更、公開投稿、ファイル送信など、画面撮影に不要な外部操作は行いません。個人情報や認証情報が見えた場合は撮影を止め、撮影用環境を整え直します。
|
||||
|
||||
## 完成版には再現可能なバグ報告テンプレートを付ける
|
||||
|
||||
問い合わせ時には、少なくとも次を添えてもらいます。
|
||||
|
||||
- Continuum version
|
||||
- ComfyUI version
|
||||
- Workflow JSON
|
||||
- Prompt全文とPrompt Format
|
||||
- Model、LoRA、Sampler、Steps、SIGMAS
|
||||
- SeedとControl After Generate
|
||||
- ChunksとSeconds per Chunk
|
||||
- ContinuityとAudio Continuity
|
||||
- RunとProgress
|
||||
- Width/HeightとSize Source
|
||||
- 使用したFirst/Last/Reference Image、Video Guide、Driving/Reference Audioの有無
|
||||
- どのChunk境界で起きたか
|
||||
- Status/Report全文
|
||||
- 問題が分かる短い出力またはスクリーンショット
|
||||
|
||||
音声の冒頭語が欠ける場合は、期待した台詞、実際に聞こえた台詞、欠落したChunk番号も記録します。ドリフトの場合は、開始Chunkと最も目立つChunkを示します。
|
||||
|
||||
## 撮影後は画面だけで手順を判断しない
|
||||
|
||||
完成判定では、画像の見た目に加えて実際の動作を確認します。
|
||||
|
||||
- すべての画像が現在のV3.8 UIである
|
||||
- 表示名が実装と完全に一致する
|
||||
- Quick Startを初見の利用者が順番どおり実行できる
|
||||
- Review操作を選ぶ工程とQueueする工程が分かれている
|
||||
- 再生成で前のTakeが保持される
|
||||
- Continue From Hereの再利用範囲が正しい
|
||||
- Coreノードの標準表示名を変更していない
|
||||
- 画像内に個人情報や不要なローカルパスがない
|
||||
- 英語版と日本語版で同じ画像を安全に共有できる
|
||||
- README、完成マニュアル、実画面の説明が矛盾しない
|
||||
|
||||
撮影・本文作成後は、手順を最初から一度再実行します。画像と文章だけを見て再現できない箇所は、UI改善候補、マニュアル修正、実装バグのいずれかへ分類します。
|
||||
|
||||
## 次回の開始指示
|
||||
|
||||
ユーザーから「V3.8マニュアルの撮影を開始」「初心者向けマニュアルを作成」などの指示があった場合は、この文書を正本として再開します。まず撮影開始条件を確認し、未確定のUIやドリフト表示方針があれば、その部分だけを保留します。条件がそろっていればV38-M01から順に進めます。
|
||||
|
||||
公開、commit、push、Civitai掲載は、この台本の作成や撮影開始には含まれません。別の明示指示が必要です。
|
||||
@@ -0,0 +1,84 @@
|
||||
# V3.8 Open Integration Contract
|
||||
|
||||
This document defines the supported boundary between H3 Continuum V3.8 and
|
||||
external processing, decoder, and acceleration nodes. It does not add a public
|
||||
node or change the Sampling, State, Session, Run Storage, or Assembly Plan
|
||||
schemas.
|
||||
|
||||
## Supported pipeline
|
||||
|
||||
```text
|
||||
H3 Continuum Sampler V3.8
|
||||
-> external latent processor or latent upscaler (optional)
|
||||
-> H3 Continuum Second Pass
|
||||
-> Core Video/Audio Decode
|
||||
-> H3 Continuum Finalize
|
||||
-> Core Save Video
|
||||
```
|
||||
|
||||
Pixel upscalers remain outside the latent boundary. If a workflow decodes to
|
||||
pixels for processing, it must encode the result back to one H3 video LATENT per
|
||||
physical group before Second Pass.
|
||||
|
||||
## External processor contract
|
||||
|
||||
An external processor may change only the spatial geometry of the video
|
||||
latents. It must preserve:
|
||||
|
||||
- physical-group count and order;
|
||||
- one indivisible entry for every Long Terminal Merge group;
|
||||
- video batch, 24 channels, and temporal latent length;
|
||||
- one common target H/W across every physical group;
|
||||
- the matching first-pass audio latent list and its order;
|
||||
- the original Assembly Plan input.
|
||||
|
||||
Spatial video dimensions may be preserved or enlarged. Smaller dimensions,
|
||||
NaN/Inf values, changed B/C/T geometry, a changed group count/order, or a changed
|
||||
audio shape are rejected before Second Pass Sampling.
|
||||
|
||||
Second Pass rebuilds supported conditioning for the target geometry, samples
|
||||
complete physical groups, and returns a copied Assembly Plan with only target
|
||||
geometry and Second Pass execution metadata added. It does not mutate the input
|
||||
plan or Run Storage. The accepted first-pass audio LATENT objects are returned
|
||||
unchanged; temporary audio produced during video refinement is discarded.
|
||||
|
||||
## Decoder boundary
|
||||
|
||||
H3 Continuum has no decoder allowlist. Any Core or third-party Video/Audio VAE
|
||||
path, including a TensorRT-backed VAE, is compatible when it implements the
|
||||
public ComfyUI contracts and produces the normal decoded types consumed by
|
||||
Finalize:
|
||||
|
||||
- `IMAGE`: `[frames, height, width, channels]` per physical group;
|
||||
- `AUDIO`: a mapping with `waveform` and positive `sample_rate` per physical
|
||||
group.
|
||||
|
||||
Finalize depends on those public decoded types and the Assembly Plan, not on a
|
||||
decoder class name. Decoder fallback, tiling, device placement, and acceleration
|
||||
are owned by the decoder or ComfyUI Core.
|
||||
|
||||
## Acceleration boundary
|
||||
|
||||
SageAttention, Sol-Attn, Spectrum, and comparable accelerators remain external
|
||||
MODEL wrappers. Continuum uses ComfyUI's public ModelPatcher wrapper APIs,
|
||||
preserves existing wrapper/model options on call-local clones, and publishes
|
||||
only the documented `h3_continuum` interoperability hint when continuation
|
||||
context exists.
|
||||
|
||||
Continuum does not select an attention backend, import accelerator-private
|
||||
functions, or globally monkey-patch an accelerator. Missing optional accelerator
|
||||
markers are informational and never become package dependencies.
|
||||
|
||||
## Ownership summary
|
||||
|
||||
| Owner | Responsibility |
|
||||
|---|---|
|
||||
| Continuum | Physical-group identity/order, temporal ownership, conditioning reconstruction, Second Pass validation/Sampling, first-pass audio passthrough, target-geometry plan copy, Finalize assembly |
|
||||
| External processor | Spatial Video LATENT transformation while preserving B/C/T, group order, and finite values |
|
||||
| Core or decoder node | Video/Audio VAE decode/encode behavior, tiling, fallback, device lifecycle |
|
||||
| Accelerator wrapper | Sage/Sol/Spectrum backend selection and wrapper lifecycle |
|
||||
| User workflow | Correctly wire the matching Video LATENT list, first-pass Audio LATENT list, and original Assembly Plan |
|
||||
|
||||
The contract deliberately avoids an All-in-One node. New processors and
|
||||
decoders can integrate through public ComfyUI types without requiring a
|
||||
Continuum release, provided these invariants remain true.
|
||||
@@ -0,0 +1,35 @@
|
||||
# V3.8 Release and Migration Policy
|
||||
|
||||
## Supported release
|
||||
|
||||
V3.8 is the current supported H3 Continuum product. Its package exports seven Node IDs:
|
||||
|
||||
```text
|
||||
H3ContinuumSamplerV38
|
||||
H3ContinuumReferenceAudios
|
||||
H3ContinuumAssembleSeamV35
|
||||
H3EasyLoadImage
|
||||
H3EasyLoadAudio
|
||||
H3ContinuumLoadVideo
|
||||
H3ContinuumSecondPassV35
|
||||
```
|
||||
|
||||
The assembler, loader, and Second Pass IDs are retained while their V3.8 display names are simplified. AUDIO-R1 adds one modular Reference Audios helper and appends one optional Sampler bundle socket. The Resolution / Size Source UX keeps the old Aspect input hidden for compatibility and appends Size Source, Width, and Height; saved fixed-Aspect workflows migrate to an equivalent Manual canvas. Sampling, Run Storage, State/Session, and Assembly contracts are unchanged.
|
||||
|
||||
## Saved workflows from older releases
|
||||
|
||||
Only the seven IDs listed above are exported by V3.8, 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.8 node.
|
||||
|
||||
- Use tag `v3.7.0` for V3.7 workflows.
|
||||
- Use tag `v3.6.0` for V3.6 workflows.
|
||||
- V3.4/V3.5 archives will be finalized during Release Preparation. Until then, use the matching historical commit or release asset already associated with that workflow.
|
||||
|
||||
Do not mix a historical workflow's private schema with the V3.8 package. Install the matching historical package, open and render the workflow there, or rebuild the graph explicitly with the V3.8 public nodes.
|
||||
|
||||
## V3.8 workflow and external integration
|
||||
|
||||
The declared Registry payload and GitHub distribution use `examples/workflows/MiniMax_H3_Continuum_V38.json` and `examples/workflows/MiniMax_H3_Continuum_V38.zip`. The ZIP contains exactly the same JSON: one graph, not two variants. This is the user-supplied Spectrum workflow, not the former dependency-free Core template. It requires external Spectrum, rgthree, KJNodes, and ComfyUI-Easy-Use nodes, which Continuum does not bundle or install. Its saved default is the Spectrum path; users may switch the same graph to one task-matched LightX2V Turbo LoRA after disabling Spectrum, but all custom-node types remain in the graph.
|
||||
|
||||
The supplied JSON and ZIP are preserved byte-for-byte, including prompt, media filenames, custom titles, and settings. Select local files and disable unused inputs before rendering. A saved title such as `Save 3x5s Video` does not control duration; the Sampler settings do. The output path uses Core Video/Audio Decode, Finalize, Core Create Video, and Core Save Video (with the supplied Easy Use cleanup wrapper before Save). External latent processors and upscalers connect through H3 Continuum Second Pass; the old integrated Hi-Res Fix is not part of the V3.8 standard workflow. The supported processor, decoder, and accelerator boundaries are defined in [V3.8 Open Integration Contract](V38_OPEN_INTEGRATION_CONTRACT.md). Registry validate/pack and publication remain separate gates; a GitHub source commit does not claim they have run.
|
||||
|
||||
Tests, runner/probe/diagnostic tools, internal development documents, Labs nodes, and historical workflows remain available in the GitHub source for development and audit purposes but are excluded from the Registry archive. The archive retains `tools/__init__.py` and `tools/p20_file_backed_tensor_poc.py`, which are runtime dependencies of the Production file-backed buffer path, plus `tools/verify_runtime.py` for verification. `MANIFEST.sha256` validates its declared source files; the staged archive instead carries `REGISTRY_MANIFEST.sha256`. These development assets are not part of the supported V3.8 searchable node surface.
|
||||
|
After Width: | Height: | Size: 7.8 KiB |
|
After Width: | Height: | Size: 718 KiB |
|
After Width: | Height: | Size: 20 KiB |
|
After Width: | Height: | Size: 1.9 MiB |
|
After Width: | Height: | Size: 1.6 MiB |
|
After Width: | Height: | Size: 282 KiB |
|
After Width: | Height: | Size: 48 KiB |
|
After Width: | Height: | Size: 7.9 KiB |
|
After Width: | Height: | Size: 46 KiB |
|
After Width: | Height: | Size: 26 KiB |
|
After Width: | Height: | Size: 62 KiB |
|
After Width: | Height: | Size: 33 KiB |
|
After Width: | Height: | Size: 47 KiB |
|
After Width: | Height: | Size: 107 KiB |
|
After Width: | Height: | Size: 38 KiB |
|
After Width: | Height: | Size: 112 KiB |
|
After Width: | Height: | Size: 172 KiB |
|
After Width: | Height: | Size: 28 KiB |
|
After Width: | Height: | Size: 25 KiB |
|
After Width: | Height: | Size: 55 KiB |
|
After Width: | Height: | Size: 32 KiB |
|
After Width: | Height: | Size: 18 KiB |
|
After Width: | Height: | Size: 17 KiB |
|
After Width: | Height: | Size: 20 KiB |
|
After Width: | Height: | Size: 127 KiB |
@@ -1,31 +1,31 @@
|
||||
H3 Continuum V2 standard workflow
|
||||
|
||||
Contents:
|
||||
- H3_Continuum_V2.json
|
||||
- H3_Continuum_V2_reference.webp
|
||||
|
||||
Setup:
|
||||
1. Copy H3_Continuum_V2_reference.webp to ComfyUI/input/.
|
||||
2. Drag H3_Continuum_V2.json onto the ComfyUI canvas.
|
||||
3. Install or replace any custom nodes reported as missing.
|
||||
4. Confirm the model selections before queueing.
|
||||
|
||||
Default profile:
|
||||
- 3 chunks x 5.0 seconds
|
||||
- Timeline prompt with three sections
|
||||
- Scale Image to Total Pixels: area, 0.50 MP, 32-step rounding
|
||||
- Continuity: Balanced, 22 frames
|
||||
- Seam correction: Auto
|
||||
- Report Detail: Basic
|
||||
|
||||
Quality note:
|
||||
- In the current local A/B sample, Seam Correction Off produced the least noticeable visual boundary.
|
||||
- Compare Auto and Off with the same seed; keep Off when Native Continuity already provides a clean join.
|
||||
|
||||
Reference test environment:
|
||||
- NVIDIA GeForce RTX 5060 Ti 16GB
|
||||
- 64GB system RAM
|
||||
- Python 3.13.12, PyTorch 2.13.0+cu130, CUDA 13.0
|
||||
- SageAttention 2.2.0+cu130, KJNodes FP8 CUDA++, compile disabled
|
||||
|
||||
The 0.50 MP profile is a starting point. If VRAM is insufficient, reduce the image scale to 0.30 MP.
|
||||
H3 Continuum V2 standard workflow
|
||||
|
||||
Contents:
|
||||
- H3_Continuum_V2.json
|
||||
- H3_Continuum_V2_reference.webp
|
||||
|
||||
Setup:
|
||||
1. Copy H3_Continuum_V2_reference.webp to ComfyUI/input/.
|
||||
2. Drag H3_Continuum_V2.json onto the ComfyUI canvas.
|
||||
3. Install or replace any custom nodes reported as missing.
|
||||
4. Confirm the model selections before queueing.
|
||||
|
||||
Default profile:
|
||||
- 3 chunks x 5.0 seconds
|
||||
- Timeline prompt with three sections
|
||||
- Scale Image to Total Pixels: area, 0.50 MP, 32-step rounding
|
||||
- Continuity: Balanced, 22 frames
|
||||
- Seam correction: Auto
|
||||
- Report Detail: Basic
|
||||
|
||||
Quality note:
|
||||
- In the current local A/B sample, Seam Correction Off produced the least noticeable visual boundary.
|
||||
- Compare Auto and Off with the same seed; keep Off when Native Continuity already provides a clean join.
|
||||
|
||||
Reference test environment:
|
||||
- NVIDIA GeForce RTX 5060 Ti 16GB
|
||||
- 64GB system RAM
|
||||
- Python 3.13.12, PyTorch 2.13.0+cu130, CUDA 13.0
|
||||
- SageAttention 2.2.0+cu130, KJNodes FP8 CUDA++, compile disabled
|
||||
|
||||
The 0.50 MP profile is a starting point. If VRAM is insufficient, reduce the image scale to 0.30 MP.
|
||||
|
||||
@@ -104,18 +104,29 @@ def build_upstream_graph_contract(
|
||||
safe = True
|
||||
reasons: list[str] = []
|
||||
specs = [
|
||||
("model", True),
|
||||
("clip", True),
|
||||
("video_vae", bool(require_video_vae)),
|
||||
("model", "model", True),
|
||||
("clip", "clip", True),
|
||||
("video_vae", "video_vae", bool(require_video_vae)),
|
||||
]
|
||||
if require_reference_audio_vae:
|
||||
specs.append(("reference_audio_vae", True))
|
||||
reference_audio_route = "reference_audio_vae"
|
||||
direct_link = inputs.get(reference_audio_route)
|
||||
if not (
|
||||
isinstance(direct_link, (list, tuple))
|
||||
and len(direct_link) == 2
|
||||
and isinstance(direct_link[0], (str, int))
|
||||
and isinstance(direct_link[1], int)
|
||||
):
|
||||
reference_audio_route = "audio_references"
|
||||
# Keep the established descriptor key. The bundled route fingerprints
|
||||
# the helper and therefore its Audio VAE plus every ordered source.
|
||||
specs.append(("reference_audio_vae", reference_audio_route, True))
|
||||
if require_audio_vae:
|
||||
specs.append(("audio_vae", True))
|
||||
for name, required in specs:
|
||||
specs.append(("audio_vae", "audio_vae", True))
|
||||
for name, input_name, required in specs:
|
||||
if not required:
|
||||
continue
|
||||
link = inputs.get(name)
|
||||
link = inputs.get(input_name)
|
||||
if not (
|
||||
isinstance(link, (list, tuple))
|
||||
and len(link) == 2
|
||||
|
||||
@@ -37,8 +37,12 @@ Get-ChildItem -LiteralPath $source -Force | Where-Object { $exclude -notcontains
|
||||
}
|
||||
|
||||
$python = Join-Path $ComfyUIRoot "venv\Scripts\python.exe"
|
||||
$verifier = Join-Path $destination "tools\verify_runtime.py"
|
||||
if (Test-Path $python) {
|
||||
& $python (Join-Path $destination "tools\verify_runtime.py") --comfy-root $ComfyUIRoot
|
||||
if (-not (Test-Path $verifier -PathType Leaf)) {
|
||||
throw "Runtime verifier is missing from the installed package: $verifier"
|
||||
}
|
||||
& $python $verifier --comfy-root $ComfyUIRoot
|
||||
if ($LASTEXITCODE -ne 0) {
|
||||
throw "Runtime verification failed. See the output above."
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
[project]
|
||||
name = H3 Continuum
|
||||
version = 3.7.0
|
||||
[project]
|
||||
name = H3 Continuum
|
||||
version = 3.8.0
|
||||
description = Native MiniMax H3 masked AV continuation, Second Pass, and disk-backed assembly.
|
||||
|
||||
@@ -159,11 +159,15 @@ def _wrapper_factory(
|
||||
strict: bool,
|
||||
debug: bool,
|
||||
validation_profiler: LayoutValidationProfiler | None = None,
|
||||
packed_row_planner: Any = None,
|
||||
) -> Callable[..., Any]:
|
||||
branch_baselines: dict[tuple[Any, ...], tuple[Any, ...]] = {}
|
||||
|
||||
def apply_model_wrapper(executor, *args, **kwargs):
|
||||
payload = kwargs.get("minimax_payload")
|
||||
if packed_row_planner is not None:
|
||||
from .v3.packed_row_planner import observe_layout_fail_soft
|
||||
observe_layout_fail_soft(packed_row_planner, payload)
|
||||
has_continuum = payload_has_continuum(payload)
|
||||
has_mixed_keyframe_refs = (
|
||||
isinstance(payload, dict)
|
||||
@@ -233,6 +237,7 @@ def configure_continuum_model(
|
||||
strict: bool,
|
||||
debug: bool,
|
||||
validation_profiler: LayoutValidationProfiler | None = None,
|
||||
packed_row_planner: Any = None,
|
||||
):
|
||||
try:
|
||||
from comfy.patcher_extension import WrappersMP
|
||||
@@ -264,6 +269,7 @@ def configure_continuum_model(
|
||||
strict=bool(strict),
|
||||
debug=bool(debug),
|
||||
validation_profiler=validation_profiler,
|
||||
packed_row_planner=packed_row_planner,
|
||||
),
|
||||
)
|
||||
model_options = dict(getattr(patched, "model_options", None) or {})
|
||||
@@ -279,6 +285,7 @@ def patch_model(
|
||||
strict: bool,
|
||||
debug: bool,
|
||||
validation_profiler: LayoutValidationProfiler | None = None,
|
||||
packed_row_planner: Any = None,
|
||||
):
|
||||
"""Clone once, then install the Continuum wrapper on that clone."""
|
||||
if not hasattr(model, "clone"):
|
||||
@@ -290,6 +297,7 @@ def patch_model(
|
||||
strict=strict,
|
||||
debug=debug,
|
||||
validation_profiler=validation_profiler,
|
||||
packed_row_planner=packed_row_planner,
|
||||
)
|
||||
|
||||
def continuum_interop_request(*, chunk_index: int, context_frames: int) -> dict[str, Any]:
|
||||
@@ -310,6 +318,7 @@ def clone_model_for_chunk(
|
||||
chunk_index: int,
|
||||
context_frames: int | None,
|
||||
validation_profiler: LayoutValidationProfiler | None = None,
|
||||
packed_row_planner: Any = None,
|
||||
):
|
||||
"""Create a call-local MODEL and attach an optional read-only Spectrum hint."""
|
||||
if not hasattr(model, "clone"):
|
||||
@@ -322,6 +331,7 @@ def clone_model_for_chunk(
|
||||
strict=bool(strict),
|
||||
debug=bool(debug),
|
||||
validation_profiler=validation_profiler,
|
||||
packed_row_planner=packed_row_planner,
|
||||
)
|
||||
if debug:
|
||||
parent = getattr(chunk_model, "parent", None)
|
||||
|
||||
@@ -382,6 +382,38 @@ from .v3.driving_nodes import (
|
||||
NODE_CLASS_MAPPINGS.update(V34_NODE_CLASS_MAPPINGS)
|
||||
NODE_DISPLAY_NAME_MAPPINGS.update(V34_NODE_DISPLAY_NAME_MAPPINGS)
|
||||
|
||||
from .v3.easy_nodes import (
|
||||
NODE_CLASS_MAPPINGS as V38_EASY_NODE_CLASS_MAPPINGS,
|
||||
NODE_DISPLAY_NAME_MAPPINGS as V38_EASY_NODE_DISPLAY_NAME_MAPPINGS,
|
||||
)
|
||||
|
||||
NODE_CLASS_MAPPINGS.update(V38_EASY_NODE_CLASS_MAPPINGS)
|
||||
NODE_DISPLAY_NAME_MAPPINGS.update(V38_EASY_NODE_DISPLAY_NAME_MAPPINGS)
|
||||
|
||||
from .v3.easy_image_nodes import (
|
||||
NODE_CLASS_MAPPINGS as EASY_IMAGE_NODE_CLASS_MAPPINGS,
|
||||
NODE_DISPLAY_NAME_MAPPINGS as EASY_IMAGE_NODE_DISPLAY_NAME_MAPPINGS,
|
||||
)
|
||||
|
||||
NODE_CLASS_MAPPINGS.update(EASY_IMAGE_NODE_CLASS_MAPPINGS)
|
||||
NODE_DISPLAY_NAME_MAPPINGS.update(EASY_IMAGE_NODE_DISPLAY_NAME_MAPPINGS)
|
||||
|
||||
from .v3.easy_audio_nodes import (
|
||||
NODE_CLASS_MAPPINGS as EASY_AUDIO_NODE_CLASS_MAPPINGS,
|
||||
NODE_DISPLAY_NAME_MAPPINGS as EASY_AUDIO_NODE_DISPLAY_NAME_MAPPINGS,
|
||||
)
|
||||
|
||||
NODE_CLASS_MAPPINGS.update(EASY_AUDIO_NODE_CLASS_MAPPINGS)
|
||||
NODE_DISPLAY_NAME_MAPPINGS.update(EASY_AUDIO_NODE_DISPLAY_NAME_MAPPINGS)
|
||||
|
||||
from .v3.easy_video_nodes import (
|
||||
NODE_CLASS_MAPPINGS as EASY_VIDEO_NODE_CLASS_MAPPINGS,
|
||||
NODE_DISPLAY_NAME_MAPPINGS as EASY_VIDEO_NODE_DISPLAY_NAME_MAPPINGS,
|
||||
)
|
||||
|
||||
NODE_CLASS_MAPPINGS.update(EASY_VIDEO_NODE_CLASS_MAPPINGS)
|
||||
NODE_DISPLAY_NAME_MAPPINGS.update(EASY_VIDEO_NODE_DISPLAY_NAME_MAPPINGS)
|
||||
|
||||
from .v3.second_pass_nodes import (
|
||||
NODE_CLASS_MAPPINGS as V35_NODE_CLASS_MAPPINGS,
|
||||
NODE_DISPLAY_NAME_MAPPINGS as V35_NODE_DISPLAY_NAME_MAPPINGS,
|
||||
@@ -416,29 +448,20 @@ from .v3.hires_fix_nodes import (
|
||||
NODE_CLASS_MAPPINGS.update(V35_HIRES_FIX_NODE_CLASS_MAPPINGS)
|
||||
NODE_DISPLAY_NAME_MAPPINGS.update(V35_HIRES_FIX_NODE_DISPLAY_NAME_MAPPINGS)
|
||||
|
||||
# The stable facade and its pack helpers are the public workflow surface. Keep
|
||||
# every older identifier registered so saved workflows still load, while
|
||||
# ComfyUI's native deprecated-node filter hides legacy building blocks.
|
||||
_primary_node_ids = {
|
||||
"H3ContinuumSamplerV34",
|
||||
"H3ContinuumSamplerV35",
|
||||
"H3ContinuumSamplerV36",
|
||||
"H3ContinuumStillImageGuideV37",
|
||||
"H3ContinuumSamplerV37",
|
||||
"H3ContinuumAssembleSeamV34",
|
||||
"H3ContinuumAssembleSeamV35",
|
||||
"H3ContinuumHiResFixV35",
|
||||
"H3ContinuumLatentResizeV35",
|
||||
"H3ContinuumSecondPassV35",
|
||||
"H3ContinuumConditioningBridgeV35",
|
||||
"H3ContinuumClipOverrides",
|
||||
"H3ContinuumResult",
|
||||
# V3.8 exports only its audited launch surface. The imports and merged mappings
|
||||
# above intentionally stay in place because the V3.8 implementation still
|
||||
# inherits and reuses historical modules internally.
|
||||
_PUBLIC_NODE_DISPLAY_NAMES = {
|
||||
"H3ContinuumSamplerV38": "H3 Continuum Sampler V3.8",
|
||||
"H3ContinuumReferenceAudios": "H3 Continuum Reference Audios",
|
||||
"H3ContinuumAssembleSeamV35": "H3 Continuum Finalize",
|
||||
"H3EasyLoadImage": "H3 Continuum Load Image",
|
||||
"H3EasyLoadAudio": "H3 Continuum Load Audio",
|
||||
"H3ContinuumLoadVideo": "H3 Continuum Load Video",
|
||||
"H3ContinuumSecondPassV35": "H3 Continuum Second Pass",
|
||||
}
|
||||
for _node_id, _node_class in NODE_CLASS_MAPPINGS.items():
|
||||
if _node_id in _primary_node_ids:
|
||||
continue
|
||||
_node_class.DEPRECATED = True
|
||||
_node_class.CATEGORY = f"{CATEGORY}/Legacy"
|
||||
_display_name = NODE_DISPLAY_NAME_MAPPINGS.get(_node_id, _node_id)
|
||||
if not _display_name.startswith("[Legacy]"):
|
||||
NODE_DISPLAY_NAME_MAPPINGS[_node_id] = f"[Legacy] {_display_name}"
|
||||
NODE_CLASS_MAPPINGS = {
|
||||
node_id: NODE_CLASS_MAPPINGS[node_id]
|
||||
for node_id in _PUBLIC_NODE_DISPLAY_NAMES
|
||||
}
|
||||
NODE_DISPLAY_NAME_MAPPINGS = dict(_PUBLIC_NODE_DISPLAY_NAMES)
|
||||
|
||||
@@ -1,18 +1,18 @@
|
||||
[project]
|
||||
name = "comfyui-h3-continuum"
|
||||
version = "3.7.0"
|
||||
description = "Integrated N-chunk continuation for ComfyUI native MiniMax H3 video and audio"
|
||||
readme = "README.md"
|
||||
requires-python = ">=3.10"
|
||||
license = { file = "LICENSE" }
|
||||
authors = [{ name = "ukr8b3g-cmyk" }]
|
||||
dependencies = []
|
||||
keywords = ["comfyui", "minimax-h3", "video", "audio", "continuation"]
|
||||
|
||||
[project.urls]
|
||||
Repository = "https://github.com/ukr8b3g-cmyk/ComfyUI-H3-Continuum"
|
||||
|
||||
[tool.comfy]
|
||||
PublisherId = "ukr8b3g-cmyk"
|
||||
DisplayName = "H3 Continuum"
|
||||
requires-comfyui = ">=0.32.0"
|
||||
[project]
|
||||
name = "comfyui-h3-continuum"
|
||||
version = "3.8.0"
|
||||
description = "Integrated N-chunk continuation for ComfyUI native MiniMax H3 video and audio"
|
||||
readme = "README.md"
|
||||
requires-python = ">=3.10"
|
||||
license = { file = "LICENSE" }
|
||||
authors = [{ name = "ukr8b3g-cmyk" }]
|
||||
dependencies = []
|
||||
keywords = ["comfyui", "minimax-h3", "video", "audio", "continuation"]
|
||||
|
||||
[project.urls]
|
||||
Repository = "https://github.com/ukr8b3g-cmyk/ComfyUI-H3-Continuum"
|
||||
|
||||
[tool.comfy]
|
||||
PublisherId = "ukr8b3g-cmyk"
|
||||
DisplayName = "H3 Continuum"
|
||||
requires-comfyui = ">=0.32.0"
|
||||
|
||||
@@ -1,191 +1,217 @@
|
||||
"""MiniMax H3 image-reference adapter for the V3 production sampler.
|
||||
|
||||
This module only builds the public Core conditioning contract. It does not
|
||||
own model loading, sampling, VAE decoding, or any optimizer implementation.
|
||||
"""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from dataclasses import dataclass, replace
|
||||
import hashlib
|
||||
import json
|
||||
import math
|
||||
import re
|
||||
from typing import Any
|
||||
|
||||
import torch
|
||||
|
||||
|
||||
REFERENCE_CONTRACT_VERSION = 1
|
||||
REFERENCE_PREPROCESS_VERSION = 1
|
||||
HYBRID_PRESENTATION_VERSION = 1
|
||||
REFERENCE_SIZE_MATCH_OUTPUT = "Match Output"
|
||||
REFERENCE_SIZE_MAX_IDENTITY = "Max Identity"
|
||||
REFERENCE_SIZE_OPTIONS = (
|
||||
REFERENCE_SIZE_MATCH_OUTPUT,
|
||||
REFERENCE_SIZE_MAX_IDENTITY,
|
||||
)
|
||||
_CANVAS_MULTIPLE = 32
|
||||
_MAX_IDENTITY_SHORT_EDGE = 2048
|
||||
_PICTURE_TAG = re.compile(r"<Picture\s+(\d+)>")
|
||||
|
||||
|
||||
class ReferenceConditioningError(ValueError):
|
||||
pass
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
class ReferenceAssets:
|
||||
images: tuple[torch.Tensor, ...]
|
||||
latents: tuple[torch.Tensor | None, ...]
|
||||
image_hashes: tuple[str, ...]
|
||||
combined_hash: str
|
||||
size_mode: str
|
||||
|
||||
@property
|
||||
def count(self) -> int:
|
||||
return len(self.images)
|
||||
|
||||
@property
|
||||
def contract(self) -> dict[str, Any]:
|
||||
result = {
|
||||
"reference_contract_version": REFERENCE_CONTRACT_VERSION,
|
||||
"count": self.count,
|
||||
"size_mode": self.size_mode,
|
||||
"image_hashes": list(self.image_hashes),
|
||||
"combined_hash": self.combined_hash,
|
||||
}
|
||||
# Preserve the V3.2.2 JSON contract byte-for-byte for zero, one, and
|
||||
# two references. The V3.2.3 extension exists only when Image 3 is
|
||||
# connected, so removing it can resolve back to an older Revision.
|
||||
if self.count == 3:
|
||||
image = self.images[2]
|
||||
result["reference_image_3"] = {
|
||||
"reference_position": 3,
|
||||
"shape": [int(value) for value in image.shape],
|
||||
"dtype": str(image.dtype),
|
||||
"sha256": self.image_hashes[2],
|
||||
"preprocess_version": REFERENCE_PREPROCESS_VERSION,
|
||||
}
|
||||
return result
|
||||
|
||||
|
||||
def _canonical_hash(value: Any) -> str:
|
||||
payload = json.dumps(
|
||||
value, sort_keys=True, separators=(",", ":"), ensure_ascii=True
|
||||
).encode("utf-8")
|
||||
return hashlib.sha256(payload).hexdigest()
|
||||
|
||||
|
||||
def _tensor_hash(value: torch.Tensor) -> str:
|
||||
tensor = value.detach().to(device="cpu").contiguous()
|
||||
digest = hashlib.sha256()
|
||||
digest.update(str(tuple(int(v) for v in tensor.shape)).encode("ascii"))
|
||||
digest.update(str(tensor.dtype).encode("ascii"))
|
||||
digest.update(tensor.numpy().tobytes(order="C"))
|
||||
return digest.hexdigest()
|
||||
|
||||
|
||||
def _round_canvas(value: float) -> int:
|
||||
return max(_CANVAS_MULTIPLE, int(round(value / _CANVAS_MULTIPLE)) * _CANVAS_MULTIPLE)
|
||||
|
||||
|
||||
"""MiniMax H3 image-reference adapter for the V3 production sampler.
|
||||
|
||||
This module only builds the public Core conditioning contract. It does not
|
||||
own model loading, sampling, VAE decoding, or any optimizer implementation.
|
||||
"""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from dataclasses import dataclass, replace
|
||||
import hashlib
|
||||
import json
|
||||
import math
|
||||
import re
|
||||
from typing import Any
|
||||
|
||||
import torch
|
||||
|
||||
|
||||
REFERENCE_CONTRACT_VERSION = 1
|
||||
REFERENCE_PREPROCESS_VERSION = 1
|
||||
HYBRID_PRESENTATION_VERSION = 1
|
||||
REFERENCE_SIZE_MATCH_OUTPUT = "Match Output"
|
||||
REFERENCE_SIZE_MAX_IDENTITY = "Max Identity"
|
||||
REFERENCE_SIZE_OPTIONS = (
|
||||
REFERENCE_SIZE_MATCH_OUTPUT,
|
||||
REFERENCE_SIZE_MAX_IDENTITY,
|
||||
)
|
||||
_CANVAS_MULTIPLE = 32
|
||||
_MAX_IDENTITY_SHORT_EDGE = 2048
|
||||
_PICTURE_TAG = re.compile(r"<Picture\s+(\d+)>")
|
||||
|
||||
|
||||
class ReferenceConditioningError(ValueError):
|
||||
pass
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
class ReferenceAssets:
|
||||
images: tuple[torch.Tensor, ...]
|
||||
latents: tuple[torch.Tensor | None, ...]
|
||||
image_hashes: tuple[str, ...]
|
||||
combined_hash: str
|
||||
size_mode: str
|
||||
|
||||
@property
|
||||
def count(self) -> int:
|
||||
return len(self.images)
|
||||
|
||||
@property
|
||||
def contract(self) -> dict[str, Any]:
|
||||
result = {
|
||||
"reference_contract_version": REFERENCE_CONTRACT_VERSION,
|
||||
"count": self.count,
|
||||
"size_mode": self.size_mode,
|
||||
"image_hashes": list(self.image_hashes),
|
||||
"combined_hash": self.combined_hash,
|
||||
}
|
||||
# Preserve the V3.2.2 JSON contract byte-for-byte for zero, one, and
|
||||
# two references. The V3.2.3 extension exists only when Image 3 is
|
||||
# connected, so removing it can resolve back to an older Revision.
|
||||
if self.count == 3:
|
||||
image = self.images[2]
|
||||
result["reference_image_3"] = {
|
||||
"reference_position": 3,
|
||||
"shape": [int(value) for value in image.shape],
|
||||
"dtype": str(image.dtype),
|
||||
"sha256": self.image_hashes[2],
|
||||
"preprocess_version": REFERENCE_PREPROCESS_VERSION,
|
||||
}
|
||||
return result
|
||||
|
||||
|
||||
def _canonical_hash(value: Any) -> str:
|
||||
payload = json.dumps(
|
||||
value, sort_keys=True, separators=(",", ":"), ensure_ascii=True
|
||||
).encode("utf-8")
|
||||
return hashlib.sha256(payload).hexdigest()
|
||||
|
||||
|
||||
def _tensor_hash(value: torch.Tensor) -> str:
|
||||
tensor = value.detach().to(device="cpu").contiguous()
|
||||
digest = hashlib.sha256()
|
||||
digest.update(str(tuple(int(v) for v in tensor.shape)).encode("ascii"))
|
||||
digest.update(str(tensor.dtype).encode("ascii"))
|
||||
digest.update(tensor.numpy().tobytes(order="C"))
|
||||
return digest.hexdigest()
|
||||
|
||||
|
||||
def _round_canvas(value: float) -> int:
|
||||
return max(_CANVAS_MULTIPLE, int(round(value / _CANVAS_MULTIPLE)) * _CANVAS_MULTIPLE)
|
||||
|
||||
|
||||
def _validate_image(name: str, image: torch.Tensor) -> torch.Tensor:
|
||||
if not torch.is_tensor(image) or image.ndim != 4:
|
||||
raise ReferenceConditioningError(f"{name} must be a ComfyUI IMAGE tensor")
|
||||
if int(image.shape[0]) < 1 or int(image.shape[1]) < 1 or int(image.shape[2]) < 1:
|
||||
raise ReferenceConditioningError(f"{name} is empty")
|
||||
if int(image.shape[0]) != 1:
|
||||
raise ReferenceConditioningError(
|
||||
f"{name} must contain exactly one image (batch size B=1)"
|
||||
)
|
||||
if int(image.shape[-1]) < 3:
|
||||
raise ReferenceConditioningError(f"{name} must have RGB channels")
|
||||
if not torch.is_tensor(image) or image.ndim != 4:
|
||||
raise ReferenceConditioningError(f"{name} must be a ComfyUI IMAGE tensor")
|
||||
if int(image.shape[0]) < 1 or int(image.shape[1]) < 1 or int(image.shape[2]) < 1:
|
||||
raise ReferenceConditioningError(f"{name} is empty")
|
||||
if int(image.shape[0]) != 1:
|
||||
raise ReferenceConditioningError(
|
||||
f"{name} must contain exactly one image (batch size B=1)"
|
||||
)
|
||||
if int(image.shape[-1]) < 3:
|
||||
raise ReferenceConditioningError(f"{name} must have RGB channels")
|
||||
return image[:, :, :, :3]
|
||||
|
||||
|
||||
def _resize_reference(
|
||||
image: torch.Tensor,
|
||||
def resolve_reference_image_size(
|
||||
source_width: int,
|
||||
source_height: int,
|
||||
*,
|
||||
output_width: int,
|
||||
output_height: int,
|
||||
size_mode: str,
|
||||
) -> torch.Tensor:
|
||||
) -> tuple[int, int]:
|
||||
"""Resolve Reference Image geometry without resizing or reading pixels."""
|
||||
|
||||
if size_mode not in REFERENCE_SIZE_OPTIONS:
|
||||
raise ReferenceConditioningError(f"unknown Reference Size: {size_mode!r}")
|
||||
source_height = int(image.shape[1])
|
||||
source_width = int(image.shape[2])
|
||||
source_width = int(source_width)
|
||||
source_height = int(source_height)
|
||||
if size_mode == REFERENCE_SIZE_MATCH_OUTPUT:
|
||||
target_area = float(int(output_width) * int(output_height))
|
||||
scale = min(1.0, math.sqrt(target_area / float(source_width * source_height)))
|
||||
else:
|
||||
scale = min(1.0, float(_MAX_IDENTITY_SHORT_EDGE) / min(source_width, source_height))
|
||||
target_width = _round_canvas(source_width * scale)
|
||||
target_height = _round_canvas(source_height * scale)
|
||||
if target_width == source_width and target_height == source_height:
|
||||
return image.contiguous()
|
||||
try:
|
||||
import comfy.utils
|
||||
except Exception as exc:
|
||||
raise ReferenceConditioningError(
|
||||
"ComfyUI Core image resize support is unavailable"
|
||||
) from exc
|
||||
channels_first = image.movedim(-1, 1)
|
||||
resized = comfy.utils.common_upscale(
|
||||
channels_first,
|
||||
target_width,
|
||||
target_height,
|
||||
"lanczos",
|
||||
"disabled",
|
||||
scale = min(
|
||||
1.0,
|
||||
float(_MAX_IDENTITY_SHORT_EDGE) / min(source_width, source_height),
|
||||
)
|
||||
return (
|
||||
_round_canvas(source_width * scale),
|
||||
_round_canvas(source_height * scale),
|
||||
)
|
||||
return resized.movedim(1, -1).contiguous()
|
||||
|
||||
|
||||
def prepare_reference_assets(
|
||||
*,
|
||||
reference_image_1: torch.Tensor | None,
|
||||
reference_image_2: torch.Tensor | None,
|
||||
output_width: int,
|
||||
def _resize_reference(
|
||||
image: torch.Tensor,
|
||||
*,
|
||||
output_width: int,
|
||||
output_height: int,
|
||||
size_mode: str,
|
||||
reference_image_3: torch.Tensor | 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 (reference_image_1, reference_image_2, reference_image_3)
|
||||
if image is not None
|
||||
]
|
||||
if not inputs:
|
||||
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)
|
||||
)
|
||||
image_hashes = tuple(_tensor_hash(image) for image in images)
|
||||
combined_hash = _canonical_hash(
|
||||
{
|
||||
"reference_contract_version": REFERENCE_CONTRACT_VERSION,
|
||||
"size_mode": size_mode,
|
||||
"image_hashes": list(image_hashes),
|
||||
}
|
||||
)
|
||||
return ReferenceAssets(
|
||||
images=images,
|
||||
latents=tuple(None for _ in images),
|
||||
image_hashes=image_hashes,
|
||||
combined_hash=combined_hash,
|
||||
) -> torch.Tensor:
|
||||
source_height = int(image.shape[1])
|
||||
source_width = int(image.shape[2])
|
||||
target_width, target_height = resolve_reference_image_size(
|
||||
source_width,
|
||||
source_height,
|
||||
output_width=int(output_width),
|
||||
output_height=int(output_height),
|
||||
size_mode=size_mode,
|
||||
)
|
||||
|
||||
|
||||
if target_width == source_width and target_height == source_height:
|
||||
return image.contiguous()
|
||||
try:
|
||||
import comfy.utils
|
||||
except Exception as exc:
|
||||
raise ReferenceConditioningError(
|
||||
"ComfyUI Core image resize support is unavailable"
|
||||
) from exc
|
||||
channels_first = image.movedim(-1, 1)
|
||||
resized = comfy.utils.common_upscale(
|
||||
channels_first,
|
||||
target_width,
|
||||
target_height,
|
||||
"lanczos",
|
||||
"disabled",
|
||||
)
|
||||
return resized.movedim(1, -1).contiguous()
|
||||
|
||||
|
||||
def prepare_reference_assets(
|
||||
*,
|
||||
reference_image_1: torch.Tensor | None,
|
||||
reference_image_2: torch.Tensor | None,
|
||||
output_width: int,
|
||||
output_height: int,
|
||||
size_mode: str,
|
||||
reference_image_3: torch.Tensor | 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 (reference_image_1, reference_image_2, reference_image_3)
|
||||
if image is not None
|
||||
]
|
||||
if not inputs:
|
||||
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)
|
||||
)
|
||||
image_hashes = tuple(_tensor_hash(image) for image in images)
|
||||
combined_hash = _canonical_hash(
|
||||
{
|
||||
"reference_contract_version": REFERENCE_CONTRACT_VERSION,
|
||||
"size_mode": size_mode,
|
||||
"image_hashes": list(image_hashes),
|
||||
}
|
||||
)
|
||||
return ReferenceAssets(
|
||||
images=images,
|
||||
latents=tuple(None for _ in images),
|
||||
image_hashes=image_hashes,
|
||||
combined_hash=combined_hash,
|
||||
size_mode=size_mode,
|
||||
)
|
||||
|
||||
|
||||
def encode_reference_latents(video_vae: Any, assets: ReferenceAssets) -> ReferenceAssets:
|
||||
if all(latent is not None for latent in assets.latents):
|
||||
return assets
|
||||
@@ -193,44 +219,84 @@ def encode_reference_latents(video_vae: Any, assets: ReferenceAssets) -> Referen
|
||||
return replace(assets, latents=latents)
|
||||
|
||||
|
||||
def build_hybrid_presentation_items(
|
||||
reference_items: list[dict[str, Any]],
|
||||
def encode_reference_latents_cached(
|
||||
video_vae: Any,
|
||||
assets: ReferenceAssets,
|
||||
*,
|
||||
first_image: torch.Tensor | None = None,
|
||||
last_image: torch.Tensor | None = None,
|
||||
) -> list[dict[str, Any]]:
|
||||
"""Build the Core Qwen Picture list without changing DiT payloads."""
|
||||
items: list[dict[str, Any]] = []
|
||||
if first_image is not None:
|
||||
items.append({"type": "image", "data": first_image})
|
||||
if last_image is not None:
|
||||
items.append({"type": "image", "data": last_image})
|
||||
items.extend(dict(item) for item in reference_items)
|
||||
return items
|
||||
cache_event=None,
|
||||
) -> ReferenceAssets:
|
||||
"""Encode V3.8 Reference Images with the process-local VAE cache."""
|
||||
|
||||
|
||||
def combine_hybrid_visual_identity(
|
||||
*,
|
||||
keyframe_identity_hash: str,
|
||||
reference_assets: ReferenceAssets | None,
|
||||
has_first: bool,
|
||||
has_last: bool,
|
||||
) -> str:
|
||||
"""Preserve pure-mode identity and version only the hybrid contract."""
|
||||
if reference_assets is None:
|
||||
return str(keyframe_identity_hash)
|
||||
if not has_first and not has_last:
|
||||
return reference_assets.combined_hash
|
||||
return _canonical_hash(
|
||||
{
|
||||
"hybrid_visual_identity_version": 1,
|
||||
"hybrid_presentation_version": HYBRID_PRESENTATION_VERSION,
|
||||
"keyframe_identity_hash": str(keyframe_identity_hash),
|
||||
"reference_hash": reference_assets.combined_hash,
|
||||
}
|
||||
if all(latent is not None for latent in assets.latents):
|
||||
return assets
|
||||
from .v3.ref_encode_cache import (
|
||||
get_ref_encode_cache,
|
||||
make_ref_encode_cache_key,
|
||||
)
|
||||
|
||||
|
||||
cache = get_ref_encode_cache()
|
||||
latents: list[torch.Tensor] = []
|
||||
for image, image_hash, existing in zip(
|
||||
assets.images,
|
||||
assets.image_hashes,
|
||||
assets.latents,
|
||||
strict=True,
|
||||
):
|
||||
if existing is not None:
|
||||
latents.append(existing)
|
||||
continue
|
||||
key = make_ref_encode_cache_key(
|
||||
"reference_image",
|
||||
REFERENCE_PREPROCESS_VERSION,
|
||||
image_hash,
|
||||
)
|
||||
latent = cache.lookup(video_vae, key, event_sink=cache_event)
|
||||
if latent is None:
|
||||
latent = video_vae.encode(image)
|
||||
if cache.supports_vae(video_vae):
|
||||
cache.store(video_vae, key, latent, event_sink=cache_event)
|
||||
latents.append(latent)
|
||||
return replace(assets, latents=tuple(latents))
|
||||
|
||||
|
||||
def build_hybrid_presentation_items(
|
||||
reference_items: list[dict[str, Any]],
|
||||
*,
|
||||
first_image: torch.Tensor | None = None,
|
||||
last_image: torch.Tensor | None = None,
|
||||
) -> list[dict[str, Any]]:
|
||||
"""Build the Core Qwen Picture list without changing DiT payloads."""
|
||||
items: list[dict[str, Any]] = []
|
||||
if first_image is not None:
|
||||
items.append({"type": "image", "data": first_image})
|
||||
if last_image is not None:
|
||||
items.append({"type": "image", "data": last_image})
|
||||
items.extend(dict(item) for item in reference_items)
|
||||
return items
|
||||
|
||||
|
||||
def combine_hybrid_visual_identity(
|
||||
*,
|
||||
keyframe_identity_hash: str,
|
||||
reference_assets: ReferenceAssets | None,
|
||||
has_first: bool,
|
||||
has_last: bool,
|
||||
) -> str:
|
||||
"""Preserve pure-mode identity and version only the hybrid contract."""
|
||||
if reference_assets is None:
|
||||
return str(keyframe_identity_hash)
|
||||
if not has_first and not has_last:
|
||||
return reference_assets.combined_hash
|
||||
return _canonical_hash(
|
||||
{
|
||||
"hybrid_visual_identity_version": 1,
|
||||
"hybrid_presentation_version": HYBRID_PRESENTATION_VERSION,
|
||||
"keyframe_identity_hash": str(keyframe_identity_hash),
|
||||
"reference_hash": reference_assets.combined_hash,
|
||||
}
|
||||
)
|
||||
|
||||
|
||||
def validate_reference_prompts(
|
||||
prompts: list[str],
|
||||
reference_count: int,
|
||||
@@ -249,13 +315,13 @@ def validate_reference_prompts(
|
||||
}
|
||||
invalid = sorted(value for value in found if value < 1 or value > last_reference)
|
||||
warnings: list[str] = []
|
||||
if invalid:
|
||||
unavailable = ", ".join(f"<Picture {value}>" for value in invalid)
|
||||
warnings.append(
|
||||
f"H3C-P102 Warning: prompt references unavailable {unavailable}; only "
|
||||
f"{reference_count} active reference image(s) reached the Sampler. "
|
||||
"ComfyUI Core permits this and generation will continue, but the "
|
||||
"unavailable reference may be ignored or hallucinated. Enable the "
|
||||
if invalid:
|
||||
unavailable = ", ".join(f"<Picture {value}>" for value in invalid)
|
||||
warnings.append(
|
||||
f"H3C-P102 Warning: prompt references unavailable {unavailable}; only "
|
||||
f"{reference_count} active reference image(s) reached the Sampler. "
|
||||
"ComfyUI Core permits this and generation will continue, but the "
|
||||
"unavailable reference may be ignored or hallucinated. Enable the "
|
||||
"corresponding Reference Image input or remove the unavailable tag."
|
||||
)
|
||||
|
||||
@@ -268,63 +334,75 @@ def validate_reference_prompts(
|
||||
if picture_offset == 0 and not found
|
||||
else f"connected reference {labels} is not explicitly mentioned in the prompt"
|
||||
)
|
||||
warnings.append(
|
||||
f"H3C-P103 Warning: {detail}; images still condition generation, but "
|
||||
"explicit identity references are recommended."
|
||||
)
|
||||
return "\n".join(warnings)
|
||||
|
||||
|
||||
def encode_reference_prompt(
|
||||
clip: Any,
|
||||
prompt: str,
|
||||
assets: ReferenceAssets,
|
||||
first_image: torch.Tensor | None = None,
|
||||
last_image: torch.Tensor | None = None,
|
||||
reference_audio_assets=None,
|
||||
timeline_video_assets=None,
|
||||
) -> list[list[Any]]:
|
||||
if any(latent is None for latent in assets.latents):
|
||||
raise ReferenceConditioningError("reference latents were not encoded")
|
||||
reference_items = [
|
||||
{"type": "image", "data": image}
|
||||
for image in assets.images
|
||||
]
|
||||
warnings.append(
|
||||
f"H3C-P103 Warning: {detail}; images still condition generation, but "
|
||||
"explicit identity references are recommended."
|
||||
)
|
||||
return "\n".join(warnings)
|
||||
|
||||
|
||||
def encode_reference_prompt(
|
||||
clip: Any,
|
||||
prompt: str,
|
||||
assets: ReferenceAssets,
|
||||
first_image: torch.Tensor | None = None,
|
||||
last_image: torch.Tensor | None = None,
|
||||
reference_audio_assets=None,
|
||||
timeline_video_assets=None,
|
||||
) -> list[list[Any]]:
|
||||
if any(latent is None for latent in assets.latents):
|
||||
raise ReferenceConditioningError("reference latents were not encoded")
|
||||
reference_items = [
|
||||
{"type": "image", "data": image}
|
||||
for image in assets.images
|
||||
]
|
||||
if timeline_video_assets is not None:
|
||||
reference_items.append(dict(timeline_video_assets.item))
|
||||
if reference_audio_assets is not None:
|
||||
from .reference_audio import reference_audio_item
|
||||
|
||||
reference_items.append(reference_audio_item())
|
||||
presentation_items = build_hybrid_presentation_items(
|
||||
reference_items,
|
||||
first_image=first_image,
|
||||
last_image=last_image,
|
||||
)
|
||||
try:
|
||||
tokens = clip.tokenize(str(prompt), minimax_ref_items=presentation_items)
|
||||
except TypeError as exc:
|
||||
raise ReferenceConditioningError(
|
||||
"This ComfyUI Core/CLIP does not support MiniMax H3 image references"
|
||||
) from exc
|
||||
conditioning = clip.encode_from_tokens_scheduled(tokens)
|
||||
refs = []
|
||||
for image, latent in zip(assets.images, assets.latents, strict=True):
|
||||
refs.append(
|
||||
{
|
||||
"kind": "image",
|
||||
"latent_h": int(image.shape[1]) // 16,
|
||||
"latent_w": int(image.shape[2]) // 16,
|
||||
"latent": latent,
|
||||
}
|
||||
from .reference_audio import (
|
||||
reference_audio_asset_items,
|
||||
reference_audio_item,
|
||||
)
|
||||
|
||||
reference_items.extend(
|
||||
reference_audio_item()
|
||||
for _ in reference_audio_asset_items(reference_audio_assets)
|
||||
)
|
||||
presentation_items = build_hybrid_presentation_items(
|
||||
reference_items,
|
||||
first_image=first_image,
|
||||
last_image=last_image,
|
||||
)
|
||||
try:
|
||||
tokens = clip.tokenize(str(prompt), minimax_ref_items=presentation_items)
|
||||
except TypeError as exc:
|
||||
raise ReferenceConditioningError(
|
||||
"This ComfyUI Core/CLIP does not support MiniMax H3 image references"
|
||||
) from exc
|
||||
conditioning = clip.encode_from_tokens_scheduled(tokens)
|
||||
refs = []
|
||||
for image, latent in zip(assets.images, assets.latents, strict=True):
|
||||
refs.append(
|
||||
{
|
||||
"kind": "image",
|
||||
"latent_h": int(image.shape[1]) // 16,
|
||||
"latent_w": int(image.shape[2]) // 16,
|
||||
"latent": latent,
|
||||
}
|
||||
)
|
||||
if timeline_video_assets is not None:
|
||||
refs.append(dict(timeline_video_assets.block))
|
||||
if reference_audio_assets is not None:
|
||||
from .reference_audio import reference_audio_block
|
||||
from .reference_audio import (
|
||||
reference_audio_asset_items,
|
||||
reference_audio_block,
|
||||
)
|
||||
|
||||
refs.append(reference_audio_block(reference_audio_assets))
|
||||
return [
|
||||
[tensor, {**dict(metadata), "minimax_refs": list(refs)}]
|
||||
for tensor, metadata in conditioning
|
||||
]
|
||||
refs.extend(
|
||||
dict(reference_audio_block(item))
|
||||
for item in reference_audio_asset_items(reference_audio_assets)
|
||||
)
|
||||
return [
|
||||
[tensor, {**dict(metadata), "minimax_refs": list(refs)}]
|
||||
for tensor, metadata in conditioning
|
||||
]
|
||||
|
||||
@@ -13,6 +13,8 @@ import torch
|
||||
|
||||
REFERENCE_AUDIO_CONTRACT_VERSION = 1
|
||||
REFERENCE_AUDIO_PREPROCESS_VERSION = 1
|
||||
REFERENCE_AUDIO_BUNDLE_CONTRACT_VERSION = 1
|
||||
REFERENCE_AUDIOS_TYPE = "H3_CONTINUUM_AUDIO_REFERENCES"
|
||||
_AUDIO_TAG = re.compile(r"<Audio\s+(\d+)>")
|
||||
|
||||
|
||||
@@ -60,6 +62,36 @@ class ReferenceAudioAssets:
|
||||
return self.source.combined_hash
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
class ReferenceAudioBundle:
|
||||
"""Ordered Reference Audio sources plus their shared Core Audio VAE."""
|
||||
|
||||
sources: tuple[ReferenceAudioSource, ...]
|
||||
reference_audio_vae: Any
|
||||
combined_hash: str
|
||||
|
||||
@property
|
||||
def count(self) -> int:
|
||||
return len(self.sources)
|
||||
|
||||
@property
|
||||
def contract(self) -> dict[str, Any]:
|
||||
return {
|
||||
"reference_audio_bundle_contract_version": (
|
||||
REFERENCE_AUDIO_BUNDLE_CONTRACT_VERSION
|
||||
),
|
||||
"count": self.count,
|
||||
"items": [
|
||||
{
|
||||
"audio_index": index,
|
||||
"reference_audio": source.contract,
|
||||
}
|
||||
for index, source in enumerate(self.sources, start=1)
|
||||
],
|
||||
"combined_hash": self.combined_hash,
|
||||
}
|
||||
|
||||
|
||||
def _canonical_hash(value: Any) -> str:
|
||||
payload = json.dumps(
|
||||
value, sort_keys=True, separators=(",", ":"), ensure_ascii=True
|
||||
@@ -90,32 +122,30 @@ def _validate_waveform(name: str, waveform: Any) -> torch.Tensor:
|
||||
return waveform.detach().to(device="cpu").contiguous()
|
||||
|
||||
|
||||
def prepare_reference_audio_source(
|
||||
reference_audio_1: Any,
|
||||
def _prepare_reference_audio_source(
|
||||
reference_audio: Any,
|
||||
reference_audio_vae: Any,
|
||||
*,
|
||||
name: str,
|
||||
) -> ReferenceAudioSource | None:
|
||||
if reference_audio_1 is None:
|
||||
if reference_audio is None:
|
||||
return None
|
||||
if reference_audio_vae is None:
|
||||
raise ReferenceAudioError(
|
||||
"reference_audio_vae is required when reference_audio_1 is connected"
|
||||
"reference_audio_vae is required when reference audio is connected"
|
||||
)
|
||||
if not isinstance(reference_audio_1, dict):
|
||||
raise ReferenceAudioError("Reference Audio 1 must be a ComfyUI AUDIO value")
|
||||
waveform = _validate_waveform(
|
||||
"Reference Audio 1", reference_audio_1.get("waveform")
|
||||
)
|
||||
sample_rate_value = reference_audio_1.get("sample_rate")
|
||||
if not isinstance(reference_audio, dict):
|
||||
raise ReferenceAudioError(f"{name} must be a ComfyUI AUDIO value")
|
||||
waveform = _validate_waveform(name, reference_audio.get("waveform"))
|
||||
sample_rate_value = reference_audio.get("sample_rate")
|
||||
if isinstance(sample_rate_value, bool):
|
||||
raise ReferenceAudioError("Reference Audio 1 sample_rate must be positive")
|
||||
raise ReferenceAudioError(f"{name} sample_rate must be positive")
|
||||
try:
|
||||
source_sample_rate = int(sample_rate_value)
|
||||
except (TypeError, ValueError) as exc:
|
||||
raise ReferenceAudioError(
|
||||
"Reference Audio 1 sample_rate must be positive"
|
||||
) from exc
|
||||
raise ReferenceAudioError(f"{name} sample_rate must be positive") from exc
|
||||
if source_sample_rate <= 0:
|
||||
raise ReferenceAudioError("Reference Audio 1 sample_rate must be positive")
|
||||
raise ReferenceAudioError(f"{name} sample_rate must be positive")
|
||||
resolved_rate = int(getattr(reference_audio_vae, "audio_sample_rate", 32000))
|
||||
if resolved_rate <= 0:
|
||||
raise ReferenceAudioError("Reference Audio VAE sample rate must be positive")
|
||||
@@ -129,11 +159,11 @@ def prepare_reference_audio_source(
|
||||
).contiguous()
|
||||
except Exception as exc:
|
||||
raise ReferenceAudioError(
|
||||
"Reference Audio 1 could not be resampled for the Audio VAE"
|
||||
f"{name} could not be resampled for the Audio VAE"
|
||||
) from exc
|
||||
if not bool(torch.isfinite(resampled).all().item()):
|
||||
raise ReferenceAudioError(
|
||||
"Reference Audio 1 contains NaN or infinity after resampling"
|
||||
f"{name} contains NaN or infinity after resampling"
|
||||
)
|
||||
source_shape = tuple(int(value) for value in waveform.shape)
|
||||
resampled_shape = tuple(int(value) for value in resampled.shape)
|
||||
@@ -165,6 +195,96 @@ def prepare_reference_audio_source(
|
||||
)
|
||||
|
||||
|
||||
def prepare_reference_audio_source(
|
||||
reference_audio_1: Any,
|
||||
reference_audio_vae: Any,
|
||||
) -> ReferenceAudioSource | None:
|
||||
"""Prepare the unchanged legacy single-Reference-Audio path."""
|
||||
|
||||
if reference_audio_1 is None:
|
||||
return None
|
||||
if reference_audio_vae is None:
|
||||
# Preserve the established user-facing legacy validation text exactly.
|
||||
raise ReferenceAudioError(
|
||||
"reference_audio_vae is required when reference_audio_1 is connected"
|
||||
)
|
||||
return _prepare_reference_audio_source(
|
||||
reference_audio_1,
|
||||
reference_audio_vae,
|
||||
name="Reference Audio 1",
|
||||
)
|
||||
|
||||
|
||||
def prepare_reference_audio_bundle(
|
||||
reference_audio_1: Any,
|
||||
reference_audio_2: Any,
|
||||
reference_audio_3: Any,
|
||||
reference_audio_vae: Any,
|
||||
) -> ReferenceAudioBundle | None:
|
||||
"""Prepare up to three ordered Core-native standalone audio references."""
|
||||
|
||||
values = (reference_audio_1, reference_audio_2, reference_audio_3)
|
||||
connected = tuple(value is not None for value in values)
|
||||
if not any(connected):
|
||||
return None
|
||||
first_gap = next((index for index, present in enumerate(connected) if not present), 3)
|
||||
if any(connected[first_gap + 1 :]):
|
||||
raise ReferenceAudioError(
|
||||
"Reference Audio inputs must be connected in order without gaps so "
|
||||
"<Audio 1>, <Audio 2>, and <Audio 3> keep their exact Core numbering"
|
||||
)
|
||||
sources = tuple(
|
||||
_prepare_reference_audio_source(
|
||||
value,
|
||||
reference_audio_vae,
|
||||
name=f"Reference Audio {index}",
|
||||
)
|
||||
for index, value in enumerate(values, start=1)
|
||||
if value is not None
|
||||
)
|
||||
contract_base = {
|
||||
"reference_audio_bundle_contract_version": (
|
||||
REFERENCE_AUDIO_BUNDLE_CONTRACT_VERSION
|
||||
),
|
||||
"count": len(sources),
|
||||
"items": [
|
||||
{
|
||||
"audio_index": index,
|
||||
"reference_audio": source.contract,
|
||||
}
|
||||
for index, source in enumerate(sources, start=1)
|
||||
],
|
||||
}
|
||||
return ReferenceAudioBundle(
|
||||
sources=sources,
|
||||
reference_audio_vae=reference_audio_vae,
|
||||
combined_hash=_canonical_hash(contract_base),
|
||||
)
|
||||
|
||||
|
||||
def resolve_reference_audio_input(
|
||||
reference_audio_1: Any,
|
||||
reference_audio_vae: Any,
|
||||
audio_references: Any,
|
||||
) -> tuple[ReferenceAudioSource | ReferenceAudioBundle | None, Any]:
|
||||
"""Resolve legacy or bundled input without silently mixing contracts."""
|
||||
|
||||
if audio_references is not None:
|
||||
if not isinstance(audio_references, ReferenceAudioBundle):
|
||||
raise ReferenceAudioError(
|
||||
"Audio References must come from H3 Continuum Reference Audios"
|
||||
)
|
||||
if reference_audio_1 is not None:
|
||||
raise ReferenceAudioError(
|
||||
"Use either legacy Reference Audio or Audio References, not both"
|
||||
)
|
||||
return audio_references, audio_references.reference_audio_vae
|
||||
return (
|
||||
prepare_reference_audio_source(reference_audio_1, reference_audio_vae),
|
||||
reference_audio_vae,
|
||||
)
|
||||
|
||||
|
||||
def encode_reference_audio(
|
||||
reference_audio_vae: Any,
|
||||
source: ReferenceAudioSource,
|
||||
@@ -189,16 +309,71 @@ def encode_reference_audio(
|
||||
return ReferenceAudioAssets(source=source, audio_latent=latent)
|
||||
|
||||
|
||||
def encode_reference_audio_cached(
|
||||
reference_audio_vae: Any,
|
||||
source: ReferenceAudioSource,
|
||||
*,
|
||||
cache_event=None,
|
||||
) -> ReferenceAudioAssets:
|
||||
"""Cache Reference Audio only when its established output is already CPU."""
|
||||
|
||||
from .v3.ref_encode_cache import (
|
||||
get_ref_encode_cache,
|
||||
make_ref_encode_cache_key,
|
||||
)
|
||||
|
||||
cache = get_ref_encode_cache()
|
||||
key = make_ref_encode_cache_key(
|
||||
"reference_audio",
|
||||
REFERENCE_AUDIO_PREPROCESS_VERSION,
|
||||
source.combined_hash,
|
||||
)
|
||||
latent = cache.lookup(reference_audio_vae, key, event_sink=cache_event)
|
||||
if latent is not None:
|
||||
return ReferenceAudioAssets(source=source, audio_latent=latent)
|
||||
assets = encode_reference_audio(reference_audio_vae, source)
|
||||
if cache.supports_vae(reference_audio_vae):
|
||||
cache.store(
|
||||
reference_audio_vae,
|
||||
key,
|
||||
assets.audio_latent,
|
||||
event_sink=cache_event,
|
||||
)
|
||||
return assets
|
||||
|
||||
|
||||
def encode_reference_audio_input(
|
||||
reference_audio_vae: Any,
|
||||
source: ReferenceAudioSource | ReferenceAudioBundle,
|
||||
*,
|
||||
cache_enabled: bool,
|
||||
cache_event=None,
|
||||
) -> ReferenceAudioAssets | tuple[ReferenceAudioAssets, ...]:
|
||||
"""Encode one legacy source or each ordered bundle source independently."""
|
||||
|
||||
encoder = encode_reference_audio_cached if cache_enabled else encode_reference_audio
|
||||
if isinstance(source, ReferenceAudioBundle):
|
||||
if cache_enabled:
|
||||
return tuple(
|
||||
encoder(reference_audio_vae, item, cache_event=cache_event)
|
||||
for item in source.sources
|
||||
)
|
||||
return tuple(encoder(reference_audio_vae, item) for item in source.sources)
|
||||
if cache_enabled:
|
||||
return encoder(reference_audio_vae, source, cache_event=cache_event)
|
||||
return encoder(reference_audio_vae, source)
|
||||
|
||||
|
||||
def validate_reference_audio_prompts(
|
||||
prompts: list[str], source: ReferenceAudioSource | None
|
||||
prompts: list[str], source: ReferenceAudioSource | ReferenceAudioBundle | None
|
||||
) -> str:
|
||||
found: set[int] = set()
|
||||
for prompt in prompts:
|
||||
found.update(int(value) for value in _AUDIO_TAG.findall(str(prompt)))
|
||||
warnings: list[str] = []
|
||||
active_count = 1 if source is not None else 0
|
||||
active_count = source.count if isinstance(source, ReferenceAudioBundle) else int(source is not None)
|
||||
unavailable = sorted(
|
||||
value for value in found if source is None or value != 1
|
||||
value for value in found if not 1 <= value <= active_count
|
||||
)
|
||||
for value in unavailable:
|
||||
warnings.append(
|
||||
@@ -207,20 +382,32 @@ def validate_reference_audio_prompts(
|
||||
"Core-compatible generation will continue; the tag may be ignored "
|
||||
"or hallucinated."
|
||||
)
|
||||
if source is not None and 1 not in found:
|
||||
warnings.append(
|
||||
"H3C-P103 Warning: Reference Audio 1 is connected but the prompt contains no <Audio 1> "
|
||||
"tag; audio still conditions generation, but an explicit tag is recommended."
|
||||
)
|
||||
for value in range(1, active_count + 1):
|
||||
if value not in found:
|
||||
warnings.append(
|
||||
f"H3C-P103 Warning: Reference Audio {value} is connected but the prompt "
|
||||
f"contains no <Audio {value}> tag; audio still conditions generation, "
|
||||
"but an explicit tag is recommended."
|
||||
)
|
||||
return "\n".join(warnings)
|
||||
|
||||
|
||||
def combine_reference_audio_identity(
|
||||
visual_identity_hash: str,
|
||||
source: ReferenceAudioSource | None,
|
||||
source: ReferenceAudioSource | ReferenceAudioBundle | None,
|
||||
) -> str:
|
||||
if source is None:
|
||||
return str(visual_identity_hash)
|
||||
if isinstance(source, ReferenceAudioBundle):
|
||||
return _canonical_hash(
|
||||
{
|
||||
"reference_audio_identity_version": 2,
|
||||
"visual_identity_hash": str(visual_identity_hash),
|
||||
"ordered_reference_audio_hashes": [
|
||||
item.combined_hash for item in source.sources
|
||||
],
|
||||
}
|
||||
)
|
||||
return _canonical_hash(
|
||||
{
|
||||
"reference_audio_identity_version": 1,
|
||||
@@ -240,3 +427,80 @@ def reference_audio_block(assets: ReferenceAudioAssets) -> dict[str, Any]:
|
||||
"ref_audio_t": int(assets.audio_latent.shape[-1]),
|
||||
"audio_latent": assets.audio_latent,
|
||||
}
|
||||
|
||||
|
||||
def reference_audio_asset_items(
|
||||
assets: ReferenceAudioAssets | tuple[ReferenceAudioAssets, ...],
|
||||
) -> tuple[ReferenceAudioAssets, ...]:
|
||||
if isinstance(assets, tuple):
|
||||
return assets
|
||||
return (assets,)
|
||||
|
||||
|
||||
class H3ContinuumReferenceAudios:
|
||||
"""Compact public helper for one to three ordered H3 Reference Audios."""
|
||||
|
||||
DEPRECATED = False
|
||||
CATEGORY = "MiniMax H3/Continuum/Input"
|
||||
DESCRIPTION = (
|
||||
"Bundle up to three ordered standalone Reference Audios for the V3.8 "
|
||||
"sampler. Connected inputs map directly to <Audio 1>, <Audio 2>, and "
|
||||
"<Audio 3>; generated final audio is never replaced."
|
||||
)
|
||||
SEARCH_ALIASES = [
|
||||
"H3 Continuum Reference Audios",
|
||||
"MiniMax H3 multiple reference audio",
|
||||
]
|
||||
|
||||
@classmethod
|
||||
def INPUT_TYPES(cls):
|
||||
audio_tooltip = (
|
||||
"Optional standalone voice or sound reference. Connect inputs in order "
|
||||
"without gaps; their order maps to the matching <Audio N> prompt tags."
|
||||
)
|
||||
return {
|
||||
"optional": {
|
||||
"reference_audio_1": (
|
||||
"AUDIO",
|
||||
{"display_name": "Reference Audio 1 (Optional)", "tooltip": audio_tooltip},
|
||||
),
|
||||
"reference_audio_2": (
|
||||
"AUDIO",
|
||||
{"display_name": "Reference Audio 2 (Optional)", "tooltip": audio_tooltip},
|
||||
),
|
||||
"reference_audio_3": (
|
||||
"AUDIO",
|
||||
{"display_name": "Reference Audio 3 (Optional)", "tooltip": audio_tooltip},
|
||||
),
|
||||
"reference_audio_vae": (
|
||||
"VAE",
|
||||
{
|
||||
"display_name": "Reference Audio VAE",
|
||||
"tooltip": (
|
||||
"Shared Core Audio VAE used to encode every connected "
|
||||
"Reference Audio. Required when any audio is connected."
|
||||
),
|
||||
},
|
||||
),
|
||||
}
|
||||
}
|
||||
|
||||
RETURN_TYPES = (REFERENCE_AUDIOS_TYPE,)
|
||||
RETURN_NAMES = ("audio_references",)
|
||||
FUNCTION = "pack"
|
||||
|
||||
def pack(
|
||||
self,
|
||||
reference_audio_1=None,
|
||||
reference_audio_2=None,
|
||||
reference_audio_3=None,
|
||||
reference_audio_vae=None,
|
||||
):
|
||||
return (
|
||||
prepare_reference_audio_bundle(
|
||||
reference_audio_1,
|
||||
reference_audio_2,
|
||||
reference_audio_3,
|
||||
reference_audio_vae,
|
||||
),
|
||||
)
|
||||
|
||||
@@ -61,7 +61,7 @@ def _round_canvas(value: float) -> int:
|
||||
)
|
||||
|
||||
|
||||
def _resolved_size(
|
||||
def resolve_reference_video_size(
|
||||
source_width: int,
|
||||
source_height: int,
|
||||
*,
|
||||
@@ -92,6 +92,10 @@ def _resolved_size(
|
||||
return target_width, target_height
|
||||
|
||||
|
||||
# Preserve the established private helper for existing internal callers/tests.
|
||||
_resolved_size = resolve_reference_video_size
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
class ReferenceVideoSource:
|
||||
frames: torch.Tensor
|
||||
@@ -128,7 +132,12 @@ class ReferenceVideoAssets:
|
||||
block: dict[str, Any]
|
||||
|
||||
|
||||
def _resolve_reference_frame_count(source_frames: int, target_frames: int) -> int:
|
||||
def resolve_reference_video_frame_count(
|
||||
source_frames: int,
|
||||
target_frames: int,
|
||||
) -> int:
|
||||
"""Resolve the used Video Guide frame count without touching frame data."""
|
||||
|
||||
source_count = int(source_frames)
|
||||
target_count = int(target_frames)
|
||||
if source_count < 5 or target_count < 5:
|
||||
@@ -138,6 +147,10 @@ def _resolve_reference_frame_count(source_frames: int, target_frames: int) -> in
|
||||
return min(align_frame_count_up(available_count), target_cap)
|
||||
|
||||
|
||||
# Preserve the established private name while exposing one shared pure resolver.
|
||||
_resolve_reference_frame_count = resolve_reference_video_frame_count
|
||||
|
||||
|
||||
def _fit_reference_frames(frames: torch.Tensor, frame_count: int) -> torch.Tensor:
|
||||
requested_count = int(frame_count)
|
||||
current_count = int(frames.shape[0])
|
||||
@@ -204,7 +217,7 @@ def prepare_reference_video_source(
|
||||
)
|
||||
if int(reference_video_1.shape[-1]) < 3:
|
||||
raise ReferenceVideoError("Video Reference must contain RGB channels")
|
||||
frame_count = _resolve_reference_frame_count(
|
||||
frame_count = resolve_reference_video_frame_count(
|
||||
int(reference_video_1.shape[0]),
|
||||
int(target_frames),
|
||||
)
|
||||
@@ -217,7 +230,7 @@ def prepare_reference_video_source(
|
||||
if str(size_mode) in REFERENCE_VIDEO_SIZE_OPTIONS
|
||||
else REFERENCE_VIDEO_SIZE_EFFICIENT
|
||||
)
|
||||
target_width, target_height = _resolved_size(
|
||||
target_width, target_height = resolve_reference_video_size(
|
||||
int(source_shape[2]),
|
||||
int(source_shape[1]),
|
||||
output_width=int(output_width),
|
||||
@@ -249,10 +262,9 @@ def prepare_reference_video_source(
|
||||
)
|
||||
|
||||
|
||||
def encode_reference_video(
|
||||
video_vae: Any,
|
||||
def _prepare_reference_video_encode_input(
|
||||
source: ReferenceVideoSource,
|
||||
) -> ReferenceVideoAssets:
|
||||
) -> tuple[torch.Tensor, dict[str, Any]]:
|
||||
available_count = min(int(source.frames.shape[0]), int(source.frame_count))
|
||||
frames = source.frames[:available_count]
|
||||
if (
|
||||
@@ -273,16 +285,20 @@ def encode_reference_video(
|
||||
"disabled",
|
||||
).movedim(1, -1).contiguous()
|
||||
frames = _fit_reference_frames(frames, source.frame_count)
|
||||
try:
|
||||
latent = video_vae.encode(frames).detach().to("cpu").contiguous()
|
||||
except Exception as exc:
|
||||
raise ReferenceVideoError("Video Reference VAE Encode failed") from exc
|
||||
qwen_frames = frames[::_SOURCE_FPS // 2].contiguous()
|
||||
item = {
|
||||
"type": "video",
|
||||
"data": qwen_frames,
|
||||
"timestamps": [index / 2.0 for index in range(int(qwen_frames.shape[0]))],
|
||||
}
|
||||
return frames, item
|
||||
|
||||
|
||||
def _build_reference_video_assets(
|
||||
source: ReferenceVideoSource,
|
||||
item: dict[str, Any],
|
||||
latent: torch.Tensor,
|
||||
) -> ReferenceVideoAssets:
|
||||
block = {
|
||||
"kind": "video",
|
||||
"latent_t": int(latent.shape[2]),
|
||||
@@ -295,6 +311,49 @@ def encode_reference_video(
|
||||
return ReferenceVideoAssets(source=source, item=item, block=block)
|
||||
|
||||
|
||||
def encode_reference_video(
|
||||
video_vae: Any,
|
||||
source: ReferenceVideoSource,
|
||||
) -> ReferenceVideoAssets:
|
||||
frames, item = _prepare_reference_video_encode_input(source)
|
||||
try:
|
||||
latent = video_vae.encode(frames).detach().to("cpu").contiguous()
|
||||
except Exception as exc:
|
||||
raise ReferenceVideoError("Video Reference VAE Encode failed") from exc
|
||||
return _build_reference_video_assets(source, item, latent)
|
||||
|
||||
|
||||
def encode_reference_video_cached(
|
||||
video_vae: Any,
|
||||
source: ReferenceVideoSource,
|
||||
*,
|
||||
cache_event=None,
|
||||
) -> ReferenceVideoAssets:
|
||||
"""Encode only the V3.8 Video Guide latent through the shared cache."""
|
||||
|
||||
from .v3.ref_encode_cache import (
|
||||
get_ref_encode_cache,
|
||||
make_ref_encode_cache_key,
|
||||
)
|
||||
|
||||
frames, item = _prepare_reference_video_encode_input(source)
|
||||
cache = get_ref_encode_cache()
|
||||
key = make_ref_encode_cache_key(
|
||||
"video_guide",
|
||||
REFERENCE_VIDEO_PREPROCESS_VERSION,
|
||||
source.combined_hash,
|
||||
)
|
||||
latent = cache.lookup(video_vae, key, event_sink=cache_event)
|
||||
if latent is None:
|
||||
try:
|
||||
latent = video_vae.encode(frames).detach().to("cpu").contiguous()
|
||||
except Exception as exc:
|
||||
raise ReferenceVideoError("Video Reference VAE Encode failed") from exc
|
||||
if cache.supports_vae(video_vae):
|
||||
cache.store(video_vae, key, latent, event_sink=cache_event)
|
||||
return _build_reference_video_assets(source, item, latent)
|
||||
|
||||
|
||||
def combine_reference_video_identity(
|
||||
visual_identity_hash: str,
|
||||
source: ReferenceVideoSource | None,
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
{
|
||||
"last_node_id": 420,
|
||||
"last_link_id": 0,
|
||||
"nodes": [
|
||||
{
|
||||
"id": 420,
|
||||
"type": "H3ContinuumSelectiveSecondPassExperimental",
|
||||
"pos": [0, 0],
|
||||
"size": [360, 420],
|
||||
"flags": {},
|
||||
"order": 0,
|
||||
"mode": 0,
|
||||
"inputs": [],
|
||||
"outputs": [],
|
||||
"properties": {
|
||||
"Node name for S&R": "H3ContinuumSelectiveSecondPassExperimental"
|
||||
},
|
||||
"widgets_values": [73, "Video + Audio"]
|
||||
}
|
||||
],
|
||||
"links": [],
|
||||
"groups": [],
|
||||
"config": {},
|
||||
"extra": {},
|
||||
"version": 0.4
|
||||
}
|
||||
@@ -1,378 +1,378 @@
|
||||
"""Tests-only capture and comparison helpers for Terminal Merge diagnostics.
|
||||
|
||||
This module deliberately has no production imports or runtime hooks. Tests can
|
||||
monkeypatch Core and Continuum boundaries, feed the captured values here, and
|
||||
identify the first pipeline stage that differs without changing generation
|
||||
semantics.
|
||||
"""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from dataclasses import dataclass
|
||||
from enum import Enum
|
||||
from hashlib import sha256
|
||||
import json
|
||||
from pathlib import Path
|
||||
from typing import Any, Mapping
|
||||
|
||||
import torch
|
||||
|
||||
|
||||
STAGE_ORDER = (
|
||||
"A_pre_sampler",
|
||||
"B_first_model_call",
|
||||
"C_sampled_physical_av",
|
||||
"D_split_recombine",
|
||||
"E_decode_assembly",
|
||||
)
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
class TensorFingerprint:
|
||||
shape: tuple[int, ...]
|
||||
dtype: str
|
||||
sha256: str
|
||||
|
||||
def as_dict(self) -> dict[str, Any]:
|
||||
return {
|
||||
"shape": list(self.shape),
|
||||
"dtype": self.dtype,
|
||||
"sha256": self.sha256,
|
||||
}
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
class TensorDifference:
|
||||
same_shape: bool
|
||||
same_dtype: bool
|
||||
bit_exact: bool
|
||||
allclose: bool
|
||||
max_abs_diff: float | None
|
||||
mean_abs_diff: float | None
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
class StageSnapshot:
|
||||
name: str
|
||||
sha256: str
|
||||
payload: Any
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
class StageComparison:
|
||||
name: str
|
||||
equal: bool
|
||||
core_sha256: str | None
|
||||
continuum_sha256: str | None
|
||||
missing_from: str | None = None
|
||||
|
||||
|
||||
def _tensor_raw_bytes(tensor: torch.Tensor) -> bytes:
|
||||
value = tensor.detach().to("cpu").contiguous()
|
||||
if value.numel() == 0:
|
||||
return b""
|
||||
return value.reshape(-1).view(torch.uint8).numpy().tobytes()
|
||||
|
||||
|
||||
def tensor_fingerprint(tensor: torch.Tensor) -> TensorFingerprint:
|
||||
if not torch.is_tensor(tensor):
|
||||
raise TypeError("tensor_fingerprint expects a torch.Tensor")
|
||||
return TensorFingerprint(
|
||||
shape=tuple(int(size) for size in tensor.shape),
|
||||
dtype=str(tensor.dtype),
|
||||
sha256=sha256(_tensor_raw_bytes(tensor)).hexdigest(),
|
||||
)
|
||||
|
||||
|
||||
def tensor_difference(
|
||||
core: torch.Tensor,
|
||||
continuum: torch.Tensor,
|
||||
*,
|
||||
rtol: float = 1.0e-5,
|
||||
atol: float = 1.0e-6,
|
||||
) -> TensorDifference:
|
||||
if not torch.is_tensor(core) or not torch.is_tensor(continuum):
|
||||
raise TypeError("tensor_difference expects two torch.Tensor values")
|
||||
|
||||
same_shape = tuple(core.shape) == tuple(continuum.shape)
|
||||
same_dtype = core.dtype == continuum.dtype
|
||||
bit_exact = (
|
||||
same_shape
|
||||
and same_dtype
|
||||
and tensor_fingerprint(core).sha256 == tensor_fingerprint(continuum).sha256
|
||||
)
|
||||
if not same_shape:
|
||||
return TensorDifference(
|
||||
same_shape=False,
|
||||
same_dtype=same_dtype,
|
||||
bit_exact=False,
|
||||
allclose=False,
|
||||
max_abs_diff=None,
|
||||
mean_abs_diff=None,
|
||||
)
|
||||
|
||||
core_value = core.detach().to("cpu")
|
||||
continuum_value = continuum.detach().to("cpu")
|
||||
if core_value.is_complex() or continuum_value.is_complex():
|
||||
core_numeric = core_value.to(torch.complex128)
|
||||
continuum_numeric = continuum_value.to(torch.complex128)
|
||||
else:
|
||||
core_numeric = core_value.to(torch.float64)
|
||||
continuum_numeric = continuum_value.to(torch.float64)
|
||||
|
||||
if core_numeric.numel() == 0:
|
||||
max_abs_diff = 0.0
|
||||
mean_abs_diff = 0.0
|
||||
else:
|
||||
absolute = (core_numeric - continuum_numeric).abs()
|
||||
max_abs_diff = float(absolute.max().item())
|
||||
mean_abs_diff = float(absolute.mean().item())
|
||||
|
||||
return TensorDifference(
|
||||
same_shape=True,
|
||||
same_dtype=same_dtype,
|
||||
bit_exact=bit_exact,
|
||||
allclose=bool(
|
||||
torch.allclose(
|
||||
core_numeric,
|
||||
continuum_numeric,
|
||||
rtol=rtol,
|
||||
atol=atol,
|
||||
equal_nan=True,
|
||||
)
|
||||
),
|
||||
max_abs_diff=max_abs_diff,
|
||||
mean_abs_diff=mean_abs_diff,
|
||||
)
|
||||
|
||||
|
||||
def packed_layout_snapshot(layout: Any) -> dict[str, Any]:
|
||||
return {
|
||||
"signature": stable_snapshot(getattr(layout, "signature", None)),
|
||||
"segments": stable_snapshot(getattr(layout, "segments", None)),
|
||||
"position_ids": stable_snapshot(getattr(layout, "position_ids", None)),
|
||||
}
|
||||
|
||||
|
||||
def stable_snapshot(value: Any) -> Any:
|
||||
"""Convert diagnostic data to deterministic JSON-compatible state."""
|
||||
|
||||
if torch.is_tensor(value):
|
||||
return {"kind": "tensor", **tensor_fingerprint(value).as_dict()}
|
||||
if isinstance(value, TensorFingerprint):
|
||||
return {"kind": "tensor", **value.as_dict()}
|
||||
if value is None or isinstance(value, (bool, int, str)):
|
||||
return value
|
||||
if isinstance(value, float):
|
||||
return {"kind": "float", "hex": value.hex()}
|
||||
if isinstance(value, bytes):
|
||||
return {
|
||||
"kind": "bytes",
|
||||
"length": len(value),
|
||||
"sha256": sha256(value).hexdigest(),
|
||||
}
|
||||
if isinstance(value, (Path, torch.device, torch.dtype)):
|
||||
return str(value)
|
||||
if isinstance(value, Enum):
|
||||
return {
|
||||
"kind": "enum",
|
||||
"type": f"{type(value).__module__}.{type(value).__qualname__}",
|
||||
"value": stable_snapshot(value.value),
|
||||
}
|
||||
if isinstance(value, slice):
|
||||
return {
|
||||
"kind": "slice",
|
||||
"start": value.start,
|
||||
"stop": value.stop,
|
||||
"step": value.step,
|
||||
}
|
||||
if isinstance(value, Mapping):
|
||||
return {
|
||||
"kind": "mapping",
|
||||
"items": [
|
||||
[str(key), stable_snapshot(item)]
|
||||
for key, item in sorted(value.items(), key=lambda pair: str(pair[0]))
|
||||
],
|
||||
}
|
||||
if isinstance(value, tuple):
|
||||
return {"kind": "tuple", "items": [stable_snapshot(item) for item in value]}
|
||||
if isinstance(value, list):
|
||||
return {"kind": "list", "items": [stable_snapshot(item) for item in value]}
|
||||
if isinstance(value, (set, frozenset)):
|
||||
items = [stable_snapshot(item) for item in value]
|
||||
items.sort(key=lambda item: json.dumps(item, sort_keys=True, separators=(",", ":")))
|
||||
return {"kind": type(value).__name__, "items": items}
|
||||
if callable(value):
|
||||
return {
|
||||
"kind": "callable",
|
||||
"module": getattr(value, "__module__", type(value).__module__),
|
||||
"qualname": getattr(value, "__qualname__", type(value).__qualname__),
|
||||
}
|
||||
if all(hasattr(value, name) for name in ("signature", "segments", "position_ids")):
|
||||
return {"kind": "packed_layout", **packed_layout_snapshot(value)}
|
||||
if hasattr(value, "__dict__"):
|
||||
public_state = {
|
||||
key: item
|
||||
for key, item in vars(value).items()
|
||||
if not key.startswith("_") and not callable(item)
|
||||
}
|
||||
return {
|
||||
"kind": "object",
|
||||
"type": f"{type(value).__module__}.{type(value).__qualname__}",
|
||||
"state": stable_snapshot(public_state),
|
||||
}
|
||||
raise TypeError(f"Unsupported diagnostic value: {type(value)!r}")
|
||||
|
||||
|
||||
def snapshot_sha256(payload: Any) -> str:
|
||||
normalized = stable_snapshot(payload)
|
||||
encoded = json.dumps(
|
||||
normalized,
|
||||
ensure_ascii=True,
|
||||
sort_keys=True,
|
||||
separators=(",", ":"),
|
||||
).encode("utf-8")
|
||||
return sha256(encoded).hexdigest()
|
||||
|
||||
|
||||
class DiagnosticCapture:
|
||||
def __init__(self) -> None:
|
||||
self._stages: dict[str, StageSnapshot] = {}
|
||||
|
||||
@property
|
||||
def stages(self) -> Mapping[str, StageSnapshot]:
|
||||
return self._stages
|
||||
|
||||
def capture(self, stage: str, **payload: Any) -> StageSnapshot:
|
||||
if stage not in STAGE_ORDER:
|
||||
raise ValueError(f"Unknown diagnostic stage: {stage}")
|
||||
if stage in self._stages:
|
||||
raise ValueError(f"Diagnostic stage already captured: {stage}")
|
||||
normalized = stable_snapshot(payload)
|
||||
snapshot = StageSnapshot(
|
||||
name=stage,
|
||||
sha256=snapshot_sha256(normalized),
|
||||
payload=normalized,
|
||||
)
|
||||
self._stages[stage] = snapshot
|
||||
return snapshot
|
||||
|
||||
def capture_pre_sampler(
|
||||
self,
|
||||
*,
|
||||
physical_frames: int,
|
||||
seed: int,
|
||||
conditioning: Any,
|
||||
latent: Any,
|
||||
noise: torch.Tensor,
|
||||
keyframes: Any = None,
|
||||
qwen_images: Any = None,
|
||||
minimax_refs: Any = None,
|
||||
) -> StageSnapshot:
|
||||
return self.capture(
|
||||
"A_pre_sampler",
|
||||
physical_frames=physical_frames,
|
||||
seed=seed,
|
||||
conditioning=conditioning,
|
||||
latent=latent,
|
||||
noise=noise,
|
||||
keyframes=keyframes,
|
||||
qwen_images=qwen_images,
|
||||
minimax_refs=minimax_refs,
|
||||
)
|
||||
|
||||
def capture_first_model_call(
|
||||
self,
|
||||
*,
|
||||
minimax_payload: Any,
|
||||
transformer_options: Any,
|
||||
) -> StageSnapshot:
|
||||
return self.capture(
|
||||
"B_first_model_call",
|
||||
minimax_payload=minimax_payload,
|
||||
transformer_options=transformer_options,
|
||||
)
|
||||
|
||||
def capture_sampled_physical_av(
|
||||
self,
|
||||
*,
|
||||
video: torch.Tensor,
|
||||
audio: torch.Tensor,
|
||||
) -> StageSnapshot:
|
||||
return self.capture(
|
||||
"C_sampled_physical_av",
|
||||
video=video,
|
||||
audio=audio,
|
||||
)
|
||||
|
||||
def capture_split_recombine(
|
||||
self,
|
||||
*,
|
||||
physical_video: torch.Tensor,
|
||||
physical_audio: torch.Tensor,
|
||||
recombined_video: torch.Tensor,
|
||||
recombined_audio: torch.Tensor,
|
||||
) -> StageSnapshot:
|
||||
return self.capture(
|
||||
"D_split_recombine",
|
||||
physical_video=physical_video,
|
||||
physical_audio=physical_audio,
|
||||
recombined_video=recombined_video,
|
||||
recombined_audio=recombined_audio,
|
||||
video_difference=tensor_difference(physical_video, recombined_video).__dict__,
|
||||
audio_difference=tensor_difference(physical_audio, recombined_audio).__dict__,
|
||||
)
|
||||
|
||||
def capture_decode_assembly(
|
||||
self,
|
||||
*,
|
||||
physical_decoded: torch.Tensor,
|
||||
assembled_decoded: torch.Tensor,
|
||||
) -> StageSnapshot:
|
||||
return self.capture(
|
||||
"E_decode_assembly",
|
||||
physical_decoded=physical_decoded,
|
||||
assembled_decoded=assembled_decoded,
|
||||
difference=tensor_difference(physical_decoded, assembled_decoded).__dict__,
|
||||
)
|
||||
|
||||
|
||||
def compare_captures(
|
||||
core: DiagnosticCapture,
|
||||
continuum: DiagnosticCapture,
|
||||
) -> tuple[StageComparison, ...]:
|
||||
comparisons = []
|
||||
for stage in STAGE_ORDER:
|
||||
core_stage = core.stages.get(stage)
|
||||
continuum_stage = continuum.stages.get(stage)
|
||||
missing = None
|
||||
if core_stage is None and continuum_stage is None:
|
||||
missing = "both"
|
||||
elif core_stage is None:
|
||||
missing = "core"
|
||||
elif continuum_stage is None:
|
||||
missing = "continuum"
|
||||
comparisons.append(
|
||||
StageComparison(
|
||||
name=stage,
|
||||
equal=(
|
||||
core_stage is not None
|
||||
and continuum_stage is not None
|
||||
and core_stage.sha256 == continuum_stage.sha256
|
||||
),
|
||||
core_sha256=None if core_stage is None else core_stage.sha256,
|
||||
continuum_sha256=None if continuum_stage is None else continuum_stage.sha256,
|
||||
missing_from=missing,
|
||||
)
|
||||
)
|
||||
return tuple(comparisons)
|
||||
|
||||
|
||||
def first_divergent_stage(
|
||||
core: DiagnosticCapture,
|
||||
continuum: DiagnosticCapture,
|
||||
) -> str | None:
|
||||
for comparison in compare_captures(core, continuum):
|
||||
if not comparison.equal:
|
||||
return comparison.name
|
||||
return None
|
||||
"""Tests-only capture and comparison helpers for Terminal Merge diagnostics.
|
||||
|
||||
This module deliberately has no production imports or runtime hooks. Tests can
|
||||
monkeypatch Core and Continuum boundaries, feed the captured values here, and
|
||||
identify the first pipeline stage that differs without changing generation
|
||||
semantics.
|
||||
"""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from dataclasses import dataclass
|
||||
from enum import Enum
|
||||
from hashlib import sha256
|
||||
import json
|
||||
from pathlib import Path
|
||||
from typing import Any, Mapping
|
||||
|
||||
import torch
|
||||
|
||||
|
||||
STAGE_ORDER = (
|
||||
"A_pre_sampler",
|
||||
"B_first_model_call",
|
||||
"C_sampled_physical_av",
|
||||
"D_split_recombine",
|
||||
"E_decode_assembly",
|
||||
)
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
class TensorFingerprint:
|
||||
shape: tuple[int, ...]
|
||||
dtype: str
|
||||
sha256: str
|
||||
|
||||
def as_dict(self) -> dict[str, Any]:
|
||||
return {
|
||||
"shape": list(self.shape),
|
||||
"dtype": self.dtype,
|
||||
"sha256": self.sha256,
|
||||
}
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
class TensorDifference:
|
||||
same_shape: bool
|
||||
same_dtype: bool
|
||||
bit_exact: bool
|
||||
allclose: bool
|
||||
max_abs_diff: float | None
|
||||
mean_abs_diff: float | None
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
class StageSnapshot:
|
||||
name: str
|
||||
sha256: str
|
||||
payload: Any
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
class StageComparison:
|
||||
name: str
|
||||
equal: bool
|
||||
core_sha256: str | None
|
||||
continuum_sha256: str | None
|
||||
missing_from: str | None = None
|
||||
|
||||
|
||||
def _tensor_raw_bytes(tensor: torch.Tensor) -> bytes:
|
||||
value = tensor.detach().to("cpu").contiguous()
|
||||
if value.numel() == 0:
|
||||
return b""
|
||||
return value.reshape(-1).view(torch.uint8).numpy().tobytes()
|
||||
|
||||
|
||||
def tensor_fingerprint(tensor: torch.Tensor) -> TensorFingerprint:
|
||||
if not torch.is_tensor(tensor):
|
||||
raise TypeError("tensor_fingerprint expects a torch.Tensor")
|
||||
return TensorFingerprint(
|
||||
shape=tuple(int(size) for size in tensor.shape),
|
||||
dtype=str(tensor.dtype),
|
||||
sha256=sha256(_tensor_raw_bytes(tensor)).hexdigest(),
|
||||
)
|
||||
|
||||
|
||||
def tensor_difference(
|
||||
core: torch.Tensor,
|
||||
continuum: torch.Tensor,
|
||||
*,
|
||||
rtol: float = 1.0e-5,
|
||||
atol: float = 1.0e-6,
|
||||
) -> TensorDifference:
|
||||
if not torch.is_tensor(core) or not torch.is_tensor(continuum):
|
||||
raise TypeError("tensor_difference expects two torch.Tensor values")
|
||||
|
||||
same_shape = tuple(core.shape) == tuple(continuum.shape)
|
||||
same_dtype = core.dtype == continuum.dtype
|
||||
bit_exact = (
|
||||
same_shape
|
||||
and same_dtype
|
||||
and tensor_fingerprint(core).sha256 == tensor_fingerprint(continuum).sha256
|
||||
)
|
||||
if not same_shape:
|
||||
return TensorDifference(
|
||||
same_shape=False,
|
||||
same_dtype=same_dtype,
|
||||
bit_exact=False,
|
||||
allclose=False,
|
||||
max_abs_diff=None,
|
||||
mean_abs_diff=None,
|
||||
)
|
||||
|
||||
core_value = core.detach().to("cpu")
|
||||
continuum_value = continuum.detach().to("cpu")
|
||||
if core_value.is_complex() or continuum_value.is_complex():
|
||||
core_numeric = core_value.to(torch.complex128)
|
||||
continuum_numeric = continuum_value.to(torch.complex128)
|
||||
else:
|
||||
core_numeric = core_value.to(torch.float64)
|
||||
continuum_numeric = continuum_value.to(torch.float64)
|
||||
|
||||
if core_numeric.numel() == 0:
|
||||
max_abs_diff = 0.0
|
||||
mean_abs_diff = 0.0
|
||||
else:
|
||||
absolute = (core_numeric - continuum_numeric).abs()
|
||||
max_abs_diff = float(absolute.max().item())
|
||||
mean_abs_diff = float(absolute.mean().item())
|
||||
|
||||
return TensorDifference(
|
||||
same_shape=True,
|
||||
same_dtype=same_dtype,
|
||||
bit_exact=bit_exact,
|
||||
allclose=bool(
|
||||
torch.allclose(
|
||||
core_numeric,
|
||||
continuum_numeric,
|
||||
rtol=rtol,
|
||||
atol=atol,
|
||||
equal_nan=True,
|
||||
)
|
||||
),
|
||||
max_abs_diff=max_abs_diff,
|
||||
mean_abs_diff=mean_abs_diff,
|
||||
)
|
||||
|
||||
|
||||
def packed_layout_snapshot(layout: Any) -> dict[str, Any]:
|
||||
return {
|
||||
"signature": stable_snapshot(getattr(layout, "signature", None)),
|
||||
"segments": stable_snapshot(getattr(layout, "segments", None)),
|
||||
"position_ids": stable_snapshot(getattr(layout, "position_ids", None)),
|
||||
}
|
||||
|
||||
|
||||
def stable_snapshot(value: Any) -> Any:
|
||||
"""Convert diagnostic data to deterministic JSON-compatible state."""
|
||||
|
||||
if torch.is_tensor(value):
|
||||
return {"kind": "tensor", **tensor_fingerprint(value).as_dict()}
|
||||
if isinstance(value, TensorFingerprint):
|
||||
return {"kind": "tensor", **value.as_dict()}
|
||||
if value is None or isinstance(value, (bool, int, str)):
|
||||
return value
|
||||
if isinstance(value, float):
|
||||
return {"kind": "float", "hex": value.hex()}
|
||||
if isinstance(value, bytes):
|
||||
return {
|
||||
"kind": "bytes",
|
||||
"length": len(value),
|
||||
"sha256": sha256(value).hexdigest(),
|
||||
}
|
||||
if isinstance(value, (Path, torch.device, torch.dtype)):
|
||||
return str(value)
|
||||
if isinstance(value, Enum):
|
||||
return {
|
||||
"kind": "enum",
|
||||
"type": f"{type(value).__module__}.{type(value).__qualname__}",
|
||||
"value": stable_snapshot(value.value),
|
||||
}
|
||||
if isinstance(value, slice):
|
||||
return {
|
||||
"kind": "slice",
|
||||
"start": value.start,
|
||||
"stop": value.stop,
|
||||
"step": value.step,
|
||||
}
|
||||
if isinstance(value, Mapping):
|
||||
return {
|
||||
"kind": "mapping",
|
||||
"items": [
|
||||
[str(key), stable_snapshot(item)]
|
||||
for key, item in sorted(value.items(), key=lambda pair: str(pair[0]))
|
||||
],
|
||||
}
|
||||
if isinstance(value, tuple):
|
||||
return {"kind": "tuple", "items": [stable_snapshot(item) for item in value]}
|
||||
if isinstance(value, list):
|
||||
return {"kind": "list", "items": [stable_snapshot(item) for item in value]}
|
||||
if isinstance(value, (set, frozenset)):
|
||||
items = [stable_snapshot(item) for item in value]
|
||||
items.sort(key=lambda item: json.dumps(item, sort_keys=True, separators=(",", ":")))
|
||||
return {"kind": type(value).__name__, "items": items}
|
||||
if callable(value):
|
||||
return {
|
||||
"kind": "callable",
|
||||
"module": getattr(value, "__module__", type(value).__module__),
|
||||
"qualname": getattr(value, "__qualname__", type(value).__qualname__),
|
||||
}
|
||||
if all(hasattr(value, name) for name in ("signature", "segments", "position_ids")):
|
||||
return {"kind": "packed_layout", **packed_layout_snapshot(value)}
|
||||
if hasattr(value, "__dict__"):
|
||||
public_state = {
|
||||
key: item
|
||||
for key, item in vars(value).items()
|
||||
if not key.startswith("_") and not callable(item)
|
||||
}
|
||||
return {
|
||||
"kind": "object",
|
||||
"type": f"{type(value).__module__}.{type(value).__qualname__}",
|
||||
"state": stable_snapshot(public_state),
|
||||
}
|
||||
raise TypeError(f"Unsupported diagnostic value: {type(value)!r}")
|
||||
|
||||
|
||||
def snapshot_sha256(payload: Any) -> str:
|
||||
normalized = stable_snapshot(payload)
|
||||
encoded = json.dumps(
|
||||
normalized,
|
||||
ensure_ascii=True,
|
||||
sort_keys=True,
|
||||
separators=(",", ":"),
|
||||
).encode("utf-8")
|
||||
return sha256(encoded).hexdigest()
|
||||
|
||||
|
||||
class DiagnosticCapture:
|
||||
def __init__(self) -> None:
|
||||
self._stages: dict[str, StageSnapshot] = {}
|
||||
|
||||
@property
|
||||
def stages(self) -> Mapping[str, StageSnapshot]:
|
||||
return self._stages
|
||||
|
||||
def capture(self, stage: str, **payload: Any) -> StageSnapshot:
|
||||
if stage not in STAGE_ORDER:
|
||||
raise ValueError(f"Unknown diagnostic stage: {stage}")
|
||||
if stage in self._stages:
|
||||
raise ValueError(f"Diagnostic stage already captured: {stage}")
|
||||
normalized = stable_snapshot(payload)
|
||||
snapshot = StageSnapshot(
|
||||
name=stage,
|
||||
sha256=snapshot_sha256(normalized),
|
||||
payload=normalized,
|
||||
)
|
||||
self._stages[stage] = snapshot
|
||||
return snapshot
|
||||
|
||||
def capture_pre_sampler(
|
||||
self,
|
||||
*,
|
||||
physical_frames: int,
|
||||
seed: int,
|
||||
conditioning: Any,
|
||||
latent: Any,
|
||||
noise: torch.Tensor,
|
||||
keyframes: Any = None,
|
||||
qwen_images: Any = None,
|
||||
minimax_refs: Any = None,
|
||||
) -> StageSnapshot:
|
||||
return self.capture(
|
||||
"A_pre_sampler",
|
||||
physical_frames=physical_frames,
|
||||
seed=seed,
|
||||
conditioning=conditioning,
|
||||
latent=latent,
|
||||
noise=noise,
|
||||
keyframes=keyframes,
|
||||
qwen_images=qwen_images,
|
||||
minimax_refs=minimax_refs,
|
||||
)
|
||||
|
||||
def capture_first_model_call(
|
||||
self,
|
||||
*,
|
||||
minimax_payload: Any,
|
||||
transformer_options: Any,
|
||||
) -> StageSnapshot:
|
||||
return self.capture(
|
||||
"B_first_model_call",
|
||||
minimax_payload=minimax_payload,
|
||||
transformer_options=transformer_options,
|
||||
)
|
||||
|
||||
def capture_sampled_physical_av(
|
||||
self,
|
||||
*,
|
||||
video: torch.Tensor,
|
||||
audio: torch.Tensor,
|
||||
) -> StageSnapshot:
|
||||
return self.capture(
|
||||
"C_sampled_physical_av",
|
||||
video=video,
|
||||
audio=audio,
|
||||
)
|
||||
|
||||
def capture_split_recombine(
|
||||
self,
|
||||
*,
|
||||
physical_video: torch.Tensor,
|
||||
physical_audio: torch.Tensor,
|
||||
recombined_video: torch.Tensor,
|
||||
recombined_audio: torch.Tensor,
|
||||
) -> StageSnapshot:
|
||||
return self.capture(
|
||||
"D_split_recombine",
|
||||
physical_video=physical_video,
|
||||
physical_audio=physical_audio,
|
||||
recombined_video=recombined_video,
|
||||
recombined_audio=recombined_audio,
|
||||
video_difference=tensor_difference(physical_video, recombined_video).__dict__,
|
||||
audio_difference=tensor_difference(physical_audio, recombined_audio).__dict__,
|
||||
)
|
||||
|
||||
def capture_decode_assembly(
|
||||
self,
|
||||
*,
|
||||
physical_decoded: torch.Tensor,
|
||||
assembled_decoded: torch.Tensor,
|
||||
) -> StageSnapshot:
|
||||
return self.capture(
|
||||
"E_decode_assembly",
|
||||
physical_decoded=physical_decoded,
|
||||
assembled_decoded=assembled_decoded,
|
||||
difference=tensor_difference(physical_decoded, assembled_decoded).__dict__,
|
||||
)
|
||||
|
||||
|
||||
def compare_captures(
|
||||
core: DiagnosticCapture,
|
||||
continuum: DiagnosticCapture,
|
||||
) -> tuple[StageComparison, ...]:
|
||||
comparisons = []
|
||||
for stage in STAGE_ORDER:
|
||||
core_stage = core.stages.get(stage)
|
||||
continuum_stage = continuum.stages.get(stage)
|
||||
missing = None
|
||||
if core_stage is None and continuum_stage is None:
|
||||
missing = "both"
|
||||
elif core_stage is None:
|
||||
missing = "core"
|
||||
elif continuum_stage is None:
|
||||
missing = "continuum"
|
||||
comparisons.append(
|
||||
StageComparison(
|
||||
name=stage,
|
||||
equal=(
|
||||
core_stage is not None
|
||||
and continuum_stage is not None
|
||||
and core_stage.sha256 == continuum_stage.sha256
|
||||
),
|
||||
core_sha256=None if core_stage is None else core_stage.sha256,
|
||||
continuum_sha256=None if continuum_stage is None else continuum_stage.sha256,
|
||||
missing_from=missing,
|
||||
)
|
||||
)
|
||||
return tuple(comparisons)
|
||||
|
||||
|
||||
def first_divergent_stage(
|
||||
core: DiagnosticCapture,
|
||||
continuum: DiagnosticCapture,
|
||||
) -> str | None:
|
||||
for comparison in compare_captures(core, continuum):
|
||||
if not comparison.equal:
|
||||
return comparison.name
|
||||
return None
|
||||
|
||||
@@ -0,0 +1,216 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import importlib.util
|
||||
import inspect
|
||||
import json
|
||||
from pathlib import Path
|
||||
import shutil
|
||||
import subprocess
|
||||
import sys
|
||||
from types import ModuleType, SimpleNamespace
|
||||
|
||||
import pytest
|
||||
|
||||
from ComfyUI_H3_Continuum_Join import nodes as root_nodes
|
||||
from ComfyUI_H3_Continuum_Join.v3.easy_audio_nodes import (
|
||||
H3EasyLoadAudio,
|
||||
NODE_CLASS_MAPPINGS,
|
||||
NODE_DISPLAY_NAME_MAPPINGS,
|
||||
)
|
||||
|
||||
|
||||
ROOT = Path(__file__).resolve().parents[1]
|
||||
BACKEND_PATH = ROOT / "v3" / "easy_audio_nodes.py"
|
||||
COMMON_FRONTEND_PATH = ROOT / "web" / "easy_bypass_toggle.js"
|
||||
FRONTEND_PATH = ROOT / "web" / "easy_load_audio.js"
|
||||
|
||||
|
||||
def test_easy_load_audio_is_public_and_keeps_core_audio_contract():
|
||||
schema = H3EasyLoadAudio.define_schema()
|
||||
assert NODE_CLASS_MAPPINGS["H3EasyLoadAudio"] is H3EasyLoadAudio
|
||||
assert root_nodes.NODE_CLASS_MAPPINGS["H3EasyLoadAudio"] is H3EasyLoadAudio
|
||||
assert NODE_DISPLAY_NAME_MAPPINGS["H3EasyLoadAudio"] == "H3 Continuum Load Audio"
|
||||
assert root_nodes.NODE_DISPLAY_NAME_MAPPINGS["H3EasyLoadAudio"] == (
|
||||
"H3 Continuum Load Audio"
|
||||
)
|
||||
assert schema.node_id == "H3EasyLoadAudio"
|
||||
assert schema.display_name == "H3 Continuum Load Audio"
|
||||
source = inspect.getsource(H3EasyLoadAudio)
|
||||
assert "def execute" not in source
|
||||
assert "def fingerprint_inputs" not in source
|
||||
assert "def validate_inputs" not in source
|
||||
|
||||
|
||||
def test_easy_load_audio_inherits_and_delegates_to_runtime_core(monkeypatch):
|
||||
fake_package = ModuleType("comfy_extras")
|
||||
fake_audio_module = ModuleType("comfy_extras.nodes_audio")
|
||||
|
||||
class FakeCoreLoadAudio:
|
||||
@classmethod
|
||||
def define_schema(cls):
|
||||
return SimpleNamespace(
|
||||
node_id="LoadAudio",
|
||||
display_name="Load Audio",
|
||||
category="audio",
|
||||
essentials_category="Audio",
|
||||
description="core",
|
||||
search_aliases=["audio file"],
|
||||
)
|
||||
|
||||
@classmethod
|
||||
def execute(cls, audio):
|
||||
return f"loaded:{audio}"
|
||||
|
||||
@classmethod
|
||||
def fingerprint_inputs(cls, audio):
|
||||
return f"fingerprint:{audio}"
|
||||
|
||||
@classmethod
|
||||
def validate_inputs(cls, audio):
|
||||
return audio == "valid.wav"
|
||||
|
||||
fake_audio_module.LoadAudio = FakeCoreLoadAudio
|
||||
monkeypatch.setitem(sys.modules, "comfy_extras", fake_package)
|
||||
monkeypatch.setitem(sys.modules, "comfy_extras.nodes_audio", fake_audio_module)
|
||||
spec = importlib.util.spec_from_file_location("h3_easy_audio_runtime_probe", BACKEND_PATH)
|
||||
assert spec is not None and spec.loader is not None
|
||||
module = importlib.util.module_from_spec(spec)
|
||||
spec.loader.exec_module(module)
|
||||
|
||||
assert issubclass(module.H3EasyLoadAudio, FakeCoreLoadAudio)
|
||||
schema = module.H3EasyLoadAudio.define_schema()
|
||||
assert schema.node_id == "H3EasyLoadAudio"
|
||||
assert schema.display_name == "H3 Continuum Load Audio"
|
||||
assert module.H3EasyLoadAudio.execute("voice.wav") == "loaded:voice.wav"
|
||||
assert module.H3EasyLoadAudio.fingerprint_inputs("voice.wav") == (
|
||||
"fingerprint:voice.wav"
|
||||
)
|
||||
assert module.H3EasyLoadAudio.validate_inputs("valid.wav") is True
|
||||
|
||||
|
||||
def test_easy_load_audio_frontend_preserves_filename_player_and_mode(tmp_path):
|
||||
node_executable = shutil.which("node")
|
||||
if node_executable is None:
|
||||
pytest.skip("Node.js is required for the frontend behavior regression")
|
||||
functions = COMMON_FRONTEND_PATH.read_text(encoding="utf-8").replace(
|
||||
"export ", ""
|
||||
)
|
||||
script = f"""
|
||||
{functions}
|
||||
function plainWidget(name, value) {{
|
||||
return {{ name, value, options: {{}}, serialize: true }};
|
||||
}}
|
||||
const audioWidget = plainWidget("audio", "voice.wav");
|
||||
const playerWidget = plainWidget("audioUI", {{ position: 1.25, volume: 0.8 }});
|
||||
const node = {{
|
||||
comfyClass: "H3EasyLoadAudio",
|
||||
mode: 0,
|
||||
widgets: [audioWidget, playerWidget],
|
||||
addWidget(type, name, value, callback, options) {{
|
||||
const widget = {{ type, name, value, callback, options, serialize: true }};
|
||||
this.widgets.push(widget);
|
||||
return widget;
|
||||
}},
|
||||
setDirtyCanvas() {{}},
|
||||
serialize() {{
|
||||
return {{
|
||||
mode: this.mode,
|
||||
widgets_values: this.widgets
|
||||
.filter((widget) => widget.serialize !== false)
|
||||
.map((widget) => widget.value),
|
||||
}};
|
||||
}},
|
||||
configure(info) {{
|
||||
this.mode = info.mode;
|
||||
for (let index = 0; index < info.widgets_values.length; index++) {{
|
||||
this.widgets[index].value = info.widgets_values[index];
|
||||
}}
|
||||
}},
|
||||
}};
|
||||
configureEasyBypassToggleNode(node, {{
|
||||
nodeClass: "H3EasyLoadAudio",
|
||||
widgetName: "Enable Audio",
|
||||
tooltip: "audio tooltip",
|
||||
}});
|
||||
const toggle = findEasyBypassWidget(node);
|
||||
const initial = {{ names: node.widgets.map((w) => w.name), saved: node.serialize() }};
|
||||
toggle.callback(false);
|
||||
const off = {{ mode: node.mode, toggle: toggle.value, saved: node.serialize() }};
|
||||
toggle.callback(true);
|
||||
const onAgain = {{ mode: node.mode, toggle: toggle.value, saved: node.serialize() }};
|
||||
node.mode = 4;
|
||||
const externalBypass = {{ mode: node.mode, toggle: toggle.value }};
|
||||
node.configure({{
|
||||
mode: 4,
|
||||
widgets_values: ["reloaded.wav", {{ position: 2.5, volume: 0.6 }}],
|
||||
}});
|
||||
const reloaded = {{
|
||||
mode: node.mode,
|
||||
toggle: toggle.value,
|
||||
audio: audioWidget.value,
|
||||
player: playerWidget.value,
|
||||
names: node.widgets.map((w) => w.name),
|
||||
}};
|
||||
console.log(JSON.stringify({{ initial, off, onAgain, externalBypass, reloaded }}));
|
||||
"""
|
||||
script_path = tmp_path / "easy-load-audio-frontend.js"
|
||||
script_path.write_text(script, encoding="utf-8")
|
||||
result = subprocess.run(
|
||||
[node_executable, str(script_path)],
|
||||
check=True,
|
||||
capture_output=True,
|
||||
text=True,
|
||||
)
|
||||
observed = json.loads(result.stdout)
|
||||
assert observed == {
|
||||
"initial": {
|
||||
"names": ["Enable Audio", "audio", "audioUI"],
|
||||
"saved": {
|
||||
"mode": 0,
|
||||
"widgets_values": [
|
||||
"voice.wav",
|
||||
{"position": 1.25, "volume": 0.8},
|
||||
],
|
||||
},
|
||||
},
|
||||
"off": {
|
||||
"mode": 4,
|
||||
"toggle": False,
|
||||
"saved": {
|
||||
"mode": 4,
|
||||
"widgets_values": [
|
||||
"voice.wav",
|
||||
{"position": 1.25, "volume": 0.8},
|
||||
],
|
||||
},
|
||||
},
|
||||
"onAgain": {
|
||||
"mode": 0,
|
||||
"toggle": True,
|
||||
"saved": {
|
||||
"mode": 0,
|
||||
"widgets_values": [
|
||||
"voice.wav",
|
||||
{"position": 1.25, "volume": 0.8},
|
||||
],
|
||||
},
|
||||
},
|
||||
"externalBypass": {"mode": 4, "toggle": False},
|
||||
"reloaded": {
|
||||
"mode": 4,
|
||||
"toggle": False,
|
||||
"audio": "reloaded.wav",
|
||||
"player": {"position": 2.5, "volume": 0.6},
|
||||
"names": ["Enable Audio", "audio", "audioUI"],
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
def test_easy_load_audio_uses_shared_non_polling_bypass_helper():
|
||||
source = FRONTEND_PATH.read_text(encoding="utf-8")
|
||||
common = COMMON_FRONTEND_PATH.read_text(encoding="utf-8")
|
||||
assert 'from "./easy_bypass_toggle.js"' in source
|
||||
assert 'widgetName: "Enable Audio"' in source
|
||||
assert "setInterval" not in common
|
||||
assert "setTimeout" not in common
|
||||
assert "node.mode = enabled ? NODE_MODE_ALWAYS : NODE_MODE_BYPASS" in common
|
||||
@@ -0,0 +1,300 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import importlib.util
|
||||
import inspect
|
||||
import json
|
||||
from pathlib import Path
|
||||
import shutil
|
||||
import subprocess
|
||||
import sys
|
||||
from types import ModuleType
|
||||
|
||||
import pytest
|
||||
|
||||
from ComfyUI_H3_Continuum_Join import nodes as root_nodes
|
||||
from ComfyUI_H3_Continuum_Join.v3.easy_image_nodes import (
|
||||
H3EasyLoadImage,
|
||||
NODE_CLASS_MAPPINGS,
|
||||
NODE_DISPLAY_NAME_MAPPINGS,
|
||||
)
|
||||
|
||||
|
||||
ROOT = Path(__file__).resolve().parents[1]
|
||||
BACKEND_PATH = ROOT / "v3" / "easy_image_nodes.py"
|
||||
FRONTEND_PATH = ROOT / "web" / "easy_load_image.js"
|
||||
COMMON_FRONTEND_PATH = ROOT / "web" / "easy_bypass_toggle.js"
|
||||
|
||||
|
||||
def test_easy_load_image_is_public_and_keeps_core_image_mask_contract():
|
||||
assert NODE_CLASS_MAPPINGS["H3EasyLoadImage"] is H3EasyLoadImage
|
||||
assert root_nodes.NODE_CLASS_MAPPINGS["H3EasyLoadImage"] is H3EasyLoadImage
|
||||
assert NODE_DISPLAY_NAME_MAPPINGS["H3EasyLoadImage"] == "H3 Continuum Load Image"
|
||||
assert root_nodes.NODE_DISPLAY_NAME_MAPPINGS["H3EasyLoadImage"] == (
|
||||
"H3 Continuum Load Image"
|
||||
)
|
||||
assert H3EasyLoadImage.RETURN_TYPES == ("IMAGE", "MASK")
|
||||
assert H3EasyLoadImage.FUNCTION == "load_image"
|
||||
assert H3EasyLoadImage.DEPRECATED is False
|
||||
assert "def load_image" not in inspect.getsource(H3EasyLoadImage)
|
||||
|
||||
|
||||
def test_easy_load_image_inherits_the_runtime_core_loader(monkeypatch):
|
||||
fake_core = ModuleType("nodes")
|
||||
|
||||
class FakeCoreLoadImage:
|
||||
RETURN_TYPES = ("IMAGE", "MASK")
|
||||
FUNCTION = "load_image"
|
||||
|
||||
@classmethod
|
||||
def INPUT_TYPES(cls):
|
||||
return {"required": {"image": (("core.png",), {"image_upload": True})}}
|
||||
|
||||
def load_image(self, image):
|
||||
return f"image:{image}", f"mask:{image}"
|
||||
|
||||
fake_core.LoadImage = FakeCoreLoadImage
|
||||
monkeypatch.setitem(sys.modules, "nodes", fake_core)
|
||||
spec = importlib.util.spec_from_file_location("h3_easy_image_runtime_probe", BACKEND_PATH)
|
||||
assert spec is not None and spec.loader is not None
|
||||
module = importlib.util.module_from_spec(spec)
|
||||
spec.loader.exec_module(module)
|
||||
|
||||
assert issubclass(module.H3EasyLoadImage, FakeCoreLoadImage)
|
||||
assert module.H3EasyLoadImage.INPUT_TYPES() == FakeCoreLoadImage.INPUT_TYPES()
|
||||
assert module.H3EasyLoadImage().load_image("core.png") == (
|
||||
"image:core.png",
|
||||
"mask:core.png",
|
||||
)
|
||||
|
||||
|
||||
def _frontend_functions(source: str) -> str:
|
||||
return source.replace("export ", "")
|
||||
|
||||
|
||||
def test_easy_load_image_frontend_uses_mode_as_single_source_of_truth(tmp_path):
|
||||
node_executable = shutil.which("node")
|
||||
if node_executable is None:
|
||||
pytest.skip("Node.js is required for the frontend behavior regression")
|
||||
source = COMMON_FRONTEND_PATH.read_text(encoding="utf-8")
|
||||
functions = _frontend_functions(source)
|
||||
script = f"""
|
||||
const EASY_LOAD_IMAGE_CLASS = "H3EasyLoadImage";
|
||||
{functions}
|
||||
function plainWidget(name, value) {{
|
||||
return {{ name, value, options: {{}}, serialize: true }};
|
||||
}}
|
||||
const imageWidget = plainWidget("image", "first.png");
|
||||
const uploadWidget = plainWidget("upload", "image");
|
||||
const node = {{
|
||||
comfyClass: EASY_LOAD_IMAGE_CLASS,
|
||||
mode: NODE_MODE_ALWAYS,
|
||||
widgets: [imageWidget, uploadWidget],
|
||||
dirtyCalls: 0,
|
||||
addWidget(type, name, value, callback, options) {{
|
||||
const widget = {{ type, name, value, callback, options, serialize: true }};
|
||||
this.widgets.push(widget);
|
||||
return widget;
|
||||
}},
|
||||
setDirtyCanvas() {{ this.dirtyCalls += 1; }},
|
||||
serialize() {{
|
||||
return {{
|
||||
mode: this.mode,
|
||||
widgets_values: this.widgets
|
||||
.filter((widget) => widget.serialize !== false)
|
||||
.map((widget) => widget.value),
|
||||
}};
|
||||
}},
|
||||
configure(info) {{
|
||||
this.mode = info.mode;
|
||||
for (let index = 0; index < info.widgets_values.length; index++) {{
|
||||
this.widgets[index].value = info.widgets_values[index];
|
||||
}}
|
||||
}},
|
||||
}};
|
||||
configureEasyBypassToggleNode(node, {{
|
||||
nodeClass: EASY_LOAD_IMAGE_CLASS,
|
||||
widgetName: "Enable Image",
|
||||
tooltip: "image tooltip",
|
||||
}});
|
||||
const toggle = findEasyBypassWidget(node);
|
||||
const initial = {{
|
||||
names: node.widgets.map((widget) => widget.name),
|
||||
toggle: toggle.value,
|
||||
saved: node.serialize(),
|
||||
}};
|
||||
toggle.value = false;
|
||||
toggle.callback(false);
|
||||
const toggledOff = {{ mode: node.mode, toggle: toggle.value, saved: node.serialize() }};
|
||||
node.mode = NODE_MODE_ALWAYS;
|
||||
const externalUnbypass = {{ mode: node.mode, toggle: toggle.value }};
|
||||
node.mode = NODE_MODE_BYPASS;
|
||||
const externalBypass = {{ mode: node.mode, toggle: toggle.value }};
|
||||
node.configure({{ mode: NODE_MODE_BYPASS, widgets_values: ["reloaded.png", "image"] }});
|
||||
const reloaded = {{
|
||||
mode: node.mode,
|
||||
toggle: toggle.value,
|
||||
image: imageWidget.value,
|
||||
upload: uploadWidget.value,
|
||||
names: node.widgets.map((widget) => widget.name),
|
||||
}};
|
||||
console.log(JSON.stringify({{ initial, toggledOff, externalUnbypass, externalBypass, reloaded }}));
|
||||
"""
|
||||
script_path = tmp_path / "easy-load-image-frontend.js"
|
||||
script_path.write_text(script, encoding="utf-8")
|
||||
result = subprocess.run(
|
||||
[node_executable, str(script_path)],
|
||||
check=True,
|
||||
capture_output=True,
|
||||
text=True,
|
||||
)
|
||||
observed = json.loads(result.stdout)
|
||||
assert observed == {
|
||||
"initial": {
|
||||
"names": ["Enable Image", "image", "upload"],
|
||||
"toggle": True,
|
||||
"saved": {"mode": 0, "widgets_values": ["first.png", "image"]},
|
||||
},
|
||||
"toggledOff": {
|
||||
"mode": 4,
|
||||
"toggle": False,
|
||||
"saved": {"mode": 4, "widgets_values": ["first.png", "image"]},
|
||||
},
|
||||
"externalUnbypass": {"mode": 0, "toggle": True},
|
||||
"externalBypass": {"mode": 4, "toggle": False},
|
||||
"reloaded": {
|
||||
"mode": 4,
|
||||
"toggle": False,
|
||||
"image": "reloaded.png",
|
||||
"upload": "image",
|
||||
"names": ["Enable Image", "image", "upload"],
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
def test_shared_bypass_helper_redraws_only_enable_row_at_full_opacity(tmp_path):
|
||||
node_executable = shutil.which("node")
|
||||
if node_executable is None:
|
||||
pytest.skip("Node.js is required for the frontend drawing regression")
|
||||
functions = _frontend_functions(
|
||||
COMMON_FRONTEND_PATH.read_text(encoding="utf-8")
|
||||
)
|
||||
script = f"""
|
||||
{functions}
|
||||
function widget(name, value) {{
|
||||
return {{ name, value, options: {{}}, serialize: true }};
|
||||
}}
|
||||
function nodeFor(nodeClass, enableName, existing) {{
|
||||
const enable = existing ? widget(enableName, false) : undefined;
|
||||
const node = {{
|
||||
comfyClass: nodeClass,
|
||||
mode: NODE_MODE_ALWAYS,
|
||||
widgets: existing ? [enable, widget("file", "media.bin")] : [widget("file", "media.bin")],
|
||||
drawCalls: [],
|
||||
addWidget(type, name, value, callback, options) {{
|
||||
const created = {{ type, name, value, callback, options, serialize: true }};
|
||||
this.widgets.push(created);
|
||||
return created;
|
||||
}},
|
||||
drawWidgets(ctx, options) {{
|
||||
this.drawCalls.push({{
|
||||
names: this.widgets.map((item) => item.name),
|
||||
alpha: options.editorAlpha,
|
||||
}});
|
||||
}},
|
||||
setDirtyCanvas() {{}},
|
||||
}};
|
||||
if (existing) {{
|
||||
configureExistingEasyBypassWidgetNode(node, {{
|
||||
nodeClass,
|
||||
widgetNames: [enableName],
|
||||
}});
|
||||
}} else {{
|
||||
configureEasyBypassToggleNode(node, {{
|
||||
nodeClass,
|
||||
widgetName: enableName,
|
||||
tooltip: "enable tooltip",
|
||||
}});
|
||||
node.mode = NODE_MODE_BYPASS;
|
||||
}}
|
||||
const toggle = findEasyBypassWidget(node);
|
||||
node.drawWidgets({{}}, {{ editorAlpha: 0.2, lowQuality: false }});
|
||||
const bypassCalls = node.drawCalls.slice();
|
||||
toggle.callback(true);
|
||||
node.drawCalls = [];
|
||||
node.drawWidgets({{}}, {{ editorAlpha: 1, lowQuality: false }});
|
||||
return {{
|
||||
bypassCalls,
|
||||
enabledCalls: node.drawCalls,
|
||||
mode: node.mode,
|
||||
toggle: toggle.value,
|
||||
clickable: typeof toggle.callback === "function",
|
||||
visible: toggle.hidden !== true,
|
||||
}};
|
||||
}}
|
||||
console.log(JSON.stringify({{
|
||||
image: nodeFor("H3EasyLoadImage", "Enable Image", false),
|
||||
audio: nodeFor("H3EasyLoadAudio", "Enable Audio", false),
|
||||
video: nodeFor("H3ContinuumLoadVideo", "enable_video", true),
|
||||
}}));
|
||||
"""
|
||||
script_path = tmp_path / "easy-loader-bypass-foreground.js"
|
||||
script_path.write_text(script, encoding="utf-8")
|
||||
result = subprocess.run(
|
||||
[node_executable, str(script_path)],
|
||||
check=True,
|
||||
capture_output=True,
|
||||
text=True,
|
||||
)
|
||||
observed = json.loads(result.stdout)
|
||||
assert observed == {
|
||||
"image": {
|
||||
"bypassCalls": [
|
||||
{"names": ["Enable Image", "file"], "alpha": 0.2},
|
||||
{"names": ["Enable Image"], "alpha": 1},
|
||||
],
|
||||
"enabledCalls": [
|
||||
{"names": ["Enable Image", "file"], "alpha": 1}
|
||||
],
|
||||
"mode": 0,
|
||||
"toggle": True,
|
||||
"clickable": True,
|
||||
"visible": True,
|
||||
},
|
||||
"audio": {
|
||||
"bypassCalls": [
|
||||
{"names": ["Enable Audio", "file"], "alpha": 0.2},
|
||||
{"names": ["Enable Audio"], "alpha": 1},
|
||||
],
|
||||
"enabledCalls": [
|
||||
{"names": ["Enable Audio", "file"], "alpha": 1}
|
||||
],
|
||||
"mode": 0,
|
||||
"toggle": True,
|
||||
"clickable": True,
|
||||
"visible": True,
|
||||
},
|
||||
"video": {
|
||||
"bypassCalls": [
|
||||
{"names": ["enable_video", "file"], "alpha": 0.2},
|
||||
{"names": ["enable_video"], "alpha": 1},
|
||||
],
|
||||
"enabledCalls": [
|
||||
{"names": ["enable_video", "file"], "alpha": 1}
|
||||
],
|
||||
"mode": 0,
|
||||
"toggle": True,
|
||||
"clickable": True,
|
||||
"visible": True,
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
def test_easy_load_image_frontend_has_no_backend_boolean_or_polling():
|
||||
source = FRONTEND_PATH.read_text(encoding="utf-8")
|
||||
common = COMMON_FRONTEND_PATH.read_text(encoding="utf-8")
|
||||
assert "setInterval" not in common
|
||||
assert "setTimeout" not in common
|
||||
assert "node.mode = enabled ? NODE_MODE_ALWAYS : NODE_MODE_BYPASS" in common
|
||||
assert "widget.options.serialize = false" in common
|
||||
assert 'from "./easy_bypass_toggle.js"' in source
|
||||
assert "configureEasyBypassToggleNode" in source
|
||||
@@ -0,0 +1,345 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from fractions import Fraction
|
||||
import inspect
|
||||
import json
|
||||
import os
|
||||
from pathlib import Path
|
||||
import shutil
|
||||
import subprocess
|
||||
from types import SimpleNamespace
|
||||
|
||||
import pytest
|
||||
import torch
|
||||
|
||||
from ComfyUI_H3_Continuum_Join import nodes as root_nodes
|
||||
from ComfyUI_H3_Continuum_Join.v3 import easy_video_nodes as video_nodes
|
||||
from ComfyUI_H3_Continuum_Join.v3.easy_video_nodes import (
|
||||
ExecutionBlocker,
|
||||
H3ContinuumLoadVideo,
|
||||
NODE_CLASS_MAPPINGS,
|
||||
NODE_DISPLAY_NAME_MAPPINGS,
|
||||
_resample_video_frames,
|
||||
load_video_components,
|
||||
)
|
||||
|
||||
|
||||
ROOT = Path(__file__).resolve().parents[1]
|
||||
COMMON_FRONTEND_PATH = ROOT / "web" / "easy_bypass_toggle.js"
|
||||
FRONTEND_PATH = ROOT / "web" / "easy_load_video.js"
|
||||
|
||||
|
||||
def _frames(count: int) -> torch.Tensor:
|
||||
values = torch.arange(count, dtype=torch.float32).view(count, 1, 1, 1)
|
||||
return values.expand(-1, 2, 2, 3).clone()
|
||||
|
||||
|
||||
def test_schema_registration_and_minimal_core_contract():
|
||||
schema = H3ContinuumLoadVideo.define_schema()
|
||||
assert NODE_CLASS_MAPPINGS["H3ContinuumLoadVideo"] is H3ContinuumLoadVideo
|
||||
assert root_nodes.NODE_CLASS_MAPPINGS["H3ContinuumLoadVideo"] is (
|
||||
H3ContinuumLoadVideo
|
||||
)
|
||||
assert NODE_DISPLAY_NAME_MAPPINGS["H3ContinuumLoadVideo"] == (
|
||||
"H3 Continuum Load Video"
|
||||
)
|
||||
assert schema.node_id == "H3ContinuumLoadVideo"
|
||||
assert schema.display_name == "H3 Continuum Load Video"
|
||||
assert schema.category == "MiniMax H3/Continuum"
|
||||
assert [item.id for item in schema.inputs] == [
|
||||
"enable_video",
|
||||
"file",
|
||||
"force_rate",
|
||||
]
|
||||
assert schema.inputs[0].default is True
|
||||
assert schema.inputs[1].upload.value == "video_upload"
|
||||
assert schema.inputs[2].default == 24.0
|
||||
assert schema.inputs[2].min == 0.0
|
||||
assert schema.inputs[2].max == 120.0
|
||||
assert schema.inputs[2].step == 0.01
|
||||
assert len(schema.outputs) == 2
|
||||
source = inspect.getsource(video_nodes)
|
||||
assert "InputImpl.VideoFromFile" in source
|
||||
assert "import av" not in source
|
||||
assert "subprocess" not in source
|
||||
|
||||
|
||||
def test_24_to_24_returns_the_identical_image_batch():
|
||||
images = _frames(240)
|
||||
result = _resample_video_frames(images, Fraction(24, 1), 24.0)
|
||||
assert result is images
|
||||
|
||||
|
||||
def test_30_to_24_preserves_ten_second_duration():
|
||||
result = _resample_video_frames(_frames(300), Fraction(30, 1), 24.0)
|
||||
assert result.shape[0] == 240
|
||||
assert result.shape[0] / 24.0 == 10.0
|
||||
|
||||
|
||||
def test_24_to_30_preserves_duration_and_duplicates_frames():
|
||||
result = _resample_video_frames(_frames(240), Fraction(24, 1), 30.0)
|
||||
assert result.shape[0] == 300
|
||||
assert result.shape[0] / 30.0 == 10.0
|
||||
source_values = result[:, 0, 0, 0]
|
||||
assert torch.unique(source_values).numel() == 240
|
||||
|
||||
|
||||
def test_2997_to_24_uses_fraction_without_off_by_one():
|
||||
result = _resample_video_frames(
|
||||
_frames(300),
|
||||
Fraction(30_000, 1_001),
|
||||
24.0,
|
||||
)
|
||||
assert result.shape[0] == 240
|
||||
|
||||
|
||||
def test_force_rate_zero_returns_the_identical_image_batch():
|
||||
images = _frames(123)
|
||||
result = _resample_video_frames(images, Fraction(30_000, 1_001), 0.0)
|
||||
assert result is images
|
||||
|
||||
|
||||
def test_audio_is_bit_exact_and_core_components_are_used(monkeypatch):
|
||||
images = _frames(300)
|
||||
waveform = torch.linspace(-1.0, 1.0, 64).reshape(1, 1, 64)
|
||||
audio = {"waveform": waveform, "sample_rate": 32_000}
|
||||
calls = []
|
||||
|
||||
class FakeVideo:
|
||||
def get_components(self):
|
||||
calls.append("get_components")
|
||||
return SimpleNamespace(
|
||||
images=images,
|
||||
audio=audio,
|
||||
frame_rate=Fraction(30, 1),
|
||||
)
|
||||
|
||||
def fake_video_from_file(path):
|
||||
calls.append(("VideoFromFile", path))
|
||||
return FakeVideo()
|
||||
|
||||
monkeypatch.setattr(
|
||||
video_nodes.folder_paths,
|
||||
"get_annotated_filepath",
|
||||
lambda file: f"D:/input/{file}",
|
||||
)
|
||||
monkeypatch.setattr(video_nodes.InputImpl, "VideoFromFile", fake_video_from_file)
|
||||
output_images, output_audio = load_video_components(
|
||||
file="source.mp4",
|
||||
enable_video=True,
|
||||
force_rate=24.0,
|
||||
)
|
||||
|
||||
assert output_images.shape[0] == 240
|
||||
assert output_audio is audio
|
||||
assert output_audio["sample_rate"] == 32_000
|
||||
assert output_audio["waveform"].shape == waveform.shape
|
||||
assert torch.equal(output_audio["waveform"], waveform)
|
||||
assert calls == [("VideoFromFile", "D:/input/source.mp4"), "get_components"]
|
||||
|
||||
|
||||
def test_enable_video_off_never_resolves_or_decodes(monkeypatch):
|
||||
def forbidden(*args, **kwargs):
|
||||
raise AssertionError("disabled video must not touch Core decode or the file")
|
||||
|
||||
monkeypatch.setattr(video_nodes.folder_paths, "get_annotated_filepath", forbidden)
|
||||
monkeypatch.setattr(video_nodes.InputImpl, "VideoFromFile", forbidden)
|
||||
image, audio = load_video_components(
|
||||
file="missing-old-file.mp4",
|
||||
enable_video=False,
|
||||
force_rate=24.0,
|
||||
)
|
||||
assert isinstance(image, ExecutionBlocker)
|
||||
assert isinstance(audio, ExecutionBlocker)
|
||||
assert image.message is None
|
||||
assert audio.message is None
|
||||
|
||||
|
||||
def test_audio_missing_blocks_only_audio_branch(monkeypatch):
|
||||
images = _frames(24)
|
||||
|
||||
class FakeVideo:
|
||||
def get_components(self):
|
||||
return SimpleNamespace(
|
||||
images=images,
|
||||
audio=None,
|
||||
frame_rate=Fraction(24, 1),
|
||||
)
|
||||
|
||||
monkeypatch.setattr(
|
||||
video_nodes.folder_paths,
|
||||
"get_annotated_filepath",
|
||||
lambda file: f"D:/input/{file}",
|
||||
)
|
||||
monkeypatch.setattr(
|
||||
video_nodes.InputImpl,
|
||||
"VideoFromFile",
|
||||
lambda path: FakeVideo(),
|
||||
)
|
||||
output_images, output_audio = load_video_components(
|
||||
file="silent.mp4",
|
||||
enable_video=True,
|
||||
force_rate=24.0,
|
||||
)
|
||||
assert output_images is images
|
||||
assert isinstance(output_audio, ExecutionBlocker)
|
||||
assert output_audio.message is None
|
||||
|
||||
|
||||
def test_validation_and_fingerprint_skip_stale_file_when_disabled(
|
||||
monkeypatch,
|
||||
tmp_path: Path,
|
||||
):
|
||||
calls = []
|
||||
|
||||
def exists(file):
|
||||
calls.append(("exists", file))
|
||||
return file == "valid.mp4"
|
||||
|
||||
monkeypatch.setattr(video_nodes.folder_paths, "exists_annotated_filepath", exists)
|
||||
assert H3ContinuumLoadVideo.validate_inputs(False, "missing.mp4", 24.0) is True
|
||||
assert calls == []
|
||||
disabled_fingerprint = H3ContinuumLoadVideo.fingerprint_inputs(
|
||||
False,
|
||||
"missing.mp4",
|
||||
24.0,
|
||||
)
|
||||
assert disabled_fingerprint == (False, "missing.mp4", 24.0, None)
|
||||
assert calls == []
|
||||
|
||||
invalid = H3ContinuumLoadVideo.validate_inputs(True, "missing.mp4", 24.0)
|
||||
assert invalid == "Invalid video file: missing.mp4"
|
||||
assert H3ContinuumLoadVideo.validate_inputs(True, "valid.mp4", 24.0) is True
|
||||
|
||||
video_path = tmp_path / "valid.mp4"
|
||||
video_path.write_bytes(b"video")
|
||||
monkeypatch.setattr(
|
||||
video_nodes.folder_paths,
|
||||
"get_annotated_filepath",
|
||||
lambda file: str(video_path),
|
||||
)
|
||||
fingerprint = H3ContinuumLoadVideo.fingerprint_inputs(
|
||||
True,
|
||||
"valid.mp4",
|
||||
30.0,
|
||||
)
|
||||
assert fingerprint[:3] == (True, "valid.mp4", 30.0)
|
||||
assert fingerprint[3] == os.path.getmtime(video_path)
|
||||
|
||||
|
||||
def test_enable_video_false_uses_native_bypass_appearance(tmp_path):
|
||||
node_executable = shutil.which("node")
|
||||
if node_executable is None:
|
||||
pytest.skip("Node.js is required for the frontend behavior regression")
|
||||
functions = COMMON_FRONTEND_PATH.read_text(encoding="utf-8").replace(
|
||||
"export ", ""
|
||||
)
|
||||
script = f"""
|
||||
{functions}
|
||||
function plainWidget(name, value) {{
|
||||
return {{ name, value, options: {{}}, serialize: true }};
|
||||
}}
|
||||
const enableWidget = plainWidget("enable_video", false);
|
||||
const fileWidget = plainWidget("file", "clip.mp4");
|
||||
const rateWidget = plainWidget("force_rate", 24.0);
|
||||
const uploadWidget = plainWidget("upload", "video");
|
||||
const node = {{
|
||||
comfyClass: "H3ContinuumLoadVideo",
|
||||
mode: 0,
|
||||
widgets: [enableWidget, fileWidget, rateWidget, uploadWidget],
|
||||
dirtyCalls: 0,
|
||||
setDirtyCanvas() {{ this.dirtyCalls += 1; }},
|
||||
serialize() {{
|
||||
return {{
|
||||
mode: this.mode,
|
||||
widgets_values: this.widgets.map((widget) => widget.value),
|
||||
}};
|
||||
}},
|
||||
configure(info) {{
|
||||
this.mode = info.mode;
|
||||
for (let index = 0; index < info.widgets_values.length; index++) {{
|
||||
this.widgets[index].value = info.widgets_values[index];
|
||||
}}
|
||||
}},
|
||||
}};
|
||||
configureExistingEasyBypassWidgetNode(node, {{
|
||||
nodeClass: "H3ContinuumLoadVideo",
|
||||
widgetNames: ["enable_video", "Enable Video"],
|
||||
}});
|
||||
const initial = {{
|
||||
mode: node.mode,
|
||||
enabled: enableWidget.value,
|
||||
names: node.widgets.map((widget) => widget.name),
|
||||
saved: node.serialize(),
|
||||
}};
|
||||
enableWidget.callback(true);
|
||||
const enabled = {{ mode: node.mode, enabled: enableWidget.value }};
|
||||
node.mode = 4;
|
||||
const externalBypass = {{ mode: node.mode, enabled: enableWidget.value }};
|
||||
node.mode = 0;
|
||||
const externalUnbypass = {{ mode: node.mode, enabled: enableWidget.value }};
|
||||
node.configure({{
|
||||
mode: 0,
|
||||
widgets_values: [false, "reloaded.mp4", 30.0, "video"],
|
||||
}});
|
||||
configureExistingEasyBypassWidgetNode(node, {{
|
||||
nodeClass: "H3ContinuumLoadVideo",
|
||||
widgetNames: ["enable_video", "Enable Video"],
|
||||
}});
|
||||
const reloaded = {{
|
||||
mode: node.mode,
|
||||
enabled: enableWidget.value,
|
||||
file: fileWidget.value,
|
||||
rate: rateWidget.value,
|
||||
names: node.widgets.map((widget) => widget.name),
|
||||
saved: node.serialize(),
|
||||
}};
|
||||
console.log(JSON.stringify({{ initial, enabled, externalBypass, externalUnbypass, reloaded }}));
|
||||
"""
|
||||
script_path = tmp_path / "easy-load-video-frontend.js"
|
||||
script_path.write_text(script, encoding="utf-8")
|
||||
result = subprocess.run(
|
||||
[node_executable, str(script_path)],
|
||||
check=True,
|
||||
capture_output=True,
|
||||
text=True,
|
||||
)
|
||||
observed = json.loads(result.stdout)
|
||||
assert observed == {
|
||||
"initial": {
|
||||
"mode": 4,
|
||||
"enabled": False,
|
||||
"names": ["enable_video", "file", "force_rate", "upload"],
|
||||
"saved": {
|
||||
"mode": 4,
|
||||
"widgets_values": [False, "clip.mp4", 24, "video"],
|
||||
},
|
||||
},
|
||||
"enabled": {"mode": 0, "enabled": True},
|
||||
"externalBypass": {"mode": 4, "enabled": False},
|
||||
"externalUnbypass": {"mode": 0, "enabled": True},
|
||||
"reloaded": {
|
||||
"mode": 4,
|
||||
"enabled": False,
|
||||
"file": "reloaded.mp4",
|
||||
"rate": 30,
|
||||
"names": ["enable_video", "file", "force_rate", "upload"],
|
||||
"saved": {
|
||||
"mode": 4,
|
||||
"widgets_values": [False, "reloaded.mp4", 30, "video"],
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
def test_video_bypass_appearance_uses_native_mode_without_hardcoded_color():
|
||||
source = FRONTEND_PATH.read_text(encoding="utf-8")
|
||||
common = COMMON_FRONTEND_PATH.read_text(encoding="utf-8")
|
||||
assert 'from "./easy_bypass_toggle.js"' in source
|
||||
assert "configureExistingEasyBypassWidgetNode" in source
|
||||
assert 'widgetNames: ["enable_video", "Enable Video"]' in source
|
||||
assert "NODE_MODE_BYPASS" in common
|
||||
assert "node.color" not in source
|
||||
assert "node.bgcolor" not in source
|
||||
assert "setInterval" not in common
|
||||
assert "setTimeout" not in common
|
||||
@@ -1,81 +1,81 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import importlib.util
|
||||
import sys
|
||||
from pathlib import Path
|
||||
|
||||
import torch
|
||||
|
||||
|
||||
MODULE_PATH = Path(__file__).parents[1] / "tools" / "gpu_diagnostic_node" / "capture.py"
|
||||
SPEC = importlib.util.spec_from_file_location("h3_gpu_diagnostic_capture", MODULE_PATH)
|
||||
capture = importlib.util.module_from_spec(SPEC)
|
||||
assert SPEC.loader is not None
|
||||
sys.modules[SPEC.name] = capture
|
||||
SPEC.loader.exec_module(capture)
|
||||
|
||||
|
||||
def test_tensor_fingerprint_is_deterministic():
|
||||
value = torch.arange(12, dtype=torch.float32).reshape(1, 3, 4)
|
||||
assert capture.tensor_fingerprint(value) == capture.tensor_fingerprint(value.clone())
|
||||
|
||||
|
||||
def test_tensor_comparison_records_numerical_difference():
|
||||
left = torch.tensor([1.0, 2.0], dtype=torch.float32)
|
||||
right = torch.tensor([1.0, 2.000001], dtype=torch.float32)
|
||||
result = capture.compare_tensors(left, right)
|
||||
assert not result.bit_exact
|
||||
assert result.allclose
|
||||
assert result.matches
|
||||
assert result.max_abs_diff > 0.0
|
||||
|
||||
|
||||
def test_terminal_video_recombine_is_bit_exact():
|
||||
physical = torch.arange(72, dtype=torch.float32).reshape(1, 1, 72, 1, 1)
|
||||
first = physical[:, :, 0:37]
|
||||
second = physical[:, :, 30:72]
|
||||
rebuilt = capture.recombine_terminal_streams(
|
||||
first,
|
||||
second,
|
||||
first_range=(0, 37),
|
||||
second_range=(30, 72),
|
||||
dim=2,
|
||||
)
|
||||
assert torch.equal(rebuilt, physical)
|
||||
|
||||
|
||||
def test_terminal_audio_recombine_is_bit_exact():
|
||||
physical = torch.arange(405, dtype=torch.float32).reshape(1, 1, 405)
|
||||
first = physical[..., 0:207]
|
||||
second = physical[..., 170:405]
|
||||
rebuilt = capture.recombine_terminal_streams(
|
||||
first,
|
||||
second,
|
||||
first_range=(0, 207),
|
||||
second_range=(170, 405),
|
||||
dim=-1,
|
||||
)
|
||||
assert torch.equal(rebuilt, physical)
|
||||
|
||||
|
||||
def test_stage_comparison_reports_first_field():
|
||||
left = capture.DiagnosticCapture("core")
|
||||
right = capture.DiagnosticCapture("continuum")
|
||||
left.add_value("A_pre_sampler", "seed", 42)
|
||||
right.add_value("A_pre_sampler", "seed", 43)
|
||||
left.add_tensor("A_pre_sampler", "sigmas", torch.ones(2))
|
||||
right.add_tensor("A_pre_sampler", "sigmas", torch.ones(2))
|
||||
result = capture.compare_stage(left, right, "A_pre_sampler")
|
||||
assert result["status"] == "DIFFER"
|
||||
assert result["first_field"] == "seed"
|
||||
|
||||
|
||||
def test_summary_uses_stage_order_and_first_divergence(tmp_path):
|
||||
comparison = {
|
||||
"A_pre_sampler": {"status": "MATCH", "first_field": None},
|
||||
"B_first_model_call": {"status": "DIFFER", "first_field": "position_ids"},
|
||||
}
|
||||
text = capture.format_comparison(comparison, tmp_path)
|
||||
assert "A_pre_sampler: MATCH" in text
|
||||
assert "B_first_model_call: DIFFER" in text
|
||||
assert "First divergence: B_first_model_call.position_ids" in text
|
||||
from __future__ import annotations
|
||||
|
||||
import importlib.util
|
||||
import sys
|
||||
from pathlib import Path
|
||||
|
||||
import torch
|
||||
|
||||
|
||||
MODULE_PATH = Path(__file__).parents[1] / "tools" / "gpu_diagnostic_node" / "capture.py"
|
||||
SPEC = importlib.util.spec_from_file_location("h3_gpu_diagnostic_capture", MODULE_PATH)
|
||||
capture = importlib.util.module_from_spec(SPEC)
|
||||
assert SPEC.loader is not None
|
||||
sys.modules[SPEC.name] = capture
|
||||
SPEC.loader.exec_module(capture)
|
||||
|
||||
|
||||
def test_tensor_fingerprint_is_deterministic():
|
||||
value = torch.arange(12, dtype=torch.float32).reshape(1, 3, 4)
|
||||
assert capture.tensor_fingerprint(value) == capture.tensor_fingerprint(value.clone())
|
||||
|
||||
|
||||
def test_tensor_comparison_records_numerical_difference():
|
||||
left = torch.tensor([1.0, 2.0], dtype=torch.float32)
|
||||
right = torch.tensor([1.0, 2.000001], dtype=torch.float32)
|
||||
result = capture.compare_tensors(left, right)
|
||||
assert not result.bit_exact
|
||||
assert result.allclose
|
||||
assert result.matches
|
||||
assert result.max_abs_diff > 0.0
|
||||
|
||||
|
||||
def test_terminal_video_recombine_is_bit_exact():
|
||||
physical = torch.arange(72, dtype=torch.float32).reshape(1, 1, 72, 1, 1)
|
||||
first = physical[:, :, 0:37]
|
||||
second = physical[:, :, 30:72]
|
||||
rebuilt = capture.recombine_terminal_streams(
|
||||
first,
|
||||
second,
|
||||
first_range=(0, 37),
|
||||
second_range=(30, 72),
|
||||
dim=2,
|
||||
)
|
||||
assert torch.equal(rebuilt, physical)
|
||||
|
||||
|
||||
def test_terminal_audio_recombine_is_bit_exact():
|
||||
physical = torch.arange(405, dtype=torch.float32).reshape(1, 1, 405)
|
||||
first = physical[..., 0:207]
|
||||
second = physical[..., 170:405]
|
||||
rebuilt = capture.recombine_terminal_streams(
|
||||
first,
|
||||
second,
|
||||
first_range=(0, 207),
|
||||
second_range=(170, 405),
|
||||
dim=-1,
|
||||
)
|
||||
assert torch.equal(rebuilt, physical)
|
||||
|
||||
|
||||
def test_stage_comparison_reports_first_field():
|
||||
left = capture.DiagnosticCapture("core")
|
||||
right = capture.DiagnosticCapture("continuum")
|
||||
left.add_value("A_pre_sampler", "seed", 42)
|
||||
right.add_value("A_pre_sampler", "seed", 43)
|
||||
left.add_tensor("A_pre_sampler", "sigmas", torch.ones(2))
|
||||
right.add_tensor("A_pre_sampler", "sigmas", torch.ones(2))
|
||||
result = capture.compare_stage(left, right, "A_pre_sampler")
|
||||
assert result["status"] == "DIFFER"
|
||||
assert result["first_field"] == "seed"
|
||||
|
||||
|
||||
def test_summary_uses_stage_order_and_first_divergence(tmp_path):
|
||||
comparison = {
|
||||
"A_pre_sampler": {"status": "MATCH", "first_field": None},
|
||||
"B_first_model_call": {"status": "DIFFER", "first_field": "position_ids"},
|
||||
}
|
||||
text = capture.format_comparison(comparison, tmp_path)
|
||||
assert "A_pre_sampler: MATCH" in text
|
||||
assert "B_first_model_call: DIFFER" in text
|
||||
assert "First divergence: B_first_model_call.position_ids" in text
|
||||
|
||||
@@ -0,0 +1,313 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import importlib.util
|
||||
from pathlib import Path
|
||||
import sys
|
||||
|
||||
import numpy as np
|
||||
import torch
|
||||
|
||||
|
||||
TOOLS = Path(__file__).parents[1] / "tools"
|
||||
|
||||
|
||||
def _load(name: str, filename: str):
|
||||
path = TOOLS / filename
|
||||
spec = importlib.util.spec_from_file_location(name, path)
|
||||
assert spec is not None and spec.loader is not None
|
||||
module = importlib.util.module_from_spec(spec)
|
||||
sys.modules[name] = module
|
||||
spec.loader.exec_module(module)
|
||||
return module
|
||||
|
||||
|
||||
runner = _load("h3_issue13_r25_gate_runner", "issue13_r25_gate_runner.py")
|
||||
analyzer = _load("h3_issue13_r25_analyze", "issue13_r2_analyze.py")
|
||||
soft_reanchor = _load(
|
||||
"h3_issue13_soft_reanchor",
|
||||
"gpu_diagnostic_node/soft_reanchor.py",
|
||||
)
|
||||
|
||||
|
||||
def _source_prompt() -> dict:
|
||||
return {
|
||||
"114": {"inputs": {"image": "old.png"}},
|
||||
"119": {"inputs": {}},
|
||||
"139": {"inputs": {"sampler_name": "res_multistep"}},
|
||||
"150": {"inputs": {"enabled": True}},
|
||||
"153": {"inputs": {"scheduler": "old", "steps": 20, "denoise": 0.5}},
|
||||
"188": {"inputs": {"value": "old"}},
|
||||
"191": {"inputs": {}},
|
||||
"249": {"inputs": {}},
|
||||
"286": {
|
||||
"inputs": {
|
||||
"lora_1": {"on": True, "lora": "old.safetensors", "strength": 1.0}
|
||||
}
|
||||
},
|
||||
"297": {"inputs": {"value": 0.3}},
|
||||
"305": {
|
||||
"class_type": "H3ContinuumSamplerV37",
|
||||
"inputs": {
|
||||
"continuation_backend": "Standard",
|
||||
"generation_mode": "Full Run",
|
||||
"review_action": "Continue / Next",
|
||||
"guide": ["900", 0],
|
||||
"last_frame": ["901", 0],
|
||||
},
|
||||
},
|
||||
"306": {"inputs": {}},
|
||||
}
|
||||
|
||||
|
||||
def test_screening_order_and_contract_are_fixed():
|
||||
assert tuple(runner.CASE_SPECS)[:3] == (
|
||||
"screen_3x5_turbo",
|
||||
"screen_3x10_turbo",
|
||||
"screen_6x5_turbo",
|
||||
)
|
||||
prompt, loras = runner.configure_prompt(
|
||||
_source_prompt(),
|
||||
case="screen_3x10_turbo",
|
||||
output_prefix="video/test",
|
||||
image_name="closeup.png",
|
||||
seed=131325,
|
||||
width=576,
|
||||
height=864,
|
||||
diagnostic_nonce=7,
|
||||
)
|
||||
inputs = prompt["305"]["inputs"]
|
||||
assert inputs["chunks"] == 3
|
||||
assert inputs["chunk_seconds"] == 10.0
|
||||
assert inputs["width"] == 576
|
||||
assert inputs["height"] == 864
|
||||
assert prompt["139"]["inputs"]["sampler_name"] == "euler"
|
||||
assert prompt["153"]["inputs"]["steps"] == 8
|
||||
assert prompt["153"]["inputs"]["scheduler"] == "simple"
|
||||
assert prompt["114"]["inputs"]["image"] == "closeup.png"
|
||||
assert loras == [{"name": runner.TURBO_LORA, "strength": 1.0}]
|
||||
assert prompt["188"]["inputs"]["value"].count("\n---\n") == 2
|
||||
assert "dynv2" not in prompt["188"]["inputs"]["value"]
|
||||
|
||||
|
||||
def test_six_by_five_uses_six_motion_steps():
|
||||
prompt, _ = runner.configure_prompt(
|
||||
_source_prompt(),
|
||||
case="screen_6x5_turbo",
|
||||
output_prefix="video/test",
|
||||
image_name="closeup.png",
|
||||
seed=1,
|
||||
width=576,
|
||||
height=864,
|
||||
diagnostic_nonce=8,
|
||||
)
|
||||
assert prompt["305"]["inputs"]["chunks"] == 6
|
||||
assert prompt["188"]["inputs"]["value"].count("\n---\n") == 5
|
||||
|
||||
|
||||
def test_six_by_five_fixed_prompt_repeats_one_prompt():
|
||||
prompt, loras = runner.configure_prompt(
|
||||
_source_prompt(),
|
||||
case="screen_6x5_turbo_fixed_prompt",
|
||||
output_prefix="video/issue13_r26/fixed",
|
||||
image_name="closeup.png",
|
||||
seed=131325,
|
||||
width=576,
|
||||
height=864,
|
||||
diagnostic_nonce=132600,
|
||||
)
|
||||
prompts = prompt["188"]["inputs"]["value"].split("\n---\n")
|
||||
assert len(prompts) == 6
|
||||
assert len(set(prompts)) == 1
|
||||
assert prompt["305"]["inputs"]["chunks"] == 6
|
||||
assert prompt["305"]["inputs"]["chunk_seconds"] == 5.0
|
||||
assert prompt["153"]["inputs"]["steps"] == 8
|
||||
assert loras == [{"name": runner.TURBO_LORA, "strength": 1.0}]
|
||||
|
||||
|
||||
def test_six_by_five_fixed_prefix_changes_only_diagnostic_source_mode():
|
||||
source = _source_prompt()
|
||||
recursive, _ = runner.configure_prompt(
|
||||
source,
|
||||
case="screen_6x5_turbo_fixed_prompt",
|
||||
output_prefix="video/issue13_r26/recursive",
|
||||
image_name="closeup.png",
|
||||
seed=131325,
|
||||
width=576,
|
||||
height=864,
|
||||
diagnostic_nonce=132600,
|
||||
)
|
||||
fixed, _ = runner.configure_prompt(
|
||||
source,
|
||||
case="screen_6x5_turbo_fixed_prefix",
|
||||
output_prefix="video/issue13_r26/fixed-prefix",
|
||||
image_name="closeup.png",
|
||||
seed=131325,
|
||||
width=576,
|
||||
height=864,
|
||||
diagnostic_nonce=132601,
|
||||
)
|
||||
recursive_inputs = recursive["305"]["inputs"]
|
||||
fixed_inputs = fixed["305"]["inputs"]
|
||||
assert recursive_inputs["continuation_source_mode"] == "Recursive"
|
||||
assert fixed_inputs["continuation_source_mode"] == "Fixed Group 1 Tail"
|
||||
ignored = {"continuation_source_mode", "diagnostic_nonce"}
|
||||
assert {
|
||||
key: value for key, value in recursive_inputs.items() if key not in ignored
|
||||
} == {key: value for key, value in fixed_inputs.items() if key not in ignored}
|
||||
assert recursive["188"]["inputs"]["value"] == fixed["188"]["inputs"]["value"]
|
||||
|
||||
|
||||
def test_six_by_five_soft_reanchor_changes_only_diagnostic_source_mode():
|
||||
source = _source_prompt()
|
||||
recursive, _ = runner.configure_prompt(
|
||||
source,
|
||||
case="screen_6x5_turbo_fixed_prompt",
|
||||
output_prefix="video/issue13_r27/recursive",
|
||||
image_name="closeup.png",
|
||||
seed=131325,
|
||||
width=576,
|
||||
height=864,
|
||||
diagnostic_nonce=132700,
|
||||
)
|
||||
reanchored, _ = runner.configure_prompt(
|
||||
source,
|
||||
case="screen_6x5_turbo_soft_reanchor",
|
||||
output_prefix="video/issue13_r27/soft-reanchor",
|
||||
image_name="closeup.png",
|
||||
seed=131325,
|
||||
width=576,
|
||||
height=864,
|
||||
diagnostic_nonce=132701,
|
||||
)
|
||||
recursive_inputs = recursive["305"]["inputs"]
|
||||
reanchored_inputs = reanchored["305"]["inputs"]
|
||||
assert recursive_inputs["continuation_source_mode"] == "Recursive"
|
||||
assert reanchored_inputs["continuation_source_mode"] == "Soft Re-anchor Group 4"
|
||||
ignored = {"continuation_source_mode", "diagnostic_nonce"}
|
||||
assert {
|
||||
key: value for key, value in recursive_inputs.items() if key not in ignored
|
||||
} == {key: value for key, value in reanchored_inputs.items() if key not in ignored}
|
||||
assert recursive["188"]["inputs"]["value"] == reanchored["188"]["inputs"]["value"]
|
||||
|
||||
|
||||
def test_soft_reanchor_moves_global_appearance_halfway_without_geometry_change():
|
||||
current = torch.zeros((1, 4, 8, 8, 3), dtype=torch.float32)
|
||||
current[..., 0] = 0.8
|
||||
current[..., 1] = 0.3
|
||||
current[..., 2] = 0.2
|
||||
reference = torch.zeros_like(current)
|
||||
reference[..., 0] = 0.4
|
||||
reference[..., 1] = 0.5
|
||||
reference[..., 2] = 0.6
|
||||
adjusted, report = soft_reanchor.soft_match_rgb_appearance(
|
||||
current,
|
||||
reference,
|
||||
strength=0.5,
|
||||
)
|
||||
assert adjusted.shape == current.shape
|
||||
assert torch.equal(current[..., 0], torch.full_like(current[..., 0], 0.8))
|
||||
before_gap = abs(
|
||||
report["before"]["luma_mean"] - report["reference"]["luma_mean"]
|
||||
)
|
||||
after_gap = abs(
|
||||
report["after"]["luma_mean"] - report["reference"]["luma_mean"]
|
||||
)
|
||||
assert after_gap < before_gap
|
||||
assert report["strength"] == 0.5
|
||||
assert report["geometry_unchanged"] is True
|
||||
|
||||
|
||||
def test_soft_reanchor_vae_roundtrip_preserves_shape_and_inputs():
|
||||
class FakeVideoVAE:
|
||||
def decode(self, latent):
|
||||
value = float(latent.mean().item())
|
||||
pixels = torch.full((1, 22, 32, 32, 3), value, dtype=torch.float32)
|
||||
pixels[..., 0] = value + 0.1
|
||||
return pixels.clamp(0.0, 1.0)
|
||||
|
||||
def encode(self, pixels):
|
||||
value = float(pixels.mean().item())
|
||||
return torch.full((1, 24, 7, 2, 2), value, dtype=torch.float32)
|
||||
|
||||
current = torch.full((1, 24, 7, 2, 2), 0.7, dtype=torch.float32)
|
||||
reference = torch.full((1, 24, 7, 2, 2), 0.3, dtype=torch.float32)
|
||||
current_before = current.clone()
|
||||
reference_before = reference.clone()
|
||||
|
||||
encoded, report = soft_reanchor.soft_reanchor_context(
|
||||
current,
|
||||
reference,
|
||||
video_vae=FakeVideoVAE(),
|
||||
strength=0.5,
|
||||
)
|
||||
|
||||
assert encoded.shape == current.shape
|
||||
assert encoded.dtype == current.dtype
|
||||
assert torch.isfinite(encoded).all()
|
||||
assert torch.equal(current, current_before)
|
||||
assert torch.equal(reference, reference_before)
|
||||
assert report["current_context_unchanged"] is True
|
||||
assert report["reference_context_unchanged"] is True
|
||||
assert report["latent_shape_unchanged"] is True
|
||||
|
||||
|
||||
def test_boundary_metrics_report_flow_and_frame_jump():
|
||||
frames = []
|
||||
for index in range(12):
|
||||
frame = np.zeros((24, 24, 3), dtype=np.uint8)
|
||||
frame[:, max(0, min(20, index)) : max(1, min(24, index + 4))] = 80
|
||||
if index >= 6:
|
||||
frame = np.clip(frame + 80, 0, 255).astype(np.uint8)
|
||||
frames.append(frame)
|
||||
rows = analyzer._boundary_metrics(frames, chunks=2)
|
||||
assert len(rows) == 1
|
||||
assert rows[0]["target_group"] == 2
|
||||
assert rows[0]["frame_mae"] > 0.0
|
||||
assert rows[0]["trajectory_flow_discontinuity"] >= 0.0
|
||||
|
||||
|
||||
def test_motion_pair_ab_uses_normal_twenty_step_and_no_turbo():
|
||||
off, off_loras = runner.configure_prompt(
|
||||
_source_prompt(),
|
||||
case="motion_off_3x5_normal",
|
||||
output_prefix="video/test",
|
||||
image_name="closeup.png",
|
||||
seed=1,
|
||||
width=576,
|
||||
height=864,
|
||||
diagnostic_nonce=9,
|
||||
)
|
||||
both, both_loras = runner.configure_prompt(
|
||||
_source_prompt(),
|
||||
case="motion_both_3x5_normal",
|
||||
output_prefix="video/test",
|
||||
image_name="closeup.png",
|
||||
seed=1,
|
||||
width=576,
|
||||
height=864,
|
||||
diagnostic_nonce=10,
|
||||
)
|
||||
assert off_loras == []
|
||||
assert off["153"]["inputs"]["steps"] == 20
|
||||
assert "dynv2" in off["188"]["inputs"]["value"]
|
||||
assert [item["name"] for item in both_loras] == [
|
||||
runner.MOTION_BOOSTER_LORA,
|
||||
runner.MOTION_REPAIR_LORA,
|
||||
]
|
||||
assert both["153"]["inputs"]["steps"] == 20
|
||||
assert all(runner.TURBO_LORA != item["name"] for item in both_loras)
|
||||
|
||||
|
||||
def test_continuation_rgb_proxy_uses_pre_boundary_context_window():
|
||||
frames = [np.full((8, 8, 3), index, dtype=np.uint8) for index in range(30)]
|
||||
result = analyzer._continuation_input_rgb_proxy(
|
||||
frames, chunks=3, context_frames=4
|
||||
)
|
||||
assert result["context_frames"] == 4
|
||||
assert len(result["boundaries"]) == 2
|
||||
first = result["boundaries"][0]
|
||||
assert first["boundary_frame"] == 10
|
||||
assert first["window_start"] == 6
|
||||
assert first["window_end_exclusive"] == 10
|
||||
assert first["window_frames"] == 4
|
||||
assert abs(sum(first["luma_histogram"]) - 1.0) < 1e-9
|
||||
@@ -0,0 +1,213 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import importlib.util
|
||||
from pathlib import Path
|
||||
import sys
|
||||
|
||||
import torch
|
||||
|
||||
|
||||
TOOLS = Path(__file__).parents[1] / "tools"
|
||||
|
||||
|
||||
def _load(name: str, filename: str):
|
||||
path = TOOLS / filename
|
||||
spec = importlib.util.spec_from_file_location(name, path)
|
||||
assert spec is not None and spec.loader is not None
|
||||
module = importlib.util.module_from_spec(spec)
|
||||
sys.modules[name] = module
|
||||
spec.loader.exec_module(module)
|
||||
return module
|
||||
|
||||
|
||||
policy_module = _load(
|
||||
"h3_issue13_r28_continuation_policy",
|
||||
"gpu_diagnostic_node/continuation_policy.py",
|
||||
)
|
||||
runner = _load("h3_issue13_r28_gate_runner", "issue13_r28_gate_runner.py")
|
||||
analyzer = _load("h3_issue13_r28_analyze", "issue13_r28_analyze.py")
|
||||
|
||||
|
||||
class FakeNested:
|
||||
def __init__(self, tensors):
|
||||
self.tensors = tuple(tensors)
|
||||
|
||||
def unbind(self):
|
||||
return self.tensors
|
||||
|
||||
|
||||
def _summary(tensor: torch.Tensor) -> dict:
|
||||
return {
|
||||
"shape": [int(value) for value in tensor.shape],
|
||||
"mean": float(tensor.float().mean().item()),
|
||||
}
|
||||
|
||||
|
||||
def _latent():
|
||||
video = torch.randn((1, 24, 42, 4, 4), generator=torch.Generator().manual_seed(1))
|
||||
audio = torch.randn((1, 32, 2, 235), generator=torch.Generator().manual_seed(2))
|
||||
video_mask = torch.ones((1, 1, 42, 4, 4), dtype=torch.float32)
|
||||
video_mask[:, :, :7] = 0.0
|
||||
audio_mask = torch.ones((1, 1, 2, 235), dtype=torch.float32)
|
||||
audio_mask[..., :37] = 0.0
|
||||
return {
|
||||
"samples": FakeNested((video, audio)),
|
||||
"noise_mask": FakeNested((video_mask, audio_mask)),
|
||||
}
|
||||
|
||||
|
||||
def _apply(mode: str):
|
||||
latent = _latent()
|
||||
original_samples = latent["samples"]
|
||||
original_video_mask, original_audio_mask = [
|
||||
value.clone() for value in latent["noise_mask"].unbind()
|
||||
]
|
||||
policy = policy_module.R28ContinuationPolicy(mode, tensor_summary=_summary)
|
||||
result = policy.prepare_masked_latent(
|
||||
latent=latent,
|
||||
physical_group=2,
|
||||
logical_chunks=(2,),
|
||||
context_frames=22,
|
||||
video_context=torch.zeros((1, 24, 7, 4, 4)),
|
||||
audio_context=torch.zeros((1, 32, 2, 37)),
|
||||
)
|
||||
assert result["samples"] is original_samples
|
||||
assert torch.equal(latent["noise_mask"].unbind()[0], original_video_mask)
|
||||
assert torch.equal(latent["noise_mask"].unbind()[1], original_audio_mask)
|
||||
return policy, result
|
||||
|
||||
|
||||
def test_depth_13_uses_last_four_slots_and_preserves_audio_contract():
|
||||
policy, result = _apply(policy_module.MODE_DEPTH_13)
|
||||
video_mask, audio_mask = result["noise_mask"].unbind()
|
||||
assert policy.active_video_slots == 4
|
||||
assert policy.active_video_frames == 13
|
||||
assert torch.all(video_mask[:, :, :3] == 1)
|
||||
assert torch.all(video_mask[:, :, 3:7] == 0)
|
||||
assert torch.all(video_mask[:, :, 7:] == 1)
|
||||
assert torch.all(audio_mask[..., :37] == 0)
|
||||
assert torch.all(audio_mask[..., 37:] == 1)
|
||||
|
||||
|
||||
def test_depth_9_uses_last_three_slots_only():
|
||||
policy, result = _apply(policy_module.MODE_DEPTH_9)
|
||||
video_mask, _ = result["noise_mask"].unbind()
|
||||
assert policy.active_video_slots == 3
|
||||
assert policy.active_video_frames == 9
|
||||
assert torch.all(video_mask[:, :, :4] == 1)
|
||||
assert torch.all(video_mask[:, :, 4:7] == 0)
|
||||
|
||||
|
||||
def test_strength_75_uses_core_fractional_mask_without_scaling_latent():
|
||||
latent = _latent()
|
||||
source_video, source_audio = latent["samples"].unbind()
|
||||
source_video_before = source_video.clone()
|
||||
source_audio_before = source_audio.clone()
|
||||
policy = policy_module.R28ContinuationPolicy(
|
||||
policy_module.MODE_STRENGTH_75, tensor_summary=_summary
|
||||
)
|
||||
result = policy.prepare_masked_latent(
|
||||
latent=latent,
|
||||
physical_group=2,
|
||||
logical_chunks=(2,),
|
||||
context_frames=22,
|
||||
video_context=torch.zeros((1, 24, 7, 4, 4)),
|
||||
audio_context=torch.zeros((1, 32, 2, 37)),
|
||||
)
|
||||
video_mask, audio_mask = result["noise_mask"].unbind()
|
||||
assert torch.all(video_mask[:, :, :7] == 0.25)
|
||||
assert torch.all(audio_mask[..., :37] == 0)
|
||||
assert torch.equal(source_video, source_video_before)
|
||||
assert torch.equal(source_audio, source_audio_before)
|
||||
|
||||
|
||||
def test_baseline_returns_original_latent_and_mask_objects():
|
||||
latent = _latent()
|
||||
policy = policy_module.R28ContinuationPolicy(
|
||||
policy_module.MODE_BASELINE_22, tensor_summary=_summary
|
||||
)
|
||||
result = policy.prepare_masked_latent(
|
||||
latent=latent,
|
||||
physical_group=2,
|
||||
logical_chunks=(2,),
|
||||
context_frames=22,
|
||||
video_context=torch.zeros((1, 24, 7, 4, 4)),
|
||||
audio_context=torch.zeros((1, 32, 2, 37)),
|
||||
)
|
||||
assert result is latent
|
||||
assert policy.active_video_slots == 7
|
||||
assert policy.active_video_frames == 22
|
||||
|
||||
|
||||
def _source_prompt() -> dict:
|
||||
return {
|
||||
"114": {"inputs": {"image": "old.png"}},
|
||||
"119": {"inputs": {}},
|
||||
"139": {"inputs": {"sampler_name": "old"}},
|
||||
"150": {"inputs": {"enabled": True}},
|
||||
"153": {"inputs": {"scheduler": "old", "steps": 20}},
|
||||
"188": {"inputs": {"value": "old"}},
|
||||
"191": {"inputs": {}},
|
||||
"249": {"inputs": {}},
|
||||
"286": {"inputs": {"lora_1": {"on": False}}},
|
||||
"297": {"inputs": {"value": 0.3}},
|
||||
"305": {
|
||||
"class_type": "H3ContinuumMaskedPrefixR1Diagnostic",
|
||||
"inputs": {
|
||||
"continuation_source_mode": "Recursive",
|
||||
"synchronize_sampling": True,
|
||||
"last_frame": ["900", 0],
|
||||
},
|
||||
},
|
||||
"306": {"inputs": {}},
|
||||
}
|
||||
|
||||
|
||||
def test_runner_changes_only_the_approved_r28_experiment_contract():
|
||||
prompt, loras = runner.configure_prompt(
|
||||
_source_prompt(),
|
||||
case="depth_13f",
|
||||
output_prefix="video/issue13_r28/test",
|
||||
image_name="closeup.png",
|
||||
seed=131325,
|
||||
width=576,
|
||||
height=864,
|
||||
diagnostic_nonce=132800,
|
||||
)
|
||||
inputs = prompt["305"]["inputs"]
|
||||
assert prompt["305"]["class_type"] == "H3ContinuumContinuationR28Diagnostic"
|
||||
assert inputs["continuation_experiment"] == "Video Depth 13f"
|
||||
assert inputs["continuation_transport"] == "masked_av_prefix_22_v1"
|
||||
assert inputs["continuity"] == "Balanced — 22 frames"
|
||||
assert inputs["audio_continuity"] is True
|
||||
assert inputs["chunks"] == 6
|
||||
assert inputs["chunk_seconds"] == 5.0
|
||||
assert "continuation_source_mode" not in inputs
|
||||
assert "synchronize_sampling" not in inputs
|
||||
assert "last_frame" not in inputs
|
||||
assert prompt["188"]["inputs"]["value"].count("\n---\n") == 5
|
||||
assert len(set(prompt["188"]["inputs"]["value"].split("\n---\n"))) == 1
|
||||
assert loras == [{"name": runner.r25.TURBO_LORA, "strength": 1.0}]
|
||||
|
||||
|
||||
def _analysis_case(scale: float) -> dict:
|
||||
rows = []
|
||||
for group in range(1, 7):
|
||||
row = {key: 0.0 for key in analyzer.base.METRIC_KEYS}
|
||||
for key in analyzer.DRIFT_KEYS:
|
||||
row[key] = float(group - 1) * scale
|
||||
rows.append(row)
|
||||
return {
|
||||
"end_trend": analyzer.base._trend(rows, analyzer.base.METRIC_KEYS),
|
||||
"boundary_metrics": [
|
||||
{"trajectory_flow_discontinuity": 0.1} for _ in range(5)
|
||||
],
|
||||
}
|
||||
|
||||
|
||||
def test_comparison_marks_a_clean_half_reduction_promising():
|
||||
result = analyzer._metric_comparison(_analysis_case(1.0), _analysis_case(0.5))
|
||||
assert result["screening_mean_reduction_percent"] == 50.0
|
||||
assert result["sharpness_not_worse"] is True
|
||||
assert result["gradient_not_worse"] is True
|
||||
assert result["numeric_promising"] is True
|
||||
@@ -0,0 +1,139 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import importlib.util
|
||||
from pathlib import Path
|
||||
import sys
|
||||
|
||||
import numpy as np
|
||||
import pytest
|
||||
|
||||
|
||||
TOOLS = Path(__file__).parents[1] / "tools"
|
||||
|
||||
|
||||
def _load(name: str, filename: str):
|
||||
path = TOOLS / filename
|
||||
spec = importlib.util.spec_from_file_location(name, path)
|
||||
assert spec is not None and spec.loader is not None
|
||||
module = importlib.util.module_from_spec(spec)
|
||||
sys.modules[name] = module
|
||||
spec.loader.exec_module(module)
|
||||
return module
|
||||
|
||||
|
||||
runner = _load("h3_issue13_r2_gate_runner", "issue13_r2_gate_runner.py")
|
||||
analyzer = _load("h3_issue13_r2_analyze", "issue13_r2_analyze.py")
|
||||
|
||||
|
||||
def _source_prompt() -> dict:
|
||||
return {
|
||||
"305": {
|
||||
"class_type": "H3ContinuumSamplerV37",
|
||||
"inputs": {
|
||||
"continuation_backend": "Standard",
|
||||
"generation_mode": "Full Run",
|
||||
"review_action": "Continue / Next",
|
||||
"guide": ["900", 0],
|
||||
"last_frame": ["901", 0],
|
||||
},
|
||||
},
|
||||
"188": {"inputs": {"value": "old"}},
|
||||
"153": {"inputs": {"scheduler": "old", "steps": 20, "denoise": 0.5}},
|
||||
"297": {"inputs": {"value": 0.3}},
|
||||
"306": {"inputs": {}},
|
||||
"191": {"inputs": {}},
|
||||
"249": {"inputs": {}},
|
||||
"150": {"inputs": {"enabled": True}},
|
||||
"286": {
|
||||
"inputs": {
|
||||
"lora_1": {"on": True, "lora": "turbo.safetensors", "strength": 1.0}
|
||||
}
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
def test_g1_configures_reported_six_by_ten_masked_av_baseline():
|
||||
prompt = runner.configure_prompt(
|
||||
_source_prompt(),
|
||||
case="g1_standard_6x10",
|
||||
output_prefix="video/test",
|
||||
seed=130013,
|
||||
steps=8,
|
||||
size=384,
|
||||
diagnostic_nonce=7,
|
||||
)
|
||||
sampler = prompt["305"]
|
||||
inputs = sampler["inputs"]
|
||||
assert sampler["class_type"] == "H3ContinuumMaskedPrefixR1Diagnostic"
|
||||
assert inputs["chunks"] == 6
|
||||
assert inputs["chunk_seconds"] == 10.0
|
||||
assert inputs["continuation_transport"] == "masked_av_prefix_22_v1"
|
||||
assert inputs["continuity"] == "Balanced — 22 frames"
|
||||
assert inputs["audio_continuity"] is True
|
||||
assert inputs["run_storage"] == "Off"
|
||||
assert "continuation_backend" not in inputs
|
||||
assert "guide" not in inputs
|
||||
assert "last_frame" not in inputs
|
||||
assert prompt["188"]["inputs"]["value"].count("\n---\n") == 5
|
||||
assert prompt["150"]["inputs"]["enabled"] is False
|
||||
assert prompt["286"]["inputs"]["lora_1"]["on"] is False
|
||||
assert prompt["306"]["inputs"]["video_seam"] == "Off"
|
||||
assert prompt["306"]["inputs"]["audio_seam"] == "Off"
|
||||
|
||||
|
||||
def test_g2_keeps_old_five_by_five_comparison_shape():
|
||||
prompt = runner.configure_prompt(
|
||||
_source_prompt(),
|
||||
case="g2_standard_5x5",
|
||||
output_prefix="video/test",
|
||||
seed=130013,
|
||||
steps=8,
|
||||
size=384,
|
||||
diagnostic_nonce=8,
|
||||
)
|
||||
inputs = prompt["305"]["inputs"]
|
||||
assert inputs["chunks"] == 5
|
||||
assert inputs["chunk_seconds"] == 5.0
|
||||
assert prompt["188"]["inputs"]["value"].count("\n---\n") == 4
|
||||
|
||||
|
||||
def test_diagnostic_payload_is_extracted_from_status_suffix():
|
||||
assert runner._diagnostic_from_status(
|
||||
'Production status\nV3.6-R1 diagnostic: {"transport":"masked_av_prefix_22_v1"}'
|
||||
) == {"transport": "masked_av_prefix_22_v1"}
|
||||
|
||||
|
||||
def test_decoded_metrics_include_local_sharpness():
|
||||
frame = np.zeros((32, 32, 3), dtype=np.uint8)
|
||||
frame[:, 16:] = 255
|
||||
metrics = analyzer._frame_metrics(frame)
|
||||
assert metrics["contrast_p95_p05"] == 1.0
|
||||
assert metrics["sharpness_laplacian_variance"] > 0.0
|
||||
assert metrics["gradient_mean"] > 0.0
|
||||
|
||||
|
||||
def test_latent_trend_requires_bit_exact_continuation_prefixes():
|
||||
diagnostic = {
|
||||
"sample_calls": [
|
||||
{"sample_number": 1, "output_tail": {"rms": 1.0, "std": 0.5}},
|
||||
{
|
||||
"sample_number": 2,
|
||||
"source_tail": {"rms": 1.0, "std": 0.5},
|
||||
"output_tail": {"rms": 1.2, "std": 0.7},
|
||||
},
|
||||
],
|
||||
"final_prefix_pairs": [
|
||||
{
|
||||
"bit_exact": True,
|
||||
"audio_bit_exact": True,
|
||||
"max_abs_diff": 0.0,
|
||||
"audio_max_abs_diff": 0.0,
|
||||
}
|
||||
],
|
||||
}
|
||||
result = analyzer._latent_trend(diagnostic)
|
||||
assert result["all_video_prefix_pairs_bit_exact"] is True
|
||||
assert result["all_audio_prefix_pairs_bit_exact"] is True
|
||||
trend = result["streams"]["output_tail"]["trend"]["rms"]
|
||||
assert trend["last_minus_first"] == pytest.approx(0.2)
|
||||
assert trend["increase_steps"] == 1
|
||||
@@ -1,59 +1,59 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import pytest
|
||||
|
||||
from ComfyUI_H3_Continuum_Join.conditioning import (
|
||||
conditioning_display_label,
|
||||
conditioning_mode_from_presence,
|
||||
)
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
("has_first", "has_last", "has_reference", "expected"),
|
||||
[
|
||||
(False, False, False, "T2VA + Continuation"),
|
||||
(True, False, False, "I2VA + Continuation"),
|
||||
(False, True, False, "Last Frame + Continuation"),
|
||||
(True, True, False, "FL2VA + Continuation"),
|
||||
(False, False, True, "Reference + Continuation"),
|
||||
(True, False, True, "Hybrid I2VA + Reference + Continuation"),
|
||||
(False, True, True, "Hybrid L2VA + Reference + Continuation"),
|
||||
(True, True, True, "Hybrid FL2VA + Reference + Continuation"),
|
||||
],
|
||||
)
|
||||
def test_conditioning_display_label_matrix(
|
||||
has_first: bool,
|
||||
has_last: bool,
|
||||
has_reference: bool,
|
||||
expected: str,
|
||||
) -> None:
|
||||
assert (
|
||||
conditioning_display_label(
|
||||
has_first=has_first,
|
||||
has_last=has_last,
|
||||
has_reference=has_reference,
|
||||
)
|
||||
== expected
|
||||
)
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
("has_first", "has_last"),
|
||||
[
|
||||
(True, False),
|
||||
(False, True),
|
||||
(True, True),
|
||||
],
|
||||
)
|
||||
def test_hybrid_display_does_not_change_internal_reference_mode(
|
||||
has_first: bool,
|
||||
has_last: bool,
|
||||
) -> None:
|
||||
assert (
|
||||
conditioning_mode_from_presence(
|
||||
has_first=has_first,
|
||||
has_last=has_last,
|
||||
has_reference=True,
|
||||
)
|
||||
== "reference"
|
||||
from __future__ import annotations
|
||||
|
||||
import pytest
|
||||
|
||||
from ComfyUI_H3_Continuum_Join.conditioning import (
|
||||
conditioning_display_label,
|
||||
conditioning_mode_from_presence,
|
||||
)
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
("has_first", "has_last", "has_reference", "expected"),
|
||||
[
|
||||
(False, False, False, "T2VA + Continuation"),
|
||||
(True, False, False, "I2VA + Continuation"),
|
||||
(False, True, False, "Last Frame + Continuation"),
|
||||
(True, True, False, "FL2VA + Continuation"),
|
||||
(False, False, True, "Reference + Continuation"),
|
||||
(True, False, True, "Hybrid I2VA + Reference + Continuation"),
|
||||
(False, True, True, "Hybrid L2VA + Reference + Continuation"),
|
||||
(True, True, True, "Hybrid FL2VA + Reference + Continuation"),
|
||||
],
|
||||
)
|
||||
def test_conditioning_display_label_matrix(
|
||||
has_first: bool,
|
||||
has_last: bool,
|
||||
has_reference: bool,
|
||||
expected: str,
|
||||
) -> None:
|
||||
assert (
|
||||
conditioning_display_label(
|
||||
has_first=has_first,
|
||||
has_last=has_last,
|
||||
has_reference=has_reference,
|
||||
)
|
||||
== expected
|
||||
)
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
("has_first", "has_last"),
|
||||
[
|
||||
(True, False),
|
||||
(False, True),
|
||||
(True, True),
|
||||
],
|
||||
)
|
||||
def test_hybrid_display_does_not_change_internal_reference_mode(
|
||||
has_first: bool,
|
||||
has_last: bool,
|
||||
) -> None:
|
||||
assert (
|
||||
conditioning_mode_from_presence(
|
||||
has_first=has_first,
|
||||
has_last=has_last,
|
||||
has_reference=True,
|
||||
)
|
||||
== "reference"
|
||||
)
|
||||
@@ -581,5 +581,5 @@ def test_v35_assembler_is_registered_without_replacing_v34():
|
||||
H3ContinuumAssembleSeamV35
|
||||
)
|
||||
assert NODE_DISPLAY_NAME_MAPPINGS["H3ContinuumAssembleSeamV35"] == (
|
||||
"H3 Continuum Assemble + Seam V3.5"
|
||||
"H3 Continuum Finalize"
|
||||
)
|
||||
|
||||
@@ -6,7 +6,7 @@ import tomllib
|
||||
|
||||
|
||||
ROOT = Path(__file__).resolve().parents[1]
|
||||
EXPECTED_VERSION = "3.7.0"
|
||||
EXPECTED_VERSION = "3.8.0"
|
||||
|
||||
|
||||
def test_v35_release_metadata_is_consistent():
|
||||
|
||||
@@ -0,0 +1,113 @@
|
||||
"""Run Storage identity must not track Core's normal loading lifecycle."""
|
||||
import copy
|
||||
import json
|
||||
import os
|
||||
from pathlib import Path
|
||||
import subprocess
|
||||
import sys
|
||||
from types import SimpleNamespace
|
||||
|
||||
import torch
|
||||
|
||||
from ComfyUI_H3_Continuum_Join.run_storage import (
|
||||
_hash, _module_signature, _observe, _video_vae_signature,
|
||||
)
|
||||
|
||||
|
||||
def vae_fixture():
|
||||
module = torch.nn.Module()
|
||||
module.encoder = torch.nn.Linear(3, 4, bias=False)
|
||||
module.decoder = torch.nn.Module()
|
||||
module.decoder.register_parameter('scale1', torch.nn.Parameter(torch.tensor([0.123456, 0.654321, 1.234567])))
|
||||
module.decoder.proj = torch.nn.Linear(4, 3, bias=False)
|
||||
module.decoder.scale1_comfy_model_dtype = torch.float16
|
||||
return SimpleNamespace(first_stage_model=module, patcher=None, vae_dtype=torch.float16)
|
||||
|
||||
|
||||
def test_video_vae_identity_survives_core_lazy_cast_without_mutation():
|
||||
vae = vae_fixture()
|
||||
before_tensors = {n: p.detach().clone() for n, p in vae.first_stage_model.named_parameters()}
|
||||
rng = torch.random.get_rng_state().clone()
|
||||
cold, cold_safe = _video_vae_signature(vae, required=True)
|
||||
assert cold_safe
|
||||
assert torch.equal(rng, torch.random.get_rng_state())
|
||||
assert all(torch.equal(before_tensors[n], p) for n, p in vae.first_stage_model.named_parameters())
|
||||
assert vae.first_stage_model.decoder.scale1.dtype == torch.float32
|
||||
# Same assignment as Core DynamicVRAM load, not a Continuum mutation.
|
||||
vae.first_stage_model.decoder.scale1 = torch.nn.Parameter(vae.first_stage_model.decoder.scale1.detach().half())
|
||||
warm, warm_safe = _video_vae_signature(vae, required=True)
|
||||
assert warm_safe and cold == warm
|
||||
assert not torch.cuda.is_initialized()
|
||||
|
||||
|
||||
def test_video_vae_real_weight_change_is_still_detected():
|
||||
vae = vae_fixture()
|
||||
before, _ = _video_vae_signature(vae, required=True)
|
||||
with torch.no_grad():
|
||||
vae.first_stage_model.decoder.scale1.add_(0.25)
|
||||
after, _ = _video_vae_signature(vae, required=True)
|
||||
assert before != after
|
||||
|
||||
|
||||
def test_declared_precision_change_is_not_ignored():
|
||||
vae = vae_fixture()
|
||||
before, _ = _video_vae_signature(vae, required=True)
|
||||
vae.first_stage_model.decoder.scale1_comfy_model_dtype = torch.bfloat16
|
||||
after, _ = _video_vae_signature(vae, required=True)
|
||||
assert before != after
|
||||
|
||||
|
||||
def test_no_core_dtype_metadata_preserves_original_probe_contract():
|
||||
module = torch.nn.Linear(3, 2, bias=False)
|
||||
before, safe = _module_signature(module)
|
||||
assert safe and before['weight_probe'][0]['dtype'] == 'torch.float32'
|
||||
after, safe = _module_signature(copy.deepcopy(module).half())
|
||||
assert safe and before != after
|
||||
|
||||
|
||||
def test_set_identity_is_complete_order_independent_and_typed():
|
||||
keys = {f'layer.{i}.lora_A.weight' for i in range(500)}
|
||||
before = copy.deepcopy(keys)
|
||||
a, safe = _observe(keys)
|
||||
b, other_safe = _observe(set(reversed(sorted(keys))))
|
||||
assert safe and other_safe and a == b and keys == before
|
||||
assert len(a['items']) == 500
|
||||
changed, _ = _observe(keys | {'different.weight'})
|
||||
frozen, _ = _observe(frozenset(keys))
|
||||
assert a != changed and a != frozen
|
||||
assert _observe([1, 2])[0] != _observe([2, 1])[0]
|
||||
|
||||
|
||||
def test_adapter_weight_and_strength_changes_are_not_hidden_by_set_fix():
|
||||
adapter = SimpleNamespace(loaded_keys={'b', 'a'}, weights=[torch.arange(8.), 8.])
|
||||
before, safe = _observe([(1., adapter)])
|
||||
assert safe
|
||||
adapter.weights[0][0] += 1
|
||||
after, safe = _observe([(1., adapter)])
|
||||
assert safe and before != after
|
||||
assert after != _observe([(0.5, adapter)])[0]
|
||||
|
||||
|
||||
def test_lora_set_identity_matches_across_python_hash_seeds():
|
||||
root = str(Path(__file__).resolve().parents[1])
|
||||
code = f'''
|
||||
import sys, types, json
|
||||
p = types.ModuleType("ComfyUI_H3_Continuum_Join")
|
||||
p.__path__ = [{root!r}]
|
||||
sys.modules[p.__name__] = p
|
||||
from ComfyUI_H3_Continuum_Join.run_storage import _observe, _hash
|
||||
from types import SimpleNamespace
|
||||
import torch
|
||||
obj = SimpleNamespace(loaded_keys={{f"layer.{{i}}.lora_A.weight" for i in range(500)}}, weights=[torch.arange(8.), 8.])
|
||||
value, safe = _observe(obj)
|
||||
assert safe and not torch.cuda.is_initialized()
|
||||
print("RESULT:" + json.dumps({{"sha": _hash(value), "safe": safe}}))
|
||||
'''
|
||||
results = []
|
||||
for seed in ('1', '777'):
|
||||
env = dict(os.environ, PYTHONHASHSEED=seed)
|
||||
run = subprocess.run([sys.executable, '-B', '-c', code], env=env, capture_output=True, text=True, timeout=30, check=True)
|
||||
records = [line[7:] for line in run.stdout.splitlines() if line.startswith('RESULT:')]
|
||||
assert len(records) == 1, run.stdout
|
||||
results.append(json.loads(records[0]))
|
||||
assert results[0] == results[1]
|
||||
@@ -0,0 +1,50 @@
|
||||
"""Real on-disk provenance must not bypass a newly requested reroll."""
|
||||
import pytest
|
||||
import importlib.util
|
||||
from pathlib import Path
|
||||
|
||||
_spec = importlib.util.spec_from_file_location(
|
||||
"review_storage_fixtures", Path(__file__).with_name("test_v38_review_run_storage.py"))
|
||||
_fixtures = importlib.util.module_from_spec(_spec)
|
||||
_spec.loader.exec_module(_fixtures)
|
||||
_contract, _controller, _persist = _fixtures._contract, _fixtures._controller, _fixtures._persist
|
||||
|
||||
|
||||
@pytest.mark.parametrize("boundary", [1, 2, 3, 4, 5, 6])
|
||||
def test_new_reroll_only_reuses_chunks_before_boundary(tmp_path, boundary):
|
||||
old = _persist(tmp_path, _contract(chunks=6), prefix=6, review_unit=(6, 6),
|
||||
updated_utc="2026-09-07T00:00:00+00:00")
|
||||
requested = _contract(chunks=6, boundary=boundary, nonce=1)
|
||||
current = _controller(tmp_path, requested)
|
||||
entries, records = current._valid_provenance_prefix(
|
||||
old.manifest, current_contract=requested, enforce_sampling_contract=True)
|
||||
assert len(entries) == len(records) == boundary - 1
|
||||
assert len(old.manifest["chunks"]) == 6
|
||||
|
||||
|
||||
def test_same_nonce_interrupted_prefix_can_resume(tmp_path):
|
||||
contract = _contract(chunks=6, boundary=2, nonce=1)
|
||||
old = _persist(tmp_path, contract, prefix=3, review_unit=(3, 3),
|
||||
updated_utc="2026-09-07T00:00:00+00:00")
|
||||
current = _controller(tmp_path, contract)
|
||||
entries, records = current._valid_provenance_prefix(
|
||||
old.manifest, current_contract=contract, enforce_sampling_contract=True)
|
||||
assert len(entries) == len(records) == 3
|
||||
|
||||
|
||||
def test_completed_same_contract_still_reuses_all(tmp_path):
|
||||
contract = _contract(chunks=2)
|
||||
old = _persist(tmp_path, contract, prefix=2, review_unit=(2, 2),
|
||||
updated_utc="2026-09-07T00:00:00+00:00")
|
||||
current = _controller(tmp_path, contract)
|
||||
assert len(current._valid_provenance_prefix(
|
||||
old.manifest, current_contract=contract, enforce_sampling_contract=True)[0]) == 2
|
||||
|
||||
|
||||
def test_smart_retry_new_nonce_does_not_reuse_previous_take(tmp_path):
|
||||
old = _persist(tmp_path, _contract(chunks=3, boundary=2, nonce=1),
|
||||
prefix=2, review_unit=(2, 2), updated_utc="2026-09-07T00:00:00+00:00")
|
||||
contract = _contract(chunks=3, boundary=2, nonce=2)
|
||||
current = _controller(tmp_path, contract)
|
||||
assert len(current._valid_provenance_prefix(
|
||||
old.manifest, current_contract=contract, enforce_sampling_contract=True)[0]) == 1
|
||||
@@ -1,183 +1,183 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from types import SimpleNamespace
|
||||
|
||||
import torch
|
||||
|
||||
from ComfyUI_H3_Continuum_Join.v2.sequence import (
|
||||
_split_terminal_merged_latents,
|
||||
_terminal_pair_contract,
|
||||
)
|
||||
from ComfyUI_H3_Continuum_Join.tests.terminal_merge_diagnostics import (
|
||||
DiagnosticCapture,
|
||||
first_divergent_stage,
|
||||
tensor_difference,
|
||||
tensor_fingerprint,
|
||||
)
|
||||
|
||||
|
||||
def _capture_all_stages(*, sampled_offset: float = 0.0) -> DiagnosticCapture:
|
||||
capture = DiagnosticCapture()
|
||||
capture.capture_pre_sampler(
|
||||
physical_frames=243,
|
||||
seed=42,
|
||||
conditioning=[[torch.tensor([1.0]), {"minimax_frame_count": 243}]],
|
||||
latent={"video": torch.zeros(1, 24, 72, 2, 2)},
|
||||
noise=torch.arange(8, dtype=torch.float32),
|
||||
keyframes=(0, 242),
|
||||
qwen_images=("first", "last"),
|
||||
minimax_refs=None,
|
||||
)
|
||||
layout = SimpleNamespace(
|
||||
signature=(1, 2, 3),
|
||||
segments=(("target_video", 0, 72),),
|
||||
position_ids=torch.arange(12, dtype=torch.float32).reshape(6, 2),
|
||||
)
|
||||
capture.capture_first_model_call(
|
||||
minimax_payload={
|
||||
"layout": layout,
|
||||
"cond_video_latents": torch.ones(1, 24, 2, 2, 2),
|
||||
"target_video_shape": (1, 24, 72, 2, 2),
|
||||
"target_audio_shape": (1, 32, 2, 405),
|
||||
},
|
||||
transformer_options={"patches": {}},
|
||||
)
|
||||
video = torch.full((1, 24, 72, 2, 2), sampled_offset)
|
||||
audio = torch.zeros(1, 32, 2, 405)
|
||||
capture.capture_sampled_physical_av(video=video, audio=audio)
|
||||
capture.capture_split_recombine(
|
||||
physical_video=video,
|
||||
physical_audio=audio,
|
||||
recombined_video=video.clone(),
|
||||
recombined_audio=audio.clone(),
|
||||
)
|
||||
decoded = torch.zeros(243, 2, 2, 3)
|
||||
capture.capture_decode_assembly(
|
||||
physical_decoded=decoded,
|
||||
assembled_decoded=decoded.clone(),
|
||||
)
|
||||
return capture
|
||||
|
||||
|
||||
def test_tensor_fingerprint_is_deterministic_and_dtype_sensitive():
|
||||
value = torch.arange(12, dtype=torch.float32).reshape(3, 4)
|
||||
first = tensor_fingerprint(value)
|
||||
second = tensor_fingerprint(value.clone())
|
||||
|
||||
assert first == second
|
||||
assert first.shape == (3, 4)
|
||||
assert first.dtype == "torch.float32"
|
||||
assert first.sha256 != tensor_fingerprint(value.to(torch.float64)).sha256
|
||||
|
||||
|
||||
def test_tensor_difference_keeps_hash_mismatch_distinct_from_allclose():
|
||||
core = torch.tensor([1.0], dtype=torch.float32)
|
||||
continuum = torch.tensor([1.0 + 1.0e-7], dtype=torch.float32)
|
||||
|
||||
difference = tensor_difference(core, continuum)
|
||||
|
||||
assert difference.bit_exact is False
|
||||
assert difference.allclose is True
|
||||
assert difference.max_abs_diff is not None
|
||||
assert difference.max_abs_diff > 0.0
|
||||
assert difference.mean_abs_diff == difference.max_abs_diff
|
||||
|
||||
|
||||
def test_pre_sampler_capture_includes_initial_noise():
|
||||
core = _capture_all_stages()
|
||||
continuum = _capture_all_stages()
|
||||
assert first_divergent_stage(core, continuum) is None
|
||||
|
||||
changed = DiagnosticCapture()
|
||||
changed.capture_pre_sampler(
|
||||
physical_frames=243,
|
||||
seed=42,
|
||||
conditioning=[[torch.tensor([1.0]), {"minimax_frame_count": 243}]],
|
||||
latent={"video": torch.zeros(1, 24, 72, 2, 2)},
|
||||
noise=torch.arange(8, dtype=torch.float32) + 1.0,
|
||||
keyframes=(0, 242),
|
||||
qwen_images=("first", "last"),
|
||||
minimax_refs=None,
|
||||
)
|
||||
|
||||
assert first_divergent_stage(core, changed) == "A_pre_sampler"
|
||||
|
||||
|
||||
def test_first_model_call_capture_detects_packed_layout_difference():
|
||||
core = DiagnosticCapture()
|
||||
continuum = DiagnosticCapture()
|
||||
shared = dict(
|
||||
physical_frames=243,
|
||||
seed=42,
|
||||
conditioning=[torch.zeros(1)],
|
||||
latent=torch.zeros(1),
|
||||
noise=torch.zeros(1),
|
||||
)
|
||||
core.capture_pre_sampler(**shared)
|
||||
continuum.capture_pre_sampler(**shared)
|
||||
|
||||
core_layout = SimpleNamespace(
|
||||
signature=(1, 2),
|
||||
segments=(("target_video", 0, 72),),
|
||||
position_ids=torch.zeros(4, 2),
|
||||
)
|
||||
continuum_layout = SimpleNamespace(
|
||||
signature=(1, 2),
|
||||
segments=(("target_video", 0, 72),),
|
||||
position_ids=torch.ones(4, 2),
|
||||
)
|
||||
core.capture_first_model_call(
|
||||
minimax_payload={"layout": core_layout},
|
||||
transformer_options={},
|
||||
)
|
||||
continuum.capture_first_model_call(
|
||||
minimax_payload={"layout": continuum_layout},
|
||||
transformer_options={},
|
||||
)
|
||||
|
||||
assert first_divergent_stage(core, continuum) == "B_first_model_call"
|
||||
|
||||
|
||||
def test_first_divergent_stage_uses_pipeline_order():
|
||||
core = _capture_all_stages(sampled_offset=0.0)
|
||||
continuum = _capture_all_stages(sampled_offset=1.0)
|
||||
|
||||
assert first_divergent_stage(core, continuum) == "C_sampled_physical_av"
|
||||
|
||||
|
||||
def test_terminal_split_recombine_is_bit_exact():
|
||||
contract = _terminal_pair_contract(initial_pair=True, chunk_seconds=5.0)
|
||||
video = torch.arange(
|
||||
1 * 24 * contract["video_slices"][-1][1] * 2 * 2,
|
||||
dtype=torch.float32,
|
||||
).reshape(1, 24, contract["video_slices"][-1][1], 2, 2)
|
||||
audio = torch.arange(
|
||||
1 * 32 * 2 * contract["audio_slices"][-1][1],
|
||||
dtype=torch.float32,
|
||||
).reshape(1, 32, 2, contract["audio_slices"][-1][1])
|
||||
|
||||
(video_1, audio_1), (video_2, audio_2) = _split_terminal_merged_latents(
|
||||
video,
|
||||
audio,
|
||||
contract,
|
||||
)
|
||||
video_overlap = contract["video_slices"][0][1] - contract["video_slices"][1][0]
|
||||
audio_overlap = contract["audio_slices"][0][1] - contract["audio_slices"][1][0]
|
||||
recombined_video = torch.cat((video_1, video_2[:, :, video_overlap:]), dim=2)
|
||||
recombined_audio = torch.cat((audio_1, audio_2[..., audio_overlap:]), dim=-1)
|
||||
|
||||
assert contract["physical_frames"] == 243
|
||||
assert contract["logical_frames"] == (124, 141)
|
||||
assert torch.equal(recombined_video, video)
|
||||
assert torch.equal(recombined_audio, audio)
|
||||
assert tensor_difference(video, recombined_video).bit_exact is True
|
||||
assert tensor_difference(audio, recombined_audio).bit_exact is True
|
||||
|
||||
capture = DiagnosticCapture()
|
||||
stage = capture.capture_split_recombine(
|
||||
physical_video=video,
|
||||
physical_audio=audio,
|
||||
recombined_video=recombined_video,
|
||||
recombined_audio=recombined_audio,
|
||||
)
|
||||
assert stage.name == "D_split_recombine"
|
||||
from __future__ import annotations
|
||||
|
||||
from types import SimpleNamespace
|
||||
|
||||
import torch
|
||||
|
||||
from ComfyUI_H3_Continuum_Join.v2.sequence import (
|
||||
_split_terminal_merged_latents,
|
||||
_terminal_pair_contract,
|
||||
)
|
||||
from ComfyUI_H3_Continuum_Join.tests.terminal_merge_diagnostics import (
|
||||
DiagnosticCapture,
|
||||
first_divergent_stage,
|
||||
tensor_difference,
|
||||
tensor_fingerprint,
|
||||
)
|
||||
|
||||
|
||||
def _capture_all_stages(*, sampled_offset: float = 0.0) -> DiagnosticCapture:
|
||||
capture = DiagnosticCapture()
|
||||
capture.capture_pre_sampler(
|
||||
physical_frames=243,
|
||||
seed=42,
|
||||
conditioning=[[torch.tensor([1.0]), {"minimax_frame_count": 243}]],
|
||||
latent={"video": torch.zeros(1, 24, 72, 2, 2)},
|
||||
noise=torch.arange(8, dtype=torch.float32),
|
||||
keyframes=(0, 242),
|
||||
qwen_images=("first", "last"),
|
||||
minimax_refs=None,
|
||||
)
|
||||
layout = SimpleNamespace(
|
||||
signature=(1, 2, 3),
|
||||
segments=(("target_video", 0, 72),),
|
||||
position_ids=torch.arange(12, dtype=torch.float32).reshape(6, 2),
|
||||
)
|
||||
capture.capture_first_model_call(
|
||||
minimax_payload={
|
||||
"layout": layout,
|
||||
"cond_video_latents": torch.ones(1, 24, 2, 2, 2),
|
||||
"target_video_shape": (1, 24, 72, 2, 2),
|
||||
"target_audio_shape": (1, 32, 2, 405),
|
||||
},
|
||||
transformer_options={"patches": {}},
|
||||
)
|
||||
video = torch.full((1, 24, 72, 2, 2), sampled_offset)
|
||||
audio = torch.zeros(1, 32, 2, 405)
|
||||
capture.capture_sampled_physical_av(video=video, audio=audio)
|
||||
capture.capture_split_recombine(
|
||||
physical_video=video,
|
||||
physical_audio=audio,
|
||||
recombined_video=video.clone(),
|
||||
recombined_audio=audio.clone(),
|
||||
)
|
||||
decoded = torch.zeros(243, 2, 2, 3)
|
||||
capture.capture_decode_assembly(
|
||||
physical_decoded=decoded,
|
||||
assembled_decoded=decoded.clone(),
|
||||
)
|
||||
return capture
|
||||
|
||||
|
||||
def test_tensor_fingerprint_is_deterministic_and_dtype_sensitive():
|
||||
value = torch.arange(12, dtype=torch.float32).reshape(3, 4)
|
||||
first = tensor_fingerprint(value)
|
||||
second = tensor_fingerprint(value.clone())
|
||||
|
||||
assert first == second
|
||||
assert first.shape == (3, 4)
|
||||
assert first.dtype == "torch.float32"
|
||||
assert first.sha256 != tensor_fingerprint(value.to(torch.float64)).sha256
|
||||
|
||||
|
||||
def test_tensor_difference_keeps_hash_mismatch_distinct_from_allclose():
|
||||
core = torch.tensor([1.0], dtype=torch.float32)
|
||||
continuum = torch.tensor([1.0 + 1.0e-7], dtype=torch.float32)
|
||||
|
||||
difference = tensor_difference(core, continuum)
|
||||
|
||||
assert difference.bit_exact is False
|
||||
assert difference.allclose is True
|
||||
assert difference.max_abs_diff is not None
|
||||
assert difference.max_abs_diff > 0.0
|
||||
assert difference.mean_abs_diff == difference.max_abs_diff
|
||||
|
||||
|
||||
def test_pre_sampler_capture_includes_initial_noise():
|
||||
core = _capture_all_stages()
|
||||
continuum = _capture_all_stages()
|
||||
assert first_divergent_stage(core, continuum) is None
|
||||
|
||||
changed = DiagnosticCapture()
|
||||
changed.capture_pre_sampler(
|
||||
physical_frames=243,
|
||||
seed=42,
|
||||
conditioning=[[torch.tensor([1.0]), {"minimax_frame_count": 243}]],
|
||||
latent={"video": torch.zeros(1, 24, 72, 2, 2)},
|
||||
noise=torch.arange(8, dtype=torch.float32) + 1.0,
|
||||
keyframes=(0, 242),
|
||||
qwen_images=("first", "last"),
|
||||
minimax_refs=None,
|
||||
)
|
||||
|
||||
assert first_divergent_stage(core, changed) == "A_pre_sampler"
|
||||
|
||||
|
||||
def test_first_model_call_capture_detects_packed_layout_difference():
|
||||
core = DiagnosticCapture()
|
||||
continuum = DiagnosticCapture()
|
||||
shared = dict(
|
||||
physical_frames=243,
|
||||
seed=42,
|
||||
conditioning=[torch.zeros(1)],
|
||||
latent=torch.zeros(1),
|
||||
noise=torch.zeros(1),
|
||||
)
|
||||
core.capture_pre_sampler(**shared)
|
||||
continuum.capture_pre_sampler(**shared)
|
||||
|
||||
core_layout = SimpleNamespace(
|
||||
signature=(1, 2),
|
||||
segments=(("target_video", 0, 72),),
|
||||
position_ids=torch.zeros(4, 2),
|
||||
)
|
||||
continuum_layout = SimpleNamespace(
|
||||
signature=(1, 2),
|
||||
segments=(("target_video", 0, 72),),
|
||||
position_ids=torch.ones(4, 2),
|
||||
)
|
||||
core.capture_first_model_call(
|
||||
minimax_payload={"layout": core_layout},
|
||||
transformer_options={},
|
||||
)
|
||||
continuum.capture_first_model_call(
|
||||
minimax_payload={"layout": continuum_layout},
|
||||
transformer_options={},
|
||||
)
|
||||
|
||||
assert first_divergent_stage(core, continuum) == "B_first_model_call"
|
||||
|
||||
|
||||
def test_first_divergent_stage_uses_pipeline_order():
|
||||
core = _capture_all_stages(sampled_offset=0.0)
|
||||
continuum = _capture_all_stages(sampled_offset=1.0)
|
||||
|
||||
assert first_divergent_stage(core, continuum) == "C_sampled_physical_av"
|
||||
|
||||
|
||||
def test_terminal_split_recombine_is_bit_exact():
|
||||
contract = _terminal_pair_contract(initial_pair=True, chunk_seconds=5.0)
|
||||
video = torch.arange(
|
||||
1 * 24 * contract["video_slices"][-1][1] * 2 * 2,
|
||||
dtype=torch.float32,
|
||||
).reshape(1, 24, contract["video_slices"][-1][1], 2, 2)
|
||||
audio = torch.arange(
|
||||
1 * 32 * 2 * contract["audio_slices"][-1][1],
|
||||
dtype=torch.float32,
|
||||
).reshape(1, 32, 2, contract["audio_slices"][-1][1])
|
||||
|
||||
(video_1, audio_1), (video_2, audio_2) = _split_terminal_merged_latents(
|
||||
video,
|
||||
audio,
|
||||
contract,
|
||||
)
|
||||
video_overlap = contract["video_slices"][0][1] - contract["video_slices"][1][0]
|
||||
audio_overlap = contract["audio_slices"][0][1] - contract["audio_slices"][1][0]
|
||||
recombined_video = torch.cat((video_1, video_2[:, :, video_overlap:]), dim=2)
|
||||
recombined_audio = torch.cat((audio_1, audio_2[..., audio_overlap:]), dim=-1)
|
||||
|
||||
assert contract["physical_frames"] == 243
|
||||
assert contract["logical_frames"] == (124, 141)
|
||||
assert torch.equal(recombined_video, video)
|
||||
assert torch.equal(recombined_audio, audio)
|
||||
assert tensor_difference(video, recombined_video).bit_exact is True
|
||||
assert tensor_difference(audio, recombined_audio).bit_exact is True
|
||||
|
||||
capture = DiagnosticCapture()
|
||||
stage = capture.capture_split_recombine(
|
||||
physical_video=video,
|
||||
physical_audio=audio,
|
||||
recombined_video=recombined_video,
|
||||
recombined_audio=recombined_audio,
|
||||
)
|
||||
assert stage.name == "D_split_recombine"
|
||||
|
||||
@@ -83,12 +83,8 @@ def test_v33_unifies_optional_timeline_video_and_keeps_v324_schema():
|
||||
|
||||
from ComfyUI_H3_Continuum_Join import nodes as root_nodes
|
||||
|
||||
assert root_nodes.NODE_DISPLAY_NAME_MAPPINGS["H3ContinuumSamplerTimelineVideo"] == (
|
||||
"[Legacy] H3 Continuum Sampler V3.3"
|
||||
)
|
||||
assert root_nodes.NODE_DISPLAY_NAME_MAPPINGS["H3ContinuumSamplerProduction"] == (
|
||||
"[Legacy] H3 Continuum Sampler V3.2.4"
|
||||
)
|
||||
assert "H3ContinuumSamplerTimelineVideo" not in root_nodes.NODE_CLASS_MAPPINGS
|
||||
assert "H3ContinuumSamplerProduction" not in root_nodes.NODE_CLASS_MAPPINGS
|
||||
|
||||
|
||||
def test_timeline_node_without_video_delegates_to_stable_engine(monkeypatch):
|
||||
|
||||
@@ -1,120 +1,120 @@
|
||||
from pathlib import Path
|
||||
|
||||
import pytest
|
||||
|
||||
from ComfyUI_H3_Continuum_Join.constants import PROMPT_FORMAT_OPTIONS
|
||||
from ComfyUI_H3_Continuum_Join.v2.nodes import (
|
||||
H3ContinuumAdvanced,
|
||||
H3ContinuumClipOverrides,
|
||||
H3ContinuumResult,
|
||||
H3ContinuumSampler,
|
||||
H3ContinuumSamplerV2,
|
||||
NODE_CLASS_MAPPINGS,
|
||||
)
|
||||
from ComfyUI_H3_Continuum_Join.v2.prompts import PromptPlanError
|
||||
|
||||
|
||||
ROOT = Path(__file__).resolve().parents[1]
|
||||
|
||||
|
||||
def test_v217_registers_static_facade_and_preserves_legacy_sampler():
|
||||
assert NODE_CLASS_MAPPINGS["H3ContinuumSampler"] is H3ContinuumSampler
|
||||
assert NODE_CLASS_MAPPINGS["H3ContinuumSamplerV2"] is H3ContinuumSamplerV2
|
||||
assert NODE_CLASS_MAPPINGS["H3ContinuumClipOverrides"] is H3ContinuumClipOverrides
|
||||
assert NODE_CLASS_MAPPINGS["H3ContinuumAdvanced"] is H3ContinuumAdvanced
|
||||
assert NODE_CLASS_MAPPINGS["H3ContinuumResult"] is H3ContinuumResult
|
||||
|
||||
|
||||
def test_v217_facade_schema_is_static_and_compact():
|
||||
schema = H3ContinuumSampler.INPUT_TYPES()
|
||||
required = schema["required"]
|
||||
optional = schema["optional"]
|
||||
|
||||
assert "sequence_prompt" in required
|
||||
assert required["sequence_prompt"][1]["forceInput"] is True
|
||||
assert "prompt_script" not in required
|
||||
assert "prompt_overrides" in optional
|
||||
assert "advanced" in optional
|
||||
assert not any(name.startswith("clip_") for name in required | optional)
|
||||
assert set(H3ContinuumSampler.RETURN_NAMES) == {"images", "audio", "result"}
|
||||
|
||||
|
||||
def test_v217_pack_nodes_have_no_dynamic_clip_sockets():
|
||||
clip_schema = H3ContinuumClipOverrides.INPUT_TYPES()["required"]
|
||||
assert set(clip_schema) == {"prompt_mode", "override_script"}
|
||||
assert clip_schema["override_script"][1]["forceInput"] is True
|
||||
|
||||
advanced = H3ContinuumAdvanced.INPUT_TYPES()
|
||||
assert set(advanced["optional"]) == {
|
||||
"last_frame",
|
||||
"session",
|
||||
"initial_state",
|
||||
"prompt_plan",
|
||||
}
|
||||
|
||||
|
||||
def test_v217_facade_delegates_to_legacy_core(monkeypatch):
|
||||
captured = {}
|
||||
|
||||
def fake_run(_self, **kwargs):
|
||||
captured.update(kwargs)
|
||||
return "images", "audio", "state", "session", "report"
|
||||
|
||||
monkeypatch.setattr(H3ContinuumSamplerV2, "run", fake_run)
|
||||
facade = H3ContinuumSampler()
|
||||
result = facade.run(
|
||||
model="model",
|
||||
clip="clip",
|
||||
video_vae="video_vae",
|
||||
audio_vae="audio_vae",
|
||||
sampler="sampler",
|
||||
sigmas="sigmas",
|
||||
sequence_prompt="base prompt",
|
||||
prompt_mode=PROMPT_FORMAT_OPTIONS[0],
|
||||
chunks=3,
|
||||
chunk_seconds=5.0,
|
||||
width=1344,
|
||||
height=768,
|
||||
continuity="Balanced - 22 frames",
|
||||
base_seed=123,
|
||||
seam_correction="Auto",
|
||||
)
|
||||
|
||||
assert result == (
|
||||
"images",
|
||||
"audio",
|
||||
{"last_state": "state", "session": "session", "report": "report"},
|
||||
)
|
||||
assert captured["prompt_script"] == "base prompt"
|
||||
assert captured["sequence_prompt"] == "base prompt"
|
||||
assert captured["audio_continuity"] is True
|
||||
assert captured["show_preview"] is True
|
||||
|
||||
|
||||
def test_v217_facade_passes_only_sparse_override_clips(monkeypatch):
|
||||
captured = {}
|
||||
|
||||
def fake_run(_self, **kwargs):
|
||||
captured.update(kwargs)
|
||||
return "images", "audio", "state", "session", "report"
|
||||
|
||||
monkeypatch.setattr(H3ContinuumSamplerV2, "run", fake_run)
|
||||
pack = H3ContinuumClipOverrides().build(
|
||||
PROMPT_FORMAT_OPTIONS[0],
|
||||
"[Clip 2]\nclose-up\n\n[Clip 5]\nfinish naturally",
|
||||
)[0]
|
||||
H3ContinuumSampler().run(
|
||||
model="model", clip="clip", video_vae="video_vae", audio_vae="audio_vae",
|
||||
sampler="sampler", sigmas="sigmas", sequence_prompt="base",
|
||||
prompt_mode=PROMPT_FORMAT_OPTIONS[0], chunks=5, chunk_seconds=5.0,
|
||||
width=1344, height=768, continuity="Balanced - 22 frames", base_seed=123,
|
||||
seam_correction="Auto", prompt_overrides=pack,
|
||||
)
|
||||
assert captured["clip_2_prompt"] == "close-up"
|
||||
assert captured["clip_5_prompt"] == "finish naturally"
|
||||
assert not any(f"clip_{index}_prompt" in captured for index in (1, 3, 4))
|
||||
|
||||
|
||||
from pathlib import Path
|
||||
|
||||
import pytest
|
||||
|
||||
from ComfyUI_H3_Continuum_Join.constants import PROMPT_FORMAT_OPTIONS
|
||||
from ComfyUI_H3_Continuum_Join.v2.nodes import (
|
||||
H3ContinuumAdvanced,
|
||||
H3ContinuumClipOverrides,
|
||||
H3ContinuumResult,
|
||||
H3ContinuumSampler,
|
||||
H3ContinuumSamplerV2,
|
||||
NODE_CLASS_MAPPINGS,
|
||||
)
|
||||
from ComfyUI_H3_Continuum_Join.v2.prompts import PromptPlanError
|
||||
|
||||
|
||||
ROOT = Path(__file__).resolve().parents[1]
|
||||
|
||||
|
||||
def test_v217_registers_static_facade_and_preserves_legacy_sampler():
|
||||
assert NODE_CLASS_MAPPINGS["H3ContinuumSampler"] is H3ContinuumSampler
|
||||
assert NODE_CLASS_MAPPINGS["H3ContinuumSamplerV2"] is H3ContinuumSamplerV2
|
||||
assert NODE_CLASS_MAPPINGS["H3ContinuumClipOverrides"] is H3ContinuumClipOverrides
|
||||
assert NODE_CLASS_MAPPINGS["H3ContinuumAdvanced"] is H3ContinuumAdvanced
|
||||
assert NODE_CLASS_MAPPINGS["H3ContinuumResult"] is H3ContinuumResult
|
||||
|
||||
|
||||
def test_v217_facade_schema_is_static_and_compact():
|
||||
schema = H3ContinuumSampler.INPUT_TYPES()
|
||||
required = schema["required"]
|
||||
optional = schema["optional"]
|
||||
|
||||
assert "sequence_prompt" in required
|
||||
assert required["sequence_prompt"][1]["forceInput"] is True
|
||||
assert "prompt_script" not in required
|
||||
assert "prompt_overrides" in optional
|
||||
assert "advanced" in optional
|
||||
assert not any(name.startswith("clip_") for name in required | optional)
|
||||
assert set(H3ContinuumSampler.RETURN_NAMES) == {"images", "audio", "result"}
|
||||
|
||||
|
||||
def test_v217_pack_nodes_have_no_dynamic_clip_sockets():
|
||||
clip_schema = H3ContinuumClipOverrides.INPUT_TYPES()["required"]
|
||||
assert set(clip_schema) == {"prompt_mode", "override_script"}
|
||||
assert clip_schema["override_script"][1]["forceInput"] is True
|
||||
|
||||
advanced = H3ContinuumAdvanced.INPUT_TYPES()
|
||||
assert set(advanced["optional"]) == {
|
||||
"last_frame",
|
||||
"session",
|
||||
"initial_state",
|
||||
"prompt_plan",
|
||||
}
|
||||
|
||||
|
||||
def test_v217_facade_delegates_to_legacy_core(monkeypatch):
|
||||
captured = {}
|
||||
|
||||
def fake_run(_self, **kwargs):
|
||||
captured.update(kwargs)
|
||||
return "images", "audio", "state", "session", "report"
|
||||
|
||||
monkeypatch.setattr(H3ContinuumSamplerV2, "run", fake_run)
|
||||
facade = H3ContinuumSampler()
|
||||
result = facade.run(
|
||||
model="model",
|
||||
clip="clip",
|
||||
video_vae="video_vae",
|
||||
audio_vae="audio_vae",
|
||||
sampler="sampler",
|
||||
sigmas="sigmas",
|
||||
sequence_prompt="base prompt",
|
||||
prompt_mode=PROMPT_FORMAT_OPTIONS[0],
|
||||
chunks=3,
|
||||
chunk_seconds=5.0,
|
||||
width=1344,
|
||||
height=768,
|
||||
continuity="Balanced - 22 frames",
|
||||
base_seed=123,
|
||||
seam_correction="Auto",
|
||||
)
|
||||
|
||||
assert result == (
|
||||
"images",
|
||||
"audio",
|
||||
{"last_state": "state", "session": "session", "report": "report"},
|
||||
)
|
||||
assert captured["prompt_script"] == "base prompt"
|
||||
assert captured["sequence_prompt"] == "base prompt"
|
||||
assert captured["audio_continuity"] is True
|
||||
assert captured["show_preview"] is True
|
||||
|
||||
|
||||
def test_v217_facade_passes_only_sparse_override_clips(monkeypatch):
|
||||
captured = {}
|
||||
|
||||
def fake_run(_self, **kwargs):
|
||||
captured.update(kwargs)
|
||||
return "images", "audio", "state", "session", "report"
|
||||
|
||||
monkeypatch.setattr(H3ContinuumSamplerV2, "run", fake_run)
|
||||
pack = H3ContinuumClipOverrides().build(
|
||||
PROMPT_FORMAT_OPTIONS[0],
|
||||
"[Clip 2]\nclose-up\n\n[Clip 5]\nfinish naturally",
|
||||
)[0]
|
||||
H3ContinuumSampler().run(
|
||||
model="model", clip="clip", video_vae="video_vae", audio_vae="audio_vae",
|
||||
sampler="sampler", sigmas="sigmas", sequence_prompt="base",
|
||||
prompt_mode=PROMPT_FORMAT_OPTIONS[0], chunks=5, chunk_seconds=5.0,
|
||||
width=1344, height=768, continuity="Balanced - 22 frames", base_seed=123,
|
||||
seam_correction="Auto", prompt_overrides=pack,
|
||||
)
|
||||
assert captured["clip_2_prompt"] == "close-up"
|
||||
assert captured["clip_5_prompt"] == "finish naturally"
|
||||
assert not any(f"clip_{index}_prompt" in captured for index in (1, 3, 4))
|
||||
|
||||
|
||||
def test_v217_facade_ignores_sparse_override_outside_chunks(monkeypatch):
|
||||
captured = {}
|
||||
|
||||
@@ -134,15 +134,15 @@ def test_v217_facade_ignores_sparse_override_outside_chunks(monkeypatch):
|
||||
seam_correction="Auto", prompt_overrides=pack,
|
||||
)
|
||||
assert not any(key.startswith("clip_") and key.endswith("_prompt") for key in captured)
|
||||
|
||||
|
||||
def test_v217_result_pack_expands_legacy_outputs():
|
||||
assert H3ContinuumResult().unpack(
|
||||
{"last_state": "state", "session": "session", "report": "report"}
|
||||
) == ("state", "session", "report")
|
||||
|
||||
|
||||
|
||||
|
||||
def test_v217_result_pack_expands_legacy_outputs():
|
||||
assert H3ContinuumResult().unpack(
|
||||
{"last_state": "state", "session": "session", "report": "report"}
|
||||
) == ("state", "session", "report")
|
||||
|
||||
|
||||
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.7.0"' in version_source
|
||||
assert 'PACKAGE_VERSION = "3.8.0"' in version_source
|
||||
|
||||
@@ -1,33 +1,33 @@
|
||||
import pytest
|
||||
|
||||
from ComfyUI_H3_Continuum_Join.constants import (
|
||||
PROMPT_FORMAT_AUTO,
|
||||
PROMPT_FORMAT_FIXED,
|
||||
PROMPT_FORMAT_LIST,
|
||||
PROMPT_FORMAT_TIMELINE,
|
||||
PROMPT_MODE_FIXED,
|
||||
PROMPT_MODE_LIST,
|
||||
PROMPT_MODE_TIMELINE,
|
||||
)
|
||||
from ComfyUI_H3_Continuum_Join.v2.prompts import (
|
||||
PromptPlanError,
|
||||
apply_prompt_overrides,
|
||||
build_sampler_prompt_plan,
|
||||
detect_prompt_mode,
|
||||
make_prompt_plan,
|
||||
import pytest
|
||||
|
||||
from ComfyUI_H3_Continuum_Join.constants import (
|
||||
PROMPT_FORMAT_AUTO,
|
||||
PROMPT_FORMAT_FIXED,
|
||||
PROMPT_FORMAT_LIST,
|
||||
PROMPT_FORMAT_TIMELINE,
|
||||
PROMPT_MODE_FIXED,
|
||||
PROMPT_MODE_LIST,
|
||||
PROMPT_MODE_TIMELINE,
|
||||
)
|
||||
from ComfyUI_H3_Continuum_Join.v2.prompts import (
|
||||
PromptPlanError,
|
||||
apply_prompt_overrides,
|
||||
build_sampler_prompt_plan,
|
||||
detect_prompt_mode,
|
||||
make_prompt_plan,
|
||||
parse_sparse_prompt_overrides,
|
||||
prompt_hash,
|
||||
prompt_plan_report,
|
||||
validate_sparse_prompt_overrides,
|
||||
validate_prompt_plan,
|
||||
)
|
||||
from ComfyUI_H3_Continuum_Join.v2.nodes import H3ContinuumPromptPlanPreview
|
||||
|
||||
|
||||
validate_sparse_prompt_overrides,
|
||||
validate_prompt_plan,
|
||||
)
|
||||
from ComfyUI_H3_Continuum_Join.v2.nodes import H3ContinuumPromptPlanPreview
|
||||
|
||||
|
||||
def test_fixed_prompt_repeats_without_mutation():
|
||||
plan = make_prompt_plan(mode=PROMPT_MODE_FIXED, script="hello", chunks=3, chunk_seconds=5)
|
||||
assert plan["prompts"] == ["hello", "hello", "hello"]
|
||||
assert len(set(plan["hashes"])) == 1
|
||||
plan = make_prompt_plan(mode=PROMPT_MODE_FIXED, script="hello", chunks=3, chunk_seconds=5)
|
||||
assert plan["prompts"] == ["hello", "hello", "hello"]
|
||||
assert len(set(plan["hashes"])) == 1
|
||||
assert validate_prompt_plan(plan) is plan
|
||||
|
||||
|
||||
@@ -163,379 +163,379 @@ def test_prompt_transparency_t8_unknown_future_syntax_is_literal():
|
||||
)
|
||||
assert plan["prompts"] == [script, script]
|
||||
assert "diagnostics" not in plan
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
("script", "expected"),
|
||||
[
|
||||
("one continuous prompt", PROMPT_MODE_FIXED),
|
||||
("first\n---\nsecond", PROMPT_MODE_LIST),
|
||||
("[0-5s]\nfirst", PROMPT_MODE_TIMELINE),
|
||||
("[Chunk 1]\nfirst", PROMPT_MODE_TIMELINE),
|
||||
],
|
||||
)
|
||||
def test_auto_detects_prompt_format(script, expected):
|
||||
assert detect_prompt_mode(script) == expected
|
||||
|
||||
|
||||
def test_auto_plan_records_detected_format_without_changing_schema_mode():
|
||||
plan = make_prompt_plan(mode=PROMPT_FORMAT_AUTO, script="first\n---\nsecond", chunks=2, chunk_seconds=5)
|
||||
assert plan["mode"] == PROMPT_MODE_LIST
|
||||
assert plan["prompts"] == ["first", "second"]
|
||||
assert plan["notes"][0] == "Auto detected List"
|
||||
|
||||
|
||||
def test_simple_fixed_format_maps_to_stable_fixed_plan_mode():
|
||||
plan = make_prompt_plan(mode=PROMPT_FORMAT_FIXED, script="same", chunks=2, chunk_seconds=5)
|
||||
assert plan["mode"] == PROMPT_MODE_FIXED
|
||||
|
||||
|
||||
def test_list_prompt_uses_separator_and_repeats_last():
|
||||
plan = make_prompt_plan(
|
||||
mode=PROMPT_MODE_LIST,
|
||||
script="first\n---\nsecond",
|
||||
chunks=3,
|
||||
chunk_seconds=5,
|
||||
)
|
||||
assert plan["prompts"] == ["first", "second", "second"]
|
||||
assert "repeated" in plan["notes"][0]
|
||||
|
||||
|
||||
def test_timeline_prompt_maps_ranges_and_chunk_headers():
|
||||
plan = make_prompt_plan(
|
||||
mode=PROMPT_MODE_TIMELINE,
|
||||
script="[0-5s]\none\n[5-10s]\ntwo\n[Chunk 3]\nthree",
|
||||
chunks=3,
|
||||
chunk_seconds=5,
|
||||
)
|
||||
assert plan["prompts"] == ["one", "two", "three"]
|
||||
assert not any(item["code"] == "H3C-P105" for item in plan.get("diagnostics", []))
|
||||
|
||||
|
||||
def test_clean_list_keeps_assignments_without_mixed_syntax_warning():
|
||||
plan = make_prompt_plan(
|
||||
mode=PROMPT_FORMAT_LIST,
|
||||
script="A\n---\nB\n---\nC",
|
||||
chunks=3,
|
||||
chunk_seconds=5,
|
||||
)
|
||||
assert plan["prompts"] == ["A", "B", "C"]
|
||||
assert not any(item["code"] == "H3C-P105" for item in plan.get("diagnostics", []))
|
||||
|
||||
|
||||
@pytest.mark.parametrize("mode", [PROMPT_FORMAT_AUTO, PROMPT_FORMAT_TIMELINE])
|
||||
def test_timeline_mixed_with_list_separator_warns_and_ignores_separator(mode):
|
||||
plan = make_prompt_plan(
|
||||
mode=mode,
|
||||
script="[Chunk 1]\nA\n[Chunk 2]\nB\n---\nC",
|
||||
chunks=3,
|
||||
chunk_seconds=5,
|
||||
)
|
||||
assert plan["mode"] == PROMPT_MODE_TIMELINE
|
||||
assert plan["prompts"] == ["A", "B\nC", "B\nC"]
|
||||
assert all("---" not in prompt for prompt in plan["prompts"])
|
||||
assert any(item["code"] == "H3C-P105" for item in plan["diagnostics"])
|
||||
assert any(item["code"] == "H3C-P101" for item in plan["diagnostics"])
|
||||
|
||||
|
||||
def test_timeline_mixed_separator_is_removed_from_shared_preamble():
|
||||
plan = make_prompt_plan(
|
||||
mode=PROMPT_FORMAT_AUTO,
|
||||
script="Shared preamble\n---\n[Chunk 1]\nA\n[Chunk 2]\nB",
|
||||
chunks=2,
|
||||
chunk_seconds=5,
|
||||
)
|
||||
assert plan["prompts"] == ["Shared preamble\n\nA", "Shared preamble\n\nB"]
|
||||
assert all("---" not in prompt for prompt in plan["prompts"])
|
||||
assert any(item["code"] == "H3C-P105" for item in plan["diagnostics"])
|
||||
|
||||
|
||||
def test_five_chunk_timeline_with_trailing_separator_preserves_all_assignments():
|
||||
script = "\n".join(
|
||||
[
|
||||
"[Chunk 1]", "A", "[Chunk 2]", "B", "[Chunk 3]", "C",
|
||||
"[Chunk 4]", "D", "[Chunk 5]", "E", "---",
|
||||
]
|
||||
)
|
||||
plan = make_prompt_plan(
|
||||
mode=PROMPT_FORMAT_AUTO,
|
||||
script=script,
|
||||
chunks=5,
|
||||
chunk_seconds=5,
|
||||
)
|
||||
assert plan["prompts"] == ["A", "B", "C", "D", "E"]
|
||||
assert any(item["code"] == "H3C-P105" for item in plan["diagnostics"])
|
||||
|
||||
|
||||
def test_explicit_list_with_timeline_header_warns_but_keeps_list_parsing():
|
||||
plan = make_prompt_plan(
|
||||
mode=PROMPT_FORMAT_LIST,
|
||||
script="[Chunk 1]\nA\n---\nB\n---\nC",
|
||||
chunks=3,
|
||||
chunk_seconds=5,
|
||||
)
|
||||
assert plan["mode"] == PROMPT_MODE_LIST
|
||||
assert plan["prompts"] == ["[Chunk 1]\nA", "B", "C"]
|
||||
assert any(item["code"] == "H3C-P105" for item in plan["diagnostics"])
|
||||
assert [item["message"] for item in plan["diagnostics"] if item["code"] == "H3C-P000"] == [
|
||||
"Chunk 1 source: List section 1",
|
||||
"Chunk 2 source: List section 2",
|
||||
"Chunk 3 source: List section 3",
|
||||
]
|
||||
|
||||
|
||||
def test_explicit_fixed_keeps_all_special_syntax_literal_without_warning():
|
||||
script = "[Chunk 1]\nA\n[0-5s]\nB\n---\nC"
|
||||
plan = make_prompt_plan(
|
||||
mode=PROMPT_FORMAT_FIXED,
|
||||
script=script,
|
||||
chunks=2,
|
||||
chunk_seconds=5,
|
||||
)
|
||||
assert plan["prompts"] == [script, script]
|
||||
assert "diagnostics" not in plan
|
||||
|
||||
|
||||
def test_mixed_syntax_report_leads_with_warning_and_resolved_chunk_sources():
|
||||
plan = make_prompt_plan(
|
||||
mode=PROMPT_FORMAT_AUTO,
|
||||
script="[Chunk 1]\nA\n[Chunk 2]\nB\n---\nC",
|
||||
chunks=3,
|
||||
chunk_seconds=5,
|
||||
)
|
||||
report = prompt_plan_report(plan)
|
||||
assert report.startswith("PROMPT PREFLIGHT WARNING")
|
||||
assert "H3C-P105" in report
|
||||
assert "H3C-P101" in report
|
||||
assert "Chunk 1 source:" in report
|
||||
assert "Chunk 3 source:" in report
|
||||
|
||||
|
||||
def test_prompt_preview_uses_the_same_mixed_syntax_resolution():
|
||||
script = "[Chunk 1]\nA\n[Chunk 2]\nB\n---\nC"
|
||||
expected = make_prompt_plan(
|
||||
mode=PROMPT_FORMAT_AUTO,
|
||||
script=script,
|
||||
chunks=3,
|
||||
chunk_seconds=5,
|
||||
)
|
||||
preview_plan, preview_report = H3ContinuumPromptPlanPreview().build(
|
||||
PROMPT_FORMAT_AUTO,
|
||||
script,
|
||||
3,
|
||||
5,
|
||||
)
|
||||
assert preview_plan == expected
|
||||
assert preview_report.startswith("PROMPT PREFLIGHT WARNING")
|
||||
assert "Chunk 2:\nB\nC" in preview_report
|
||||
assert "Chunk 3:\nB\nC" in preview_report
|
||||
|
||||
|
||||
def test_timeline_preamble_is_applied_to_every_chunk():
|
||||
plan = make_prompt_plan(
|
||||
mode=PROMPT_FORMAT_AUTO,
|
||||
script="Refer to <Picture 1>.\n[0-5s]\none\n[5-10s]\ntwo",
|
||||
chunks=2,
|
||||
chunk_seconds=5,
|
||||
)
|
||||
assert plan["prompts"] == ["Refer to <Picture 1>.\n\none", "Refer to <Picture 1>.\n\ntwo"]
|
||||
assert plan["notes"] == ["Auto detected Timeline", "applied timeline preamble to all chunks"]
|
||||
|
||||
|
||||
def test_timeline_missing_coverage_warns_and_repeats_previous_prompt():
|
||||
plan = make_prompt_plan(
|
||||
mode=PROMPT_MODE_TIMELINE,
|
||||
script="[0-5s]\none",
|
||||
chunks=2,
|
||||
chunk_seconds=5,
|
||||
)
|
||||
assert plan["prompts"] == ["one", "one"]
|
||||
assert any(item["code"] == "H3C-P101" for item in plan["diagnostics"])
|
||||
assert "fallback" in prompt_plan_report(plan)
|
||||
|
||||
|
||||
def test_timeline_leading_gap_uses_earliest_valid_prompt():
|
||||
plan = make_prompt_plan(
|
||||
mode=PROMPT_MODE_TIMELINE,
|
||||
script="[5-10s]\nsecond",
|
||||
chunks=2,
|
||||
chunk_seconds=5,
|
||||
)
|
||||
assert plan["prompts"] == ["second", "second"]
|
||||
assert plan["diagnostics"][0]["code"] == "H3C-P101"
|
||||
|
||||
|
||||
def test_timeline_extra_sections_warn_and_are_ignored():
|
||||
plan = make_prompt_plan(
|
||||
mode=PROMPT_MODE_TIMELINE,
|
||||
script="[0-5s]\none\n[5-10s]\ntwo\n[10-15s]\nextra",
|
||||
chunks=2,
|
||||
chunk_seconds=5,
|
||||
)
|
||||
assert plan["prompts"] == ["one", "two"]
|
||||
assert any(item["code"] == "H3C-P104" for item in plan["diagnostics"])
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
("script", "code"),
|
||||
[
|
||||
("[0 to 5s]\none", "H3C-P001"),
|
||||
("[5-5s]\none", "H3C-P002"),
|
||||
("[Chunk 0]\none", "H3C-P004"),
|
||||
("[0-5s]\n", "H3C-P005"),
|
||||
],
|
||||
)
|
||||
def test_invalid_timeline_falls_back_with_actionable_diagnostic(script, code):
|
||||
plan = make_prompt_plan(
|
||||
mode=PROMPT_MODE_TIMELINE,
|
||||
script=script,
|
||||
chunks=2,
|
||||
chunk_seconds=5,
|
||||
)
|
||||
assert plan["mode"] == PROMPT_MODE_FIXED
|
||||
assert plan["prompts"] == [script.strip(), script.strip()]
|
||||
assert plan["diagnostics"][0]["code"] == "H3C-P100"
|
||||
assert code in plan["diagnostics"][0]["message"]
|
||||
|
||||
|
||||
def test_invalid_mixed_timeline_fallback_preserves_original_text():
|
||||
script = "[Chunk 0]\nA\n---\nB"
|
||||
plan = make_prompt_plan(
|
||||
mode=PROMPT_FORMAT_TIMELINE,
|
||||
script=script,
|
||||
chunks=2,
|
||||
chunk_seconds=5,
|
||||
)
|
||||
assert plan["mode"] == PROMPT_MODE_FIXED
|
||||
assert plan["prompts"] == [script, script]
|
||||
assert plan["diagnostics"][0]["code"] == "H3C-P100"
|
||||
|
||||
|
||||
def test_duplicate_chunk_section_falls_back_without_blocking():
|
||||
plan = make_prompt_plan(
|
||||
mode=PROMPT_MODE_TIMELINE,
|
||||
script="[Chunk 1]\none\n[Chunk 1]\ntwo",
|
||||
chunks=2,
|
||||
chunk_seconds=5,
|
||||
)
|
||||
assert plan["mode"] == PROMPT_MODE_FIXED
|
||||
assert any("H3C-P003" in item["message"] for item in plan["diagnostics"])
|
||||
|
||||
|
||||
def test_prompt_preflight_reports_explicit_chunk_sources():
|
||||
plan = make_prompt_plan(
|
||||
mode=PROMPT_MODE_TIMELINE,
|
||||
script="[0-5s]\none\n[5-10s]\ntwo",
|
||||
chunks=2,
|
||||
chunk_seconds=5,
|
||||
)
|
||||
report = prompt_plan_report(plan)
|
||||
assert "Prompt Preflight:" in report
|
||||
assert "Chunk 1 source:" in report
|
||||
assert "Chunk 2 source:" in report
|
||||
|
||||
|
||||
def test_native_h3_chunk_duration_rejects_sub_four_seconds():
|
||||
with pytest.raises(PromptPlanError):
|
||||
make_prompt_plan(mode=PROMPT_MODE_FIXED, script="x", chunks=1, chunk_seconds=3.9)
|
||||
|
||||
|
||||
def test_chunk_duration_accepts_thirty_seconds_and_rejects_above_limit():
|
||||
plan = make_prompt_plan(
|
||||
mode=PROMPT_MODE_FIXED,
|
||||
script="x",
|
||||
chunks=1,
|
||||
chunk_seconds=30.0,
|
||||
)
|
||||
assert plan["chunk_seconds"] == 30.0
|
||||
assert validate_prompt_plan(plan) is plan
|
||||
|
||||
invalid_plan = dict(plan, chunk_seconds=30.1)
|
||||
with pytest.raises(PromptPlanError, match="30.0"):
|
||||
validate_prompt_plan(invalid_plan)
|
||||
|
||||
with pytest.raises(PromptPlanError, match="30.0"):
|
||||
make_prompt_plan(
|
||||
mode=PROMPT_MODE_FIXED,
|
||||
script="x",
|
||||
chunks=1,
|
||||
chunk_seconds=30.1,
|
||||
)
|
||||
|
||||
|
||||
def test_thirty_second_timeline_maps_one_section_to_each_chunk():
|
||||
plan = make_prompt_plan(
|
||||
mode=PROMPT_MODE_TIMELINE,
|
||||
script="[0-30s]\nfirst\n[30-60s]\nsecond",
|
||||
chunks=2,
|
||||
chunk_seconds=30.0,
|
||||
)
|
||||
assert plan["prompts"] == ["first", "second"]
|
||||
|
||||
|
||||
def test_external_prompt_overrides_only_the_connected_clip_and_rehashes_it():
|
||||
plan = make_prompt_plan(mode=PROMPT_MODE_LIST, script="first\n---\nsecond\n---\nthird", chunks=3, chunk_seconds=5)
|
||||
updated = apply_prompt_overrides(plan, [None, "external second", None])
|
||||
assert updated["prompts"] == ["first", "external second", "third"]
|
||||
assert updated["hashes"][0] == plan["hashes"][0]
|
||||
assert updated["hashes"][1] != plan["hashes"][1]
|
||||
assert updated["hashes"][2] == plan["hashes"][2]
|
||||
assert updated["notes"][-1] == "external Clip Prompt input(s): 2"
|
||||
|
||||
|
||||
def test_external_prompt_with_same_text_keeps_the_same_hash():
|
||||
plan = make_prompt_plan(mode=PROMPT_MODE_FIXED, script="same", chunks=2, chunk_seconds=5)
|
||||
assert apply_prompt_overrides(plan, [None, "same"])["hashes"] == plan["hashes"]
|
||||
|
||||
|
||||
def test_external_prompt_accepts_empty_connected_text():
|
||||
plan = make_prompt_plan(mode=PROMPT_MODE_FIXED, script="fallback", chunks=1, chunk_seconds=5)
|
||||
updated = apply_prompt_overrides(plan, [" "])
|
||||
assert updated["prompts"] == [""]
|
||||
|
||||
|
||||
def test_sequence_prompt_precedes_connected_plan_and_legacy_script():
|
||||
connected = make_prompt_plan(mode=PROMPT_FORMAT_FIXED, script="connected plan", chunks=2, chunk_seconds=5)
|
||||
resolved = build_sampler_prompt_plan(prompt_mode=PROMPT_FORMAT_AUTO, prompt_script="legacy", sequence_prompt="first\n---\nsecond", prompt_plan=connected, chunks=2, chunk_seconds=5)
|
||||
assert resolved["prompts"] == ["first", "second"]
|
||||
|
||||
|
||||
def test_connected_plan_precedes_legacy_script_without_sequence_input():
|
||||
connected = make_prompt_plan(mode=PROMPT_FORMAT_FIXED, script="connected plan", chunks=2, chunk_seconds=5)
|
||||
resolved = build_sampler_prompt_plan(prompt_mode=PROMPT_FORMAT_AUTO, prompt_script="legacy", sequence_prompt=None, prompt_plan=connected, chunks=2, chunk_seconds=5)
|
||||
assert resolved == connected
|
||||
|
||||
|
||||
def test_sparse_overrides_replace_only_explicit_clips_and_rehash():
|
||||
plan = make_prompt_plan(mode=PROMPT_FORMAT_FIXED, script="Sequence Prompt", chunks=5, chunk_seconds=5)
|
||||
sparse = validate_sparse_prompt_overrides(parse_sparse_prompt_overrides("[Clip 2]\nclose-up\n\n[Clip 5]\nfinish naturally"), chunks=5)
|
||||
updated = apply_prompt_overrides(plan, [sparse.get(index) for index in range(1, 6)])
|
||||
assert updated["prompts"] == ["Sequence Prompt", "close-up", "Sequence Prompt", "Sequence Prompt", "finish naturally"]
|
||||
assert updated["hashes"][0] == plan["hashes"][0]
|
||||
assert updated["hashes"][1] != plan["hashes"][1]
|
||||
assert updated["hashes"][2] == plan["hashes"][2]
|
||||
assert updated["hashes"][3] == plan["hashes"][3]
|
||||
assert updated["hashes"][4] != plan["hashes"][4]
|
||||
|
||||
|
||||
def test_sparse_override_clip_one_leaves_remaining_clips_unchanged():
|
||||
plan = make_prompt_plan(mode=PROMPT_FORMAT_FIXED, script="base", chunks=5, chunk_seconds=5)
|
||||
sparse = validate_sparse_prompt_overrides(parse_sparse_prompt_overrides("[Clip 1]\nopening override"), chunks=5)
|
||||
updated = apply_prompt_overrides(plan, [sparse.get(index) for index in range(1, 6)])
|
||||
assert updated["prompts"] == ["opening override", "base", "base", "base", "base"]
|
||||
|
||||
|
||||
def test_sparse_override_rejects_out_of_range_clip():
|
||||
sparse = parse_sparse_prompt_overrides("[Clip 6]\noutside")
|
||||
with pytest.raises(PromptPlanError, match="outside"):
|
||||
validate_sparse_prompt_overrides(sparse, chunks=5)
|
||||
|
||||
|
||||
def test_sparse_override_rejects_duplicate_clip():
|
||||
with pytest.raises(PromptPlanError, match="more than once"):
|
||||
parse_sparse_prompt_overrides("[Clip 2]\nfirst\n\n[Chunk 2]\nsecond")
|
||||
|
||||
|
||||
def test_sparse_override_rejects_timeline_preamble():
|
||||
with pytest.raises(PromptPlanError, match="before the first"):
|
||||
parse_sparse_prompt_overrides("global text\n[Clip 1]\nopening override")
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
("script", "expected"),
|
||||
[
|
||||
("one continuous prompt", PROMPT_MODE_FIXED),
|
||||
("first\n---\nsecond", PROMPT_MODE_LIST),
|
||||
("[0-5s]\nfirst", PROMPT_MODE_TIMELINE),
|
||||
("[Chunk 1]\nfirst", PROMPT_MODE_TIMELINE),
|
||||
],
|
||||
)
|
||||
def test_auto_detects_prompt_format(script, expected):
|
||||
assert detect_prompt_mode(script) == expected
|
||||
|
||||
|
||||
def test_auto_plan_records_detected_format_without_changing_schema_mode():
|
||||
plan = make_prompt_plan(mode=PROMPT_FORMAT_AUTO, script="first\n---\nsecond", chunks=2, chunk_seconds=5)
|
||||
assert plan["mode"] == PROMPT_MODE_LIST
|
||||
assert plan["prompts"] == ["first", "second"]
|
||||
assert plan["notes"][0] == "Auto detected List"
|
||||
|
||||
|
||||
def test_simple_fixed_format_maps_to_stable_fixed_plan_mode():
|
||||
plan = make_prompt_plan(mode=PROMPT_FORMAT_FIXED, script="same", chunks=2, chunk_seconds=5)
|
||||
assert plan["mode"] == PROMPT_MODE_FIXED
|
||||
|
||||
|
||||
def test_list_prompt_uses_separator_and_repeats_last():
|
||||
plan = make_prompt_plan(
|
||||
mode=PROMPT_MODE_LIST,
|
||||
script="first\n---\nsecond",
|
||||
chunks=3,
|
||||
chunk_seconds=5,
|
||||
)
|
||||
assert plan["prompts"] == ["first", "second", "second"]
|
||||
assert "repeated" in plan["notes"][0]
|
||||
|
||||
|
||||
def test_timeline_prompt_maps_ranges_and_chunk_headers():
|
||||
plan = make_prompt_plan(
|
||||
mode=PROMPT_MODE_TIMELINE,
|
||||
script="[0-5s]\none\n[5-10s]\ntwo\n[Chunk 3]\nthree",
|
||||
chunks=3,
|
||||
chunk_seconds=5,
|
||||
)
|
||||
assert plan["prompts"] == ["one", "two", "three"]
|
||||
assert not any(item["code"] == "H3C-P105" for item in plan.get("diagnostics", []))
|
||||
|
||||
|
||||
def test_clean_list_keeps_assignments_without_mixed_syntax_warning():
|
||||
plan = make_prompt_plan(
|
||||
mode=PROMPT_FORMAT_LIST,
|
||||
script="A\n---\nB\n---\nC",
|
||||
chunks=3,
|
||||
chunk_seconds=5,
|
||||
)
|
||||
assert plan["prompts"] == ["A", "B", "C"]
|
||||
assert not any(item["code"] == "H3C-P105" for item in plan.get("diagnostics", []))
|
||||
|
||||
|
||||
@pytest.mark.parametrize("mode", [PROMPT_FORMAT_AUTO, PROMPT_FORMAT_TIMELINE])
|
||||
def test_timeline_mixed_with_list_separator_warns_and_ignores_separator(mode):
|
||||
plan = make_prompt_plan(
|
||||
mode=mode,
|
||||
script="[Chunk 1]\nA\n[Chunk 2]\nB\n---\nC",
|
||||
chunks=3,
|
||||
chunk_seconds=5,
|
||||
)
|
||||
assert plan["mode"] == PROMPT_MODE_TIMELINE
|
||||
assert plan["prompts"] == ["A", "B\nC", "B\nC"]
|
||||
assert all("---" not in prompt for prompt in plan["prompts"])
|
||||
assert any(item["code"] == "H3C-P105" for item in plan["diagnostics"])
|
||||
assert any(item["code"] == "H3C-P101" for item in plan["diagnostics"])
|
||||
|
||||
|
||||
def test_timeline_mixed_separator_is_removed_from_shared_preamble():
|
||||
plan = make_prompt_plan(
|
||||
mode=PROMPT_FORMAT_AUTO,
|
||||
script="Shared preamble\n---\n[Chunk 1]\nA\n[Chunk 2]\nB",
|
||||
chunks=2,
|
||||
chunk_seconds=5,
|
||||
)
|
||||
assert plan["prompts"] == ["Shared preamble\n\nA", "Shared preamble\n\nB"]
|
||||
assert all("---" not in prompt for prompt in plan["prompts"])
|
||||
assert any(item["code"] == "H3C-P105" for item in plan["diagnostics"])
|
||||
|
||||
|
||||
def test_five_chunk_timeline_with_trailing_separator_preserves_all_assignments():
|
||||
script = "\n".join(
|
||||
[
|
||||
"[Chunk 1]", "A", "[Chunk 2]", "B", "[Chunk 3]", "C",
|
||||
"[Chunk 4]", "D", "[Chunk 5]", "E", "---",
|
||||
]
|
||||
)
|
||||
plan = make_prompt_plan(
|
||||
mode=PROMPT_FORMAT_AUTO,
|
||||
script=script,
|
||||
chunks=5,
|
||||
chunk_seconds=5,
|
||||
)
|
||||
assert plan["prompts"] == ["A", "B", "C", "D", "E"]
|
||||
assert any(item["code"] == "H3C-P105" for item in plan["diagnostics"])
|
||||
|
||||
|
||||
def test_explicit_list_with_timeline_header_warns_but_keeps_list_parsing():
|
||||
plan = make_prompt_plan(
|
||||
mode=PROMPT_FORMAT_LIST,
|
||||
script="[Chunk 1]\nA\n---\nB\n---\nC",
|
||||
chunks=3,
|
||||
chunk_seconds=5,
|
||||
)
|
||||
assert plan["mode"] == PROMPT_MODE_LIST
|
||||
assert plan["prompts"] == ["[Chunk 1]\nA", "B", "C"]
|
||||
assert any(item["code"] == "H3C-P105" for item in plan["diagnostics"])
|
||||
assert [item["message"] for item in plan["diagnostics"] if item["code"] == "H3C-P000"] == [
|
||||
"Chunk 1 source: List section 1",
|
||||
"Chunk 2 source: List section 2",
|
||||
"Chunk 3 source: List section 3",
|
||||
]
|
||||
|
||||
|
||||
def test_explicit_fixed_keeps_all_special_syntax_literal_without_warning():
|
||||
script = "[Chunk 1]\nA\n[0-5s]\nB\n---\nC"
|
||||
plan = make_prompt_plan(
|
||||
mode=PROMPT_FORMAT_FIXED,
|
||||
script=script,
|
||||
chunks=2,
|
||||
chunk_seconds=5,
|
||||
)
|
||||
assert plan["prompts"] == [script, script]
|
||||
assert "diagnostics" not in plan
|
||||
|
||||
|
||||
def test_mixed_syntax_report_leads_with_warning_and_resolved_chunk_sources():
|
||||
plan = make_prompt_plan(
|
||||
mode=PROMPT_FORMAT_AUTO,
|
||||
script="[Chunk 1]\nA\n[Chunk 2]\nB\n---\nC",
|
||||
chunks=3,
|
||||
chunk_seconds=5,
|
||||
)
|
||||
report = prompt_plan_report(plan)
|
||||
assert report.startswith("PROMPT PREFLIGHT WARNING")
|
||||
assert "H3C-P105" in report
|
||||
assert "H3C-P101" in report
|
||||
assert "Chunk 1 source:" in report
|
||||
assert "Chunk 3 source:" in report
|
||||
|
||||
|
||||
def test_prompt_preview_uses_the_same_mixed_syntax_resolution():
|
||||
script = "[Chunk 1]\nA\n[Chunk 2]\nB\n---\nC"
|
||||
expected = make_prompt_plan(
|
||||
mode=PROMPT_FORMAT_AUTO,
|
||||
script=script,
|
||||
chunks=3,
|
||||
chunk_seconds=5,
|
||||
)
|
||||
preview_plan, preview_report = H3ContinuumPromptPlanPreview().build(
|
||||
PROMPT_FORMAT_AUTO,
|
||||
script,
|
||||
3,
|
||||
5,
|
||||
)
|
||||
assert preview_plan == expected
|
||||
assert preview_report.startswith("PROMPT PREFLIGHT WARNING")
|
||||
assert "Chunk 2:\nB\nC" in preview_report
|
||||
assert "Chunk 3:\nB\nC" in preview_report
|
||||
|
||||
|
||||
def test_timeline_preamble_is_applied_to_every_chunk():
|
||||
plan = make_prompt_plan(
|
||||
mode=PROMPT_FORMAT_AUTO,
|
||||
script="Refer to <Picture 1>.\n[0-5s]\none\n[5-10s]\ntwo",
|
||||
chunks=2,
|
||||
chunk_seconds=5,
|
||||
)
|
||||
assert plan["prompts"] == ["Refer to <Picture 1>.\n\none", "Refer to <Picture 1>.\n\ntwo"]
|
||||
assert plan["notes"] == ["Auto detected Timeline", "applied timeline preamble to all chunks"]
|
||||
|
||||
|
||||
def test_timeline_missing_coverage_warns_and_repeats_previous_prompt():
|
||||
plan = make_prompt_plan(
|
||||
mode=PROMPT_MODE_TIMELINE,
|
||||
script="[0-5s]\none",
|
||||
chunks=2,
|
||||
chunk_seconds=5,
|
||||
)
|
||||
assert plan["prompts"] == ["one", "one"]
|
||||
assert any(item["code"] == "H3C-P101" for item in plan["diagnostics"])
|
||||
assert "fallback" in prompt_plan_report(plan)
|
||||
|
||||
|
||||
def test_timeline_leading_gap_uses_earliest_valid_prompt():
|
||||
plan = make_prompt_plan(
|
||||
mode=PROMPT_MODE_TIMELINE,
|
||||
script="[5-10s]\nsecond",
|
||||
chunks=2,
|
||||
chunk_seconds=5,
|
||||
)
|
||||
assert plan["prompts"] == ["second", "second"]
|
||||
assert plan["diagnostics"][0]["code"] == "H3C-P101"
|
||||
|
||||
|
||||
def test_timeline_extra_sections_warn_and_are_ignored():
|
||||
plan = make_prompt_plan(
|
||||
mode=PROMPT_MODE_TIMELINE,
|
||||
script="[0-5s]\none\n[5-10s]\ntwo\n[10-15s]\nextra",
|
||||
chunks=2,
|
||||
chunk_seconds=5,
|
||||
)
|
||||
assert plan["prompts"] == ["one", "two"]
|
||||
assert any(item["code"] == "H3C-P104" for item in plan["diagnostics"])
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
("script", "code"),
|
||||
[
|
||||
("[0 to 5s]\none", "H3C-P001"),
|
||||
("[5-5s]\none", "H3C-P002"),
|
||||
("[Chunk 0]\none", "H3C-P004"),
|
||||
("[0-5s]\n", "H3C-P005"),
|
||||
],
|
||||
)
|
||||
def test_invalid_timeline_falls_back_with_actionable_diagnostic(script, code):
|
||||
plan = make_prompt_plan(
|
||||
mode=PROMPT_MODE_TIMELINE,
|
||||
script=script,
|
||||
chunks=2,
|
||||
chunk_seconds=5,
|
||||
)
|
||||
assert plan["mode"] == PROMPT_MODE_FIXED
|
||||
assert plan["prompts"] == [script.strip(), script.strip()]
|
||||
assert plan["diagnostics"][0]["code"] == "H3C-P100"
|
||||
assert code in plan["diagnostics"][0]["message"]
|
||||
|
||||
|
||||
def test_invalid_mixed_timeline_fallback_preserves_original_text():
|
||||
script = "[Chunk 0]\nA\n---\nB"
|
||||
plan = make_prompt_plan(
|
||||
mode=PROMPT_FORMAT_TIMELINE,
|
||||
script=script,
|
||||
chunks=2,
|
||||
chunk_seconds=5,
|
||||
)
|
||||
assert plan["mode"] == PROMPT_MODE_FIXED
|
||||
assert plan["prompts"] == [script, script]
|
||||
assert plan["diagnostics"][0]["code"] == "H3C-P100"
|
||||
|
||||
|
||||
def test_duplicate_chunk_section_falls_back_without_blocking():
|
||||
plan = make_prompt_plan(
|
||||
mode=PROMPT_MODE_TIMELINE,
|
||||
script="[Chunk 1]\none\n[Chunk 1]\ntwo",
|
||||
chunks=2,
|
||||
chunk_seconds=5,
|
||||
)
|
||||
assert plan["mode"] == PROMPT_MODE_FIXED
|
||||
assert any("H3C-P003" in item["message"] for item in plan["diagnostics"])
|
||||
|
||||
|
||||
def test_prompt_preflight_reports_explicit_chunk_sources():
|
||||
plan = make_prompt_plan(
|
||||
mode=PROMPT_MODE_TIMELINE,
|
||||
script="[0-5s]\none\n[5-10s]\ntwo",
|
||||
chunks=2,
|
||||
chunk_seconds=5,
|
||||
)
|
||||
report = prompt_plan_report(plan)
|
||||
assert "Prompt Preflight:" in report
|
||||
assert "Chunk 1 source:" in report
|
||||
assert "Chunk 2 source:" in report
|
||||
|
||||
|
||||
def test_native_h3_chunk_duration_rejects_sub_four_seconds():
|
||||
with pytest.raises(PromptPlanError):
|
||||
make_prompt_plan(mode=PROMPT_MODE_FIXED, script="x", chunks=1, chunk_seconds=3.9)
|
||||
|
||||
|
||||
def test_chunk_duration_accepts_thirty_seconds_and_rejects_above_limit():
|
||||
plan = make_prompt_plan(
|
||||
mode=PROMPT_MODE_FIXED,
|
||||
script="x",
|
||||
chunks=1,
|
||||
chunk_seconds=30.0,
|
||||
)
|
||||
assert plan["chunk_seconds"] == 30.0
|
||||
assert validate_prompt_plan(plan) is plan
|
||||
|
||||
invalid_plan = dict(plan, chunk_seconds=30.1)
|
||||
with pytest.raises(PromptPlanError, match="30.0"):
|
||||
validate_prompt_plan(invalid_plan)
|
||||
|
||||
with pytest.raises(PromptPlanError, match="30.0"):
|
||||
make_prompt_plan(
|
||||
mode=PROMPT_MODE_FIXED,
|
||||
script="x",
|
||||
chunks=1,
|
||||
chunk_seconds=30.1,
|
||||
)
|
||||
|
||||
|
||||
def test_thirty_second_timeline_maps_one_section_to_each_chunk():
|
||||
plan = make_prompt_plan(
|
||||
mode=PROMPT_MODE_TIMELINE,
|
||||
script="[0-30s]\nfirst\n[30-60s]\nsecond",
|
||||
chunks=2,
|
||||
chunk_seconds=30.0,
|
||||
)
|
||||
assert plan["prompts"] == ["first", "second"]
|
||||
|
||||
|
||||
def test_external_prompt_overrides_only_the_connected_clip_and_rehashes_it():
|
||||
plan = make_prompt_plan(mode=PROMPT_MODE_LIST, script="first\n---\nsecond\n---\nthird", chunks=3, chunk_seconds=5)
|
||||
updated = apply_prompt_overrides(plan, [None, "external second", None])
|
||||
assert updated["prompts"] == ["first", "external second", "third"]
|
||||
assert updated["hashes"][0] == plan["hashes"][0]
|
||||
assert updated["hashes"][1] != plan["hashes"][1]
|
||||
assert updated["hashes"][2] == plan["hashes"][2]
|
||||
assert updated["notes"][-1] == "external Clip Prompt input(s): 2"
|
||||
|
||||
|
||||
def test_external_prompt_with_same_text_keeps_the_same_hash():
|
||||
plan = make_prompt_plan(mode=PROMPT_MODE_FIXED, script="same", chunks=2, chunk_seconds=5)
|
||||
assert apply_prompt_overrides(plan, [None, "same"])["hashes"] == plan["hashes"]
|
||||
|
||||
|
||||
def test_external_prompt_accepts_empty_connected_text():
|
||||
plan = make_prompt_plan(mode=PROMPT_MODE_FIXED, script="fallback", chunks=1, chunk_seconds=5)
|
||||
updated = apply_prompt_overrides(plan, [" "])
|
||||
assert updated["prompts"] == [""]
|
||||
|
||||
|
||||
def test_sequence_prompt_precedes_connected_plan_and_legacy_script():
|
||||
connected = make_prompt_plan(mode=PROMPT_FORMAT_FIXED, script="connected plan", chunks=2, chunk_seconds=5)
|
||||
resolved = build_sampler_prompt_plan(prompt_mode=PROMPT_FORMAT_AUTO, prompt_script="legacy", sequence_prompt="first\n---\nsecond", prompt_plan=connected, chunks=2, chunk_seconds=5)
|
||||
assert resolved["prompts"] == ["first", "second"]
|
||||
|
||||
|
||||
def test_connected_plan_precedes_legacy_script_without_sequence_input():
|
||||
connected = make_prompt_plan(mode=PROMPT_FORMAT_FIXED, script="connected plan", chunks=2, chunk_seconds=5)
|
||||
resolved = build_sampler_prompt_plan(prompt_mode=PROMPT_FORMAT_AUTO, prompt_script="legacy", sequence_prompt=None, prompt_plan=connected, chunks=2, chunk_seconds=5)
|
||||
assert resolved == connected
|
||||
|
||||
|
||||
def test_sparse_overrides_replace_only_explicit_clips_and_rehash():
|
||||
plan = make_prompt_plan(mode=PROMPT_FORMAT_FIXED, script="Sequence Prompt", chunks=5, chunk_seconds=5)
|
||||
sparse = validate_sparse_prompt_overrides(parse_sparse_prompt_overrides("[Clip 2]\nclose-up\n\n[Clip 5]\nfinish naturally"), chunks=5)
|
||||
updated = apply_prompt_overrides(plan, [sparse.get(index) for index in range(1, 6)])
|
||||
assert updated["prompts"] == ["Sequence Prompt", "close-up", "Sequence Prompt", "Sequence Prompt", "finish naturally"]
|
||||
assert updated["hashes"][0] == plan["hashes"][0]
|
||||
assert updated["hashes"][1] != plan["hashes"][1]
|
||||
assert updated["hashes"][2] == plan["hashes"][2]
|
||||
assert updated["hashes"][3] == plan["hashes"][3]
|
||||
assert updated["hashes"][4] != plan["hashes"][4]
|
||||
|
||||
|
||||
def test_sparse_override_clip_one_leaves_remaining_clips_unchanged():
|
||||
plan = make_prompt_plan(mode=PROMPT_FORMAT_FIXED, script="base", chunks=5, chunk_seconds=5)
|
||||
sparse = validate_sparse_prompt_overrides(parse_sparse_prompt_overrides("[Clip 1]\nopening override"), chunks=5)
|
||||
updated = apply_prompt_overrides(plan, [sparse.get(index) for index in range(1, 6)])
|
||||
assert updated["prompts"] == ["opening override", "base", "base", "base", "base"]
|
||||
|
||||
|
||||
def test_sparse_override_rejects_out_of_range_clip():
|
||||
sparse = parse_sparse_prompt_overrides("[Clip 6]\noutside")
|
||||
with pytest.raises(PromptPlanError, match="outside"):
|
||||
validate_sparse_prompt_overrides(sparse, chunks=5)
|
||||
|
||||
|
||||
def test_sparse_override_rejects_duplicate_clip():
|
||||
with pytest.raises(PromptPlanError, match="more than once"):
|
||||
parse_sparse_prompt_overrides("[Clip 2]\nfirst\n\n[Chunk 2]\nsecond")
|
||||
|
||||
|
||||
def test_sparse_override_rejects_timeline_preamble():
|
||||
with pytest.raises(PromptPlanError, match="before the first"):
|
||||
parse_sparse_prompt_overrides("global text\n[Clip 1]\nopening override")
|
||||
|
||||
@@ -2,16 +2,11 @@ from ComfyUI_H3_Continuum_Join.constants import (
|
||||
PROMPT_FORMAT_OPTIONS,
|
||||
SEAM_CORRECTION_AUTO,
|
||||
)
|
||||
from ComfyUI_H3_Continuum_Join.nodes import NODE_CLASS_MAPPINGS
|
||||
from ComfyUI_H3_Continuum_Join.v2.nodes import NODE_CLASS_MAPPINGS
|
||||
|
||||
|
||||
def test_v2_nodes_are_registered_without_removing_v1():
|
||||
def test_v2_nodes_remain_available_in_the_internal_module():
|
||||
expected = {
|
||||
"H3ContinuumJoin",
|
||||
"H3ContinuumFinish",
|
||||
"H3ContinuumAssemble",
|
||||
"H3ContinuumSaveState",
|
||||
"H3ContinuumLoadState",
|
||||
"H3ContinuumSamplerV2",
|
||||
"H3ContinuumPromptPlanPreview",
|
||||
"H3ContinuumSaveSession",
|
||||
|
||||
@@ -1,105 +1,105 @@
|
||||
import torch
|
||||
|
||||
import torch
|
||||
|
||||
from ComfyUI_H3_Continuum_Join.v2.seam_guard import (
|
||||
analyze_audio_seam,
|
||||
apply_color_guard,
|
||||
choose_adaptive_cut,
|
||||
choose_video_blend,
|
||||
correct_audio_seam,
|
||||
correct_seam,
|
||||
)
|
||||
from ComfyUI_H3_Continuum_Join.v2.seam_types import VideoSeamMetrics
|
||||
|
||||
|
||||
def _frames(values):
|
||||
return torch.tensor(values, dtype=torch.float32).reshape(-1, 1, 1, 1).expand(-1, 12, 12, 3).clone()
|
||||
|
||||
|
||||
def test_adaptive_cut_detects_a_two_frame_earlier_clean_boundary():
|
||||
previous = _frames([0.0, 0.0, 0.0, 0.05, 0.10, 0.20, 0.30, 0.40])
|
||||
current = _frames([0.05, 0.10, 0.95, 0.205, 0.21, 0.90, 0.90, 0.90])
|
||||
|
||||
rewind, legacy, selected = choose_adaptive_cut(
|
||||
previous,
|
||||
current,
|
||||
context_frames=5,
|
||||
)
|
||||
|
||||
assert rewind == 2
|
||||
assert selected.score < legacy.score
|
||||
|
||||
|
||||
def test_corrected_cut_preserves_the_total_frame_count():
|
||||
previous = _frames([0.0, 0.0, 0.0, 0.05, 0.10, 0.20, 0.30, 0.40])
|
||||
current = _frames([0.05, 0.10, 0.95, 0.205, 0.21, 0.90, 0.90, 0.90])
|
||||
corrected, decision, _patch = correct_seam(
|
||||
previous,
|
||||
current,
|
||||
context_frames=5,
|
||||
)
|
||||
legacy_total = previous.shape[0] + current.shape[0] - 5
|
||||
corrected_total = (
|
||||
previous.shape[0] - decision.cut_rewind_frames + corrected.shape[0]
|
||||
)
|
||||
assert corrected_total == legacy_total
|
||||
|
||||
|
||||
def test_auto_keeps_a_clean_legacy_video_boundary():
|
||||
previous = _frames([0.2, 0.2, 0.2, 0.2])
|
||||
current = _frames([0.2, 0.2, 0.2, 0.2])
|
||||
|
||||
corrected, decision, patch = correct_seam(
|
||||
previous,
|
||||
current,
|
||||
context_frames=2,
|
||||
automatic=True,
|
||||
)
|
||||
|
||||
assert torch.equal(corrected, current[2:])
|
||||
assert decision.cut_rewind_frames == 0
|
||||
assert decision.corrected_score == decision.legacy_score
|
||||
apply_color_guard,
|
||||
choose_adaptive_cut,
|
||||
choose_video_blend,
|
||||
correct_audio_seam,
|
||||
correct_seam,
|
||||
)
|
||||
from ComfyUI_H3_Continuum_Join.v2.seam_types import VideoSeamMetrics
|
||||
|
||||
|
||||
def _frames(values):
|
||||
return torch.tensor(values, dtype=torch.float32).reshape(-1, 1, 1, 1).expand(-1, 12, 12, 3).clone()
|
||||
|
||||
|
||||
def test_adaptive_cut_detects_a_two_frame_earlier_clean_boundary():
|
||||
previous = _frames([0.0, 0.0, 0.0, 0.05, 0.10, 0.20, 0.30, 0.40])
|
||||
current = _frames([0.05, 0.10, 0.95, 0.205, 0.21, 0.90, 0.90, 0.90])
|
||||
|
||||
rewind, legacy, selected = choose_adaptive_cut(
|
||||
previous,
|
||||
current,
|
||||
context_frames=5,
|
||||
)
|
||||
|
||||
assert rewind == 2
|
||||
assert selected.score < legacy.score
|
||||
|
||||
|
||||
def test_corrected_cut_preserves_the_total_frame_count():
|
||||
previous = _frames([0.0, 0.0, 0.0, 0.05, 0.10, 0.20, 0.30, 0.40])
|
||||
current = _frames([0.05, 0.10, 0.95, 0.205, 0.21, 0.90, 0.90, 0.90])
|
||||
corrected, decision, _patch = correct_seam(
|
||||
previous,
|
||||
current,
|
||||
context_frames=5,
|
||||
)
|
||||
legacy_total = previous.shape[0] + current.shape[0] - 5
|
||||
corrected_total = (
|
||||
previous.shape[0] - decision.cut_rewind_frames + corrected.shape[0]
|
||||
)
|
||||
assert corrected_total == legacy_total
|
||||
|
||||
|
||||
def test_auto_keeps_a_clean_legacy_video_boundary():
|
||||
previous = _frames([0.2, 0.2, 0.2, 0.2])
|
||||
current = _frames([0.2, 0.2, 0.2, 0.2])
|
||||
|
||||
corrected, decision, patch = correct_seam(
|
||||
previous,
|
||||
current,
|
||||
context_frames=2,
|
||||
automatic=True,
|
||||
)
|
||||
|
||||
assert torch.equal(corrected, current[2:])
|
||||
assert decision.cut_rewind_frames == 0
|
||||
assert decision.corrected_score == decision.legacy_score
|
||||
assert decision.fallback_reason.startswith("Auto kept native video")
|
||||
assert patch is None
|
||||
|
||||
|
||||
def test_high_motion_disables_video_blend():
|
||||
metrics = VideoSeamMetrics(
|
||||
pixel_mae_norm=0.1,
|
||||
luma_norm=0.1,
|
||||
chroma_norm=0.1,
|
||||
edge_norm=0.1,
|
||||
temporal_norm=0.1,
|
||||
motion=0.2,
|
||||
score=0.1,
|
||||
)
|
||||
assert choose_video_blend(metrics) == 0
|
||||
|
||||
|
||||
def test_excessive_color_request_is_not_applied():
|
||||
previous = _frames([0.01, 0.01])
|
||||
current = _frames([1.0, 1.0, 1.0, 1.0])
|
||||
corrected, gain, bias, _metrics = apply_color_guard(previous, current)
|
||||
assert gain == 1.0
|
||||
assert bias == (0.0, 0.0, 0.0)
|
||||
assert torch.equal(corrected, current)
|
||||
|
||||
|
||||
assert patch is None
|
||||
|
||||
|
||||
def test_high_motion_disables_video_blend():
|
||||
metrics = VideoSeamMetrics(
|
||||
pixel_mae_norm=0.1,
|
||||
luma_norm=0.1,
|
||||
chroma_norm=0.1,
|
||||
edge_norm=0.1,
|
||||
temporal_norm=0.1,
|
||||
motion=0.2,
|
||||
score=0.1,
|
||||
)
|
||||
assert choose_video_blend(metrics) == 0
|
||||
|
||||
|
||||
def test_excessive_color_request_is_not_applied():
|
||||
previous = _frames([0.01, 0.01])
|
||||
current = _frames([1.0, 1.0, 1.0, 1.0])
|
||||
corrected, gain, bias, _metrics = apply_color_guard(previous, current)
|
||||
assert gain == 1.0
|
||||
assert bias == (0.0, 0.0, 0.0)
|
||||
assert torch.equal(corrected, current)
|
||||
|
||||
|
||||
def test_audio_seam_uses_one_offset_for_all_stereo_channels_and_keeps_a_local_patch():
|
||||
sample_rate = 1000
|
||||
time = torch.arange(800, dtype=torch.float32) / sample_rate
|
||||
signal = torch.sin(2.0 * torch.pi * 20.0 * time)
|
||||
previous = torch.stack((signal[:500], signal[:500]), dim=0).unsqueeze(0)
|
||||
current = torch.stack((signal, signal), dim=0).unsqueeze(0)
|
||||
|
||||
patch, metrics, fade_samples, _gain, _dc = correct_audio_seam(
|
||||
previous,
|
||||
current,
|
||||
sample_rate=sample_rate,
|
||||
cut_sample=500,
|
||||
)
|
||||
|
||||
assert isinstance(metrics.offset_samples, int)
|
||||
assert fade_samples <= round(sample_rate * 0.060)
|
||||
sample_rate = 1000
|
||||
time = torch.arange(800, dtype=torch.float32) / sample_rate
|
||||
signal = torch.sin(2.0 * torch.pi * 20.0 * time)
|
||||
previous = torch.stack((signal[:500], signal[:500]), dim=0).unsqueeze(0)
|
||||
current = torch.stack((signal, signal), dim=0).unsqueeze(0)
|
||||
|
||||
patch, metrics, fade_samples, _gain, _dc = correct_audio_seam(
|
||||
previous,
|
||||
current,
|
||||
sample_rate=sample_rate,
|
||||
cut_sample=500,
|
||||
)
|
||||
|
||||
assert isinstance(metrics.offset_samples, int)
|
||||
assert fade_samples <= round(sample_rate * 0.060)
|
||||
if patch is not None:
|
||||
assert patch.shape[1] == 2
|
||||
assert patch.shape[-1] == fade_samples
|
||||
|
||||
@@ -1,100 +1,100 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import pytest
|
||||
import torch
|
||||
|
||||
from ComfyUI_H3_Continuum_Join.v2.sequence import (
|
||||
_atomic_terminal_prefix,
|
||||
_split_terminal_merged_latents,
|
||||
_terminal_flf_merge_enabled,
|
||||
_terminal_pair_prompt,
|
||||
_terminal_physical_seed_plan,
|
||||
from __future__ import annotations
|
||||
|
||||
import pytest
|
||||
import torch
|
||||
|
||||
from ComfyUI_H3_Continuum_Join.v2.sequence import (
|
||||
_atomic_terminal_prefix,
|
||||
_split_terminal_merged_latents,
|
||||
_terminal_flf_merge_enabled,
|
||||
_terminal_pair_prompt,
|
||||
_terminal_physical_seed_plan,
|
||||
_terminal_pair_contract,
|
||||
_terminal_sampling_plan,
|
||||
_terminal_strategy_mismatch,
|
||||
)
|
||||
from ComfyUI_H3_Continuum_Join.v2.seeds import derive_chunk_seed
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
("initial_pair", "physical_frames", "logical_frames", "video_slices", "audio_slices"),
|
||||
[
|
||||
(True, 243, (124, 141), ((0, 37), (30, 72)), ((0, 207), (170, 405))),
|
||||
(False, 260, (141, 141), ((0, 42), (35, 77)), ((0, 235), (198, 433))),
|
||||
],
|
||||
)
|
||||
def test_terminal_pair_contract_uses_native_temporal_grid(
|
||||
initial_pair,
|
||||
physical_frames,
|
||||
logical_frames,
|
||||
video_slices,
|
||||
audio_slices,
|
||||
):
|
||||
contract = _terminal_pair_contract(initial_pair=initial_pair, chunk_seconds=5.0)
|
||||
assert contract["physical_frames"] == physical_frames
|
||||
assert contract["logical_frames"] == logical_frames
|
||||
assert contract["video_slices"] == video_slices
|
||||
assert contract["audio_slices"] == audio_slices
|
||||
|
||||
|
||||
@pytest.mark.parametrize("initial_pair", [True, False])
|
||||
def test_terminal_pair_split_preserves_expected_overlap(initial_pair):
|
||||
contract = _terminal_pair_contract(initial_pair=initial_pair, chunk_seconds=5.0)
|
||||
video_t = contract["video_slices"][-1][1]
|
||||
audio_t = contract["audio_slices"][-1][1]
|
||||
video = torch.arange(video_t, dtype=torch.float32).reshape(1, 1, video_t, 1, 1)
|
||||
audio = torch.arange(audio_t, dtype=torch.float32).reshape(1, 1, 1, audio_t)
|
||||
first, second = _split_terminal_merged_latents(video, audio, contract)
|
||||
assert first[0].shape[2] == contract["video_slices"][0][1]
|
||||
assert first[1].shape[-1] == contract["audio_slices"][0][1]
|
||||
assert second[0][0, 0, 0, 0, 0].item() == contract["video_slices"][1][0]
|
||||
assert second[1][0, 0, 0, 0].item() == contract["audio_slices"][1][0]
|
||||
|
||||
|
||||
def test_two_by_five_uses_one_physical_sample():
|
||||
normal, terminal = _terminal_sampling_plan(chunks=2, completed=0, merge_enabled=True)
|
||||
assert normal == ()
|
||||
assert terminal is True
|
||||
assert len(normal) + int(terminal) == 1
|
||||
|
||||
|
||||
def test_three_by_five_uses_one_normal_and_one_terminal_sample():
|
||||
normal, terminal = _terminal_sampling_plan(chunks=3, completed=0, merge_enabled=True)
|
||||
assert normal == (0,)
|
||||
assert terminal is True
|
||||
assert len(normal) + int(terminal) == 2
|
||||
|
||||
|
||||
def test_terminal_merge_accepts_distinct_prompts_but_not_timeline_video():
|
||||
common = dict(multi_chunk_flf=True, chunks=2, chunk_seconds=5.0)
|
||||
assert _terminal_flf_merge_enabled(**common, prompt_hashes=["same", "same"], timeline_video_source=None)
|
||||
assert _terminal_flf_merge_enabled(**common, prompt_hashes=["a", "b"], timeline_video_source=None)
|
||||
assert not _terminal_flf_merge_enabled(**common, prompt_hashes=["same", "same"], timeline_video_source=object())
|
||||
|
||||
|
||||
def test_terminal_pair_prompt_preserves_shared_prompt_exactly():
|
||||
prompt, policy = _terminal_pair_prompt(["same", "same"], pair_start=0, chunk_seconds=5.0)
|
||||
assert prompt == "same"
|
||||
assert policy == "shared_prompt_v1"
|
||||
|
||||
|
||||
def test_terminal_pair_prompt_rebases_distinct_sections_to_local_timeline():
|
||||
prompt, policy = _terminal_pair_prompt(["first action", "second action"], pair_start=0, chunk_seconds=5.0)
|
||||
assert prompt == "[0-5s]\nfirst action\n\n[5-10s]\nsecond action"
|
||||
assert policy == "paired_timeline_v1"
|
||||
|
||||
|
||||
def test_partial_terminal_pair_is_discarded_for_atomic_resume():
|
||||
preserved = [{"chunk": 1}, {"chunk": 2}]
|
||||
result, reset = _atomic_terminal_prefix(preserved, chunks=3, reroll_from_chunk=0)
|
||||
assert result == preserved[:1]
|
||||
assert reset is True
|
||||
|
||||
|
||||
from ComfyUI_H3_Continuum_Join.v2.seeds import derive_chunk_seed
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
("initial_pair", "physical_frames", "logical_frames", "video_slices", "audio_slices"),
|
||||
[
|
||||
(True, 243, (124, 141), ((0, 37), (30, 72)), ((0, 207), (170, 405))),
|
||||
(False, 260, (141, 141), ((0, 42), (35, 77)), ((0, 235), (198, 433))),
|
||||
],
|
||||
)
|
||||
def test_terminal_pair_contract_uses_native_temporal_grid(
|
||||
initial_pair,
|
||||
physical_frames,
|
||||
logical_frames,
|
||||
video_slices,
|
||||
audio_slices,
|
||||
):
|
||||
contract = _terminal_pair_contract(initial_pair=initial_pair, chunk_seconds=5.0)
|
||||
assert contract["physical_frames"] == physical_frames
|
||||
assert contract["logical_frames"] == logical_frames
|
||||
assert contract["video_slices"] == video_slices
|
||||
assert contract["audio_slices"] == audio_slices
|
||||
|
||||
|
||||
@pytest.mark.parametrize("initial_pair", [True, False])
|
||||
def test_terminal_pair_split_preserves_expected_overlap(initial_pair):
|
||||
contract = _terminal_pair_contract(initial_pair=initial_pair, chunk_seconds=5.0)
|
||||
video_t = contract["video_slices"][-1][1]
|
||||
audio_t = contract["audio_slices"][-1][1]
|
||||
video = torch.arange(video_t, dtype=torch.float32).reshape(1, 1, video_t, 1, 1)
|
||||
audio = torch.arange(audio_t, dtype=torch.float32).reshape(1, 1, 1, audio_t)
|
||||
first, second = _split_terminal_merged_latents(video, audio, contract)
|
||||
assert first[0].shape[2] == contract["video_slices"][0][1]
|
||||
assert first[1].shape[-1] == contract["audio_slices"][0][1]
|
||||
assert second[0][0, 0, 0, 0, 0].item() == contract["video_slices"][1][0]
|
||||
assert second[1][0, 0, 0, 0].item() == contract["audio_slices"][1][0]
|
||||
|
||||
|
||||
def test_two_by_five_uses_one_physical_sample():
|
||||
normal, terminal = _terminal_sampling_plan(chunks=2, completed=0, merge_enabled=True)
|
||||
assert normal == ()
|
||||
assert terminal is True
|
||||
assert len(normal) + int(terminal) == 1
|
||||
|
||||
|
||||
def test_three_by_five_uses_one_normal_and_one_terminal_sample():
|
||||
normal, terminal = _terminal_sampling_plan(chunks=3, completed=0, merge_enabled=True)
|
||||
assert normal == (0,)
|
||||
assert terminal is True
|
||||
assert len(normal) + int(terminal) == 2
|
||||
|
||||
|
||||
def test_terminal_merge_accepts_distinct_prompts_but_not_timeline_video():
|
||||
common = dict(multi_chunk_flf=True, chunks=2, chunk_seconds=5.0)
|
||||
assert _terminal_flf_merge_enabled(**common, prompt_hashes=["same", "same"], timeline_video_source=None)
|
||||
assert _terminal_flf_merge_enabled(**common, prompt_hashes=["a", "b"], timeline_video_source=None)
|
||||
assert not _terminal_flf_merge_enabled(**common, prompt_hashes=["same", "same"], timeline_video_source=object())
|
||||
|
||||
|
||||
def test_terminal_pair_prompt_preserves_shared_prompt_exactly():
|
||||
prompt, policy = _terminal_pair_prompt(["same", "same"], pair_start=0, chunk_seconds=5.0)
|
||||
assert prompt == "same"
|
||||
assert policy == "shared_prompt_v1"
|
||||
|
||||
|
||||
def test_terminal_pair_prompt_rebases_distinct_sections_to_local_timeline():
|
||||
prompt, policy = _terminal_pair_prompt(["first action", "second action"], pair_start=0, chunk_seconds=5.0)
|
||||
assert prompt == "[0-5s]\nfirst action\n\n[5-10s]\nsecond action"
|
||||
assert policy == "paired_timeline_v1"
|
||||
|
||||
|
||||
def test_partial_terminal_pair_is_discarded_for_atomic_resume():
|
||||
preserved = [{"chunk": 1}, {"chunk": 2}]
|
||||
result, reset = _atomic_terminal_prefix(preserved, chunks=3, reroll_from_chunk=0)
|
||||
assert result == preserved[:1]
|
||||
assert reset is True
|
||||
|
||||
|
||||
def test_rerolling_final_chunk_regenerates_both_terminal_chunks():
|
||||
preserved = [{"chunk": 1}, {"chunk": 2}, {"chunk": 3}]
|
||||
result, reset = _atomic_terminal_prefix(preserved, chunks=3, reroll_from_chunk=3)
|
||||
assert result == preserved[:1]
|
||||
preserved = [{"chunk": 1}, {"chunk": 2}, {"chunk": 3}]
|
||||
result, reset = _atomic_terminal_prefix(preserved, chunks=3, reroll_from_chunk=3)
|
||||
assert result == preserved[:1]
|
||||
assert reset is True
|
||||
|
||||
|
||||
@@ -120,9 +120,9 @@ def test_two_chunk_terminal_cache_extended_to_three_reuses_one_generates_two():
|
||||
|
||||
|
||||
def test_complete_terminal_pair_remains_reusable_without_reroll():
|
||||
preserved = [{"chunk": 1}, {"chunk": 2}, {"chunk": 3}]
|
||||
result, reset = _atomic_terminal_prefix(preserved, chunks=3, reroll_from_chunk=0)
|
||||
assert result == preserved
|
||||
preserved = [{"chunk": 1}, {"chunk": 2}, {"chunk": 3}]
|
||||
result, reset = _atomic_terminal_prefix(preserved, chunks=3, reroll_from_chunk=0)
|
||||
assert result == preserved
|
||||
assert reset is False
|
||||
|
||||
|
||||
@@ -150,61 +150,61 @@ def test_terminal_merge_keeps_prefix_with_matching_strategy():
|
||||
|
||||
|
||||
@pytest.mark.parametrize("base_seed", [42, 123456789])
|
||||
def test_initial_terminal_pair_uses_base_seed_directly(base_seed):
|
||||
plan = _terminal_physical_seed_plan(
|
||||
base_seed=base_seed,
|
||||
physical_window_start_index=0,
|
||||
reroll_nonce=0,
|
||||
)
|
||||
assert plan["physical_seed"] == base_seed
|
||||
assert plan["logical_entry_seeds"] == (base_seed, base_seed)
|
||||
|
||||
|
||||
def test_later_terminal_pair_derives_once_from_pair_start():
|
||||
plan = _terminal_physical_seed_plan(
|
||||
base_seed=42,
|
||||
physical_window_start_index=2,
|
||||
reroll_nonce=0,
|
||||
)
|
||||
assert plan["physical_seed"] == derive_chunk_seed(42, 2, 0)
|
||||
assert plan["physical_seed"] == 1808285636802909398
|
||||
assert plan["logical_entry_seeds"] == (plan["physical_seed"],) * 2
|
||||
|
||||
|
||||
def test_terminal_pair_reroll_derives_once_and_shares_new_seed():
|
||||
original = _terminal_physical_seed_plan(
|
||||
base_seed=42,
|
||||
physical_window_start_index=2,
|
||||
reroll_nonce=0,
|
||||
)
|
||||
rerolled = _terminal_physical_seed_plan(
|
||||
base_seed=42,
|
||||
physical_window_start_index=2,
|
||||
reroll_nonce=1,
|
||||
)
|
||||
assert rerolled["physical_seed"] == derive_chunk_seed(42, 2, 1)
|
||||
assert rerolled["physical_seed"] == 4306926667627841302
|
||||
assert rerolled["physical_seed"] != original["physical_seed"]
|
||||
assert rerolled["logical_entry_seeds"] == (rerolled["physical_seed"],) * 2
|
||||
|
||||
|
||||
def test_non_terminal_seed_derivation_golden_values_are_unchanged():
|
||||
assert derive_chunk_seed(42, 0, 0) == 15348518480342951850
|
||||
assert derive_chunk_seed(42, 1, 0) == 13021120982267964226
|
||||
|
||||
|
||||
def test_last_frame_absent_does_not_enable_terminal_merge():
|
||||
assert not _terminal_flf_merge_enabled(
|
||||
multi_chunk_flf=False,
|
||||
chunks=2,
|
||||
chunk_seconds=5.0,
|
||||
prompt_hashes=["same", "same"],
|
||||
timeline_video_source=None,
|
||||
)
|
||||
|
||||
|
||||
def test_one_chunk_keeps_normal_sampling_and_seed_behavior():
|
||||
normal, terminal = _terminal_sampling_plan(chunks=1, completed=0, merge_enabled=False)
|
||||
assert normal == (0,)
|
||||
assert terminal is False
|
||||
assert derive_chunk_seed(42, normal[0], 0) == 15348518480342951850
|
||||
def test_initial_terminal_pair_uses_base_seed_directly(base_seed):
|
||||
plan = _terminal_physical_seed_plan(
|
||||
base_seed=base_seed,
|
||||
physical_window_start_index=0,
|
||||
reroll_nonce=0,
|
||||
)
|
||||
assert plan["physical_seed"] == base_seed
|
||||
assert plan["logical_entry_seeds"] == (base_seed, base_seed)
|
||||
|
||||
|
||||
def test_later_terminal_pair_derives_once_from_pair_start():
|
||||
plan = _terminal_physical_seed_plan(
|
||||
base_seed=42,
|
||||
physical_window_start_index=2,
|
||||
reroll_nonce=0,
|
||||
)
|
||||
assert plan["physical_seed"] == derive_chunk_seed(42, 2, 0)
|
||||
assert plan["physical_seed"] == 1808285636802909398
|
||||
assert plan["logical_entry_seeds"] == (plan["physical_seed"],) * 2
|
||||
|
||||
|
||||
def test_terminal_pair_reroll_derives_once_and_shares_new_seed():
|
||||
original = _terminal_physical_seed_plan(
|
||||
base_seed=42,
|
||||
physical_window_start_index=2,
|
||||
reroll_nonce=0,
|
||||
)
|
||||
rerolled = _terminal_physical_seed_plan(
|
||||
base_seed=42,
|
||||
physical_window_start_index=2,
|
||||
reroll_nonce=1,
|
||||
)
|
||||
assert rerolled["physical_seed"] == derive_chunk_seed(42, 2, 1)
|
||||
assert rerolled["physical_seed"] == 4306926667627841302
|
||||
assert rerolled["physical_seed"] != original["physical_seed"]
|
||||
assert rerolled["logical_entry_seeds"] == (rerolled["physical_seed"],) * 2
|
||||
|
||||
|
||||
def test_non_terminal_seed_derivation_golden_values_are_unchanged():
|
||||
assert derive_chunk_seed(42, 0, 0) == 15348518480342951850
|
||||
assert derive_chunk_seed(42, 1, 0) == 13021120982267964226
|
||||
|
||||
|
||||
def test_last_frame_absent_does_not_enable_terminal_merge():
|
||||
assert not _terminal_flf_merge_enabled(
|
||||
multi_chunk_flf=False,
|
||||
chunks=2,
|
||||
chunk_seconds=5.0,
|
||||
prompt_hashes=["same", "same"],
|
||||
timeline_video_source=None,
|
||||
)
|
||||
|
||||
|
||||
def test_one_chunk_keeps_normal_sampling_and_seed_behavior():
|
||||
normal, terminal = _terminal_sampling_plan(chunks=1, completed=0, merge_enabled=False)
|
||||
assert normal == (0,)
|
||||
assert terminal is False
|
||||
assert derive_chunk_seed(42, normal[0], 0) == 15348518480342951850
|
||||
|
||||
@@ -1,47 +1,47 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import pytest
|
||||
import torch
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import pytest
|
||||
import torch
|
||||
|
||||
from ComfyUI_H3_Continuum_Join.reference import (
|
||||
REFERENCE_SIZE_MATCH_OUTPUT,
|
||||
ReferenceAssets,
|
||||
ReferenceConditioningError,
|
||||
prepare_reference_assets,
|
||||
validate_reference_prompts,
|
||||
REFERENCE_SIZE_MATCH_OUTPUT,
|
||||
ReferenceAssets,
|
||||
ReferenceConditioningError,
|
||||
prepare_reference_assets,
|
||||
validate_reference_prompts,
|
||||
)
|
||||
from ComfyUI_H3_Continuum_Join.reference_audio import validate_reference_audio_prompts
|
||||
from ComfyUI_H3_Continuum_Join.v3 import nodes as v3_nodes
|
||||
|
||||
|
||||
def test_reference_size_is_appended_after_v31_widgets():
|
||||
from pathlib import Path
|
||||
|
||||
source = (Path(__file__).resolve().parents[1] / "v3" / "nodes.py").read_text(
|
||||
encoding="utf-8"
|
||||
)
|
||||
production = source.split("class H3ContinuumSamplerProduction", 1)[1]
|
||||
required = production.split('"optional": {', 1)[0]
|
||||
assert required.index('"run_name"') < required.index('"reference_size"')
|
||||
|
||||
|
||||
def _assets(count: int = 2) -> ReferenceAssets:
|
||||
images = tuple(torch.zeros((1, 32, 32, 3)) for _ in range(count))
|
||||
hashes = tuple(str(index) * 64 for index in range(1, count + 1))
|
||||
return ReferenceAssets(
|
||||
images=images,
|
||||
latents=tuple(None for _ in range(count)),
|
||||
image_hashes=hashes,
|
||||
combined_hash="a" * 64,
|
||||
size_mode=REFERENCE_SIZE_MATCH_OUTPUT,
|
||||
)
|
||||
|
||||
|
||||
|
||||
|
||||
def test_reference_size_is_appended_after_v31_widgets():
|
||||
from pathlib import Path
|
||||
|
||||
source = (Path(__file__).resolve().parents[1] / "v3" / "nodes.py").read_text(
|
||||
encoding="utf-8"
|
||||
)
|
||||
production = source.split("class H3ContinuumSamplerProduction", 1)[1]
|
||||
required = production.split('"optional": {', 1)[0]
|
||||
assert required.index('"run_name"') < required.index('"reference_size"')
|
||||
|
||||
|
||||
def _assets(count: int = 2) -> ReferenceAssets:
|
||||
images = tuple(torch.zeros((1, 32, 32, 3)) for _ in range(count))
|
||||
hashes = tuple(str(index) * 64 for index in range(1, count + 1))
|
||||
return ReferenceAssets(
|
||||
images=images,
|
||||
latents=tuple(None for _ in range(count)),
|
||||
image_hashes=hashes,
|
||||
combined_hash="a" * 64,
|
||||
size_mode=REFERENCE_SIZE_MATCH_OUTPUT,
|
||||
)
|
||||
|
||||
|
||||
def test_reference_contract_contains_metadata_only():
|
||||
contract = _assets().contract
|
||||
assert contract["count"] == 2
|
||||
assert contract["size_mode"] == REFERENCE_SIZE_MATCH_OUTPUT
|
||||
assert contract["image_hashes"] == ["1" * 64, "2" * 64]
|
||||
contract = _assets().contract
|
||||
assert contract["count"] == 2
|
||||
assert contract["size_mode"] == REFERENCE_SIZE_MATCH_OUTPUT
|
||||
assert contract["image_hashes"] == ["1" * 64, "2" * 64]
|
||||
assert not any(torch.is_tensor(value) for value in contract.values())
|
||||
|
||||
|
||||
@@ -74,8 +74,8 @@ def test_v323_third_reference_adds_only_the_image_3_extension():
|
||||
"sha256": "3" * 64,
|
||||
"preprocess_version": 1,
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
def test_unavailable_picture_tags_warn_without_stopping_like_core():
|
||||
assert validate_reference_prompts(["Use <Picture 1> and <Picture 2>."], 2) == ""
|
||||
message = validate_reference_prompts(["Use <Picture 2>."], 1)
|
||||
@@ -86,21 +86,21 @@ def test_unavailable_picture_tags_warn_without_stopping_like_core():
|
||||
message = validate_reference_prompts(["Use <Picture 3>."], 2)
|
||||
assert "unavailable <Picture 3>" in message
|
||||
assert "generation will continue" in message
|
||||
|
||||
|
||||
def test_missing_picture_tag_is_a_warning_not_an_error():
|
||||
|
||||
|
||||
def test_missing_picture_tag_is_a_warning_not_an_error():
|
||||
warning = validate_reference_prompts(["The same person walks forward."], 1)
|
||||
assert "H3C-P103" in warning
|
||||
assert "no <Picture N> tag" in warning
|
||||
|
||||
|
||||
assert "no <Picture N> tag" in warning
|
||||
|
||||
|
||||
def test_reference_socket_rejects_image_batches():
|
||||
with pytest.raises(ReferenceConditioningError, match="batch size B=1"):
|
||||
prepare_reference_assets(
|
||||
reference_image_1=torch.zeros((2, 32, 32, 3)),
|
||||
reference_image_2=None,
|
||||
output_width=32,
|
||||
output_height=32,
|
||||
with pytest.raises(ReferenceConditioningError, match="batch size B=1"):
|
||||
prepare_reference_assets(
|
||||
reference_image_1=torch.zeros((2, 32, 32, 3)),
|
||||
reference_image_2=None,
|
||||
output_width=32,
|
||||
output_height=32,
|
||||
size_mode=REFERENCE_SIZE_MATCH_OUTPUT,
|
||||
)
|
||||
|
||||
|
||||
@@ -151,12 +151,8 @@ def test_v34_public_schema_replaces_reference_audio_with_driving_audio():
|
||||
|
||||
from ComfyUI_H3_Continuum_Join import nodes as root_nodes
|
||||
|
||||
assert root_nodes.NODE_DISPLAY_NAME_MAPPINGS["H3ContinuumSamplerV34"] == (
|
||||
"H3 Continuum Sampler V3.4"
|
||||
)
|
||||
assert root_nodes.NODE_DISPLAY_NAME_MAPPINGS[
|
||||
"H3ContinuumSamplerTimelineVideo"
|
||||
].startswith("[Legacy]")
|
||||
assert "H3ContinuumSamplerV34" not in root_nodes.NODE_CLASS_MAPPINGS
|
||||
assert "H3ContinuumSamplerTimelineVideo" not in root_nodes.NODE_CLASS_MAPPINGS
|
||||
|
||||
|
||||
def test_unused_long_audio_tail_does_not_change_contract_or_output():
|
||||
|
||||
@@ -1,54 +1,54 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from types import SimpleNamespace
|
||||
|
||||
import torch
|
||||
|
||||
from ComfyUI_H3_Continuum_Join.reference import (
|
||||
build_hybrid_presentation_items,
|
||||
combine_hybrid_visual_identity,
|
||||
validate_reference_prompts,
|
||||
)
|
||||
from ComfyUI_H3_Continuum_Join.v2.sequence import _conditioning_cache_key
|
||||
|
||||
|
||||
def _image(value: float) -> torch.Tensor:
|
||||
return torch.full((1, 2, 2, 3), value, dtype=torch.float32)
|
||||
|
||||
|
||||
def test_hybrid_picture_order_first_last_then_references() -> None:
|
||||
first = _image(1.0)
|
||||
last = _image(2.0)
|
||||
ref1 = _image(3.0)
|
||||
ref2 = _image(4.0)
|
||||
items = build_hybrid_presentation_items(
|
||||
[{"type": "image", "data": ref1}, {"type": "image", "data": ref2}],
|
||||
first_image=first,
|
||||
last_image=last,
|
||||
)
|
||||
assert [id(item["data"]) for item in items] == [id(first), id(last), id(ref1), id(ref2)]
|
||||
|
||||
|
||||
def test_hybrid_picture_order_supports_first_only() -> None:
|
||||
first = _image(1.0)
|
||||
ref = _image(2.0)
|
||||
items = build_hybrid_presentation_items(
|
||||
[{"type": "image", "data": ref}],
|
||||
first_image=first,
|
||||
)
|
||||
assert [id(item["data"]) for item in items] == [id(first), id(ref)]
|
||||
|
||||
|
||||
def test_hybrid_picture_order_supports_last_only() -> None:
|
||||
last = _image(1.0)
|
||||
ref = _image(2.0)
|
||||
items = build_hybrid_presentation_items(
|
||||
[{"type": "image", "data": ref}],
|
||||
last_image=last,
|
||||
)
|
||||
assert [id(item["data"]) for item in items] == [id(last), id(ref)]
|
||||
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from types import SimpleNamespace
|
||||
|
||||
import torch
|
||||
|
||||
from ComfyUI_H3_Continuum_Join.reference import (
|
||||
build_hybrid_presentation_items,
|
||||
combine_hybrid_visual_identity,
|
||||
validate_reference_prompts,
|
||||
)
|
||||
from ComfyUI_H3_Continuum_Join.v2.sequence import _conditioning_cache_key
|
||||
|
||||
|
||||
def _image(value: float) -> torch.Tensor:
|
||||
return torch.full((1, 2, 2, 3), value, dtype=torch.float32)
|
||||
|
||||
|
||||
def test_hybrid_picture_order_first_last_then_references() -> None:
|
||||
first = _image(1.0)
|
||||
last = _image(2.0)
|
||||
ref1 = _image(3.0)
|
||||
ref2 = _image(4.0)
|
||||
items = build_hybrid_presentation_items(
|
||||
[{"type": "image", "data": ref1}, {"type": "image", "data": ref2}],
|
||||
first_image=first,
|
||||
last_image=last,
|
||||
)
|
||||
assert [id(item["data"]) for item in items] == [id(first), id(last), id(ref1), id(ref2)]
|
||||
|
||||
|
||||
def test_hybrid_picture_order_supports_first_only() -> None:
|
||||
first = _image(1.0)
|
||||
ref = _image(2.0)
|
||||
items = build_hybrid_presentation_items(
|
||||
[{"type": "image", "data": ref}],
|
||||
first_image=first,
|
||||
)
|
||||
assert [id(item["data"]) for item in items] == [id(first), id(ref)]
|
||||
|
||||
|
||||
def test_hybrid_picture_order_supports_last_only() -> None:
|
||||
last = _image(1.0)
|
||||
ref = _image(2.0)
|
||||
items = build_hybrid_presentation_items(
|
||||
[{"type": "image", "data": ref}],
|
||||
last_image=last,
|
||||
)
|
||||
assert [id(item["data"]) for item in items] == [id(last), id(ref)]
|
||||
|
||||
|
||||
def test_hybrid_prompt_validation_offsets_reference_numbers() -> None:
|
||||
assert validate_reference_prompts(
|
||||
["<Picture 1> starts the shot and <Picture 3> defines identity."],
|
||||
@@ -79,64 +79,64 @@ def test_hybrid_prompt_validation_reports_the_missing_reference_number() -> None
|
||||
|
||||
|
||||
def test_pure_fl_identity_is_unchanged() -> None:
|
||||
assert combine_hybrid_visual_identity(
|
||||
keyframe_identity_hash="fl-identity",
|
||||
reference_assets=None,
|
||||
has_first=True,
|
||||
has_last=True,
|
||||
) == "fl-identity"
|
||||
|
||||
|
||||
def test_pure_reference_identity_is_unchanged() -> None:
|
||||
references = SimpleNamespace(combined_hash="reference-identity")
|
||||
assert combine_hybrid_visual_identity(
|
||||
keyframe_identity_hash="unused",
|
||||
reference_assets=references,
|
||||
has_first=False,
|
||||
has_last=False,
|
||||
) == "reference-identity"
|
||||
|
||||
|
||||
def test_hybrid_identity_uses_keyframes_and_references() -> None:
|
||||
references = SimpleNamespace(combined_hash="reference-identity")
|
||||
first = combine_hybrid_visual_identity(
|
||||
keyframe_identity_hash="keyframe-a",
|
||||
reference_assets=references,
|
||||
has_first=True,
|
||||
has_last=False,
|
||||
)
|
||||
second = combine_hybrid_visual_identity(
|
||||
keyframe_identity_hash="keyframe-b",
|
||||
reference_assets=references,
|
||||
has_first=True,
|
||||
has_last=False,
|
||||
)
|
||||
assert first != "keyframe-a"
|
||||
assert first != "reference-identity"
|
||||
assert first != second
|
||||
|
||||
|
||||
def test_hybrid_conditioning_cache_key_reuses_encoded_reference_prompt() -> None:
|
||||
references = SimpleNamespace(count=1)
|
||||
assert _conditioning_cache_key(
|
||||
"final prompt",
|
||||
include_last=True,
|
||||
reference_assets=references,
|
||||
) == ("final prompt", False)
|
||||
|
||||
|
||||
def test_pure_fl_conditioning_cache_key_keeps_final_frame_variant() -> None:
|
||||
assert _conditioning_cache_key(
|
||||
"final prompt",
|
||||
include_last=True,
|
||||
reference_assets=None,
|
||||
) == ("final prompt", True)
|
||||
|
||||
|
||||
def test_pure_reference_conditioning_cache_key_stays_without_last_frame() -> None:
|
||||
references = SimpleNamespace(count=1)
|
||||
assert _conditioning_cache_key(
|
||||
"reference prompt",
|
||||
include_last=False,
|
||||
reference_assets=references,
|
||||
) == ("reference prompt", False)
|
||||
assert combine_hybrid_visual_identity(
|
||||
keyframe_identity_hash="fl-identity",
|
||||
reference_assets=None,
|
||||
has_first=True,
|
||||
has_last=True,
|
||||
) == "fl-identity"
|
||||
|
||||
|
||||
def test_pure_reference_identity_is_unchanged() -> None:
|
||||
references = SimpleNamespace(combined_hash="reference-identity")
|
||||
assert combine_hybrid_visual_identity(
|
||||
keyframe_identity_hash="unused",
|
||||
reference_assets=references,
|
||||
has_first=False,
|
||||
has_last=False,
|
||||
) == "reference-identity"
|
||||
|
||||
|
||||
def test_hybrid_identity_uses_keyframes_and_references() -> None:
|
||||
references = SimpleNamespace(combined_hash="reference-identity")
|
||||
first = combine_hybrid_visual_identity(
|
||||
keyframe_identity_hash="keyframe-a",
|
||||
reference_assets=references,
|
||||
has_first=True,
|
||||
has_last=False,
|
||||
)
|
||||
second = combine_hybrid_visual_identity(
|
||||
keyframe_identity_hash="keyframe-b",
|
||||
reference_assets=references,
|
||||
has_first=True,
|
||||
has_last=False,
|
||||
)
|
||||
assert first != "keyframe-a"
|
||||
assert first != "reference-identity"
|
||||
assert first != second
|
||||
|
||||
|
||||
def test_hybrid_conditioning_cache_key_reuses_encoded_reference_prompt() -> None:
|
||||
references = SimpleNamespace(count=1)
|
||||
assert _conditioning_cache_key(
|
||||
"final prompt",
|
||||
include_last=True,
|
||||
reference_assets=references,
|
||||
) == ("final prompt", False)
|
||||
|
||||
|
||||
def test_pure_fl_conditioning_cache_key_keeps_final_frame_variant() -> None:
|
||||
assert _conditioning_cache_key(
|
||||
"final prompt",
|
||||
include_last=True,
|
||||
reference_assets=None,
|
||||
) == ("final prompt", True)
|
||||
|
||||
|
||||
def test_pure_reference_conditioning_cache_key_stays_without_last_frame() -> None:
|
||||
references = SimpleNamespace(count=1)
|
||||
assert _conditioning_cache_key(
|
||||
"reference prompt",
|
||||
include_last=False,
|
||||
reference_assets=references,
|
||||
) == ("reference prompt", False)
|
||||
|
||||
@@ -1,154 +1,154 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import inspect
|
||||
import json
|
||||
from pathlib import Path
|
||||
|
||||
import pytest
|
||||
import torch
|
||||
|
||||
from ComfyUI_H3_Continuum_Join.reference_audio import (
|
||||
ReferenceAudioError,
|
||||
prepare_reference_audio_source,
|
||||
)
|
||||
from ComfyUI_H3_Continuum_Join.run_storage import automatic_project_key
|
||||
from ComfyUI_H3_Continuum_Join.v3 import driving_nodes
|
||||
from ComfyUI_H3_Continuum_Join.v3.driving_nodes import (
|
||||
H3ContinuumSamplerV34,
|
||||
H3ContinuumSamplerV35,
|
||||
)
|
||||
from ComfyUI_H3_Continuum_Join.v3.nodes import H3ContinuumSamplerProduction
|
||||
|
||||
|
||||
ROOT = Path(__file__).resolve().parents[1]
|
||||
|
||||
|
||||
def test_v35_appends_reference_audio_sockets_without_changing_v34_schema():
|
||||
v34_optional = H3ContinuumSamplerV34.INPUT_TYPES()["optional"]
|
||||
v35_optional = H3ContinuumSamplerV35.INPUT_TYPES()["optional"]
|
||||
|
||||
assert "reference_audio_1" not in v34_optional
|
||||
assert "reference_audio_vae" not in v34_optional
|
||||
assert list(v35_optional)[:-2] == list(v34_optional)
|
||||
assert list(v35_optional)[-2:] == ["reference_audio_1", "reference_audio_vae"]
|
||||
assert v35_optional["reference_audio_1"][0] == "AUDIO"
|
||||
assert v35_optional["reference_audio_1"][1]["display_name"] == (
|
||||
from __future__ import annotations
|
||||
|
||||
import inspect
|
||||
import json
|
||||
from pathlib import Path
|
||||
|
||||
import pytest
|
||||
import torch
|
||||
|
||||
from ComfyUI_H3_Continuum_Join.reference_audio import (
|
||||
ReferenceAudioError,
|
||||
prepare_reference_audio_source,
|
||||
)
|
||||
from ComfyUI_H3_Continuum_Join.run_storage import automatic_project_key
|
||||
from ComfyUI_H3_Continuum_Join.v3 import driving_nodes
|
||||
from ComfyUI_H3_Continuum_Join.v3.driving_nodes import (
|
||||
H3ContinuumSamplerV34,
|
||||
H3ContinuumSamplerV35,
|
||||
)
|
||||
from ComfyUI_H3_Continuum_Join.v3.nodes import H3ContinuumSamplerProduction
|
||||
|
||||
|
||||
ROOT = Path(__file__).resolve().parents[1]
|
||||
|
||||
|
||||
def test_v35_appends_reference_audio_sockets_without_changing_v34_schema():
|
||||
v34_optional = H3ContinuumSamplerV34.INPUT_TYPES()["optional"]
|
||||
v35_optional = H3ContinuumSamplerV35.INPUT_TYPES()["optional"]
|
||||
|
||||
assert "reference_audio_1" not in v34_optional
|
||||
assert "reference_audio_vae" not in v34_optional
|
||||
assert list(v35_optional)[:-2] == list(v34_optional)
|
||||
assert list(v35_optional)[-2:] == ["reference_audio_1", "reference_audio_vae"]
|
||||
assert v35_optional["reference_audio_1"][0] == "AUDIO"
|
||||
assert v35_optional["reference_audio_1"][1]["display_name"] == (
|
||||
"Reference Audio (Optional)"
|
||||
)
|
||||
assert v35_optional["reference_audio_vae"][0] == "VAE"
|
||||
assert v35_optional["reference_audio_vae"][1]["display_name"] == (
|
||||
)
|
||||
assert v35_optional["reference_audio_vae"][0] == "VAE"
|
||||
assert v35_optional["reference_audio_vae"][1]["display_name"] == (
|
||||
"Reference Audio VAE (Optional)"
|
||||
)
|
||||
assert "Driving Audio" in v35_optional["reference_audio_1"][1]["tooltip"]
|
||||
|
||||
|
||||
def test_v34_internal_reference_audio_parameters_are_appended_and_forwarded(
|
||||
monkeypatch,
|
||||
):
|
||||
parameters = list(inspect.signature(H3ContinuumSamplerV34.run).parameters)
|
||||
assert parameters[-4:] == [
|
||||
"capture_refine_context",
|
||||
"reference_audio_1",
|
||||
"reference_audio_vae",
|
||||
"kwargs",
|
||||
]
|
||||
|
||||
captured = {}
|
||||
reference_audio = object()
|
||||
reference_audio_vae = object()
|
||||
|
||||
monkeypatch.setattr(
|
||||
driving_nodes,
|
||||
"prepare_driving_audio_source",
|
||||
lambda *_args, **_kwargs: None,
|
||||
)
|
||||
monkeypatch.setattr(
|
||||
"ComfyUI_H3_Continuum_Join.reference_video.prepare_reference_video_source",
|
||||
lambda *_args, **_kwargs: None,
|
||||
)
|
||||
|
||||
def production_run(_self, **kwargs):
|
||||
captured.update(kwargs)
|
||||
return [], [], {}, "status"
|
||||
|
||||
monkeypatch.setattr(H3ContinuumSamplerProduction, "run", production_run)
|
||||
outputs = H3ContinuumSamplerV34().run(
|
||||
reference_audio_1=reference_audio,
|
||||
reference_audio_vae=reference_audio_vae,
|
||||
chunks=1,
|
||||
chunk_seconds=5.0,
|
||||
width=640,
|
||||
height=640,
|
||||
)
|
||||
|
||||
assert captured["reference_audio_1"] is reference_audio
|
||||
assert captured["reference_audio_vae"] is reference_audio_vae
|
||||
assert outputs[-1] is None
|
||||
|
||||
|
||||
def test_v35_run_forwards_reference_audio_without_duplicate_preparation(monkeypatch):
|
||||
captured = {}
|
||||
reference_audio = object()
|
||||
reference_audio_vae = object()
|
||||
|
||||
def v34_run(_self, *args, **kwargs):
|
||||
captured.update(kwargs)
|
||||
return [], [], {}, "status", None, {"groups": ()}
|
||||
|
||||
monkeypatch.setattr(H3ContinuumSamplerV34, "run", v34_run)
|
||||
H3ContinuumSamplerV35().run(
|
||||
reference_audio_1=reference_audio,
|
||||
reference_audio_vae=reference_audio_vae,
|
||||
)
|
||||
|
||||
assert captured["reference_audio_1"] is reference_audio
|
||||
assert captured["reference_audio_vae"] is reference_audio_vae
|
||||
assert captured["capture_refine_context"] is True
|
||||
assert captured["memory_attribution"] is True
|
||||
|
||||
|
||||
def test_reference_audio_vae_is_ignored_without_audio_and_required_with_audio():
|
||||
vae = object()
|
||||
assert prepare_reference_audio_source(None, vae) is None
|
||||
audio = {
|
||||
"waveform": torch.zeros((1, 2, 32000), dtype=torch.float32),
|
||||
"sample_rate": 32000,
|
||||
}
|
||||
with pytest.raises(ReferenceAudioError, match="reference_audio_vae is required"):
|
||||
prepare_reference_audio_source(audio, None)
|
||||
|
||||
|
||||
def test_unused_reference_audio_vae_does_not_change_automatic_project_key():
|
||||
base = {
|
||||
"1": {"class_type": "H3ContinuumSamplerV35", "inputs": {}},
|
||||
"2": {"class_type": "VAELoader", "inputs": {}},
|
||||
}
|
||||
vae_only = {
|
||||
**base,
|
||||
"1": {
|
||||
"class_type": "H3ContinuumSamplerV35",
|
||||
"inputs": {"reference_audio_vae": ["2", 0]},
|
||||
},
|
||||
}
|
||||
assert automatic_project_key(base, "1") == automatic_project_key(vae_only, "1")
|
||||
|
||||
|
||||
def test_published_v35_template_keeps_existing_sampler_socket_routes():
|
||||
template = ROOT / "examples/workflows/MiniMax_H3_Continuum_V35.json"
|
||||
if not template.exists():
|
||||
pytest.skip("published workflow template is not installed in this runtime copy")
|
||||
workflow = json.loads(
|
||||
template.read_text(encoding="utf-8")
|
||||
)
|
||||
sampler = next(
|
||||
node for node in workflow["nodes"] if node["type"] == "H3ContinuumSamplerV35"
|
||||
)
|
||||
routes = {item["name"]: item.get("link") for item in sampler["inputs"]}
|
||||
assert routes["reference_image_1"] == 321
|
||||
assert routes["reference_image_2"] == 320
|
||||
assert routes["reference_image_3"] == 318
|
||||
assert routes["reference_video_1"] == 322
|
||||
assert routes["driving_audio"] == 294
|
||||
assert routes["audio_vae"] == 295
|
||||
assert "reference_audio_1" not in routes
|
||||
assert "reference_audio_vae" not in routes
|
||||
)
|
||||
assert "Driving Audio" in v35_optional["reference_audio_1"][1]["tooltip"]
|
||||
|
||||
|
||||
def test_v34_internal_reference_audio_parameters_are_appended_and_forwarded(
|
||||
monkeypatch,
|
||||
):
|
||||
parameters = list(inspect.signature(H3ContinuumSamplerV34.run).parameters)
|
||||
assert parameters[-4:] == [
|
||||
"capture_refine_context",
|
||||
"reference_audio_1",
|
||||
"reference_audio_vae",
|
||||
"kwargs",
|
||||
]
|
||||
|
||||
captured = {}
|
||||
reference_audio = object()
|
||||
reference_audio_vae = object()
|
||||
|
||||
monkeypatch.setattr(
|
||||
driving_nodes,
|
||||
"prepare_driving_audio_source",
|
||||
lambda *_args, **_kwargs: None,
|
||||
)
|
||||
monkeypatch.setattr(
|
||||
"ComfyUI_H3_Continuum_Join.reference_video.prepare_reference_video_source",
|
||||
lambda *_args, **_kwargs: None,
|
||||
)
|
||||
|
||||
def production_run(_self, **kwargs):
|
||||
captured.update(kwargs)
|
||||
return [], [], {}, "status"
|
||||
|
||||
monkeypatch.setattr(H3ContinuumSamplerProduction, "run", production_run)
|
||||
outputs = H3ContinuumSamplerV34().run(
|
||||
reference_audio_1=reference_audio,
|
||||
reference_audio_vae=reference_audio_vae,
|
||||
chunks=1,
|
||||
chunk_seconds=5.0,
|
||||
width=640,
|
||||
height=640,
|
||||
)
|
||||
|
||||
assert captured["reference_audio_1"] is reference_audio
|
||||
assert captured["reference_audio_vae"] is reference_audio_vae
|
||||
assert outputs[-1] is None
|
||||
|
||||
|
||||
def test_v35_run_forwards_reference_audio_without_duplicate_preparation(monkeypatch):
|
||||
captured = {}
|
||||
reference_audio = object()
|
||||
reference_audio_vae = object()
|
||||
|
||||
def v34_run(_self, *args, **kwargs):
|
||||
captured.update(kwargs)
|
||||
return [], [], {}, "status", None, {"groups": ()}
|
||||
|
||||
monkeypatch.setattr(H3ContinuumSamplerV34, "run", v34_run)
|
||||
H3ContinuumSamplerV35().run(
|
||||
reference_audio_1=reference_audio,
|
||||
reference_audio_vae=reference_audio_vae,
|
||||
)
|
||||
|
||||
assert captured["reference_audio_1"] is reference_audio
|
||||
assert captured["reference_audio_vae"] is reference_audio_vae
|
||||
assert captured["capture_refine_context"] is True
|
||||
assert captured["memory_attribution"] is True
|
||||
|
||||
|
||||
def test_reference_audio_vae_is_ignored_without_audio_and_required_with_audio():
|
||||
vae = object()
|
||||
assert prepare_reference_audio_source(None, vae) is None
|
||||
audio = {
|
||||
"waveform": torch.zeros((1, 2, 32000), dtype=torch.float32),
|
||||
"sample_rate": 32000,
|
||||
}
|
||||
with pytest.raises(ReferenceAudioError, match="reference_audio_vae is required"):
|
||||
prepare_reference_audio_source(audio, None)
|
||||
|
||||
|
||||
def test_unused_reference_audio_vae_does_not_change_automatic_project_key():
|
||||
base = {
|
||||
"1": {"class_type": "H3ContinuumSamplerV35", "inputs": {}},
|
||||
"2": {"class_type": "VAELoader", "inputs": {}},
|
||||
}
|
||||
vae_only = {
|
||||
**base,
|
||||
"1": {
|
||||
"class_type": "H3ContinuumSamplerV35",
|
||||
"inputs": {"reference_audio_vae": ["2", 0]},
|
||||
},
|
||||
}
|
||||
assert automatic_project_key(base, "1") == automatic_project_key(vae_only, "1")
|
||||
|
||||
|
||||
def test_published_v35_template_keeps_existing_sampler_socket_routes():
|
||||
template = ROOT / "examples/workflows/MiniMax_H3_Continuum_V35.json"
|
||||
if not template.exists():
|
||||
pytest.skip("published workflow template is not installed in this runtime copy")
|
||||
workflow = json.loads(
|
||||
template.read_text(encoding="utf-8")
|
||||
)
|
||||
sampler = next(
|
||||
node for node in workflow["nodes"] if node["type"] == "H3ContinuumSamplerV35"
|
||||
)
|
||||
routes = {item["name"]: item.get("link") for item in sampler["inputs"]}
|
||||
assert routes["reference_image_1"] == 321
|
||||
assert routes["reference_image_2"] == 320
|
||||
assert routes["reference_image_3"] == 318
|
||||
assert routes["reference_video_1"] == 322
|
||||
assert routes["driving_audio"] == 294
|
||||
assert routes["audio_vae"] == 295
|
||||
assert "reference_audio_1" not in routes
|
||||
assert "reference_audio_vae" not in routes
|
||||
|
||||