release: publish H3 Continuum V3.8X (3.8.1)

This commit is contained in:
ukr8b3g-cmyk
2026-09-15 03:46:57 +09:00
parent c421913bf1
commit 764179869f
62 changed files with 5707 additions and 2018 deletions
+3 -3
View File
@@ -31,10 +31,10 @@ docs/*
!docs/V38_OPEN_INTEGRATION_CONTRACT.md !docs/V38_OPEN_INTEGRATION_CONTRACT.md
!docs/V38_RELEASE_AND_MIGRATION.md !docs/V38_RELEASE_AND_MIGRATION.md
# One user-supplied Spectrum graph, in JSON and ZIP forms. External custom-node # One V3.8X user-supplied Spectrum graph, in JSON and ZIP forms. External custom-node
# dependencies are documented, not bundled. Historical examples stay in Git. # dependencies are documented, not bundled. Historical examples stay in Git.
examples/* examples/*
!examples/workflows/ !examples/workflows/
examples/workflows/* examples/workflows/*
!examples/workflows/MiniMax_H3_Continuum_V38.json !examples/workflows/MiniMax_H3_Continuum_V38x.json
!examples/workflows/MiniMax_H3_Continuum_V38.zip !examples/workflows/MiniMax_H3_Continuum_V38x.zip
+15 -1
View File
@@ -1,5 +1,19 @@
# Changelog # Changelog
## 3.8.1 — V3.8X release candidate (2026-09-15)
- Promote the accepted R0–R6 Runtime Redesign and final local GPU Functional Gate to the V3.8X (`3.8.1`) release candidate.
- Rename the current supplied Spectrum workflow to `MiniMax_H3_Continuum_V38x.json` and its matching ZIP. The JSON and ZIP remain byte-for-byte paired; the graph is unchanged.
- Preserve old V3.8.0 installation through the existing `v3.8.0` Git tag. Do not mix its workflow with V3.8X; use the matching tag/package for an older saved workflow.
- No new public node, socket, widget-order, Sampling, Review, or Run Storage contract is introduced by this release label.
## Unreleased — V3.8.x release hygiene (2026-09-14)
- Updated the canonical V3.8 workflow to remove both `easy cleanGpuUsed` nodes. First Image now connects directly to the Sampler, and Core Create Video connects directly to Core Save Video; ComfyUI-Easy-Use is no longer a workflow dependency.
- Fixed the shipped legacy `v3.reference_video` module to import the shared temporal helper from the package root.
- Hardened the Windows installer: validate and copy only the Registry Manifest payload, and move previous installations to a backup directory outside `custom_nodes`.
- No Sampling, Review, or Run Storage behavior is changed by these release-hygiene repairs.
## 3.8.0 — Review UI hotfix on main (2026-09-08) ## 3.8.0 — Review UI hotfix on main (2026-09-08)
- Withdraw stale Continue/Retry/Finish actions after local or connected generation inputs change. A stale queued Retry falls back to normal backend compatibility/reuse checks instead of targeting an incompatible saved review. - Withdraw stale Continue/Retry/Finish actions after local or connected generation inputs change. A stale queued Retry falls back to normal backend compatibility/reuse checks instead of targeting an incompatible saved review.
@@ -14,7 +28,7 @@
- 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. - 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 `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. - 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. - Publish one user-supplied V3.8 Spectrum workflow as matching JSON and ZIP. It requires Spectrum, rgthree, and KJNodes; 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 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. - 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. - 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.
+1 -1
View File
@@ -23,7 +23,7 @@ V3.8の公開ノードは7個です。
標準の入出力経路は、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を入力)で指定します。 標準の入出力経路は、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にしてください。 配布Workflowは `examples/workflows/MiniMax_H3_Continuum_V38x.json` と同じJSONを含む同名ZIPです。このV3.8X(package 3.8.1)ZIPはWorkflowだけを格納しており、手順3のカスタムノード本体ZIPとは別物です。旧V3.8.0は`v3.8.0` tagから導入できます。Spectrum対応graphですが、保存状態ではSpectrumとTurbo LoRAはどちらもOFFです。Spectrum、rgthree、KJNodesを別途導入してください。ComfyUI-Easy-Useは不要です。モデルや画像・音声は含みません。保存済みファイル名は各自の入力へ置き換え、不要な入力はOFFにしてください。
最小確認: 最小確認:
- chunks: 2 または 3 - chunks: 2 または 3
+258 -258
View File
@@ -1,258 +1,258 @@
dca65fb1393e67f59c6f81f9411e3e745eb8f1097e9a2adf7ffc6f4e3901ca9f __init__.py dca65fb1393e67f59c6f81f9411e3e745eb8f1097e9a2adf7ffc6f4e3901ca9f __init__.py
3e7a1ec3380be2a222c8a3e9b8a6bb184d3a760478957f48186438f15235bdba branch_provenance.py 3e7a1ec3380be2a222c8a3e9b8a6bb184d3a760478957f48186438f15235bdba branch_provenance.py
8296f0afc7be47171e439c02fb2988cfeb0df904acbe3fc4f507f426d709157e .github/workflows/tests.yml 8296f0afc7be47171e439c02fb2988cfeb0df904acbe3fc4f507f426d709157e .github/workflows/tests.yml
0a2f69d4cec89d440f5d5aa1ec68a7c9a741382d313f80dcddf96d13f70b3e68 .gitignore 0a2f69d4cec89d440f5d5aa1ec68a7c9a741382d313f80dcddf96d13f70b3e68 .gitignore
e0d0093229dd4719e97e1ee2c0cf935f6692f323f97af49a6361fd9ffac8a3d2 AGENTS.md 3a865d0b63100ff23ccb3717342b43f7f67036c99e941486a5fd20389177955b CHANGELOG.md
2794b4f4831e5ec9a38b6cb3049736c16d800708057349e80e1a921c90d16a2e CHANGELOG.md c1ed3a0342730450958fb62fd21854a876991f3a4aefb24e5383b0c73cd2312d compatibility.py
c1ed3a0342730450958fb62fd21854a876991f3a4aefb24e5383b0c73cd2312d compatibility.py 4d62508f900af9f93ec320afb900c27cc9a300d1e0c0a94714258498c5ede5fc conditioning.py
4d62508f900af9f93ec320afb900c27cc9a300d1e0c0a94714258498c5ede5fc conditioning.py 64967f4987e3ad9316f3a47f0dcf582eeff39ee0c3485f4184d3532d495534ae constants.py
64967f4987e3ad9316f3a47f0dcf582eeff39ee0c3485f4184d3532d495534ae constants.py cf255b8a635471229aebadc926acfdcacb65963adbcb9e0f9505d04eada2c6b5 continuation.py
cf255b8a635471229aebadc926acfdcacb65963adbcb9e0f9505d04eada2c6b5 continuation.py bf0556b076dbaca67c3405a7d86c333ca7fdf3d4381529b0a9edc906519943e9 guide_timeline.py
bf0556b076dbaca67c3405a7d86c333ca7fdf3d4381529b0a9edc906519943e9 guide_timeline.py f9375629fa1a2c4d3538442f0c3192d7ba2f46fe9544fb2e21f0c144b53d608c docs/AB_TEST_LOG_JA.md
f9375629fa1a2c4d3538442f0c3192d7ba2f46fe9544fb2e21f0c144b53d608c docs/AB_TEST_LOG_JA.md c93a3e52e4deabe5ef0db7f34a7605856a543089574ba17227e697e9a2c0139a docs/ARCHITECTURE.md
c93a3e52e4deabe5ef0db7f34a7605856a543089574ba17227e697e9a2c0139a docs/ARCHITECTURE.md b30fe4640359bebfcdeeb94dbeec94cb346c8e3646509e1dcdb87d7021ba04ff docs/N2B_BRANCH_PROVENANCE_CONTRACT_V1.md
b30fe4640359bebfcdeeb94dbeec94cb346c8e3646509e1dcdb87d7021ba04ff docs/N2B_BRANCH_PROVENANCE_CONTRACT_V1.md 7660570840229b6fcbe62f0fbb52966d0099d64d7e6f01a739fbf9899293c8e4 docs/FUTURE_ROADMAP.md
7660570840229b6fcbe62f0fbb52966d0099d64d7e6f01a739fbf9899293c8e4 docs/FUTURE_ROADMAP.md 9a634b4ff6c9ca98285f6b250402a3d0e67d29f031e134d9bfcab54c119ed337 docs/images/comfyui-manager-h3-continuum.png
9a634b4ff6c9ca98285f6b250402a3d0e67d29f031e134d9bfcab54c119ed337 docs/images/comfyui-manager-h3-continuum.png 6c72d9a9e35648355c4dd4c8f060a6b7667e322f4b6c86690df9d6769ba182b7 docs/images/h3-continuum-advanced.png
6c72d9a9e35648355c4dd4c8f060a6b7667e322f4b6c86690df9d6769ba182b7 docs/images/h3-continuum-advanced.png b9f1dca35706a1cd963ba892d218568ea30173c6cf6a3bdc896f7a2266eb9407 docs/images/h3-continuum-detailed-report.png
b9f1dca35706a1cd963ba892d218568ea30173c6cf6a3bdc896f7a2266eb9407 docs/images/h3-continuum-detailed-report.png de5f8fbce6bc423817acf7dc86bb0c8805a1fd962afdb2722cde7395f117eb56 docs/images/h3-continuum-image-scale.png
de5f8fbce6bc423817acf7dc86bb0c8805a1fd962afdb2722cde7395f117eb56 docs/images/h3-continuum-image-scale.png a384e26f3b088607c616be1a2b038365147d92da0961d8f47060fed09f795062 docs/images/h3-continuum-sampler.png
a384e26f3b088607c616be1a2b038365147d92da0961d8f47060fed09f795062 docs/images/h3-continuum-sampler.png 46c52e21c8f99a75c678e7abf20e381c8140860be2662bad528a6cbfc5f3295d docs/images/h3-continuum-v33-settings.png
46c52e21c8f99a75c678e7abf20e381c8140860be2662bad528a6cbfc5f3295d docs/images/h3-continuum-v33-settings.png 321311da5d2c30953dc2061ca8fdd6e10b84511a15a9bc87704f000dd687cd0a docs/images/h3-continuum-v33-streamlined-ui.png
321311da5d2c30953dc2061ca8fdd6e10b84511a15a9bc87704f000dd687cd0a docs/images/h3-continuum-v33-streamlined-ui.png e93b6f4f8da5b2191f2d7715476eff1ab6c44fd96db689618a4bc0aa307c7b5d docs/images/v31b-auto-resume.png
e93b6f4f8da5b2191f2d7715476eff1ab6c44fd96db689618a4bc0aa307c7b5d docs/images/v31b-auto-resume.png c9573d4393236276d032c4503f8ed8bd19c6ef24e84eec6f64f8a4c47aabc718 docs/images/v34-driving-audio-connection.png
c9573d4393236276d032c4503f8ed8bd19c6ef24e84eec6f64f8a4c47aabc718 docs/images/v34-driving-audio-connection.png 1b9bff0d32ab1928dd85d04700be563458484748a7bfafe4db293c4950ce6bc8 docs/images/v34-regenerate-from.png
1b9bff0d32ab1928dd85d04700be563458484748a7bfafe4db293c4950ce6bc8 docs/images/v34-regenerate-from.png 65efc844c3f116e0a46bc35390bb46e3968df44fd44ea65a63629a3953371605 docs/images/v34-sampler-spectrum-assemble.png
65efc844c3f116e0a46bc35390bb46e3968df44fd44ea65a63629a3953371605 docs/images/v34-sampler-spectrum-assemble.png ff8d901d05aa89f9b698c60b3d11534ef97982b3e22e9ede6255a85149a669c4 docs/images/v34-video-reference-separate-audio.png
ff8d901d05aa89f9b698c60b3d11534ef97982b3e22e9ede6255a85149a669c4 docs/images/v34-video-reference-separate-audio.png 06c333b3dda41526da70d56f4aa25922aafa2f48ec2d99350b0ed6b428e92bad docs/images/v34-video-reference-with-audio.png
06c333b3dda41526da70d56f4aa25922aafa2f48ec2d99350b0ed6b428e92bad docs/images/v34-video-reference-with-audio.png 301afedc3e0922a4bf3bcf445734b5adcdd5c35384132b24a38098c66750f499 docs/images/v34-workflow-overview.png
301afedc3e0922a4bf3bcf445734b5adcdd5c35384132b24a38098c66750f499 docs/images/v34-workflow-overview.png 4e0d904d3bad89cb8c3ffe17fb645bfb6fbc87fe49fe3c75c91094b983726025 docs/images/v35-assemble-seam-node.png
4e0d904d3bad89cb8c3ffe17fb645bfb6fbc87fe49fe3c75c91094b983726025 docs/images/v35-assemble-seam-node.png a53796f7a904d675e80a2276c20d68502f03a3958529278e6ce9465baaf1c4af docs/images/v35-hires-fix-node.png
a53796f7a904d675e80a2276c20d68502f03a3958529278e6ce9465baaf1c4af docs/images/v35-hires-fix-node.png 5a23f232a8b795226e8255e6e2e3248b0130f1c7ce276d50370d0333d6a62ef0 docs/images/v35-second-pass-node.png
5a23f232a8b795226e8255e6e2e3248b0130f1c7ce276d50370d0333d6a62ef0 docs/images/v35-second-pass-node.png 04a34b1b55b627553d08b7b10de71295d55ea9e4ac9815b6dd8ce6d268098851 docs/images/v351-lbh-conditioning-bridge-flow.svg
04a34b1b55b627553d08b7b10de71295d55ea9e4ac9815b6dd8ce6d268098851 docs/images/v351-lbh-conditioning-bridge-flow.svg b16d63242b45fe1abef0a4dddd4fc5b9306aa30c2f84bbc3ddf334a1c0832957 docs/images/v351-reference-audio-permanent.png
b16d63242b45fe1abef0a4dddd4fc5b9306aa30c2f84bbc3ddf334a1c0832957 docs/images/v351-reference-audio-permanent.png ed189c7f16ba1f6e48f557312066fdb5e1313b5ea7df853a99467fd0d7532ef5 docs/images/v351-video-guide-frames.png
ed189c7f16ba1f6e48f557312066fdb5e1313b5ea7df853a99467fd0d7532ef5 docs/images/v351-video-guide-frames.png 0c1dfd5acff349b98ecdfb57ae50941f6da26a462dfd2aaa9b7c7b0a34abf304 docs/images/v352-stabilization-optimization.png
0c1dfd5acff349b98ecdfb57ae50941f6da26a462dfd2aaa9b7c7b0a34abf304 docs/images/v352-stabilization-optimization.png 96395c3682fb0b6375dc23eacabea6ca9ee165078ff04e94458f178eef35c4ae docs/images/v36-masked-av-continuation.png
96395c3682fb0b6375dc23eacabea6ca9ee165078ff04e94458f178eef35c4ae docs/images/v36-masked-av-continuation.png 925898dfe741fdbcc9b429133cfcbfb8ff718a3b476b368a063b46d39511e2f9 docs/images/v36-sampler-node.png
925898dfe741fdbcc9b429133cfcbfb8ff718a3b476b368a063b46d39511e2f9 docs/images/v36-sampler-node.png edf8bcf1e9d76609a4e54ecd14a0ef6e82c9446c64355ff6ce5e25682e95a932 docs/images/v37-sampler-node.png
edf8bcf1e9d76609a4e54ecd14a0ef6e82c9446c64355ff6ce5e25682e95a932 docs/images/v37-sampler-node.png a8defccf63167a1bbd5db3bcba56781887f6ac5ee3f41de29683e0266d850198 docs/images/v37-tail6-second-pass.png
a8defccf63167a1bbd5db3bcba56781887f6ac5ee3f41de29683e0266d850198 docs/images/v37-tail6-second-pass.png 93f07aa727b34802bce3d333426b8ba2af522500882a6d222d00cf577ca82e49 docs/SEAM_TEST_SOURCE_JA.md
93f07aa727b34802bce3d333426b8ba2af522500882a6d222d00cf577ca82e49 docs/SEAM_TEST_SOURCE_JA.md 2c13aefd137db92a3dbf5576e9442d58012b1f0de1240c07d039ceeb702e7c1f docs/V2_1_4_UI_SIMPLIFICATION.md
2c13aefd137db92a3dbf5576e9442d58012b1f0de1240c07d039ceeb702e7c1f docs/V2_1_4_UI_SIMPLIFICATION.md b08022df068576c759c8bf80ac6b6519693f3c65c917f1822aeb06ea359aa5b1 docs/V2_1_5_UI_SERIALIZATION_STABILITY.md
b08022df068576c759c8bf80ac6b6519693f3c65c917f1822aeb06ea359aa5b1 docs/V2_1_5_UI_SERIALIZATION_STABILITY.md a032738b0bc5acb136e92d8bf7694643a5f518b9c7fc0fc878d66d81ba8b1b04 docs/V2_1_6_UNIFIED_UI.md
a032738b0bc5acb136e92d8bf7694643a5f518b9c7fc0fc878d66d81ba8b1b04 docs/V2_1_6_UNIFIED_UI.md 384e3841603f7c6c8286ef147e93aaf7d056a286503a2a4fc21f397e4dec4876 docs/V34_DRIVING_AUDIO_VALIDATION.md
384e3841603f7c6c8286ef147e93aaf7d056a286503a2a4fc21f397e4dec4876 docs/V34_DRIVING_AUDIO_VALIDATION.md 1840c81b4090ff3c86c0c1b0acc2cc10d3d9839e383c81f262a5c59a67504cd6 docs/V35_HIRES_FIX.md
1840c81b4090ff3c86c0c1b0acc2cc10d3d9839e383c81f262a5c59a67504cd6 docs/V35_HIRES_FIX.md f0806bb2b999794ddda072e98424dbd1b613df1cd8a096b12d979f124e066d8a docs/VALIDATION_JA.md
f0806bb2b999794ddda072e98424dbd1b613df1cd8a096b12d979f124e066d8a docs/VALIDATION_JA.md 3fec541a675c1e4e5e287cc8e498036001f34f7a62460321e16f9ba27b5e4c18 docs/VALIDATION_RESULTS.md
3fec541a675c1e4e5e287cc8e498036001f34f7a62460321e16f9ba27b5e4c18 docs/VALIDATION_RESULTS.md cedd7b07901d6065079ef37380f0062d535a39c98c8f614e1b26582f549d7183 driving_audio.py
cedd7b07901d6065079ef37380f0062d535a39c98c8f614e1b26582f549d7183 driving_audio.py 6771c9905d35666121c4892d2ec26202505f96d244ce814ad9a87a02878952cd examples/H3_CONTINUUM_V1_WIRING.md
6771c9905d35666121c4892d2ec26202505f96d244ce814ad9a87a02878952cd examples/H3_CONTINUUM_V1_WIRING.md be419d6c773784823af7b58a3423ef2e21d3cc3e23c40e60e274560895ca034b examples/H3_Continuum_V2_README.txt
f85ba3c69a473f0ac4bb96895c6d6532e8270121da65f858e364b19d31f05ef5 examples/H3_Continuum_V2_3x5s.json 4b94f779a98bfc555f6999113a694da07746cc3cf400bfc70ebc580592034d52 examples/H3_Continuum_V2_reference.webp
be419d6c773784823af7b58a3423ef2e21d3cc3e23c40e60e274560895ca034b examples/H3_Continuum_V2_README.txt c3cefcdf50df9d6609f583a008453b587c011a0fb41e290d5f1196ce62f58877 examples/H3_CONTINUUM_V2_WIRING_JA.md
4b94f779a98bfc555f6999113a694da07746cc3cf400bfc70ebc580592034d52 examples/H3_Continuum_V2_reference.webp 68e1a724d3b99458b86b8f643dcb916183e7e8dd12d7b4b3850991feb8077694 examples/recommended_settings_v1.json
c3cefcdf50df9d6609f583a008453b587c011a0fb41e290d5f1196ce62f58877 examples/H3_CONTINUUM_V2_WIRING_JA.md 5a26408c770381cdb259cb710de7dab12d7ddecca262bdbf35ba1566056050f5 examples/recommended_settings_v2.json
20f4e7c4ad085791f8b578f575d03e52ef09d0d4550aa58ad086c9857b59bf29 examples/H3_Continuum_V2.json b8275c8cecde12aee0418cea456d1e7f4b875cbb1bce32f1f3d9e06a44dd0be1 examples/v2_prompt_list_example.txt
f67febfdd7b2bfca2ad4e477c87a9a74dbe636231f9db3e1158b944d7b9f8397 examples/H3_Continuum_V2.zip 0e59ea821081cb93165aa3f88c6949736dd225837fe1cdcf1173aa5cd54c6d29 examples/v2_prompt_timeline_example.txt
68e1a724d3b99458b86b8f643dcb916183e7e8dd12d7b4b3850991feb8077694 examples/recommended_settings_v1.json 26bbca92b5f7cac4cbde89290b3f801b7a895df76a07493ca6f65c18d5b1154a examples/workflows/MiniMax_H3_Continuum_V38x.json
5a26408c770381cdb259cb710de7dab12d7ddecca262bdbf35ba1566056050f5 examples/recommended_settings_v2.json 7861fac4c8fe82372c5459aa574d35ea003bdb4fd846d567bd891c2e38571b3d graph_contract.py
b8275c8cecde12aee0418cea456d1e7f4b875cbb1bce32f1f3d9e06a44dd0be1 examples/v2_prompt_list_example.txt 1473c384082700f422f2cf9141e0d012d87d2b43ac8a8a433edc7172e6ca7bf6 hardening.py
0e59ea821081cb93165aa3f88c6949736dd225837fe1cdcf1173aa5cd54c6d29 examples/v2_prompt_timeline_example.txt de0da5590691554cbf7f6318ac539a160e639bc3e20ee0752ae189dc31e979ce INSTALL_JA.txt
55bc60447d6cd783b9df049d04b6cebb6e4a633981434ac2b28e5a1527d4f4b4 examples/workflows/MiniMax_H3_Continuum_V32_turbo.json 23bddc5a41d2e997f4fbf789c7128e32f4f197f1405b2aef1c76794f57482446 install_windows.bat
4e410aed8d7f6ebf11c98d4f71571e46855e4619c2bcbec921df70f29189b6b1 examples/workflows/MiniMax_H3_Continuum_V32.json 12bf572a65d57bbc9a72b459f29691c2057768f4fb7a74f9db87f4775e995bda install_windows.ps1
55bc60447d6cd783b9df049d04b6cebb6e4a633981434ac2b28e5a1527d4f4b4 examples/workflows/MiniMax_H3_Continuum_V33_turbo.json 6aa3f5780baa7bb0c0672b5f01a2f77e5f209da93f6373468cb274ea2f643d4b layout_adapter.py
4e410aed8d7f6ebf11c98d4f71571e46855e4619c2bcbec921df70f29189b6b1 examples/workflows/MiniMax_H3_Continuum_V33.json c44abbd789091bbead01250dbd5453e60539d2665c69f162335fdbd2936019c2 LICENSE
3d57fa510f98e0874b73ae74c9402f14611c167ef99269dc9ba025ffcaa34973 examples/workflows/MiniMax_H3_Continuum_V34_turbo.json d3e213005670e94dee33a240349a4d245cf9a3b6602099f11ed30cf5a32e2c21 media.py
a8460ca5092511f6d22da3363331ba8bff4feab01c569e539811049ea1add051 examples/workflows/MiniMax_H3_Continuum_V34.json c59b8119e1e5e185351b5e64a960bcb67ce8689f47d390fe8d783d1b5a0cae29 metadata.ini
ea8c245d36909672710bc9f535f37195e48d7151b0cb2217bcaaca5fcc6d02c0 examples/workflows/MiniMax_H3_Continuum_V35.json 2d611f7201889851eac6459f8aa2b37baf342b345241979ca6042b61b252dff9 model_patch.py
9f1a0766b97ead788989fb6eb69a6b36ad236d7a924eea4a88e4a1696e2db6d8 examples/workflows/MiniMax_H3_Continuum_V351_LBH_Conditioning_Bridge.json a4ce23167b83e8d72b86a802dfde4f4045828433c7c13aab799bd64831dc04a4 nodes.py
1c7f1810f0cdd0bdcee09fe9eb8cb052993dd7343753dc0ec0157e00fe702da3 examples/workflows/MiniMax_H3_Continuum_V36.json 2b8c19f9474beabfebe1802cdf4a89780dce3c351c48d65e1ce8bb77d2fb9ba9 PACKAGE_INFO_JA.txt
9d88ffd2d8f7b4a037bfce0aee59afbe0ab77a27c1496aff34e9d08553772804 examples/workflows/MiniMax_H3_Continuum_V37.json 6da7fe4aa34a43fba59d4f52b6588bd81aa70deef6d9d2dab789664613cd5b2e PACKAGE_VALIDATION.txt
e490c87e4995930f95c8fffc4c678111d7897e74003e1962b9b4a247ba43f4ac examples/workflows/MiniMax_H3_Continuum_V38.json b470819f16fc179654dc1600721a63f0a5a14e777f4c004d574b499da6886ba5 public_api.py
d2d22c441f2a86a49277e3ff30f05678cf3383ca74207efeb81e74bb8b4a72ce examples/workflows/MiniMax_H3_Continuum_Easy_V38.json 4ea98b8792ee9861c569e03e09e9ac8991991d2ee63d037fe86369dd51546e7d pyproject.toml
8c109973e5b49cf52b32e0ebb2b5ae6a4e349191e66c2696ff43ce76fefeb07c graph_contract.py 94fdc2d545b2d4077a4d70229fd22ba3ccac21d49d1097d2873f76d04e9a3c7a pytest.ini
1473c384082700f422f2cf9141e0d012d87d2b43ac8a8a433edc7172e6ca7bf6 hardening.py a1a9f6388e40f3ee217f7691854c04461614a37cd1a97a86fd364759593c4dd4 README_JA.md
7c8b1226592dcd9d0ec6cc1579956e380fedc9b2672386c29db82169a6cf5f10 INSTALL_JA.txt 15763bc9916dfc6be0a77a79aa957f1deebdacfdd41c6468a9df05cf99898dd3 README.md
23bddc5a41d2e997f4fbf789c7128e32f4f197f1405b2aef1c76794f57482446 install_windows.bat 44127adcfa30ee84bff9cd4b2d0c695355209550e76982d374122008728aa5bc reference_audio.py
fcf80acf6479ece00066eeb59f75d5246cb7b17b75ba84938b73ae17a5083903 install_windows.ps1 5cb9bfd6810d3a93a637451980a4cc5c1436e5b84cfd1c7a111cd192e876351b reference_video.py
6aa3f5780baa7bb0c0672b5f01a2f77e5f209da93f6373468cb274ea2f643d4b layout_adapter.py 131bdfbb7a7173c9e7826859c0e648bfb69bd18bf20fa5528c0e18a63f888b26 reference.py
c44abbd789091bbead01250dbd5453e60539d2665c69f162335fdbd2936019c2 LICENSE 467edb2c188d024c2392aafe7423b3f835e16b10f570da76e2f7dda8a962c1c5 requirements.txt
d3e213005670e94dee33a240349a4d245cf9a3b6602099f11ed30cf5a32e2c21 media.py 92e22d0e5413ce7755f380b914a6cf7f2b0a10eba65a2fb928aac3f950d60fb9 run_storage.py
8b360a1c47a8ee5a95656ffbc83bfc16de69678ecec2c1d8cace46b5ea4e911e metadata.ini 6056de6c0a5322a8a51ba5a114538dca2ef67788cd1afba10fedd483b95f6afa state_io.py
2d611f7201889851eac6459f8aa2b37baf342b345241979ca6042b61b252dff9 model_patch.py 3a359a0467725cc292ccb4c86cf0c3d30bb6a114d01f5345792b09ea3d45441d state.py
a4ce23167b83e8d72b86a802dfde4f4045828433c7c13aab799bd64831dc04a4 nodes.py 43ec4023dc06c941e5d7a04db4b8a89fb58d744ceb986f6eb9bf534d4fdcb87b temporal.py
57dcb61cc3e83b2ca97616919ac6ee17d4c62caf845c38161573f56dad12f8fe PACKAGE_INFO_JA.txt db08ce77cc5c5835f2403d4d589394090fa5d25ff3b1840312b2808e1bc203b7 tests/fixtures/v38_a3c_selective_refine_saved_workflow.json
000a56a942b13d11973994ab32cd2a1abc424a3fe1d95a323240077bd8092bdf PACKAGE_VALIDATION.txt e6506f7ee87f59c25e05156f6b9a835ef78443dcf6f0435c48675dda0c0dd63d tests/conftest.py
b470819f16fc179654dc1600721a63f0a5a14e777f4c004d574b499da6886ba5 public_api.py 041289556cc621ea1857cbb8931ae41d817f69e084b2e8a7622e184a3197b61b tests/test_compatibility.py
96f98d727b72d6aefd431061572e187c303365a3e5b4d20cbb2bcf030aa30112 pyproject.toml 875ac33b5458ec5e8d845850ed495707c394436aaadb668a44f36f6a1b73764d tests/test_conditioning_modes.py
94fdc2d545b2d4077a4d70229fd22ba3ccac21d49d1097d2873f76d04e9a3c7a pytest.ini 2be669b6d21ec40a8b0e172b8ab431f82681f3c97c7de0935d87ad43b0ae8b4e tests/test_context_diagnostics.py
f13cdf0a4ddc7943b6a464d50547d8603a0dfdfc8c970e0a601e276cb281b54f README_JA.md c058f189d8e58fd48a80c20c0a857969737a8b13960eee60e5c17db2b9288bc1 tests/test_layout_adapter.py
44076d133dfcd4df14de95c92e6cff19bd1be5c381f200d061c67d382d202996 README.md 2dddf05bbb91b7aa803959a7a8ed78489792ea9c35c5634bfb7d5b1a6c81880f tests/test_model_patch.py
44127adcfa30ee84bff9cd4b2d0c695355209550e76982d374122008728aa5bc reference_audio.py 45e8839cd82fd955df344b3bc6efa20092b8870ea378b0c898b073665d3e47d7 tests/test_nodes_logic.py
5cb9bfd6810d3a93a637451980a4cc5c1436e5b84cfd1c7a111cd192e876351b reference_video.py b635d404ca67df69894c4fcf80d8782cc5699e946bfb55ae4c44fff9d930b018 tests/test_p20_file_backed_tensor_poc.py
131bdfbb7a7173c9e7826859c0e648bfb69bd18bf20fa5528c0e18a63f888b26 reference.py 0f18b8810b2899f87ce6d6bfeee46fcd90ba787fa09665bddd8fc128f1952c65 tests/test_p21_memory_attribution.py
467edb2c188d024c2392aafe7423b3f835e16b10f570da76e2f7dda8a962c1c5 requirements.txt 2b097971258dd10f0df33e0f8cb5843ee6cd3e9ef9e7abb80b890c66baf22908 tests/test_p22_file_backed_buffer.py
2ceba1091dad4fa66da7299e8320ff0a8a6dccb948fc918e3101b40f6d8b03f6 run_storage.py d09d2bae2fac04a058ebce22fa0e761d90b267107923ab8cd01a99cc547624e6 tests/test_p23_assembly_v35.py
6056de6c0a5322a8a51ba5a114538dca2ef67788cd1afba10fedd483b95f6afa state_io.py d2a02c120e01d360ddca17a92d5bc53b12c9f0734d06440b3fc2fad2e754e549 tests/test_p23_video_seam_patches.py
3a359a0467725cc292ccb4c86cf0c3d30bb6a114d01f5345792b09ea3d45441d state.py 114530f8bc4b0a6cd416581636c85d494a07e5dcca93afe9c82f4a5aaaed9dc7 tests/test_p31_prompt_conditioning_cache.py
43ec4023dc06c941e5d7a04db4b8a89fb58d744ceb986f6eb9bf534d4fdcb87b temporal.py 403a0ff300330ac1f97642bf0681e80b83eec18e8911c03952ddf203ce794e5a tests/test_p46a_reference_video_memory.py
db08ce77cc5c5835f2403d4d589394090fa5d25ff3b1840312b2808e1bc203b7 tests/fixtures/v38_a3c_selective_refine_saved_workflow.json 1ae0369943ba2fb13f21ad0cf56ee58621ba09bf20174379595e157a1775c7fd tests/test_public_api.py
e6506f7ee87f59c25e05156f6b9a835ef78443dcf6f0435c48675dda0c0dd63d tests/conftest.py 892d3e3e022a527652dd995508c8bbb650c370caf9ee66fa3eb1f7fd288bba38 tests/test_public_workflow_integrity.py
041289556cc621ea1857cbb8931ae41d817f69e084b2e8a7622e184a3197b61b tests/test_compatibility.py e671a9cc5d093669e63b9121a12451e9d367f9419e03bdd9b1d6ab9021d9b4f7 tests/test_release_metadata.py
875ac33b5458ec5e8d845850ed495707c394436aaadb668a44f36f6a1b73764d tests/test_conditioning_modes.py d4c53d2c260b635d70fa211029d608f63776e0a56c20253475fa47c58363f8a7 tests/test_state_io.py
2be669b6d21ec40a8b0e172b8ab431f82681f3c97c7de0935d87ad43b0ae8b4e tests/test_context_diagnostics.py 5af6a16a2337e3483bb0f9197fe04756decd309e4737520c5557b527d68d51bb tests/test_state.py
c058f189d8e58fd48a80c20c0a857969737a8b13960eee60e5c17db2b9288bc1 tests/test_layout_adapter.py a1f60f01e9d86c1f2a010752612e373e85112c7054ffc31185b9b459eb2b34a5 tests/test_temporal.py
2dddf05bbb91b7aa803959a7a8ed78489792ea9c35c5634bfb7d5b1a6c81880f tests/test_model_patch.py f175e9ebf39d6fcaac578b640422676d7f7a54bfdf0f77ec44a3da6aafefd7cd tests/test_timeline_video.py
45e8839cd82fd955df344b3bc6efa20092b8870ea378b0c898b073665d3e47d7 tests/test_nodes_logic.py dc8b9cf0e77b4983ee4eecc60f4acde7d0e063f3b7569402feca8a56165107fd tests/test_v2_decoder.py
b635d404ca67df69894c4fcf80d8782cc5699e946bfb55ae4c44fff9d930b018 tests/test_p20_file_backed_tensor_poc.py 3cc94a6a7957ef285f58d373fbab001d926d2b43a754d60bb00bfce98675f32d tests/test_v2_prompts.py
0f18b8810b2899f87ce6d6bfeee46fcd90ba787fa09665bddd8fc128f1952c65 tests/test_p21_memory_attribution.py 424a4b34fb391ff3729b38a9b202e36f5bc8b9689a2a9bbf9589254c6261d9c6 tests/test_v2_registration.py
2b097971258dd10f0df33e0f8cb5843ee6cd3e9ef9e7abb80b890c66baf22908 tests/test_p22_file_backed_buffer.py 86314c190d4335586c18191dc095926909c67fe839eb29e65324acd16c44f24e tests/test_v2_seam.py
d09d2bae2fac04a058ebce22fa0e761d90b267107923ab8cd01a99cc547624e6 tests/test_p23_assembly_v35.py 74e623120a963cb96b68651b44f47a836ea8449d30ce89d749c71ffad4766d4e tests/test_v2_seeds_motion.py
d2a02c120e01d360ddca17a92d5bc53b12c9f0734d06440b3fc2fad2e754e549 tests/test_p23_video_seam_patches.py b42bcc0983147462d96c6b71cc4a38e846995dafa6eebefc3ae0d9bb36caf359 tests/test_v2_sequence_orchestration.py
114530f8bc4b0a6cd416581636c85d494a07e5dcca93afe9c82f4a5aaaed9dc7 tests/test_p31_prompt_conditioning_cache.py 0b5b20a8318862d167f135720e0489b8d4f93406d67c6646e052e35b03dcb876 tests/test_v2_session.py
403a0ff300330ac1f97642bf0681e80b83eec18e8911c03952ddf203ce794e5a tests/test_p46a_reference_video_memory.py e22486ac62c53132c275614e4e161c78e6dce09dd0d1a7cf64f641a3b7052b99 tests/test_v2_widget_migration.py
1ae0369943ba2fb13f21ad0cf56ee58621ba09bf20174379595e157a1775c7fd tests/test_public_api.py 0a57d38a6864d704f6dbb58fadb8e3fb05973d1983ea7072aa2aa97c07fa2aa3 tests/test_v217_stable_facade.py
892d3e3e022a527652dd995508c8bbb650c370caf9ee66fa3eb1f7fd288bba38 tests/test_public_workflow_integrity.py 473abac48a57aa5f297c6e141a94de17ddcb9424a8744bae1c46e6a6a734a0ab tests/test_v3_hardening.py
acf50045b69f59f42aa351c9d389e1f259ffa5714643487e899165158ca99893 tests/test_release_metadata.py 35b26c8cade7acb2eec35375d7dfa9a4a112f67a5cec6a842d61c69039de0d84 tests/test_v3_video_seam.py
d4c53d2c260b635d70fa211029d608f63776e0a56c20253475fa47c58363f8a7 tests/test_state_io.py cc954e0cb40f093b03f8a5b655993ab82375f23b624af995fbdb330f1facf1da tests/test_v31_run_storage.py
5af6a16a2337e3483bb0f9197fe04756decd309e4737520c5557b527d68d51bb tests/test_state.py 3af78ab85c8e19dee8d0a98bfd11a2c0e88c30d87256da1f9699c49a19a684e9 tests/test_v32_reference.py
a1f60f01e9d86c1f2a010752612e373e85112c7054ffc31185b9b459eb2b34a5 tests/test_temporal.py 43aef01fc587c9f9e87baf312eb4d588975aaaacab161a36bfcb638a4c11e31c tests/test_v34_driving_audio.py
f175e9ebf39d6fcaac578b640422676d7f7a54bfdf0f77ec44a3da6aafefd7cd tests/test_timeline_video.py 4279354d9ed046588d3a685f5150f1cd1891575ddbdcdba870062d8000c64f30 tests/test_v35_compact_ui_frontend.py
dc8b9cf0e77b4983ee4eecc60f4acde7d0e063f3b7569402feca8a56165107fd tests/test_v2_decoder.py 75dbdd0d9694d82fab7da23f5cc03bc118c024abc865f6c282799aa8c57427fc tests/test_v35_conditioning_bridge.py
3cc94a6a7957ef285f58d373fbab001d926d2b43a754d60bb00bfce98675f32d tests/test_v2_prompts.py f9e191b2262030f988b6230e2a1f32484df03568fa43ac46d2c34adb61b6dffa tests/test_v35_context_sampler.py
424a4b34fb391ff3729b38a9b202e36f5bc8b9689a2a9bbf9589254c6261d9c6 tests/test_v2_registration.py 7380c2ea1eeb4fb212ef51ffdf6d14a33132d3ae6d4c7ed5015f28bba6b7e75b tests/test_v35_hires_fix.py
86314c190d4335586c18191dc095926909c67fe839eb29e65324acd16c44f24e tests/test_v2_seam.py 09a6f88fe4f63b12b11d28a82df1ef8eaf01c756f7bb633a516061b93ae4f73b tests/test_v35_latent_resize.py
74e623120a963cb96b68651b44f47a836ea8449d30ce89d749c71ffad4766d4e tests/test_v2_seeds_motion.py 59a07f2172014dfdc0a447775324d7cd049f20b823276dfaf9b7b3f79628f5a8 tests/test_v35_pixel_vae_resize.py
b42bcc0983147462d96c6b71cc4a38e846995dafa6eebefc3ae0d9bb36caf359 tests/test_v2_sequence_orchestration.py 05ba609fb948665f050d58fb087569a158c040d08bebad1d728b911673b95462 tests/test_v35_refine_context.py
0b5b20a8318862d167f135720e0489b8d4f93406d67c6646e052e35b03dcb876 tests/test_v2_session.py 8ae5173eaec35adf9efcde2c464c95651c848248bdbdd6396ed2e3c3c1ac7965 tests/test_v35_refine_sampling.py
58438c3ed814adf40cefde098a37cae00ddcb703b7e5548bbbb295e54bed5a6d tests/test_v2_widget_migration.py 98a9006ebc4cab2b61b38904e0043fab24e088a25b28ffd38012c29991b8550c tests/test_v35_second_pass_contract.py
fc57dd687a3648f763afbd8badc139451fe64d644db06f81a7a38926cb6b9df7 tests/test_v217_stable_facade.py a11956a22f373d96f13b395971f39187d6bb12cdc153ce794b4729d258ce9725 tests/test_v35_second_pass_sampling.py
473abac48a57aa5f297c6e141a94de17ddcb9424a8744bae1c46e6a6a734a0ab tests/test_v3_hardening.py 1c2ef5ba0c24819d6365f75f1a263e8320d61f5eb31fda8e4c2266273ec21099 tests/test_v351_reference_audio_ui.py
35b26c8cade7acb2eec35375d7dfa9a4a112f67a5cec6a842d61c69039de0d84 tests/test_v3_video_seam.py 5003c5f5ce1a4b4c77deb47011431e4a15fe0cecaeb6d689e0d0878567c42f5a tests/test_v351_reference_audio.py
316a345f88dc424e0d5e017ca64bb0568d0b4e4ddebd076bdebf717028ddb4e4 tests/test_v31_run_storage.py 5f70cf8bd5248120ffcbe75ff3a54e23030fa6eb318ab0de6e0b08ee20e25a87 tests/test_v36_chunk_duration.py
3af78ab85c8e19dee8d0a98bfd11a2c0e88c30d87256da1f9699c49a19a684e9 tests/test_v32_reference.py bf69d1ac3fc30f963b6fed6cbd661f273593904b03275467427a954fbdc0a03f tests/test_v36_masked_video_prefix.py
43aef01fc587c9f9e87baf312eb4d588975aaaacab161a36bfcb638a4c11e31c tests/test_v34_driving_audio.py 19631b4abfdf2bd3c187ba4febbd23dd2bc6a0c5027f22c4adb8c1c4f1328926 tests/test_v36_public_sampler.py
4279354d9ed046588d3a685f5150f1cd1891575ddbdcdba870062d8000c64f30 tests/test_v35_compact_ui_frontend.py 324c213aba761e8989a78eadc0cfdcc54d098f50ed1fe84a5ea7aec26f0dc595 tests/test_v37_guide_production.py
75dbdd0d9694d82fab7da23f5cc03bc118c024abc865f6c282799aa8c57427fc tests/test_v35_conditioning_bridge.py 14ce0c7f78bcba9948e9e9930c4de5a8c7e8c453fcb6172066d43f593f7175ea tests/test_v37_guide_timeline.py
7dabf482f1fdcb9d5d3deadc1b797f1be576bdf47e0c1008bd7d5be7819f9b30 tests/test_v35_context_sampler.py 70b2413ad779bdde05bb131ef19db881c48e02004287d99626467303e23f8af6 tests/test_v37_refine_schedule.py
7380c2ea1eeb4fb212ef51ffdf6d14a33132d3ae6d4c7ed5015f28bba6b7e75b tests/test_v35_hires_fix.py 61484ca0552e8341301a481a87e12e44279dbeed68d4b841f4301a4f87ce4a29 tests/test_easy_load_audio.py
09a6f88fe4f63b12b11d28a82df1ef8eaf01c756f7bb633a516061b93ae4f73b tests/test_v35_latent_resize.py 4405c94cf190534fdabf5af3fd2ae9cc7cd1b2af6eb8b0d4ab73327cbcd455b9 tests/test_easy_load_image.py
59a07f2172014dfdc0a447775324d7cd049f20b823276dfaf9b7b3f79628f5a8 tests/test_v35_pixel_vae_resize.py 8ba1b07a4d2cdb21aba16a6c05791ec3e35ec7f4f3651e6de5e961be464b7074 tests/test_easy_load_video.py
05ba609fb948665f050d58fb087569a158c040d08bebad1d728b911673b95462 tests/test_v35_refine_context.py b7da41d7654aefaa06997720f7cbbaa7ddc3827b41ed365efd5992e399aa779c tests/test_v38_adaptive_continuity_observer.py
8ae5173eaec35adf9efcde2c464c95651c848248bdbdd6396ed2e3c3c1ac7965 tests/test_v35_refine_sampling.py 1a24a0cb040a4effba3fcd2974df093597c1686923f0a84f0cd267305a96f7a5 tests/test_v38_audio_only_refine.py
98a9006ebc4cab2b61b38904e0043fab24e088a25b28ffd38012c29991b8550c tests/test_v35_second_pass_contract.py e813b5d21af2963a325862acd344b33caa124d0cd3940a940c58118cf27742e0 tests/test_v38_chunk_boundary_diagnostics.py
a11956a22f373d96f13b395971f39187d6bb12cdc153ce794b4729d258ce9725 tests/test_v35_second_pass_sampling.py 8cdd5e14487a59ef333cf675fe3da52eb319480e69c5a6262377533cf7d0b160 tests/test_v38_chunk_scoped_refine.py
63d18643701c7d8be7b45046e6dc76616565572180afa06b7582600bd6c32431 tests/test_v351_reference_audio_ui.py c9577e9b2d430c9435a287bf679a920020192d51f780e02b47f286e2e4b6a615 tests/test_v38_easy_mode.py
5003c5f5ce1a4b4c77deb47011431e4a15fe0cecaeb6d689e0d0878567c42f5a tests/test_v351_reference_audio.py 98eb59407741dd187dc22d94b4f433f341294d05cc38106fde15b580b1465001 tests/test_v38_memory_action_policy.py
5f70cf8bd5248120ffcbe75ff3a54e23030fa6eb318ab0de6e0b08ee20e25a87 tests/test_v36_chunk_duration.py 9aad999f61c6b9110e58eb762866d5243622e43db4f718c0d23431eeb255ce8f tests/test_v38_public_workflow.py
bf69d1ac3fc30f963b6fed6cbd661f273593904b03275467427a954fbdc0a03f tests/test_v36_masked_video_prefix.py 12337a491fa67b38b32aaeb16e0b209393960dbc46db2a8bf968b8c3902855ef tests/test_v38_packed_row_planner.py
cb9ddd365ccf60693cef254685599bb002acda9986671c2ffa6a8083dae35008 tests/test_v36_public_sampler.py 14ff6561a127287d0a20887790a978612ef9d291f1d3be7d5e85b37b2c74760e tests/test_v38_ref_encode_cache.py
324c213aba761e8989a78eadc0cfdcc54d098f50ed1fe84a5ea7aec26f0dc595 tests/test_v37_guide_production.py 8b376f45261d045b584f02b4d14cd70c2d6269b9c814d4e62b5c612f6e30e36f tests/test_v38_refine_target.py
14ce0c7f78bcba9948e9e9930c4de5a8c7e8c453fcb6172066d43f593f7175ea tests/test_v37_guide_timeline.py 0b2b1280a1217816984a99c0f948a52a8e2e6fdf924b5c4f2f578719b12b01ed tests/test_v38_video_audio_refine.py
28adaed7d5a9ce74b91cecc37a8bb173832ef41827bdfdfc2f7ae79d96a4dc59 tests/test_v37_public_workflow.py 072c9b30a5edefacb4cd682808b9b04dd088f5b7bafce2c090def8dab0efc037 tests/test_v38_reliability.py
70b2413ad779bdde05bb131ef19db881c48e02004287d99626467303e23f8af6 tests/test_v37_refine_schedule.py cff84ae0562ba5fc48f3608ecaa433e74c0af9b689d7dca94ec8c3c4e9dc232f tests/test_v38_resolution_preset.py
61484ca0552e8341301a481a87e12e44279dbeed68d4b841f4301a4f87ce4a29 tests/test_easy_load_audio.py 2ac395009e49f9554af8d1a251d93fc5d5e7070bf80f5a0b7b3f7e00cde15077 tests/test_v38_review_cache.py
4405c94cf190534fdabf5af3fd2ae9cc7cd1b2af6eb8b0d4ab73327cbcd455b9 tests/test_easy_load_image.py ee4dd8f6eb8114706b2625b4471b041a0ea66198f9f825c63e913c896ed87530 tests/test_v38_branch_provenance.py
8ba1b07a4d2cdb21aba16a6c05791ec3e35ec7f4f3651e6de5e961be464b7074 tests/test_easy_load_video.py 72a0e3cb334049b66dd36f52c826931067c242fa63557933fd667138b38d6e8d tests/test_v38_review_control.py
b7da41d7654aefaa06997720f7cbbaa7ddc3827b41ed365efd5992e399aa779c tests/test_v38_adaptive_continuity_observer.py ed81cc9c969f8402bf4286954e2848df5f38bd4fe16dcff2ac0b4d894a70138b tests/test_runtime_redesign_r0_characterization.py
1a24a0cb040a4effba3fcd2974df093597c1686923f0a84f0cd267305a96f7a5 tests/test_v38_audio_only_refine.py cda09feb111efb8961e56c5f378f7925d63d0143b084c8248a9bc8be7f33ce6f tests/test_runtime_redesign_r2_validated_prefix.py
e813b5d21af2963a325862acd344b33caa124d0cd3940a940c58118cf27742e0 tests/test_v38_chunk_boundary_diagnostics.py 88ab786b7d45fe0b28a645da1e25213d6f971250208e7df197ecae862ab32058 tests/test_runtime_redesign_r3_pure_planner.py
8cdd5e14487a59ef333cf675fe3da52eb319480e69c5a6262377533cf7d0b160 tests/test_v38_chunk_scoped_refine.py 5f701a84f43a04c85d6f68627defd958e7dc9a1c0023632265dd2b1d19635b87 tests/test_runtime_redesign_r4_coordinator.py
c9577e9b2d430c9435a287bf679a920020192d51f780e02b47f286e2e4b6a615 tests/test_v38_easy_mode.py f62daa235117a3041c66ebb17adedb13c0452c3a2fc0acdd51006d7aa0078a9b tests/test_v38_review_execution_cap.py
f84c1b4f31c2f45a2eff1b192945f84f08b009dcd2e27b029cd3c9666e59393c tests/test_v38_easy_public_workflow.py 483735a87ffd67b5d5e3d8cebca5d3c4be00b1bc50c0ab4dba3e5e06f6a2ca98 tests/test_v38_review_run_storage.py
98eb59407741dd187dc22d94b4f433f341294d05cc38106fde15b580b1465001 tests/test_v38_memory_action_policy.py 2011ca4fc8b5b0cea7cb8df313f89ccc071396b9121ca27e988f6d7df45016bb tests/test_v38_review_ui.py
338371e7aefc0f303bf62899e5c7f15e1bead2ad3579eee7144f4681487f4014 tests/test_v38_public_workflow.py 75697036f361a9b8ea74f69b15e408670f686c8c0e8a6c1d48fe059cc837d12a tests/test_v38_selective_second_pass_node.py
12337a491fa67b38b32aaeb16e0b209393960dbc46db2a8bf968b8c3902855ef tests/test_v38_packed_row_planner.py 8026a241301dfc4de518649305458a538ef17a0b1567b113877a2af377738528 tests/test_v38_temporal_window_refine.py
967ab1262a90b5ba5b19ad8fb8c9d74aef4a35b02b4a176144b6edc537547939 tests/test_v38_ref_encode_cache.py 0dbe8a5f71c92f3523942343b40787104c8b96781461ba3ba82934a6bdbe5834 THIRD_PARTY_NOTICES.md
8b376f45261d045b584f02b4d14cd70c2d6269b9c814d4e62b5c612f6e30e36f tests/test_v38_refine_target.py f218e1a93c42467c6057c5c1d04d57cc82f6331b97ec9257e4e2dfb9c831876a timeline_video.py
0b2b1280a1217816984a99c0f948a52a8e2e6fdf924b5c4f2f578719b12b01ed tests/test_v38_video_audio_refine.py e5a84569953ee63b9625f4f2e3195ec368204fddcfc746564cfbd0e8449bb8e9 tools/p20_file_backed_tensor_poc.py
072c9b30a5edefacb4cd682808b9b04dd088f5b7bafce2c090def8dab0efc037 tests/test_v38_reliability.py cf9eaee6730fb15aa757b13d9a3c5775f398d845e4c7cb4be66f88f620f6a7e8 tools/v38_easy_driving_audio_gpu_gate_runner.py
cff84ae0562ba5fc48f3608ecaa433e74c0af9b689d7dca94ec8c3c4e9dc232f tests/test_v38_resolution_preset.py cc247c01a01efaf594c24c7ce36ca3357c092fc28dd742c7577093ee9d5efdef tools/v38_resolution_gpu_gate_runner.py
2ac395009e49f9554af8d1a251d93fc5d5e7070bf80f5a0b7b3f7e00cde15077 tests/test_v38_review_cache.py ad8609a45ba818fb74245b30cb0a3a221d6b345c20671092cafd714d8b07aaea tools/v38_review_phase_f_gpu_gate_runner.py
ee4dd8f6eb8114706b2625b4471b041a0ea66198f9f825c63e913c896ed87530 tests/test_v38_branch_provenance.py 60e9bf2c7c40ef9dd71f08ec2ec8c25f7ae9b08e74c3b7be5964e1138848ae82 tools/v38_review_phase_f_recovery_runner.py
72a0e3cb334049b66dd36f52c826931067c242fa63557933fd667138b38d6e8d tests/test_v38_review_control.py 556bce17d14303d1e8a36a85dc13da24c46eedd86f3eacdb102289574faf0626 tools/verify_runtime.py
83301839f08d275f5648d7782b6d96795e14b1ce79d722e83e57190fe52fb4aa tests/test_v38_review_execution_cap.py ffd61f3f31c9b6430e1169007ee906c8f5000eba63ee44e2976ad4f5f1112671 v2/__init__.py
2fec519540e18c55682884647db9fa1c90902da7be3d62261f2801a5c5724a96 tests/test_v38_review_run_storage.py 2003902c87bba09cfa143f5a9e4248f3a78c0fb544449a75fd40ba2cacb35655 v2/context_diagnostics.py
7facb5a236d90d8b02a57b49107010ab33393079b0fbd9bc37ebe09266c2f928 tests/test_v38_review_ui.py cde27db19b677e318cc4dfb4235be7a11429c19945f4083052a91fe117e74c82 v2/decoder.py
75697036f361a9b8ea74f69b15e408670f686c8c0e8a6c1d48fe059cc837d12a tests/test_v38_selective_second_pass_node.py 31012ec48a64c7467ad869c79982b7f8502c1785c33f51ee1b5727ce8b4243fb v2/diagnostics.py
8026a241301dfc4de518649305458a538ef17a0b1567b113877a2af377738528 tests/test_v38_temporal_window_refine.py 2ebff4502381f675d06bba4b127b81bc3201e7579ddcd46fa5051cbdf3facd55 v2/h3_builder.py
0dbe8a5f71c92f3523942343b40787104c8b96781461ba3ba82934a6bdbe5834 THIRD_PARTY_NOTICES.md aea01a48a8c03a25ed97ea05e5b137f89e388832d1be7d38f2da2be3d1b9830b v2/motion.py
f218e1a93c42467c6057c5c1d04d57cc82f6331b97ec9257e4e2dfb9c831876a timeline_video.py aefa29b9d51a05f9a972d75404fd786300202251887e67f55530e97ccd9519f5 v2/nodes.py
e5a84569953ee63b9625f4f2e3195ec368204fddcfc746564cfbd0e8449bb8e9 tools/p20_file_backed_tensor_poc.py dc2b901789e4b024dbcbc4024c63eb8cbc564d77003ce8c35c0584851ba6dfbd v2/prompts.py
cf9eaee6730fb15aa757b13d9a3c5775f398d845e4c7cb4be66f88f620f6a7e8 tools/v38_easy_driving_audio_gpu_gate_runner.py 4080f1875b958b316e8e76852c4be5527a6de5c71d604e7642d3098478eb4a36 v2/sampling.py
cc247c01a01efaf594c24c7ce36ca3357c092fc28dd742c7577093ee9d5efdef tools/v38_resolution_gpu_gate_runner.py 2fd811794c4cc0f2ce050250b80484876454926b9f20fce6af3a97d728e5acdf v2/seam_guard.py
ad8609a45ba818fb74245b30cb0a3a221d6b345c20671092cafd714d8b07aaea tools/v38_review_phase_f_gpu_gate_runner.py be0d8585fa57e0ccd6d02577bbc7299629e5bfe20e186747f571fccc98b67d7e v2/seam_types.py
60e9bf2c7c40ef9dd71f08ec2ec8c25f7ae9b08e74c3b7be5964e1138848ae82 tools/v38_review_phase_f_recovery_runner.py 12cfcc0c71ca087fe39a5ce2922959a62b2bb311bfe664f05c4480affce03708 v2/seeds.py
556bce17d14303d1e8a36a85dc13da24c46eedd86f3eacdb102289574faf0626 tools/verify_runtime.py ff23b9f49b05b1e000110ab4eb211942f0aa0d376f35694e80c5df25047a77c7 v2/sequence.py
ffd61f3f31c9b6430e1169007ee906c8f5000eba63ee44e2976ad4f5f1112671 v2/__init__.py 13213e7709fd02bb810af3c18e4cd7d010f8cdfb121a4b99866a9f2333331089 v2/session_io.py
2003902c87bba09cfa143f5a9e4248f3a78c0fb544449a75fd40ba2cacb35655 v2/context_diagnostics.py 3ea23dbce6fcd217b6e81235855479b9b16fed7a21693cf156f9014555c4fe13 v2/session.py
cde27db19b677e318cc4dfb4235be7a11429c19945f4083052a91fe117e74c82 v2/decoder.py 78c830cdf49034c6e3b2cd3da5914d5cfc5638eb63ec6dbd1bab13c50d6d4caf v3/__init__.py
31012ec48a64c7467ad869c79982b7f8502c1785c33f51ee1b5727ce8b4243fb v2/diagnostics.py ea2922567df90436dd6fa21696833a49dd0cbfeee142a5fedc3a7c303824d473 v3/adaptive_continuity.py
2ebff4502381f675d06bba4b127b81bc3201e7579ddcd46fa5051cbdf3facd55 v2/h3_builder.py b3dc61503d35d9ef0a0dc7fed1c9b2fdc00fcb2072d4e39f64ae0826f9ec7dca v3/assembly_v35.py
aea01a48a8c03a25ed97ea05e5b137f89e388832d1be7d38f2da2be3d1b9830b v2/motion.py 7815230e0a9540bc2edeaf818e940b7a1fdd817fd217ba8a4f9cb21aaf6a308e v3/assembly.py
aefa29b9d51a05f9a972d75404fd786300202251887e67f55530e97ccd9519f5 v2/nodes.py 3f62fdb35e804f42d7cbf0828b4e87e69a2b99246c3f7467fe4fa698f1d803c9 v3/conditioning_bridge_nodes.py
dc2b901789e4b024dbcbc4024c63eb8cbc564d77003ce8c35c0584851ba6dfbd v2/prompts.py bb4567770db74d4d8a286e3eb2da2230987d5a3bf35747c0815960d18049bc06 v3/driving_nodes.py
4080f1875b958b316e8e76852c4be5527a6de5c71d604e7642d3098478eb4a36 v2/sampling.py b230500f37783ab2cba124f3be20ef93a70da37c45db37ea4ab45589c910d1a5 v3/node_facade.py
2fd811794c4cc0f2ce050250b80484876454926b9f20fce6af3a97d728e5acdf v2/seam_guard.py 2f395da6a41981713f99ba40b73d14f2274b8ca34a73cf2b275a444993765b99 v3/easy_audio_nodes.py
be0d8585fa57e0ccd6d02577bbc7299629e5bfe20e186747f571fccc98b67d7e v2/seam_types.py 64b3e54b42e5156642f9957ccc374fd190d9fc7145637984e702534fb1bf80b4 v3/easy_image_nodes.py
12cfcc0c71ca087fe39a5ce2922959a62b2bb311bfe664f05c4480affce03708 v2/seeds.py ac859cb1a6e23b8ceae300d818c24fe1346b649a0d663017a9b3ac64aa96fca3 v3/easy_nodes.py
3a98f8a21756f3813f52197946e761227507b14c40703c9fb1bb108c1e4ddbe7 v2/sequence.py bf6bae0c9e14883728860470af86e14395dba40a7377cd874d4dc4548ae53c65 v3/easy_video_nodes.py
13213e7709fd02bb810af3c18e4cd7d010f8cdfb121a4b99866a9f2333331089 v2/session_io.py 6cc7ed74666084c55beb9075304e92a9defafd81b9c6678239ca3859a08cddd7 v3/file_backed_buffer.py
3ea23dbce6fcd217b6e81235855479b9b16fed7a21693cf156f9014555c4fe13 v2/session.py cb53e1b104415032ec79b7e7aa1c99848e63da3eedaa251eeba102970e4172b5 v3/hires_fix_nodes.py
78c830cdf49034c6e3b2cd3da5914d5cfc5638eb63ec6dbd1bab13c50d6d4caf v3/__init__.py 0858487e2b8c0060a856273ffc65d23165b2f253d183f506e27e419aea0da561 v3/latent_resize_nodes.py
ea2922567df90436dd6fa21696833a49dd0cbfeee142a5fedc3a7c303824d473 v3/adaptive_continuity.py 5b8a54e67a608e757a505abc712effb33312636e3bb235835a485a506e80eeee v3/masked_continuation.py
b3dc61503d35d9ef0a0dc7fed1c9b2fdc00fcb2072d4e39f64ae0826f9ec7dca v3/assembly_v35.py 91a868d2e392b018b01d0396209849c146b0d560ceb109fcdd87dea7f3d786aa v3/memory_action_policy.py
7815230e0a9540bc2edeaf818e940b7a1fdd817fd217ba8a4f9cb21aaf6a308e v3/assembly.py 85477badd85281cfb77582fdd5b34228a9f6b68376f1b7743af2ca7d4b55aa36 v3/memory_attribution.py
3f62fdb35e804f42d7cbf0828b4e87e69a2b99246c3f7467fe4fa698f1d803c9 v3/conditioning_bridge_nodes.py fe03ae0aa0dbbbe5f950bb7da34c18a078d841547992c374ea8beda5e3ad4715 v3/execution_planner.py
92b92c51b87182d420ce0468f57797fbb6fe4123d04080b73d6d89581ff96c31 v3/driving_nodes.py 473dc26ba53010c53e6273ebe04a071ccc6758201a06df46cd2ef4bee4263246 v3/nodes.py
2f395da6a41981713f99ba40b73d14f2274b8ca34a73cf2b275a444993765b99 v3/easy_audio_nodes.py b7c4a35a5e73f528492bc6946b97b687c412f1d3f5f976c19d45c6dc20288c9a v3/pixel_vae_resize.py
64b3e54b42e5156642f9957ccc374fd190d9fc7145637984e702534fb1bf80b4 v3/easy_image_nodes.py b139843ccfc826937c80f118920bbee2609c37d45ef88291f80f491744fd5e76 v3/plan.py
ac859cb1a6e23b8ceae300d818c24fe1346b649a0d663017a9b3ac64aa96fca3 v3/easy_nodes.py 0e3dd69d6d2bec6d9491c2fb806c25f0c62629b1eb5f9e4f77ae8d27a5b19cfc v3/planning_types.py
bf6bae0c9e14883728860470af86e14395dba40a7377cd874d4dc4548ae53c65 v3/easy_video_nodes.py a3411c7a295308d21623551cf4aeca5bef511eb5f063f31ac84032e3bdf4e16d v3/packed_row_planner.py
6cc7ed74666084c55beb9075304e92a9defafd81b9c6678239ca3859a08cddd7 v3/file_backed_buffer.py ec71e3965f445756d54d005c0e27bea520e26dbac44e1ee3d3867bfe2da100b0 v3/ref_encode_cache.py
cb53e1b104415032ec79b7e7aa1c99848e63da3eedaa251eeba102970e4172b5 v3/hires_fix_nodes.py 9076c47aa5145c81f34793d6c90410656065248f37d9990a92a6a4061b358811 v3/refine_context.py
0858487e2b8c0060a856273ffc65d23165b2f253d183f506e27e419aea0da561 v3/latent_resize_nodes.py 43f33f989eb70ca87b916fc33267732a2be3dd4581fc72af17c53f840b53ca49 v3/refine_schedule.py
5b8a54e67a608e757a505abc712effb33312636e3bb235835a485a506e80eeee v3/masked_continuation.py 519586b1b3f48c73d329f7a2aaa8a1bfc6fe31ac2ecb64f2b1fdf9c19026001a v3/refine_sampling.py
91a868d2e392b018b01d0396209849c146b0d560ceb109fcdd87dea7f3d786aa v3/memory_action_policy.py ac373d9783d3a7bb968e8117843d246d6a090b66a819015348bff84e7747442c v3/refine_target.py
85477badd85281cfb77582fdd5b34228a9f6b68376f1b7743af2ca7d4b55aa36 v3/memory_attribution.py 45ae91f13e8f71405d2f46045c8acc6eabbc9500c194cf5d0ba541bb085cd135 v3/refine_window.py
b528e34e24407896e3728d693a40393b46ec7bce236d455721712dfe2fe75adb v3/nodes.py afc149dc347b4c1502ddf32ea4229e633799cd34d2b2c6f98bf8a47910a9ef77 v3/refine_scope.py
b7c4a35a5e73f528492bc6946b97b687c412f1d3f5f976c19d45c6dc20288c9a v3/pixel_vae_resize.py ae909b43ad17934c85881d3b0bea81e7b45c215eeb4d1f9f6a9ea72faf633ddf v3/reliability_v38.py
34ea38c03b6322288d88fc8595e3655a7a7afddb51709142a954eb7349f71ac2 v3/plan.py 520a4ae849f83450855ce0023c582db5f91d29d8694a99aa8cf491351c837cff v3/resolution.py
a3411c7a295308d21623551cf4aeca5bef511eb5f063f31ac84032e3bdf4e16d v3/packed_row_planner.py 3f03d8659305d2def41939205d21cdc6f35e32943274e87afe539d15b9635f9b v3/review_control.py
ec71e3965f445756d54d005c0e27bea520e26dbac44e1ee3d3867bfe2da100b0 v3/ref_encode_cache.py be6610fb9427546d9485a17015cfbdc8786715e6a0967f3e4c1dee35d8768385 v3/runtime_coordinator.py
9076c47aa5145c81f34793d6c90410656065248f37d9990a92a6a4061b358811 v3/refine_context.py d0a004aa3030c8adaa5ea788f9acc758fcb4a556f203f9a3f63fa4e4b5772063 v3/sampling_engine.py
43f33f989eb70ca87b916fc33267732a2be3dd4581fc72af17c53f840b53ca49 v3/refine_schedule.py 452022107cea233aa84d5366ec4943ac5aadbd5fcf786113f1d542a641eac8f7 v3/second_pass_nodes.py
519586b1b3f48c73d329f7a2aaa8a1bfc6fe31ac2ecb64f2b1fdf9c19026001a v3/refine_sampling.py 66501234756c2b558ce84f887bd540e7f843ed574c8a8b2522950bd1985d7acc v3/second_pass.py
ac373d9783d3a7bb968e8117843d246d6a090b66a819015348bff84e7747442c v3/refine_target.py 6e71e944313339f14e14e11cec682593159ca5542aa5d38095371da781d60224 v3/targeted_refine_sampling.py
45ae91f13e8f71405d2f46045c8acc6eabbc9500c194cf5d0ba541bb085cd135 v3/refine_window.py 5a044bdd70c546e4446e0c26af92aae88049ffa2e0e2d01b52033a83a3152d0e v3/targeted_second_pass.py
afc149dc347b4c1502ddf32ea4229e633799cd34d2b2c6f98bf8a47910a9ef77 v3/refine_scope.py 4178dcfa442abdb06ce276e05bd7bcbaa6da28469ba5e57d3da3c663de4e4a9d v3/video_seam_v35.py
ae909b43ad17934c85881d3b0bea81e7b45c215eeb4d1f9f6a9ea72faf633ddf v3/reliability_v38.py 2f07ace1462644f0bee553827b3571535de4d0c2d9ef847bd9e0ca73a4eed5cb v3/video_seam.py
520a4ae849f83450855ce0023c582db5f91d29d8694a99aa8cf491351c837cff v3/resolution.py 91ebc1f20c31645faf75e2e98228f30aec03d026c78698e4c20e39c447cdbf64 version.py
c21602eb983d497f0eb559197f4f1408b9b5ebb8dcd3aab65e746641f77bcfd4 v3/review_control.py c2883272b05a9a9146b5c6cf614ddae8a3e6893cd910902023aae61360195289 web/easy_bypass_toggle.js
452022107cea233aa84d5366ec4943ac5aadbd5fcf786113f1d542a641eac8f7 v3/second_pass_nodes.py 092088096307d33ac016b82b4774ca38845a2ff2f63b97ac6da8c5aca4fea413 web/easy_load_audio.js
66501234756c2b558ce84f887bd540e7f843ed574c8a8b2522950bd1985d7acc v3/second_pass.py 9db0aa94f634578a962d5db49e5c70356040a59df968e3a2e531b327a623081f web/easy_load_image.js
6e71e944313339f14e14e11cec682593159ca5542aa5d38095371da781d60224 v3/targeted_refine_sampling.py 873efcbd15c2d9fa10c9d5fc51a796ad3a18c0c6acceecf499c4b956aa845c6c web/easy_load_video.js
5a044bdd70c546e4446e0c26af92aae88049ffa2e0e2d01b52033a83a3152d0e v3/targeted_second_pass.py 0c68d13a1f8beb7431a32b471f8b0612c42fcc4bf72dd97611a025d158008662 web/easy_v38.js
4178dcfa442abdb06ce276e05bd7bcbaa6da28469ba5e57d3da3c663de4e4a9d v3/video_seam_v35.py 1db955b555367ec8cad26e35b8ad9a23b808db6ea86ba746d41a3af3b9e336e9 web/project_id.js
2f07ace1462644f0bee553827b3571535de4d0c2d9ef847bd9e0ca73a4eed5cb v3/video_seam.py dfd195c1f59078f8438bceb7472673abc28c89b183ee4045a9fad27280a9663c .comfyignore
d1957fa668a0332e483330bc79fc53095712420e401035a4f80cf6b532677d51 version.py b08159178c999c4c97df6aed67c6cf48b5032548a1d370dc4a0cf7e293ab8031 docs/V38_RELEASE_AND_MIGRATION.md
c2883272b05a9a9146b5c6cf614ddae8a3e6893cd910902023aae61360195289 web/easy_bypass_toggle.js 8c2ec7cdbb2d55536a4c14d7518165c976ae22428f373a4e1ed21959dfcab4a9 tests/test_v38_public_surface_cleanup.py
092088096307d33ac016b82b4774ca38845a2ff2f63b97ac6da8c5aca4fea413 web/easy_load_audio.js 0cf8d49bcb71b30437dc893f6218dc4cfb1cd244b647e4fbc2861dea2271a33a web/reference_audio_ui.js
9db0aa94f634578a962d5db49e5c70356040a59df968e3a2e531b327a623081f web/easy_load_image.js 37459d9f215049684bbadb1106851f7a50a975f6f257324c77c4165ac622cce4 REGISTRY_MANIFEST.sha256
873efcbd15c2d9fa10c9d5fc51a796ad3a18c0c6acceecf499c4b956aa845c6c web/easy_load_video.js 717577efdec5e61600504b77bc2a099ef022c4fe2333e936c3310c7182d8f2a0 docs/V38_OPEN_INTEGRATION_CONTRACT.md
0c68d13a1f8beb7431a32b471f8b0612c42fcc4bf72dd97611a025d158008662 web/easy_v38.js 623d528a02b6712cba28c374ba3ad979bc84e2ac5318640692589a04ba6ab15f tests/test_v38_open_integration_contract.py
045b8154ef5c5b2839d87b685ebc875d4f8fb98ddf1571fc58fd73a558bc0eaa web/project_id.js 0bc369ee428b8a5bc8e370a81fbab427262a1fdb7805a78c442c91698d65efba tools/__init__.py
be0b8d39e5343680ebea815c3a4fb6ce7a32e065f30e43e013040a40f702cef3 .comfyignore 5960c6feb10df5b79d51711d46de55f2f850be69e4943b6c5d12df38b0cedd26 tests/test_v38_multi_reference_audio.py
1d2838cc47694609289ea15132872ad48e1b6c8274da4b7bf188dd3ebf066121 docs/V38_RELEASE_AND_MIGRATION.md bb5a1530c890d357dc48ea74039340d746e876e8f85e06d4d9a19369f8ff5961 tests/test_v38_hover_help.py
abaaf46043bc17958bbe2d22c7961993682c49a3ac37d44ef68aa2133482a539 tests/test_v38_public_surface_cleanup.py 3d681ded5d4c50cc20c2382e29fdc98d8a48e76d552c41ad5a195d941e66e612 .gitattributes
0cf8d49bcb71b30437dc893f6218dc4cfb1cd244b647e4fbc2861dea2271a33a web/reference_audio_ui.js df4e0e355020d2e731932cff86a4b00932b4f193ec7ed513be0db994ec0e71bb examples/workflows/MiniMax_H3_Continuum_V38x.zip
b165ea2c599c5be1b6c0cf23dce09021f94a8e0e10c284a578c9b705de2f0f5e REGISTRY_MANIFEST.sha256 3c42647d3719ad6d7d6a102ab04df58ce51c54968ec1f6eaae2390b54e0ac2cc tests/frontend_review_queue.cjs
717577efdec5e61600504b77bc2a099ef022c4fe2333e936c3310c7182d8f2a0 docs/V38_OPEN_INTEGRATION_CONTRACT.md 7344eda4f112901995341ea748781920cb0ae925a665e64d9b28bbdcc810459c tests/test_v38_completed_review_ui.py
623d528a02b6712cba28c374ba3ad979bc84e2ac5318640692589a04ba6ab15f tests/test_v38_open_integration_contract.py fe23752312d62ddc8c23a3c598ed2f92f2d46e2e4460f06aea91921659092451 tests/test_audit_boundary_repairs.py
0bc369ee428b8a5bc8e370a81fbab427262a1fdb7805a78c442c91698d65efba tools/__init__.py 36f74c03a40c4b62b90eede070d976bcd1b7f0ea828983d1e61a6cb6d80a0ea8 tests/helpers/r5_process_crash_worker.py
5960c6feb10df5b79d51711d46de55f2f850be69e4943b6c5d12df38b0cedd26 tests/test_v38_multi_reference_audio.py 4b03e1a9140ba32b3c24e1a2567ccbe90ecbe54f1b4e1ed760bc45da5fe9fb5b tests/test_runtime_redesign_r5_transactions.py
bb5a1530c890d357dc48ea74039340d746e876e8f85e06d4d9a19369f8ff5961 tests/test_v38_hover_help.py d6bac16cb0b794ea9d8836a73d3189a879fb5a96dd2e6fcd974c0de2ebb4ab23 tests/test_runtime_redesign_r6_node_facade.py
3d681ded5d4c50cc20c2382e29fdc98d8a48e76d552c41ad5a195d941e66e612 .gitattributes 1d60cf5d4ef9c45885d4f90289c3b17aa70a6a2752c6b288288322a5e0568050 docs/FAILURE_SEMANTICS_BASELINE.md
83d28cc0cd549066962dc21ceae05d2b189fe22391b556887eab2cc1800e1e80 examples/workflows/MiniMax_H3_Continuum_V38.zip a884c0bb08fca1f3a2f2b8f0e607f5d2c9ea27feec902fdce720743026fae019 docs/R0_RUNTIME_CHARACTERIZATION.md
089c544b897c00a88f391c96b677739fae817ac4d57f4ac644762befb3465480 tests/frontend_review_queue.cjs c6ea788a03c5f29f32fb6a4fd62db92f108e604493d818b9729e9d7fb967526e docs/FAILURE_SEMANTICS_DELTA_R5.md
c98ef5e0431c1dc071e0a18a5904e57fb4b6d226ea5f5996756876cc93173607 tests/test_v38_completed_review_ui.py e6b8cc3250776868f473357cd97ce299fcea31ae18b879ec6e6466f47dbf704e docs/R6_NODE_FACADE_DELTA.md
+4 -3
View File
@@ -1,8 +1,8 @@
ComfyUI-H3-Continuum V3.8.0 ComfyUI-H3-Continuum V3.8X / package 3.8.1
MiniMax H3の5秒ChunkをAV latent contextで継続し、長尺映像として組み立てるComfyUIカスタムノードです。 MiniMax H3の5秒ChunkをAV latent contextで継続し、長尺映像として組み立てるComfyUIカスタムノードです。
V3.8.0: V3.8X / 3.8.1:
- 公開面はSampler V3.8、Finalize、Load Image、Load Audio、Load Video、Second Pass、Reference Audios helperの7ノード - 公開面は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 Samplerへfrontend-onlyのBasic/Production表示propertyを追加。Python Schema、widget順・値、backend引数は不変
- MainのAspect選択をSize Source(First Image/Manual)へ整理。ManualではWidth/Heightを表示し、旧Aspect値は同じcanvasへ移行 - MainのAspect選択をSize Source(First Image/Manual)へ整理。ManualではWidth/Heightを表示し、旧Aspect値は同じcanvasへ移行
@@ -11,7 +11,8 @@ V3.8.0:
- FL2VA Terminal Merge pairを1つのatomic review unitとして維持 - FL2VA Terminal Merge pairを1つのatomic review unitとして維持
- Driving AudioをReview、Smart Regenerate、Finish Remaining、restart persistenceと併用可能 - Driving AudioをReview、Smart Regenerate、Finish Remaining、restart persistenceと併用可能
- Image/Audio/Video Loaderはnative Bypass中もEnable行を明瞭に表示し、その場でONへ復帰可能 - Image/Audio/Video Loaderはnative Bypass中もEnable行を明瞭に表示し、その場でONへ復帰可能
- 公開WorkflowはMiniMax_H3_Continuum_V38.jsonと同じJSONを含む同名ZIP。Spectrum初期設定のgraphを変更せず配布。Spectrum、rgthree、KJNodes、ComfyUI-Easy-Useが必要 - 公開WorkflowはMiniMax_H3_Continuum_V38x.jsonと同じJSONを含む同名ZIP。Spectrum対応graphで、保存状態ではSpectrumとTurbo LoRAはOFF。Spectrum、rgthree、KJNodesが必要。ComfyUI-Easy-Useは不要
- 旧V3.8.0は`v3.8.0` tagから導入可能。旧WorkflowとV3.8Xを混在させない
- 16GB GPU GateはPASS。ただしVRAM headroomは小さく、Strict Minimal 14.96 GiB、複雑なGateは約15.5~15.6 GiB - 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を実行 - Review途中のpartial sequenceではSecond Pass/refine_contextは正式対応外。Review完了後にSecond Passを実行
- V3.7以前のNode IDはV3.8で非export。旧保存Workflowは対応するhistorical Release/tagを使用 - V3.7以前のNode IDはV3.8で非export。旧保存Workflowは対応するhistorical Release/tagを使用
+2 -2
View File
@@ -1,4 +1,4 @@
ComfyUI-H3-Continuum V3.8 — package validation record ComfyUI-H3-Continuum V3.8X / package 3.8.1 — package validation record
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. 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.
@@ -30,7 +30,7 @@ Current verified source checks (2026-09-03)
Registry package policy Registry package policy
- Include production runtime modules, the two runtime-required tools modules, and tools/verify_runtime.py for package verification. - 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. - 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. - Include `examples/workflows/MiniMax_H3_Continuum_V38x.json` and `examples/workflows/MiniMax_H3_Continuum_V38x.zip`: one identical, user-supplied V3.8X graph in two formats, not two workflow variants. Spectrum, rgthree, and KJNodes are external requirements, not bundled dependencies. ComfyUI-Easy-Use is not required. The older V3.8.0 package remains available through tag `v3.8.0`.
- Preserve the supplied JSON and ZIP bytes, including prompt, media filenames, titles, and settings. Exclude unrelated backup ZIPs without deleting them. - 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. - 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.
+37 -58
View File
@@ -1,10 +1,10 @@
# ComfyUI-H3-Continuum 3.8.0 # ComfyUI-H3-Continuum 3.8.1 — V3.8X
> This is the current **V3.8X / package 3.8.1 guide**. It documents the supported seven-node surface and the supplied V3.8X workflow. The older V3.8.0 package remains available from tag [`v3.8.0`](https://github.com/ukr8b3g-cmyk/ComfyUI-H3-Continuum/tree/v3.8.0); do not combine its workflow or instructions with this guide.
**Download workflow: [JSON](examples/workflows/MiniMax_H3_Continuum_V38.json) | [ZIP](examples/workflows/MiniMax_H3_Continuum_V38.zip)** — [Latest release](https://github.com/ukr8b3g-cmyk/ComfyUI-H3-Continuum/releases/latest) **Download V3.8X workflow: [JSON](examples/workflows/MiniMax_H3_Continuum_V38x.json) | [ZIP](examples/workflows/MiniMax_H3_Continuum_V38x.zip)** — [Latest release](https://github.com/ukr8b3g-cmyk/ComfyUI-H3-Continuum/releases/latest)
✅ V3.8 hotfix applied on `main` — September 8, 2026: Review Each Chunk continuation, stale `Regenerate From` state, completed-sequence extension, and Render History queue handling have been repaired. Update with `git pull --ff-only origin main` (or ComfyUI Manager **Update**), restart ComfyUI, and hard-refresh the browser if the old UI remains. Existing saved Takes are preserved. Issue #13 remains a separate open long-continuation quality issue and is not part of this hotfix. ✅ V3.8X on `main` includes the September 8, 2026 Review hotfix: Review Each Chunk continuation, stale `Regenerate From` state, completed-sequence extension, and Render History queue handling are repaired. Update with `git pull --ff-only origin main` (or ComfyUI Manager **Update**), restart ComfyUI, and hard-refresh the browser if the old UI remains. Existing saved Takes are preserved. Issue #13 remains a separate open long-continuation quality issue and is not part of this hotfix.
<img width="1536" height="1024" alt="exec-55ad0463-8655-409c-b9a6-49d1315cdd78" src="https://github.com/user-attachments/assets/063bb16b-5c25-44f8-9304-031995502b26" />
H3 Continuum is a Production Sampler for generating, reviewing, partially regenerating, and resuming long-form MiniMax H3 video without restarting the entire work. V3.8 has two product layers: **Main / Production** and **Advanced**. H3 Continuum is a Production Sampler for generating, reviewing, partially regenerating, and resuming long-form MiniMax H3 video without restarting the entire work. V3.8 has two product layers: **Main / Production** and **Advanced**.
@@ -25,9 +25,18 @@ cd ComfyUI/custom_nodes/ComfyUI-H3-Continuum
git pull --ff-only origin main git pull --ff-only origin main
``` ```
Restart ComfyUI after cloning or pulling. If ComfyUI Manager installed the node, use its **Update** action instead of mixing Manager updates with a second Git checkout. Restart ComfyUI after cloning or pulling. If ComfyUI Manager installed the node, use its **Update** action instead of mixing Manager updates with a second Git checkout.
Download the current V3.8 workflow: [JSON](examples/workflows/MiniMax_H3_Continuum_V38.json) or [ZIP containing the same JSON](examples/workflows/MiniMax_H3_Continuum_V38.zip). This is one Spectrum-default graph, also usable with [LightX2V Turbo](https://github.com/ModelTC/Minimax-H3-Turbo). Install its external Spectrum, rgthree, KJNodes, and ComfyUI-Easy-Use nodes before opening it; switching Spectrum off does not remove those node dependencies. See [Spectrum and Turbo setup](#turbo-lora-and-spectrum-in-supplied-workflows) below. To install the historical V3.8.0 package into a separate checkout instead:
```bash
cd ComfyUI/custom_nodes
git clone --branch v3.8.0 --single-branch https://github.com/ukr8b3g-cmyk/ComfyUI-H3-Continuum.git ComfyUI-H3-Continuum-v3.8.0
```
Use only one Continuum checkout at a time. ComfyUI Manager **Update** tracks `main`; it does not select historical tags.
Download the current V3.8X workflow: [JSON](examples/workflows/MiniMax_H3_Continuum_V38x.json) or [ZIP containing the same JSON](examples/workflows/MiniMax_H3_Continuum_V38x.zip). This is one Spectrum-capable graph, also usable with [LightX2V Turbo](https://github.com/ModelTC/Minimax-H3-Turbo); both Spectrum and all Turbo LoRA entries are saved disabled. Install its external Spectrum, rgthree, and KJNodes nodes before opening it. ComfyUI-Easy-Use is not required. See [Spectrum and Turbo setup](#turbo-lora-and-spectrum-in-supplied-workflows) below.
## Prompt and skill downloads ## Prompt and skill downloads
@@ -39,7 +48,7 @@ These are optional prompt-authoring resources, not ComfyUI custom nodes. Extract
## You can ask an AI to read this manual ## You can ask an AI to read this manual
This README is intentionally detailed. You do not have to memorize it. Give its GitHub URL to a web-enabled AI and describe what you want to make, your GPU/VRAM, whether you have a First Image or audio, and whether you want to review every chunk. Ask it to answer with the **exact V3.8 labels** used below. This README is intentionally detailed. You do not have to memorize it. Give its GitHub URL or this file to a web-enabled AI, describe your target video, GPU/VRAM, available First Image/audio, and whether you want to review every chunk. Ask it to use the **exact V3.8 labels** below.
Example request: Example request:
@@ -50,11 +59,7 @@ Continuum inputs and controls to use, what must stay fixed between Queue runs,
and what output length I should expect after each action. Do not use older V3.7 UI. and what output length I should expect after each action. Do not use older V3.7 UI.
``` ```
- [ChatGPT Free](https://help.openai.com/en/articles/9275245-chatgpt-free-tier-faq) currently includes web search and file uploads, subject to separate limits. If a repository URL is not read correctly, paste this README or upload it as a file. AI products, plans, and repository-reading behavior change frequently. If a URL is not read correctly, paste or upload this README instead. Do not send private workflows, local paths, tokens, or credentials to a public AI service. The README and the UI remain the source of truth; an AI summary can still be wrong.
- [Gemini on desktop](https://support.google.com/gemini/answer/16176929) has an explicit **Add file → More Uploads → Import code** path for one GitHub repository, up to 5,000 files and 100 MB. Pasting a GitHub URL into an ordinary prompt is not the same as importing the repository.
- [Grok Free](https://x.ai/pricing) currently includes limited real-time web search and connectors. A GitHub-specific full-repository importer is not guaranteed, so paste/upload this README if the URL alone is not enough.
Plans, limits, and web-access behavior can change. Do not send private workflows, local paths, tokens, or credentials to a public AI service. The README and the UI remain the source of truth; an AI summary can still be wrong.
## V3.8 supported surface ## V3.8 supported surface
@@ -276,7 +281,7 @@ The four MiniMax H3 Turbo files shown in the example come from the LightX2V Mini
The number in a Turbo filename is its distilled NFE target. Use the matching upstream recommendation unless a provided workflow explicitly documents a tested exception. In particular, using a 4-step LoRA with `Steps = 6` is a workflow-specific experiment, not the LightX2V default. `Euler`/`simple`, the actual Steps value, and the selected LoRA must be recorded together when comparing results. The number in a Turbo filename is its distilled NFE target. Use the matching upstream recommendation unless a provided workflow explicitly documents a tested exception. In particular, using a 4-step LoRA with `Steps = 6` is a workflow-specific experiment, not the LightX2V default. `Euler`/`simple`, the actual Steps value, and the selected LoRA must be recorded together when comparing results.
`Power Lora Loader (rgthree)`, KJNodes SageAttention, ComfyUI-Easy-Use, and Spectrum are external components. Continuum does not install, enable, or tune them. The [V3.8 workflow](examples/workflows/MiniMax_H3_Continuum_V38.json) is the single supplied graph, distributed unchanged as JSON and ZIP. Its saved default is Spectrum enabled, no Turbo LoRA enabled, `res_multistep`, `simple`, and `Steps = 20`. All four custom-node packages are required to open the complete graph, including when switching it to Turbo. `Power Lora Loader (rgthree)`, KJNodes SageAttention, and Spectrum are external components. Continuum does not install, enable, or tune them. The [V3.8X workflow](examples/workflows/MiniMax_H3_Continuum_V38x.json) is the single supplied graph, distributed unchanged as JSON and ZIP. Its saved default has Spectrum disabled, no Turbo LoRA enabled, `res_multistep`, `simple`, and `Steps = 20`. These three custom-node packages are required to open the complete graph, including when switching it to Turbo. ComfyUI-Easy-Use is not required.
The supplied prompt, media selections, and node titles have deliberately been preserved. Choose files available on your computer, disable unused optional inputs, and enter your own prompt before generating. Models, LoRAs, images, and audio are not included. A custom title such as `Save 3x5s Video` is only a saved label: actual duration follows the Sampler's `Chunks` and `Seconds per Chunk`, not that title. The supplied prompt, media selections, and node titles have deliberately been preserved. Choose files available on your computer, disable unused optional inputs, and enter your own prompt before generating. Models, LoRAs, images, and audio are not included. A custom title such as `Save 3x5s Video` is only a saved label: actual duration follows the Sampler's `Chunks` and `Seconds per Chunk`, not that title.
@@ -318,7 +323,7 @@ Choose the task you need:
`Chunks` is the **total number of chunks you want**, not the number to add on the next Queue. `Seconds per Chunk` is the duration of each chunk. `Total Length` is the planned final duration; it is not a progress counter. `Chunks` is the **total number of chunks you want**, not the number to add on the next Queue. `Seconds per Chunk` is the duration of each chunk. `Total Length` is the planned final duration; it is not a progress counter.
For example, `Chunks = 6` and `Seconds per Chunk = 5` means a 30-second target. With `Run = Review Each Chunk`, the first Queue normally creates only Chunk 1: a 5-second video. Continuing produces a 10-second video, then 15 seconds, and so on, until the target is complete. Each saved output contains the completed sequence so far, not just the newest 5 seconds. For example, `Chunks = 6` and `Seconds per Chunk = 5` means a 30-second target. With `Run = Review Each Chunk`, the first Queue normally creates only Chunk 1: a 5-second video. Continuing generates the next review unit. During review, the preview/save output is the **current review unit** (normally 5 seconds), not an accumulating preview. After the run reaches `complete`, or after `Use it and finish the rest` generates the remaining chunks, Finalize outputs the assembled completed sequence.
The screenshots show **two chunks as a small example**. The same controls apply to three, four, five, six, or another supported total. The screenshots show **two chunks as a small example**. The same controls apply to three, four, five, six, or another supported total.
@@ -547,9 +552,9 @@ Driving Audio can be used with Review and Smart Regenerate. The Continuum Image,
> **Second Pass limitation:** Finish the reviewed sequence before running Second Pass. Second Pass / `refine_context` is not supported on a partial Review sequence. > **Second Pass limitation:** Finish the reviewed sequence before running Second Pass. Second Pass / `refine_context` is not supported on a partial Review sequence.
## Historical implementation notes (pre-V3.8; not the standard workflow) ## Archived implementation notes (pre-V3.8; not the current guide)
The version-labelled sections below document earlier releases and compatibility work. Their node-registration and saved-workflow guarantees apply to those historical packages, not to V3.8. They do not change the current seven-node surface or the V3.8 standard path described above. Open historical workflows with their matching Release/tag. The version-labelled sections below are retained temporarily as source history only. They do not describe the V3.8 standard workflow, public surface, or recommended wiring. For an older workflow, use the migration policy and its matching historical Release/tag.
### V3.7 High-Resolution Refinement Foundation ### V3.7 High-Resolution Refinement Foundation
@@ -645,7 +650,7 @@ Prompt/CLIP figures measure only the conditioning subphase, not total generation
The measured Sage-only production baselines on the tested RTX 5060 Ti 16 GB / 64 GB system were 168.069 seconds for 1×5-second 576×576 T2VA and 379.765 seconds for 3×5-second 640×640 FL2VA Long Terminal Merge. These are configuration-specific baselines, not universal speed guarantees. Sampling remained the dominant cost; Continuum Assemble + Seam stayed below 1%. The measured Sage-only production baselines on the tested RTX 5060 Ti 16 GB / 64 GB system were 168.069 seconds for 1×5-second 576×576 T2VA and 379.765 seconds for 3×5-second 640×640 FL2VA Long Terminal Merge. These are configuration-specific baselines, not universal speed guarantees. Sampling remained the dominant cost; Continuum Assemble + Seam stayed below 1%.
> **V3.8.0 is the current release candidate.** Historical implementation modules remain in source because V3.8 reuses them internally. Only the seven current public nodes are exported, including the earlier IDs retained for those nodes. Use the matching historical Release/tag for workflows requiring other IDs. Still Image Guide remains Experimental. > **V3.8.0 is the historical release baseline.** The current release candidate is V3.8X / package 3.8.1. Historical implementation modules remain in source because V3.8X reuses them internally. Only the seven current public nodes are exported, including the earlier IDs retained for those nodes. Use the matching historical Release/tag for workflows requiring other IDs. Still Image Guide remains Experimental.
## V3.5.1 Reference Audio & Compatibility Update ## V3.5.1 Reference Audio & Compatibility Update
@@ -694,7 +699,7 @@ The external workflow owns AV LATENT pairing, noise, SIGMAS, Audio Lock, samplin
![V3.5.1 LBH and Conditioning Bridge external sampling flow](docs/images/v351-lbh-conditioning-bridge-flow.svg) ![V3.5.1 LBH and Conditioning Bridge external sampling flow](docs/images/v351-lbh-conditioning-bridge-flow.svg)
Download the complete connection example: [V3.5.1 LBH + Conditioning Bridge workflow](examples/workflows/MiniMax_H3_Continuum_V351_LBH_Conditioning_Bridge.json). The retired V3.5.1 LBH + Conditioning Bridge example is available only from its matching historical Release/tag; it is not a V3.8 workflow.
The example keeps the standard Core titles `BasicGuider`, `BasicScheduler`, and `SamplerCustomAdvanced`. Public examples do not rename Core nodes, so they remain immediately distinguishable from Continuum and third-party nodes. The workflow also uses external nodes for LBH latent upscaling, AV LATENT concatenation/separation, loading/saving, and optional acceleration; install or replace those nodes according to your ComfyUI environment. The example keeps the standard Core titles `BasicGuider`, `BasicScheduler`, and `SamplerCustomAdvanced`. Public examples do not rename Core nodes, so they remain immediately distinguishable from Continuum and third-party nodes. The workflow also uses external nodes for LBH latent upscaling, AV LATENT concatenation/separation, loading/saving, and optional acceleration; install or replace those nodes according to your ComfyUI environment.
@@ -828,10 +833,10 @@ This is a usability and reliability decision, not a claim that the experimental
## Example workflow ## Example workflow
- [V3.8 workflow JSON](examples/workflows/MiniMax_H3_Continuum_V38.json) — Spectrum enabled by default; switch the same graph to LightX2V Turbo as described above - [V3.8X workflow JSON](examples/workflows/MiniMax_H3_Continuum_V38x.json) — Spectrum disabled by default; switch the same graph to LightX2V Turbo as described above
- [V3.8 workflow ZIP](examples/workflows/MiniMax_H3_Continuum_V38.zip) — contains exactly the same JSON, not another variant or a custom-node installer - [V3.8X workflow ZIP](examples/workflows/MiniMax_H3_Continuum_V38x.zip) — contains exactly the same JSON, not another variant or a custom-node installer
The declared Registry payload includes this one graph in both formats; it is **not dependency-free**. Spectrum, rgthree, KJNodes, and ComfyUI-Easy-Use must be installed separately. Historical workflow files remain in GitHub source but are excluded from the Registry payload. For an older saved workflow, use its matching historical Release/tag as described in the [migration policy](docs/V38_RELEASE_AND_MIGRATION.md). Registry packaging validation/publication is separate from this GitHub source update. The declared Registry payload includes this one graph in both formats; it is **not dependency-free**. Spectrum, rgthree, and KJNodes must be installed separately; ComfyUI-Easy-Use is not required. Historical workflow files remain in GitHub source but are excluded from the Registry payload. For an older saved workflow, use its matching historical Release/tag as described in the [migration policy](docs/V38_RELEASE_AND_MIGRATION.md). Registry packaging validation/publication is separate from this GitHub source update.
## V3.4 feature details ## V3.4 feature details
@@ -937,7 +942,7 @@ git pull --ff-only origin main
Restart ComfyUI after the update. If the node was installed with ComfyUI Manager, use its **Update** action instead of running `git pull` manually. Do not mix Manager updates and a separate Git checkout for the same installation. Restart ComfyUI after the update. If the node was installed with ComfyUI Manager, use its **Update** action instead of running `git pull` manually. Do not mix Manager updates and a separate Git checkout for the same installation.
After the backend restart, search for `H3 Continuum Sampler V3.8`. The complete V3.8 search surface contains the seven nodes listed above. If they are missing, check the startup console for the `H3 Continuum 3.8.0 loaded` message and any `ComfyUI-H3-Continuum` import error. After the backend restart, search for `H3 Continuum Sampler V3.8`. The complete V3.8X search surface contains the seven nodes listed above. If they are missing, check the startup console for the `H3 Continuum 3.8.1 loaded` message and any `ComfyUI-H3-Continuum` import error.
Search for H3 Continuum or Continuum in ComfyUI Manager, or install manually: Search for H3 Continuum or Continuum in ComfyUI Manager, or install manually:
@@ -1245,39 +1250,13 @@ Both inputs are optional. Connect `Video Guide Frames` when video guidance is ne
Use a 24 fps source for `Video Guide Frames`. `Load Video (Upload)` may accept files recorded at 25 fps or another frame rate, but acceptance alone does not guarantee correct temporal alignment with H3. For a non-24 fps source, set `force_rate` to `24` in `Load Video (Upload)`, or convert the file to 24 fps before loading it. If the source is already 24 fps, leave `force_rate` at its default and do not resample it. Use a 24 fps source for `Video Guide Frames`. `Load Video (Upload)` may accept files recorded at 25 fps or another frame rate, but acceptance alone does not guarantee correct temporal alignment with H3. For a non-24 fps source, set `force_rate` to `24` in `Load Video (Upload)`, or convert the file to 24 fps before loading it. If the source is already 24 fps, leave `force_rate` at its default and do not resample it.
## Current validation status ## Current validation status
The current V3.8 public-surface suite verifies the exact seven-ID export, the single supplied Spectrum graph and its identical ZIP payload, declared external dependencies, Registry exclusions, preserved legacy V3.8 widget/socket order with the AUDIO-R1 socket appended, and presentation-only `Show Advanced Settings` / `Hide Advanced Settings` behavior, including migration of the former `H3 Continuum View` property. Registry payload hashes are recorded in `REGISTRY_MANIFEST.sha256`; source-only files are also covered by `MANIFEST.sha256`. Git preserves exact bytes to avoid platform-dependent hash changes. Historical implementation paths remain covered by module-local regression tests without exporting additional V3.8 nodes. The V3.8 public-surface suite checks the exact seven-node export, the supplied Spectrum graph and matching ZIP payload, declared external dependencies, Registry exclusions, preserved V3.8 widget/socket order, and presentation-only `Show Advanced Settings` / `Hide Advanced Settings` behavior. Registry payload hashes are recorded in `REGISTRY_MANIFEST.sha256`; source integrity is recorded in `MANIFEST.sha256`.
**CPU launch audit — 2026-09-07, before the final distribution rename:** the full guarded suite passed **1,154/1,154 tests**, with no failures, errors, skips, or recorded CUDA initialization requests. Isolated ComfyUI Core 0.34.5 CPU checks passed seven-node registration and native PackedLayout; both the former Core-only template and the supplied Spectrum graph passed graph/schema checks. CUDA remained uninitialized. The final distribution uses the unchanged Spectrum graph under the generic V38 filename. These are CPU/software-contract results, not a new GPU-quality acceptance or proof that a running installed backend has loaded the latest source. **Latest local RC evidence:** the full CPU suite passed **1,261 passed / 1 skipped / 0 failed**. The final dedicated GPU Functional Gate passed a `3 × 5 second` Review Each Chunk run: Q1–Q3 generated one physical group at a time, and Q4 reused all three groups with `3 reused / 0 generated`. Q3 and Q4 had identical decoded RGB and PCM SHA-256 values. This confirms functional execution, prefix reuse, and AV reconstruction; it is not a full subjective image- or audio-quality rating.
**Historical V3.6 acceptance:** the V3.6 release gate included PIG-0 through PIG-5 Production Integration acceptance: backend-scoped Run Storage, real-cache Save/Resume/Regenerate From, atomic Terminal Merge reuse, Reference Image/Audio retention, bit-exact protected prefixes, GPU workflow output, numeric Audio Seam analysis, and subjective Audio PASS. Its automated validation result was `527 passed`; this is a historical count, not the current V3.8 CPU total. The package checklist and historical acceptance records are in `PACKAGE_VALIDATION.txt`. Regression coverage also includes source/runtime registration, native PackedLayout, Fixed 3x5 prompt planning, JavaScript UI harnesses, Prompt/CLIP cache equality, Video Guide bit-exact A/B, V3.5 Second Pass/Hi-Res, and V3.5.3 distribution-integrity checks. Validation results apply to the tested local source and environment. They do not guarantee that an installed copy is current, that all models/wrappers fit every GPU, or that a different prompt will have the same visual quality.
V3.4 compatibility paths have been exercised locally with:
- 1, 2, and 3 chunks
- standard and Turbo paths
- Spectrum enabled and disabled
- I2VA, Reference, and selected FL2VA configurations
- Hybrid FLF + Reference with the B2049 hybrid variant
- Core-equivalent `2 x 5s` FL2VA Terminal Merge
- `3 x 5s` FL2VA with the final two logical chunks merged into one 260-frame physical sample and decode group
- Driving Audio with short, exact-length, and longer sources
- Video Guide Frames with source audio routed separately to Driving Audio
- 0.4 MP and 0.6 MP reference sizing
- Run Storage reuse and selected-chunk regeneration
- Core VAE Decode and final assembly
Additional V3.5 acceptance includes:
- Advanced Second Pass Bridge for 1x5 T2VA, 3x5 T2VA, and 3x5 FL2VA Long Terminal Merge
- first-pass audio LATENT object passthrough through Second Pass
- RAM / Disk-backed bit-exact assembly, cache/requeue, Preview, Save, VHS, interrupt, stale cleanup, and a 9.49 GiB mapped IMAGE stress
- Auto backend selection in both the real 1.65 GiB Long Terminal Merge case and the 9.49 GiB stress case
- Experimental integrated Main Hi-Res Fix for FL2VA 1x5, 576x576 to 1152x1152
- Hybrid FL2VA + Reference 1x5 through both the integrated 576-to-1152 Main Hi-Res Fix and the direct 576x576 Advanced Second Pass node
No OOM was observed in the cited recent local V3.4 checks, including two-chunk 800 x 800 runs. This is not a universal memory guarantee. Model precision, LoRAs, source resolution, optional nodes, GPU, and RAM affect memory use.
## Limits ## Limits
+26 -15
View File
@@ -1,4 +1,6 @@
# ComfyUI-H3-Continuum 3.8.0 # ComfyUI-H3-Continuum 3.8.1 — V3.8X
> これは現在の**V3.8X/パッケージ3.8.1向けガイド**です。ここでは公開7ノードと同梱V3.8X Workflowだけを案内します。旧V3.8.0は[`v3.8.0`タグ](https://github.com/ukr8b3g-cmyk/ComfyUI-H3-Continuum/tree/v3.8.0)から引き続き導入できます。旧保存Workflowは、この説明と混在させず、対応するtagで開いてください。
MiniMax H3を複数チャンクで連続生成し、直前チャンク末尾の**映像latent / 音声latentを直接**次チャンクへ継承するComfyUIカスタムノードです。チャンク間でVideo/Audio VAEのDecode→Encodeは行いません。 MiniMax H3を複数チャンクで連続生成し、直前チャンク末尾の**映像latent / 音声latentを直接**次チャンクへ継承するComfyUIカスタムノードです。チャンク間でVideo/Audio VAEのDecode→Encodeは行いません。
@@ -20,7 +22,16 @@ git pull --ff-only origin main
ComfyUIを再起動してください。Managerから導入した場合はManagerのUpdateを使い、同じノードを重複配置しないでください。 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.0を別フォルダへ導入する場合:
```bash
cd ComfyUI/custom_nodes
git clone --branch v3.8.0 --single-branch https://github.com/ukr8b3g-cmyk/ComfyUI-H3-Continuum.git ComfyUI-H3-Continuum-v3.8.0
```
Continuumのcheckoutは同時に1つだけ有効にしてください。ComfyUI Managerの**Update**は`main`を更新するため、過去tagの選択には使いません。
V3.8X Workflow:[JSON](examples/workflows/MiniMax_H3_Continuum_V38x.json)/[同じJSONを含むZIP](examples/workflows/MiniMax_H3_Continuum_V38x.zip)。Spectrum対応の1本で、保存状態ではSpectrumとTurbo LoRAはどちらもOFFです。[LightX2V Turbo](https://github.com/ModelTC/Minimax-H3-Turbo)にも切り替えられます。完全なgraphを開くにはSpectrum・rgthree・KJNodesが必要です。ComfyUI-Easy-Useは不要です。
## プロンプト・スキルのダウンロード ## プロンプト・スキルのダウンロード
@@ -52,7 +63,7 @@ Main Sampler内の`Show Advanced Settings`/`Hide Advanced Settings`で詳細
`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経路は同時接続しないでください。 `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)を参照してください。 > **V3.8の対応範囲:** 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での動作保証ではありません。 複雑な16GB GPU受入Gateでは約`15.5~15.6 GiB`を使用しました。GPU、driver、backend、model精度、解像度、接続ノードで変動するため、すべての16GB GPUでの動作保証ではありません。
@@ -76,6 +87,8 @@ MainのWidth/Heightは`Manual`のときだけ表示・編集できます。`Fi
### 10秒を5秒ずつ確認しながら作る ### 10秒を5秒ずつ確認しながら作る
ComfyUI上端の実行ボタンは、frontendにより`Queue`、`Run`、または`実行する`と表示されます。この手順内の`Queue`は、その実行ボタンを指します。
ここでは、画面に表示される名前だけを使って手順を説明します。 ここでは、画面に表示される名前だけを使って手順を説明します。
#### 最初に知っておくこと #### 最初に知っておくこと
@@ -148,9 +161,9 @@ Takeを選択してもcanonical結果は変わりません。**Use This Take**
canonicalにし、**Continue From Here**で選択したTakeまでを保持して後続groupだけを canonicalにし、**Continue From Here**で選択したTakeまでを保持して後続groupだけを
再生成します。どちらの操作も自動Queueは行いません。 再生成します。どちらの操作も自動Queueは行いません。
## 歴史的な実装・受入記録(V3.8標準Workflowではありません) ## アーカイブされた実装・受入記録(V3.8現行ガイドではありません)
以下の節は旧リリースと互換性作業の記録です。上記のV3.8標準経路を変更するものではありません。 以下は一時的にsource historyとして残る旧リリース記録です。V3.8の標準経路・公開範囲・推奨配線を示すものではありません。旧WorkflowにはMigration Policyと対応するhistorical Release/tagを使用してください。
### V3.7 高解像度Refinement基盤 ### V3.7 高解像度Refinement基盤
@@ -230,7 +243,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%未満でした。 RTX 5060 Ti 16 GB/RAM 64 GBの検証環境で測定したSage-only Production baselineは、576×576 T2VA 1×5秒が168.069秒、640×640 FL2VA Long Terminal Merge 3×5秒が379.765秒です。環境・設定固有の測定値であり、すべての環境に対する速度保証ではありません。Samplingが最大コストで、Continuum Assemble + Seamは1%未満でした。
**V3.8.0が現在のRelease Candidateです。** V3.8が内部利用する旧module/classはsourceへ維持します。exportするのは現在の公開7ノードだけで、その一部は旧IDを維持しています。それ以外のIDを必要とする旧保存Workflowは、対応するhistorical Release/tagを使用してください。Still Image Guideは引き続きExperimentalです。 **V3.8.0はhistorical release baselineです。現在のRelease CandidateはV3.8X/package 3.8.1です。** V3.8Xが内部利用する旧module/classはsourceへ維持します。exportするのは現在の公開7ノードだけで、その一部は旧IDを維持しています。それ以外のIDを必要とする旧保存Workflowは、対応するhistorical Release/tagを使用してください。Still Image Guideは引き続きExperimentalです。
## V3.5.1 Reference Audio/互換性更新 ## V3.5.1 Reference Audio/互換性更新
@@ -277,7 +290,7 @@ AV LATENTの組、Noise、SIGMAS、Audio Lock、sampling、audio passthroughは
![V3.5.1 LBH+Conditioning Bridge外部sampling接続図](docs/images/v351-lbh-conditioning-bridge-flow.svg) ![V3.5.1 LBH+Conditioning Bridge外部sampling接続図](docs/images/v351-lbh-conditioning-bridge-flow.svg)
完全な接続例: [V3.5.1 LBH+Conditioning Bridgeワークフロー](examples/workflows/MiniMax_H3_Continuum_V351_LBH_Conditioning_Bridge.json) 退役したV3.5.1 LBH+Conditioning Bridgeの接続例は、対応するhistorical Release/tagでのみ参照できます。これはV3.8 Workflowではありません。
接続例ではCore標準名の`BasicGuider`、`BasicScheduler`、`SamplerCustomAdvanced`を変更していません。公開サンプルではCoreノードを独自タイトルへ変更せず、Continuumノードや外部カスタムノードと直感的に区別できる状態を維持します。LBH latent upscaler、AV LATENTの結合/分離、load/save、任意accelerationは外部ノードなので、各ComfyUI環境に合わせて導入または置換してください。 接続例ではCore標準名の`BasicGuider`、`BasicScheduler`、`SamplerCustomAdvanced`を変更していません。公開サンプルではCoreノードを独自タイトルへ変更せず、Continuumノードや外部カスタムノードと直感的に区別できる状態を維持します。LBH latent upscaler、AV LATENTの結合/分離、load/save、任意accelerationは外部ノードなので、各ComfyUI環境に合わせて導入または置換してください。
@@ -351,10 +364,10 @@ Hi-Res Fixを接続しなければV3.4 Sampling経路は変わりません。強
## 公開テンプレートワークフロー ## 公開テンプレートワークフロー
- [V3.8 Workflow JSON](examples/workflows/MiniMax_H3_Continuum_V38.json) — Spectrum初期設定の現行graph 1本 - [V3.8X Workflow JSON](examples/workflows/MiniMax_H3_Continuum_V38x.json) — Spectrum OFF初期設定の現行graph 1本
- [V3.8 Workflow ZIP](examples/workflows/MiniMax_H3_Continuum_V38.zip) — 同じJSONのみを格納。カスタムノードのインストーラーではありません - [V3.8X Workflow ZIP](examples/workflows/MiniMax_H3_Continuum_V38x.zip) — 同じJSONのみを格納。カスタムノードのインストーラーではありません
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です。 Registry配布予定の対象もこのJSONとZIPです。依存なしのテンプレートではなく、Spectrum・rgthree・KJNodesが必要です。ComfyUI-Easy-Useは不要です。Turboへ切り替えてもgraph内の外部ノードは残ります。SpectrumをOFFにし、用途に合うLightX2V Turbo LoRAを1本だけONにしてsampler/Stepsを合わせます。保存状態はSpectrum OFF、Turbo LoRA OFF、res_multistep/simple/20 Stepsです。
配布元のprompt、画像・音声名、ノード表示名、設定は変更していません。手元にあるファイルを選び、不要な入力をOFFにし、promptを入力してください。モデルやメディアは同梱しません。`Save 3x5s Video`などの保存済み表示名は生成時間を決めません。実際の長さはSamplerのChunksとSeconds per Chunkで決まります。 配布元のprompt、画像・音声名、ノード表示名、設定は変更していません。手元にあるファイルを選び、不要な入力をOFFにし、promptを入力してください。モデルやメディアは同梱しません。`Save 3x5s Video`などの保存済み表示名は生成時間を決めません。実際の長さはSamplerのChunksとSeconds per Chunkで決まります。
@@ -484,13 +497,11 @@ ZIPを展開して、`ComfyUI-H3-Continuum`フォルダーを`ComfyUI/custom_nod
## 検査 ## 検査
現在の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の公開ノードが増えることはありません。 現在のV3.8 Public Surface suiteは、正確な7 ID export、Spectrum graph 1本とZIP内JSONの同一性、外部依存、Registry除外、既存V3.8 widget/socket順、`Show Advanced Settings`/`Hide Advanced Settings`による表示切替を確認します。Registry配布対象のハッシュは`REGISTRY_MANIFEST.sha256`、source側の整合性は`MANIFEST.sha256`で管理します。
**配布名の最終整理前の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や、起動中の実行環境へ最新版が反映されたことを示すものではありません。 **最新のローカルRC証拠:** Full CPU suiteは**1,261 passed / 1 skipped / 0 failed**です。最終GPU Functional Gateでは`3 × 5秒`のReview Each Chunkを実行し、Q1~Q3はphysical groupを1つずつ生成、Q4は`3 reused / 0 generated`で3 groupすべてを再利用しました。Q3とQ4の復号後RGBおよびPCM SHA-256は一致しています。これは実行、prefix再利用、AV再構築の確認であり、画像・音声の総合的な主観品質評価ではありません。
**過去の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配布整合性の回帰も維持します。 検証結果はテストしたローカルsourceと環境に限られます。導入済み環境が最新版であること、すべてのmodel/wrapperが任意のGPUに収まること、別のpromptでも同じ画質になることを保証するものではありません。
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 ```text
python -m compileall -q . python -m compileall -q .
+28 -23
View File
@@ -1,39 +1,39 @@
dca65fb1393e67f59c6f81f9411e3e745eb8f1097e9a2adf7ffc6f4e3901ca9f __init__.py dca65fb1393e67f59c6f81f9411e3e745eb8f1097e9a2adf7ffc6f4e3901ca9f __init__.py
be0b8d39e5343680ebea815c3a4fb6ce7a32e065f30e43e013040a40f702cef3 .comfyignore dfd195c1f59078f8438bceb7472673abc28c89b183ee4045a9fad27280a9663c .comfyignore
3e7a1ec3380be2a222c8a3e9b8a6bb184d3a760478957f48186438f15235bdba branch_provenance.py 3e7a1ec3380be2a222c8a3e9b8a6bb184d3a760478957f48186438f15235bdba branch_provenance.py
2794b4f4831e5ec9a38b6cb3049736c16d800708057349e80e1a921c90d16a2e CHANGELOG.md 3a865d0b63100ff23ccb3717342b43f7f67036c99e941486a5fd20389177955b CHANGELOG.md
c1ed3a0342730450958fb62fd21854a876991f3a4aefb24e5383b0c73cd2312d compatibility.py c1ed3a0342730450958fb62fd21854a876991f3a4aefb24e5383b0c73cd2312d compatibility.py
4d62508f900af9f93ec320afb900c27cc9a300d1e0c0a94714258498c5ede5fc conditioning.py 4d62508f900af9f93ec320afb900c27cc9a300d1e0c0a94714258498c5ede5fc conditioning.py
64967f4987e3ad9316f3a47f0dcf582eeff39ee0c3485f4184d3532d495534ae constants.py 64967f4987e3ad9316f3a47f0dcf582eeff39ee0c3485f4184d3532d495534ae constants.py
cf255b8a635471229aebadc926acfdcacb65963adbcb9e0f9505d04eada2c6b5 continuation.py cf255b8a635471229aebadc926acfdcacb65963adbcb9e0f9505d04eada2c6b5 continuation.py
b30fe4640359bebfcdeeb94dbeec94cb346c8e3646509e1dcdb87d7021ba04ff docs/N2B_BRANCH_PROVENANCE_CONTRACT_V1.md b30fe4640359bebfcdeeb94dbeec94cb346c8e3646509e1dcdb87d7021ba04ff docs/N2B_BRANCH_PROVENANCE_CONTRACT_V1.md
717577efdec5e61600504b77bc2a099ef022c4fe2333e936c3310c7182d8f2a0 docs/V38_OPEN_INTEGRATION_CONTRACT.md 717577efdec5e61600504b77bc2a099ef022c4fe2333e936c3310c7182d8f2a0 docs/V38_OPEN_INTEGRATION_CONTRACT.md
1d2838cc47694609289ea15132872ad48e1b6c8274da4b7bf188dd3ebf066121 docs/V38_RELEASE_AND_MIGRATION.md b08159178c999c4c97df6aed67c6cf48b5032548a1d370dc4a0cf7e293ab8031 docs/V38_RELEASE_AND_MIGRATION.md
cedd7b07901d6065079ef37380f0062d535a39c98c8f614e1b26582f549d7183 driving_audio.py cedd7b07901d6065079ef37380f0062d535a39c98c8f614e1b26582f549d7183 driving_audio.py
e490c87e4995930f95c8fffc4c678111d7897e74003e1962b9b4a247ba43f4ac examples/workflows/MiniMax_H3_Continuum_V38.json 26bbca92b5f7cac4cbde89290b3f801b7a895df76a07493ca6f65c18d5b1154a examples/workflows/MiniMax_H3_Continuum_V38x.json
8c109973e5b49cf52b32e0ebb2b5ae6a4e349191e66c2696ff43ce76fefeb07c graph_contract.py 7861fac4c8fe82372c5459aa574d35ea003bdb4fd846d567bd891c2e38571b3d graph_contract.py
bf0556b076dbaca67c3405a7d86c333ca7fdf3d4381529b0a9edc906519943e9 guide_timeline.py bf0556b076dbaca67c3405a7d86c333ca7fdf3d4381529b0a9edc906519943e9 guide_timeline.py
1473c384082700f422f2cf9141e0d012d87d2b43ac8a8a433edc7172e6ca7bf6 hardening.py 1473c384082700f422f2cf9141e0d012d87d2b43ac8a8a433edc7172e6ca7bf6 hardening.py
7c8b1226592dcd9d0ec6cc1579956e380fedc9b2672386c29db82169a6cf5f10 INSTALL_JA.txt de0da5590691554cbf7f6318ac539a160e639bc3e20ee0752ae189dc31e979ce INSTALL_JA.txt
23bddc5a41d2e997f4fbf789c7128e32f4f197f1405b2aef1c76794f57482446 install_windows.bat 23bddc5a41d2e997f4fbf789c7128e32f4f197f1405b2aef1c76794f57482446 install_windows.bat
fcf80acf6479ece00066eeb59f75d5246cb7b17b75ba84938b73ae17a5083903 install_windows.ps1 12bf572a65d57bbc9a72b459f29691c2057768f4fb7a74f9db87f4775e995bda install_windows.ps1
6aa3f5780baa7bb0c0672b5f01a2f77e5f209da93f6373468cb274ea2f643d4b layout_adapter.py 6aa3f5780baa7bb0c0672b5f01a2f77e5f209da93f6373468cb274ea2f643d4b layout_adapter.py
c44abbd789091bbead01250dbd5453e60539d2665c69f162335fdbd2936019c2 LICENSE c44abbd789091bbead01250dbd5453e60539d2665c69f162335fdbd2936019c2 LICENSE
d3e213005670e94dee33a240349a4d245cf9a3b6602099f11ed30cf5a32e2c21 media.py d3e213005670e94dee33a240349a4d245cf9a3b6602099f11ed30cf5a32e2c21 media.py
8b360a1c47a8ee5a95656ffbc83bfc16de69678ecec2c1d8cace46b5ea4e911e metadata.ini c59b8119e1e5e185351b5e64a960bcb67ce8689f47d390fe8d783d1b5a0cae29 metadata.ini
2d611f7201889851eac6459f8aa2b37baf342b345241979ca6042b61b252dff9 model_patch.py 2d611f7201889851eac6459f8aa2b37baf342b345241979ca6042b61b252dff9 model_patch.py
a4ce23167b83e8d72b86a802dfde4f4045828433c7c13aab799bd64831dc04a4 nodes.py a4ce23167b83e8d72b86a802dfde4f4045828433c7c13aab799bd64831dc04a4 nodes.py
57dcb61cc3e83b2ca97616919ac6ee17d4c62caf845c38161573f56dad12f8fe PACKAGE_INFO_JA.txt 2b8c19f9474beabfebe1802cdf4a89780dce3c351c48d65e1ce8bb77d2fb9ba9 PACKAGE_INFO_JA.txt
000a56a942b13d11973994ab32cd2a1abc424a3fe1d95a323240077bd8092bdf PACKAGE_VALIDATION.txt 6da7fe4aa34a43fba59d4f52b6588bd81aa70deef6d9d2dab789664613cd5b2e PACKAGE_VALIDATION.txt
b470819f16fc179654dc1600721a63f0a5a14e777f4c004d574b499da6886ba5 public_api.py b470819f16fc179654dc1600721a63f0a5a14e777f4c004d574b499da6886ba5 public_api.py
96f98d727b72d6aefd431061572e187c303365a3e5b4d20cbb2bcf030aa30112 pyproject.toml 4ea98b8792ee9861c569e03e09e9ac8991991d2ee63d037fe86369dd51546e7d pyproject.toml
f13cdf0a4ddc7943b6a464d50547d8603a0dfdfc8c970e0a601e276cb281b54f README_JA.md a1a9f6388e40f3ee217f7691854c04461614a37cd1a97a86fd364759593c4dd4 README_JA.md
44076d133dfcd4df14de95c92e6cff19bd1be5c381f200d061c67d382d202996 README.md 15763bc9916dfc6be0a77a79aa957f1deebdacfdd41c6468a9df05cf99898dd3 README.md
44127adcfa30ee84bff9cd4b2d0c695355209550e76982d374122008728aa5bc reference_audio.py 44127adcfa30ee84bff9cd4b2d0c695355209550e76982d374122008728aa5bc reference_audio.py
5cb9bfd6810d3a93a637451980a4cc5c1436e5b84cfd1c7a111cd192e876351b reference_video.py 5cb9bfd6810d3a93a637451980a4cc5c1436e5b84cfd1c7a111cd192e876351b reference_video.py
131bdfbb7a7173c9e7826859c0e648bfb69bd18bf20fa5528c0e18a63f888b26 reference.py 131bdfbb7a7173c9e7826859c0e648bfb69bd18bf20fa5528c0e18a63f888b26 reference.py
467edb2c188d024c2392aafe7423b3f835e16b10f570da76e2f7dda8a962c1c5 requirements.txt 467edb2c188d024c2392aafe7423b3f835e16b10f570da76e2f7dda8a962c1c5 requirements.txt
2ceba1091dad4fa66da7299e8320ff0a8a6dccb948fc918e3101b40f6d8b03f6 run_storage.py 92e22d0e5413ce7755f380b914a6cf7f2b0a10eba65a2fb928aac3f950d60fb9 run_storage.py
6056de6c0a5322a8a51ba5a114538dca2ef67788cd1afba10fedd483b95f6afa state_io.py 6056de6c0a5322a8a51ba5a114538dca2ef67788cd1afba10fedd483b95f6afa state_io.py
3a359a0467725cc292ccb4c86cf0c3d30bb6a114d01f5345792b09ea3d45441d state.py 3a359a0467725cc292ccb4c86cf0c3d30bb6a114d01f5345792b09ea3d45441d state.py
43ec4023dc06c941e5d7a04db4b8a89fb58d744ceb986f6eb9bf534d4fdcb87b temporal.py 43ec4023dc06c941e5d7a04db4b8a89fb58d744ceb986f6eb9bf534d4fdcb87b temporal.py
@@ -54,7 +54,7 @@ dc2b901789e4b024dbcbc4024c63eb8cbc564d77003ce8c35c0584851ba6dfbd v2/prompts.py
2fd811794c4cc0f2ce050250b80484876454926b9f20fce6af3a97d728e5acdf v2/seam_guard.py 2fd811794c4cc0f2ce050250b80484876454926b9f20fce6af3a97d728e5acdf v2/seam_guard.py
be0d8585fa57e0ccd6d02577bbc7299629e5bfe20e186747f571fccc98b67d7e v2/seam_types.py be0d8585fa57e0ccd6d02577bbc7299629e5bfe20e186747f571fccc98b67d7e v2/seam_types.py
12cfcc0c71ca087fe39a5ce2922959a62b2bb311bfe664f05c4480affce03708 v2/seeds.py 12cfcc0c71ca087fe39a5ce2922959a62b2bb311bfe664f05c4480affce03708 v2/seeds.py
3a98f8a21756f3813f52197946e761227507b14c40703c9fb1bb108c1e4ddbe7 v2/sequence.py ff23b9f49b05b1e000110ab4eb211942f0aa0d376f35694e80c5df25047a77c7 v2/sequence.py
13213e7709fd02bb810af3c18e4cd7d010f8cdfb121a4b99866a9f2333331089 v2/session_io.py 13213e7709fd02bb810af3c18e4cd7d010f8cdfb121a4b99866a9f2333331089 v2/session_io.py
3ea23dbce6fcd217b6e81235855479b9b16fed7a21693cf156f9014555c4fe13 v2/session.py 3ea23dbce6fcd217b6e81235855479b9b16fed7a21693cf156f9014555c4fe13 v2/session.py
78c830cdf49034c6e3b2cd3da5914d5cfc5638eb63ec6dbd1bab13c50d6d4caf v3/__init__.py 78c830cdf49034c6e3b2cd3da5914d5cfc5638eb63ec6dbd1bab13c50d6d4caf v3/__init__.py
@@ -62,7 +62,8 @@ ea2922567df90436dd6fa21696833a49dd0cbfeee142a5fedc3a7c303824d473 v3/adaptive_co
b3dc61503d35d9ef0a0dc7fed1c9b2fdc00fcb2072d4e39f64ae0826f9ec7dca v3/assembly_v35.py b3dc61503d35d9ef0a0dc7fed1c9b2fdc00fcb2072d4e39f64ae0826f9ec7dca v3/assembly_v35.py
7815230e0a9540bc2edeaf818e940b7a1fdd817fd217ba8a4f9cb21aaf6a308e v3/assembly.py 7815230e0a9540bc2edeaf818e940b7a1fdd817fd217ba8a4f9cb21aaf6a308e v3/assembly.py
3f62fdb35e804f42d7cbf0828b4e87e69a2b99246c3f7467fe4fa698f1d803c9 v3/conditioning_bridge_nodes.py 3f62fdb35e804f42d7cbf0828b4e87e69a2b99246c3f7467fe4fa698f1d803c9 v3/conditioning_bridge_nodes.py
92b92c51b87182d420ce0468f57797fbb6fe4123d04080b73d6d89581ff96c31 v3/driving_nodes.py bb4567770db74d4d8a286e3eb2da2230987d5a3bf35747c0815960d18049bc06 v3/driving_nodes.py
b230500f37783ab2cba124f3be20ef93a70da37c45db37ea4ab45589c910d1a5 v3/node_facade.py
2f395da6a41981713f99ba40b73d14f2274b8ca34a73cf2b275a444993765b99 v3/easy_audio_nodes.py 2f395da6a41981713f99ba40b73d14f2274b8ca34a73cf2b275a444993765b99 v3/easy_audio_nodes.py
64b3e54b42e5156642f9957ccc374fd190d9fc7145637984e702534fb1bf80b4 v3/easy_image_nodes.py 64b3e54b42e5156642f9957ccc374fd190d9fc7145637984e702534fb1bf80b4 v3/easy_image_nodes.py
ac859cb1a6e23b8ceae300d818c24fe1346b649a0d663017a9b3ac64aa96fca3 v3/easy_nodes.py ac859cb1a6e23b8ceae300d818c24fe1346b649a0d663017a9b3ac64aa96fca3 v3/easy_nodes.py
@@ -73,10 +74,12 @@ cb53e1b104415032ec79b7e7aa1c99848e63da3eedaa251eeba102970e4172b5 v3/hires_fix_n
5b8a54e67a608e757a505abc712effb33312636e3bb235835a485a506e80eeee v3/masked_continuation.py 5b8a54e67a608e757a505abc712effb33312636e3bb235835a485a506e80eeee v3/masked_continuation.py
91a868d2e392b018b01d0396209849c146b0d560ceb109fcdd87dea7f3d786aa v3/memory_action_policy.py 91a868d2e392b018b01d0396209849c146b0d560ceb109fcdd87dea7f3d786aa v3/memory_action_policy.py
85477badd85281cfb77582fdd5b34228a9f6b68376f1b7743af2ca7d4b55aa36 v3/memory_attribution.py 85477badd85281cfb77582fdd5b34228a9f6b68376f1b7743af2ca7d4b55aa36 v3/memory_attribution.py
b528e34e24407896e3728d693a40393b46ec7bce236d455721712dfe2fe75adb v3/nodes.py fe03ae0aa0dbbbe5f950bb7da34c18a078d841547992c374ea8beda5e3ad4715 v3/execution_planner.py
473dc26ba53010c53e6273ebe04a071ccc6758201a06df46cd2ef4bee4263246 v3/nodes.py
a3411c7a295308d21623551cf4aeca5bef511eb5f063f31ac84032e3bdf4e16d v3/packed_row_planner.py a3411c7a295308d21623551cf4aeca5bef511eb5f063f31ac84032e3bdf4e16d v3/packed_row_planner.py
b7c4a35a5e73f528492bc6946b97b687c412f1d3f5f976c19d45c6dc20288c9a v3/pixel_vae_resize.py b7c4a35a5e73f528492bc6946b97b687c412f1d3f5f976c19d45c6dc20288c9a v3/pixel_vae_resize.py
34ea38c03b6322288d88fc8595e3655a7a7afddb51709142a954eb7349f71ac2 v3/plan.py b139843ccfc826937c80f118920bbee2609c37d45ef88291f80f491744fd5e76 v3/plan.py
0e3dd69d6d2bec6d9491c2fb806c25f0c62629b1eb5f9e4f77ae8d27a5b19cfc v3/planning_types.py
ec71e3965f445756d54d005c0e27bea520e26dbac44e1ee3d3867bfe2da100b0 v3/ref_encode_cache.py ec71e3965f445756d54d005c0e27bea520e26dbac44e1ee3d3867bfe2da100b0 v3/ref_encode_cache.py
9076c47aa5145c81f34793d6c90410656065248f37d9990a92a6a4061b358811 v3/refine_context.py 9076c47aa5145c81f34793d6c90410656065248f37d9990a92a6a4061b358811 v3/refine_context.py
519586b1b3f48c73d329f7a2aaa8a1bfc6fe31ac2ecb64f2b1fdf9c19026001a v3/refine_sampling.py 519586b1b3f48c73d329f7a2aaa8a1bfc6fe31ac2ecb64f2b1fdf9c19026001a v3/refine_sampling.py
@@ -86,20 +89,22 @@ ac373d9783d3a7bb968e8117843d246d6a090b66a819015348bff84e7747442c v3/refine_targ
45ae91f13e8f71405d2f46045c8acc6eabbc9500c194cf5d0ba541bb085cd135 v3/refine_window.py 45ae91f13e8f71405d2f46045c8acc6eabbc9500c194cf5d0ba541bb085cd135 v3/refine_window.py
ae909b43ad17934c85881d3b0bea81e7b45c215eeb4d1f9f6a9ea72faf633ddf v3/reliability_v38.py ae909b43ad17934c85881d3b0bea81e7b45c215eeb4d1f9f6a9ea72faf633ddf v3/reliability_v38.py
520a4ae849f83450855ce0023c582db5f91d29d8694a99aa8cf491351c837cff v3/resolution.py 520a4ae849f83450855ce0023c582db5f91d29d8694a99aa8cf491351c837cff v3/resolution.py
c21602eb983d497f0eb559197f4f1408b9b5ebb8dcd3aab65e746641f77bcfd4 v3/review_control.py 3f03d8659305d2def41939205d21cdc6f35e32943274e87afe539d15b9635f9b v3/review_control.py
be6610fb9427546d9485a17015cfbdc8786715e6a0967f3e4c1dee35d8768385 v3/runtime_coordinator.py
d0a004aa3030c8adaa5ea788f9acc758fcb4a556f203f9a3f63fa4e4b5772063 v3/sampling_engine.py
452022107cea233aa84d5366ec4943ac5aadbd5fcf786113f1d542a641eac8f7 v3/second_pass_nodes.py 452022107cea233aa84d5366ec4943ac5aadbd5fcf786113f1d542a641eac8f7 v3/second_pass_nodes.py
71791b8032c9857b5fcdcaf1ce004a48c0e1c9e074a1de867ec0547e3ec5e313 v3/reference_video.py 057921bf2b05e88c2cbc08c16e2ac483aea905b8a144fbadf4a21d6ae8252427 v3/reference_video.py
66501234756c2b558ce84f887bd540e7f843ed574c8a8b2522950bd1985d7acc v3/second_pass.py 66501234756c2b558ce84f887bd540e7f843ed574c8a8b2522950bd1985d7acc v3/second_pass.py
6e71e944313339f14e14e11cec682593159ca5542aa5d38095371da781d60224 v3/targeted_refine_sampling.py 6e71e944313339f14e14e11cec682593159ca5542aa5d38095371da781d60224 v3/targeted_refine_sampling.py
5a044bdd70c546e4446e0c26af92aae88049ffa2e0e2d01b52033a83a3152d0e v3/targeted_second_pass.py 5a044bdd70c546e4446e0c26af92aae88049ffa2e0e2d01b52033a83a3152d0e v3/targeted_second_pass.py
4178dcfa442abdb06ce276e05bd7bcbaa6da28469ba5e57d3da3c663de4e4a9d v3/video_seam_v35.py 4178dcfa442abdb06ce276e05bd7bcbaa6da28469ba5e57d3da3c663de4e4a9d v3/video_seam_v35.py
2f07ace1462644f0bee553827b3571535de4d0c2d9ef847bd9e0ca73a4eed5cb v3/video_seam.py 2f07ace1462644f0bee553827b3571535de4d0c2d9ef847bd9e0ca73a4eed5cb v3/video_seam.py
d1957fa668a0332e483330bc79fc53095712420e401035a4f80cf6b532677d51 version.py 91ebc1f20c31645faf75e2e98228f30aec03d026c78698e4c20e39c447cdbf64 version.py
c2883272b05a9a9146b5c6cf614ddae8a3e6893cd910902023aae61360195289 web/easy_bypass_toggle.js c2883272b05a9a9146b5c6cf614ddae8a3e6893cd910902023aae61360195289 web/easy_bypass_toggle.js
092088096307d33ac016b82b4774ca38845a2ff2f63b97ac6da8c5aca4fea413 web/easy_load_audio.js 092088096307d33ac016b82b4774ca38845a2ff2f63b97ac6da8c5aca4fea413 web/easy_load_audio.js
9db0aa94f634578a962d5db49e5c70356040a59df968e3a2e531b327a623081f web/easy_load_image.js 9db0aa94f634578a962d5db49e5c70356040a59df968e3a2e531b327a623081f web/easy_load_image.js
873efcbd15c2d9fa10c9d5fc51a796ad3a18c0c6acceecf499c4b956aa845c6c web/easy_load_video.js 873efcbd15c2d9fa10c9d5fc51a796ad3a18c0c6acceecf499c4b956aa845c6c web/easy_load_video.js
0c68d13a1f8beb7431a32b471f8b0612c42fcc4bf72dd97611a025d158008662 web/easy_v38.js 0c68d13a1f8beb7431a32b471f8b0612c42fcc4bf72dd97611a025d158008662 web/easy_v38.js
045b8154ef5c5b2839d87b685ebc875d4f8fb98ddf1571fc58fd73a558bc0eaa web/project_id.js 1db955b555367ec8cad26e35b8ad9a23b808db6ea86ba746d41a3af3b9e336e9 web/project_id.js
0cf8d49bcb71b30437dc893f6218dc4cfb1cd244b647e4fbc2861dea2271a33a web/reference_audio_ui.js 0cf8d49bcb71b30437dc893f6218dc4cfb1cd244b647e4fbc2861dea2271a33a web/reference_audio_ui.js
83d28cc0cd549066962dc21ceae05d2b189fe22391b556887eab2cc1800e1e80 examples/workflows/MiniMax_H3_Continuum_V38.zip df4e0e355020d2e731932cff86a4b00932b4f193ec7ed513be0db994ec0e71bb examples/workflows/MiniMax_H3_Continuum_V38x.zip
+93
View File
@@ -0,0 +1,93 @@
# R0 Failure Semantics Baseline
Date: 2026-09-14
Scope: current V3.8 Python-exception behavior
Storage root: pytest `tmp_path` only
## Isolation contract
すべてのfailure injectionは一時Run Storage rootで実施した。
```text
real h3_continuum storage touched: NO
existing Take / revision touched: NO
user backend 8188 touched: NO
GPU used: NO
public workflow changed: NO
```
このbaselineは、catch可能なPython exceptionが`RunStorageController.__exit__()`へ到達する場合を記録する。OS強制終了、電源断、process killの挙動を成功扱いしない。
## Results
| Injection point | Committed records after cleanup | Manifest status | Canonical pointer | Current observable behavior |
|---|---:|---|---|---|
| before Sampling | 0 | `interrupted` | none | errorを記録し、review pause metadataを除去 |
| after Sampling / before chunk commit | 0 | `interrupted` | none | sampled resultは永続化されない |
| after first entry of terminal physical group | 1 | `interrupted` | none | terminal pairの片側raw/recordがinterrupted revision内に見える |
| before manifest update (one-shot exception) | 1 | `interrupted` | none | in-memory recordを`__exit__()`が再度manifestへ書き、interruptedとして回収 |
| after manifest update | 1 | `interrupted` | none | committed recordを保持してinterrupted化 |
| before output projection | 1 | `interrupted` | none | recordを保持してinterrupted化 |
| during output projection | 1 | `interrupted` | none | recordを保持してinterrupted化 |
| before storage finalize | 1 | `interrupted` | none | in-progress recordを保持してinterrupted化 |
| before canonical pointer update (first `_write_project`) | 1 | `interrupted` | none | finalize途中のmanifestをexception cleanupがinterruptedへ戻し、2回目のproject writeはcanonicalを設定しない |
Assertions are implemented in:
```text
tests/test_runtime_redesign_r0_characterization.py
```
## Current write ordering
### `commit_chunk()`
```text
validate one logical entry
→ write temporary safetensors
→ fsync temporary
→ os.replace to chunk_000N.safetensors
→ fsync chunks directory
→ construct one record
→ replace manifest chunks in memory
→ write manifest
```
この処理はphysical group単位ではなくlogical entry単位である。terminal merged pairでも、1件目commitと2件目commitの間に例外が起きる窓がある。
### `finalize()`
```text
validate committed prefix and Session length
→ set status / review metadata
→ write manifest
→ build branch provenance
→ write manifest again
→ write project with set_canonical=True
```
Python exceptionが上位のstorage scopeへ戻れば、`__exit__()`はstatusを`interrupted`へ変更し、canonical指定なしでprojectを再書込する。
## Process-crash limitations
このR0 testは、次を保証しない。
- `os.replace(raw)`直後、manifest更新前にprocessが消失した場合のorphan raw回収
- 既存`chunk_000N.safetensors`を上書き中にprocessが消失した場合の旧manifest/raw整合性
- terminal pairの両entryを不可分にpublishすること
- manifest provenance書込後、project canonical更新前にprocessが消失した場合の再起動時selection
これらはR5のprocess-crash consistency対象である。R0でwrite orderやschemaを変更していない。
## R5-approved delta boundary
将来R5で許可される差分はV9どおり次に限定する。
- physical group全entryを先にvalidate
- immutable transaction raw filenames
- raw durabilityとSHA verification後にmanifestを1回でswitch
- `commit_group()`はcanonical pointerを更新しない
- canonical pointerはsuccessful finalize後だけ更新
Sampling結果、Session/State/Assembly、Review user-visible semantics、Run Storage v3 readabilityは変更しない。
+90
View File
@@ -0,0 +1,90 @@
# Failure Semantics Delta — R5
Date: 2026-09-14
Status: R5 Design Delta PASS / Implementation PASS / Validation PASS
Baseline: authoritative ComfyUI_W dirty tree, with R0–R4 PASS before R5
## Approved differences
R5 may change only these two externally observable failure details.
### D1: terminal physical-group manifest visibility
Previously, the first logical entry of a terminal merged pair could become
visible in an interrupted manifest before the second entry was committed.
R5 publishes all records of that physical group in one manifest replacement.
An incomplete terminal group is never manifest-visible.
After all raw files have been written and verified, catchable Python exceptions
may recover the entire terminal group as `interrupted`. They may not recover
only one logical half.
### D2: immutable transaction raw names and orphan layout
Legacy raw name:
```text
chunks/chunk_000N.safetensors
```
R5 raw name:
```text
chunks/rev-<revision>-txn-<transaction-id>-chunk-000N.safetensors
```
The reader continues to accept the legacy filename stored in existing v3
manifests. A retry uses a new transaction filename and never overwrites a raw
file referenced by an older manifest or Take. A process stop may leave an
unreferenced raw or temporary file. R5 does not adopt, promote, or delete that
orphan automatically.
## Manifest switch definition
```text
write a complete candidate manifest to a unique temporary file
→ flush and fsync the temporary file
→ atomically replace the active manifest
→ run the available directory durability helper
```
The completed atomic replacement is the **manifest visibility switch**. The
subsequent directory helper completion is the **manifest durability
completion**. Process-stop tests observe the state before replacement,
immediately after replacement, and after the directory helper separately.
On Windows, atomic replacement and media-level durability are not treated as
equivalent. The current Windows directory helper is a no-op; validation records
that limitation and does not claim power-loss or OS-crash durability.
## Behavior that remains unchanged
- non-terminal accepted-prefix meaning and resume position
- manifest status and Review/Take behavior
- canonical eligibility, fallback selection, and pointer meaning
- Sampling, Projection, and finalize failure semantics
- accepted chunk tensors, seeds, prompts, Session, State, and Assembly data
- Run Storage v3 schema readability
- Storage OFF filesystem-I/O behavior
`commit_group()` writes physical-group raw files and publishes their records.
It never updates the canonical project pointer. Canonical promotion remains in
the existing successful-finalize path.
## Process-stop acceptance
- Before manifest replacement, a fresh reader sees the previous complete
manifest. Any new raw files are unreferenced orphans.
- After manifest replacement, every raw referenced by the new manifest exists,
has the recorded size, and matches the recorded SHA-256.
- At the replacement boundary, the active file is a complete old manifest or a
complete new manifest. A partial JSON file and a half terminal group are
invalid.
- A forced process stop does not run `__exit__`; it is not required to change
status to `interrupted`.
- Existing canonical fallback selection is preserved even in windows where the
project pointer has not yet been replaced.
The test fixture covers raw-write, raw-verification, manifest-temporary,
manifest-replace, directory-helper, finalize-manifest, and project-pointer
boundaries with a separately terminated worker and a fresh reader.
+256
View File
@@ -0,0 +1,256 @@
# Runtime Redesign R0 Characterization
Date: 2026-09-14 (Asia/Tokyo)
Phase: R0 only
Architecture changes: none
## 1. Authoritative baseline
R0の正本は、開始時点の次のdirty treeである。HEADや別cloneへ置き換えない。
```text
authoritative_runtime_path:
D:\StabilityMatrix\Data\Packages\ComfyUI_W\custom_nodes\ComfyUI-H3-Continuum
branch: main
HEAD: c421913bf1311050ac10a6d782ce40f9e72be852
Python: 3.13.12
Torch: 2.14.0+cu130
ComfyUI: 0.35.1
GPU initialized by R0: NO
user backend 8188 touched: NO
```
開始時点には既存のtracked変更と、次のuntrackedファイルがあった。すべてユーザー作業として保持した。
| Untracked file | SHA-256 |
|---|---|
| `examples/workflows/MiniMax_H3_Continuum_V38.json` | `9772DD1A82C20FD0D6F40AE7CD2B2F11DFB81641B86515ADB17C6555ADA7AFF3` |
| `examples/workflows/MiniMax_H3_Continuum_V38.zip` | `9B684C37EBFE116FCB5C68032B82E5D49279325548C48494F23B3309BB211924` |
| `tests/test_audit_boundary_repairs.py` | `FE23752312D62DDC8C23A3C598ED2F92F2D46E2E4460F06AEA91921659092451` |
Workflow ZIP内の唯一のentryは`MiniMax_H3_Continuum_V38.json`で、展開JSONのSHA-256は上表のJSONと一致した。
Baseline diff artifact:
```text
D:\Codex\_test_results\ComfyUI-H3-Continuum\r0-runtime-redesign-20260914\BASELINE_WORKTREE.diff
```
Snapshot:
```text
verified:
D:\Codex\_snapshots\ComfyUI-H3-Continuum\pre-r0-runtime-redesign-verified-excluding-pytest-cache-20260914_021621
files: 892
partial attempt (Copy-Item was denied by .pytest_cache ACL):
D:\Codex\_snapshots\ComfyUI-H3-Continuum\pre-r0-runtime-redesign-20260914_021557
```
Verified snapshotは`.git`とアクセス不能だった`.pytest_cache`だけを除外し、source/destination file countを一致確認した。
## 2. Baseline validation
R0変更前:
```text
full CPU pytest: 1187 passed, 1 skipped, 1 warning, 62.18 s
frontend_review_queue.cjs: 46 passed
tools/verify_runtime.py: PASS
registered public nodes: 7
```
実ComfyUI Queue、GPU、VAE DecodeはR0の対象外であり未実行。
## 3. Continuation source baseline
### 3.1 Storage OFF
| Inputs | Accepted prefix | Effective generation start | Continuation state | Current result |
|---|---:|---:|---|---|
| none | 0 | Chunk 1 | none | fresh Full Run |
| compatible explicit Session with 1 accepted chunk | 1 | Chunk 2 | last accepted Session entry | prefix reuse |
| Session + `Regenerate From = 2` | 1 | Chunk 2 | Session Chunk 1 | Chunk 2以降を再生成 |
| incompatible explicit Session | 0 | Chunk 1 | none | Sessionをadvisory rejectしてfresh run |
| initial State only | 0 | logical Chunk 1 | supplied State | generated plan is continuation and increments State `clip_index` |
| compatible Session + valid State | Session prefix | prefix後 | Session last entry | StateはSession検証前に抑止 |
| invalid Session + valid State | 0 | Chunk 1 | none | Stateへfallbackせずfresh run |
| initial State + invalid `Regenerate From > 1` | n/a | n/a | n/a | `SequenceRuntimeError` |
重要なV9との差分: 現在の`_preserved_prefix()`はSession validation、resolution、duration、identity不一致を例外として外へ出さず、noteを付けて空prefixを返す。このため、V9の「invalid/incompatible Sessionなら既存Sessionエラー」は現行実装の事実ではない。
実際の現行結果は次である。
```text
Session present + initial State present
→ initial State = None
→ Sessionを検証
→ Session invalid/incompatibleならSession prefixを0件へ落とす
→ initial Stateには戻らない
→ fresh Chunk 1を生成
→ reportへ "saved session was ignored; generated a fresh run (...)"
```
したがってR1以降で維持すべきbaselineは、ユーザーが別途変更を承認しない限り「no State fallback + advisory fresh run」である。
Storage OFF characterizationでは、Run Storage Review policy invocationは0、Run Storage filesystem I/Oは0だった。
### 3.2 Run Storage ON
| Inputs / saved state | Current result |
|---|---|
| explicit Session present | `RunStorageError: Run Storage cannot be combined with an explicit Session`。storage書込前に停止 |
| validated saved prefix + initial State | saved prefixが優先。Stateはcontinuation sourceにならない |
| no saved prefix + initial State | initial Stateを使用 |
| Review Continue | review decisionを作成後、prefix実読込後にreconcileして再度decisionを作成 |
現在のReview Continue decision-producing pathを隔離すると、pure policy callは2回だった。
```text
_resolve_review_contract()
→ resolve_review_execution() # first decision
→ prefix selection/load
→ _reconcile_review_execution_with_reused_prefix()
→ resolve_review_execution() # second decision
```
`_validated_review_head()`も同じpure functionをmetadata validationに使用するが、その戻り値はQueue decisionではない。R2の「Decision 1回」は上記decision-producing 2経路を1経路にする課題であり、R0では変更していない。
## 4. ContinuationSourceFacts mapping baseline
この型とprojection関数はR0時点のsource treeには存在しない。R3/R4で新しい意味を作らないため、現行runtime値からのmappingを次で固定する。
| selected kind | `accepted_chunks` | `reroll_from_chunk` | `physical_group_boundaries` |
|---|---:|---|---|
| `run_storage` | 実際にraw検証とloadを通過した`best_entries`数 | final branch contractの有効boundary。通常continueは0 | accepted prefix内で完全に成立した現行physical groups |
| `explicit_session` | `_preserved_prefix()`が受理したentries数 | explicit Session経路の実効`reroll_from_chunk` | terminal atomicity適用後、accepted prefix内で完全に成立したgroups |
| `initial_state` | 0 | 0または現行で許可される1 | empty tuple |
| `none` | 0 | 0(plain Full Run baseline) | empty tuple |
`initial_state`はaccepted raw prefixではない。logical Chunk 1のSamplingにcontinuation stateを供給するだけである。
## 5. Current validated-prefix representation
R0 source treeには`ValidatedPrefix`、`EmptyValidatedPrefix`、`PrefixFacts`、`ContinuationSourceFacts`、`to_planning_facts()`はまだ存在しない。現在は次のmutable valuesへ分散している。
- `review_head`: `revision_id`, `status`, `validated_prefix_count`, `review_unit`, `branch_regenerate_from`, `effective_reroll_nonce`, `updated_utc`, `manifest`
- `best_entries`: raw existence、SHA-256、entry contractを通過して実際にloadされたentries
- `best_records`: accepted entriesに対応するmanifest records
- `RunStorageController.reused_count`: `len(best_entries)`
- `RunStorageController.review_execution`: prefix load前decisionを、load後reconcileで置換した値
よってV9の`ValidatedPrefix.to_planning_facts() -> PrefixFacts`は「現行契約」ではなく、R2で導入する将来契約である。R0でその型を追加するとR1/R2実装へ先行するため、追加していない。R2で導入する場合も戻り型を`ContinuationSourceFacts`へ流用しない。
## 6. ReviewUnit inventory
Productionの`ReviewUnit`定義は1種類だけである。
```text
v3/review_control.py
class ReviewUnit(start, end, physical_group)
```
Production usage:
- `v3/review_control.py`: unit作成、normalization、pause metadata、Review/Take policy
- `run_storage.py`: import、review group marker、pause metadata validation、finalize validation
- `v3/nodes.py`: `review_execution`からprojection rangeを読む。別`ReviewUnit`型は定義しない
R0検索では別の`class ReviewUnit`は存在しなかった。
## 7. Required behavior coverage map
新しいR0 testは`tests/test_runtime_redesign_r0_characterization.py`に隔離した。既存fixtureと合わせた代表coverageは次の通り。
| Contract | Characterization coverage |
|---|---|
| Review Q1 → next → complete | `test_limit_one_returns_one_new_chunk_and_prefix_assembly`, `test_prefix_five_generates_only_chunk_six_and_completes`, L0/L1 storage tests |
| Regenerate Current | N0-N5 and terminal regenerate tests in `test_v38_review_run_storage.py` |
| Finish Remaining | `test_n5_finish_remaining_keeps_current_branch_nonce`, `test_finish_remaining_complete_records_the_final_generated_group` |
| Use This Take / Continue From Here | N2B take-selection, canonical, and continue tests |
| Back to Settings compatible extension | `test_i2va_two_to_three_reuses_both_canonical_prefix_chunks` |
| terminal physical group | terminal atomic tests in execution-cap and Run Storage suites |
| Session/State precedence | new R0 characterization tests |
| Balanced 22 / Strong 39 | new parametrized R0 characterization test |
| Reference Image / Audio and Refine Context | `test_audit_boundary_repairs.py`, `test_v35_context_sampler.py` |
| Video Reference | `test_p46a_reference_video_memory.py` and sequence contract tests |
| Timeline Video | `test_timeline_video.py` |
| Driving Audio | `test_v34_driving_audio.py` |
| Second Pass | `test_v35_second_pass_contract.py`, `test_v35_second_pass_sampling.py`, selective node tests |
| external wrappers | graph-contract Turbo/Sage tests and `test_model_patch.py` |
## 8. Hardening signature baseline
`hardening.run_sequence_with_hardening()` calls `inspect.signature(base).bind_partial(...)`. The current keyword-only `run_sequence` signature contains 41 parameters, in this order:
```text
model
clip
video_vae
audio_vae
sampler
sigmas
first_frame
last_frame
prompt_plan
width
height
continuity
base_seed
audio_continuity
exact_total_duration
diagnostics_mode
reroll_from_chunk
reroll_nonce
strict_compatibility
debug
seam_correction
enable_preview
session
initial_state
latent_only
reference_assets
reference_audio_source
reference_audio_vae
driving_audio_source
driving_audio_vae
reference_video_source
timeline_video_source
guide_source
capture_refine_context
memory_attribution
prompt_conditioning_cache
reference_encode_cache
continuation_transport
max_new_physical_groups
_memory_attribution_collector
_diagnostic_continuation_policy
```
R4 thin adapterはこの名前・keyword-only形・defaultsを維持する必要がある。
## 9. R1 concrete plan (not implemented)
R1はProjectionだけに限定する。
1. 現在`v3/nodes.py`にある`_review_decode_chunk_range()`の判断を、torch/ComfyUI非依存のpure `ProjectionDecision`へ写す。
2. `full_accepted_prefix`と`current_review_unit(start,end)`だけを表現する。
3. 現在の`_apply_review_decode_scope()`のTensor/Assembly再構築をOutput Projectorの単一ownerへ移す。
4. Session、full Refine Context、Run Storage recordsは切り詰めず、表示用Video/Audio latentとAssemblyだけを同じrangeで投影する。
5. terminal merged unitは既存physical group境界に従い分割しない。
6. Full Run、Finish Remaining、complete、Use This Takeは現行どおりfull projectionを維持する。
7. focused parity、full CPU、frontend、manifest、workflow SHA/ZIP parity、public schemaをGateにする。
R1ではReview policy、prefix探索、Session/State priority、Sampling、commit/finalizeを変更しない。R1実装は明示承認までHOLD。
## 10. R0 disposition
R0 Characterizationの実装対象はtest/documentationだけで、Production runtimeは変更していない。
R1へ進む前の要確認事項:
1. V9の「invalid/incompatible Sessionは既存エラー」を、実コードの「advisory reject + fresh run」へ訂正するか。
2. `ValidatedPrefix.to_planning_facts()`を現行契約ではなくR2導入契約として扱うか。
この2点を未訂正のままR2/R4へ進むと、現行挙動維持とV9本文を同時に満たせない。
+41
View File
@@ -0,0 +1,41 @@
# R6 Node Facade Delta
## Purpose
R6 reduces only the public V3.8 Sampler method into this fixed boundary:
```text
public inputs
-> RuntimeRequest
-> existing hardening/runtime adapter
-> RuntimeOutput
-> public tuple
```
`v3/node_facade.py` owns the immutable request container and the V3.8
status-only resolution/diagnostic decoration. It does not import or create a
Coordinator, Planner, Run Storage controller, Sampling Engine, or ReviewUnit.
## Preserved ownership
- `v2/sequence.run_sequence` remains the R4 signature-compatible hardening
adapter and keeps its explicit 41-keyword signature.
- `InternalRuntimeCoordinator` remains the sole owner of continuation-source,
Session/State priority, prefix validation, and Runtime execution ordering.
- `execution_planner` remains the sole owner of physical-group and Projection
decisions.
- `run_storage` remains the sole owner of R5 immutable raw transactions and
manifest publication.
- The V3.8 node still resolves its existing Size Source contract before the
request boundary and calls the unchanged V3.7 runtime inheritance path once.
## Non-goals and compatibility
No public node ID, socket, widget order, output tuple, Workflow, Sampling,
Review, Run Storage schema, canonical selection, or hardening behavior is
changed. Tensor/model identities are preserved; only keyword containers are
copied into immutable request mappings. Duplicate runtime keywords fail
instead of being silently overridden, matching the prior explicit-keyword
call's fail-closed behavior.
This phase introduces no temporary adapter, new dependency, or future hook.
@@ -15,14 +15,13 @@
- README冒頭に「Web対応AIへこのREADMEを読ませる」案内を置く。ChatGPT/Gemini/Grokの現行公式情報に限定し、URLだけでrepository全文を読めるとは保証しない。GeminiのImport codeと、失敗時のREADME貼付/uploadを案内する。 - 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は音声だけを聴く診断用であり、映像品質の推奨値にはしない。 - 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だった、という証拠範囲を固定する。「解決済み」「全く改善方法がない」のどちらにも誇張しない。 - 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は今後の明示依頼時のみ。 - READMEの測定例は今回の4-step実測へ更新し、旧6-step値と混在させない。commit/pushは今後の明示依頼時のみ。
作成日: 2026-09-06 作成日: 2026-09-06
対象: `H3 Continuum Sampler V3.8`の現在のMain UI 対象: `H3 Continuum Sampler V3.8`の現在のMain UI
再開時の正本: この文書と`PROJECT_STATE.md` 再開時の正本: この文書と公開README
## この文書を読めば撮影準備から再開できる ## この文書を読めば撮影準備から再開できる
@@ -30,11 +29,9 @@
撮影開始の指示を受けた担当者は、最初に次を読みます。 撮影開始の指示を受けた担当者は、最初に次を読みます。
1. `AGENTS.md` 1. この文書
2. `PROJECT_STATE.md` 2. `README_JA.md`の「10秒を5秒ずつ確認しながら作る」
3. この文書 3. `examples/workflows/MiniMax_H3_Continuum_V38x.json`
4. `README_JA.md`の「10秒を5秒ずつ確認しながら作る」
5. `examples/workflows/MiniMax_H3_Continuum_V38.json`
撮影開始前に、表示ラベル、標準Workflow、公開ノード数、Review/Take動作がこの台本と一致するか確認します。違いがある場合は、古い画面を撮影せず、先に台本を現在のUIへ合わせます。 撮影開始前に、表示ラベル、標準Workflow、公開ノード数、Review/Take動作がこの台本と一致するか確認します。違いがある場合は、古い画面を撮影せず、先に台本を現在のUIへ合わせます。
+8 -7
View File
@@ -1,8 +1,8 @@
# V3.8 Release and Migration Policy # V3.8X Release and Migration Policy
## Supported release ## Supported release
V3.8 is the current supported H3 Continuum product. Its package exports seven Node IDs: V3.8X is the current supported H3 Continuum product. Its package version is `3.8.1` and it exports seven Node IDs:
```text ```text
H3ContinuumSamplerV38 H3ContinuumSamplerV38
@@ -18,18 +18,19 @@ The assembler, loader, and Second Pass IDs are retained while their V3.8 display
## Saved workflows from older releases ## 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. Only the seven IDs listed above are exported by V3.8X, including the retained Finalize, loader, and Second Pass IDs. Other public Node IDs from V3.7 and earlier are not exported. ComfyUI can therefore show an unknown node when a saved workflow refers to an ID outside this list. This is an intentional support boundary, not a request to replace the unknown node with a superficially similar V3.8X node.
- Use tag `v3.7.0` for V3.7 workflows. - Use tag `v3.7.0` for V3.7 workflows.
- Use tag `v3.6.0` for V3.6 workflows. - Use tag `v3.6.0` for V3.6 workflows.
- Use tag `v3.8.0` for the prior V3.8.0 package and its supplied workflow.
- 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. - 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. Do not mix a historical workflow's private schema with the V3.8X package. Install the matching historical package, open and render the workflow there, or rebuild the graph explicitly with the V3.8X public nodes.
## V3.8 workflow and external integration ## V3.8X 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 declared Registry payload and GitHub distribution use `examples/workflows/MiniMax_H3_Continuum_V38x.json` and `examples/workflows/MiniMax_H3_Continuum_V38x.zip`. The ZIP contains exactly the same JSON: one V3.8X graph, not two variants. This is the user-supplied Spectrum-capable workflow, not the former dependency-free Core template. It requires external Spectrum, rgthree, and KJNodes nodes, which Continuum does not bundle or install. ComfyUI-Easy-Use is no longer required. Spectrum and all Turbo LoRA entries are saved disabled; users may enable one task-matched path, but the external 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. 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 directly. External latent processors and upscalers connect through H3 Continuum Second Pass; the old integrated Hi-Res Fix is not part of the V3.8X 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. 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.
Binary file not shown.
Binary file not shown.
+9 -9
View File
@@ -91,6 +91,7 @@ def build_upstream_graph_contract(
prompt: Any, unique_id: Any, *, require_video_vae: bool, prompt: Any, unique_id: Any, *, require_video_vae: bool,
require_reference_audio_vae: bool = False, require_reference_audio_vae: bool = False,
require_audio_vae: bool = False, require_audio_vae: bool = False,
reference_audio_route: str | None = None,
) -> tuple[dict[str, Any], bool, list[str]]: ) -> tuple[dict[str, Any], bool, list[str]]:
"""Fingerprint MODEL/CLIP/VAE routes feeding the Continuum sampler.""" """Fingerprint MODEL/CLIP/VAE routes feeding the Continuum sampler."""
if not isinstance(prompt, dict): if not isinstance(prompt, dict):
@@ -109,15 +110,14 @@ def build_upstream_graph_contract(
("video_vae", "video_vae", bool(require_video_vae)), ("video_vae", "video_vae", bool(require_video_vae)),
] ]
if require_reference_audio_vae: if require_reference_audio_vae:
reference_audio_route = "reference_audio_vae" if reference_audio_route is None:
direct_link = inputs.get(reference_audio_route) bundle_link = inputs.get("audio_references")
if not ( reference_audio_route = "audio_references" if (
isinstance(direct_link, (list, tuple)) isinstance(bundle_link, (list, tuple))
and len(direct_link) == 2 and len(bundle_link) == 2
and isinstance(direct_link[0], (str, int)) and isinstance(bundle_link[0], (str, int))
and isinstance(direct_link[1], int) and isinstance(bundle_link[1], int)
): ) else "reference_audio_vae"
reference_audio_route = "audio_references"
# Keep the established descriptor key. The bundled route fingerprints # Keep the established descriptor key. The bundled route fingerprints
# the helper and therefore its Audio VAE plus every ordered source. # the helper and therefore its Audio VAE plus every ordered source.
specs.append(("reference_audio_vae", reference_audio_route, True)) specs.append(("reference_audio_vae", reference_audio_route, True))
+46 -4
View File
@@ -7,6 +7,8 @@ $source = (Resolve-Path $PSScriptRoot).Path
$customNodes = Join-Path $ComfyUIRoot "custom_nodes" $customNodes = Join-Path $ComfyUIRoot "custom_nodes"
$destination = Join-Path $customNodes "ComfyUI-H3-Continuum" $destination = Join-Path $customNodes "ComfyUI-H3-Continuum"
$legacyDestination = Join-Path $customNodes "ComfyUI-H3-Continuum-Join" $legacyDestination = Join-Path $customNodes "ComfyUI-H3-Continuum-Join"
$backupRoot = Join-Path $ComfyUIRoot "h3_continuum_backups"
$registryManifest = Join-Path $source "REGISTRY_MANIFEST.sha256"
if (-not (Test-Path $ComfyUIRoot -PathType Container)) { if (-not (Test-Path $ComfyUIRoot -PathType Container)) {
throw "ComfyUI root not found: $ComfyUIRoot" throw "ComfyUI root not found: $ComfyUIRoot"
@@ -21,20 +23,60 @@ if ([System.StringComparer]::OrdinalIgnoreCase.Equals($source, $destination)) {
exit 0 exit 0
} }
$sourceRoot = [IO.Path]::GetFullPath($source).TrimEnd('\', '/') + [IO.Path]::DirectorySeparatorChar
$destinationRoot = [IO.Path]::GetFullPath($destination).TrimEnd('\', '/') + [IO.Path]::DirectorySeparatorChar
if (-not (Test-Path -LiteralPath $registryManifest -PathType Leaf)) {
throw "Registry manifest not found: $registryManifest"
}
$filesToInstall = foreach ($line in Get-Content -LiteralPath $registryManifest) {
if ([string]::IsNullOrWhiteSpace($line)) { continue }
if ($line -notmatch '^(?<Hash>[0-9a-fA-F]{64})\s{2}(?<Path>.+)$') {
throw "Invalid Registry manifest line: $line"
}
$relativePath = $Matches.Path.Replace('/', [IO.Path]::DirectorySeparatorChar)
if ([IO.Path]::IsPathRooted($relativePath)) {
throw "Registry manifest contains an absolute path: $relativePath"
}
$sourceFile = [IO.Path]::GetFullPath((Join-Path $source $relativePath))
if (-not $sourceFile.StartsWith($sourceRoot, [StringComparison]::OrdinalIgnoreCase)) {
throw "Registry manifest path escaped the source directory: $relativePath"
}
if (-not (Test-Path -LiteralPath $sourceFile -PathType Leaf)) {
throw "Registry manifest file is missing: $relativePath"
}
$actualHash = (Get-FileHash -LiteralPath $sourceFile -Algorithm SHA256).Hash
if (-not $actualHash.Equals($Matches.Hash, [StringComparison]::OrdinalIgnoreCase)) {
throw "Registry manifest hash mismatch: $relativePath"
}
[pscustomobject]@{
RelativePath = $relativePath
Source = $sourceFile
}
}
$stamp = Get-Date -Format 'yyyyMMdd-HHmmss' $stamp = Get-Date -Format 'yyyyMMdd-HHmmss'
New-Item -ItemType Directory -Force -Path $backupRoot | Out-Null
foreach ($old in @($destination, $legacyDestination)) { foreach ($old in @($destination, $legacyDestination)) {
if ((Test-Path $old) -and -not [System.StringComparer]::OrdinalIgnoreCase.Equals($source, $old)) { if ((Test-Path $old) -and -not [System.StringComparer]::OrdinalIgnoreCase.Equals($source, $old)) {
$backup = "$old.backup-$stamp" $backupName = "$(Split-Path -Leaf $old).backup-$stamp"
$backup = Join-Path $backupRoot $backupName
Move-Item -LiteralPath $old -Destination $backup Move-Item -LiteralPath $old -Destination $backup
Write-Host "Existing installation moved to: $backup" Write-Host "Existing installation moved to: $backup"
} }
} }
New-Item -ItemType Directory -Force -Path $destination | Out-Null New-Item -ItemType Directory -Force -Path $destination | Out-Null
$exclude = @(".git", ".pytest_cache", "__pycache__") foreach ($file in $filesToInstall) {
Get-ChildItem -LiteralPath $source -Force | Where-Object { $exclude -notcontains $_.Name } | ForEach-Object { $destinationFile = [IO.Path]::GetFullPath((Join-Path $destination $file.RelativePath))
Copy-Item -LiteralPath $_.FullName -Destination $destination -Recurse -Force if (-not $destinationFile.StartsWith($destinationRoot, [StringComparison]::OrdinalIgnoreCase)) {
throw "Registry manifest path escaped the destination directory: $($file.RelativePath)"
}
$parent = Split-Path -Parent $destinationFile
New-Item -ItemType Directory -Force -Path $parent | Out-Null
Copy-Item -LiteralPath $file.Source -Destination $destinationFile -Force
} }
Copy-Item -LiteralPath $registryManifest -Destination (Join-Path $destination "REGISTRY_MANIFEST.sha256") -Force
$python = Join-Path $ComfyUIRoot "venv\Scripts\python.exe" $python = Join-Path $ComfyUIRoot "venv\Scripts\python.exe"
$verifier = Join-Path $destination "tools\verify_runtime.py" $verifier = Join-Path $destination "tools\verify_runtime.py"
+1 -1
View File
@@ -1,4 +1,4 @@
[project] [project]
name = H3 Continuum name = H3 Continuum
version = 3.8.0 version = 3.8.1
description = Native MiniMax H3 masked AV continuation, Second Pass, and disk-backed assembly. description = Native MiniMax H3 masked AV continuation, Second Pass, and disk-backed assembly.
+1 -1
View File
@@ -1,6 +1,6 @@
[project] [project]
name = "comfyui-h3-continuum" name = "comfyui-h3-continuum"
version = "3.8.0" version = "3.8.1"
description = "Integrated N-chunk continuation for ComfyUI native MiniMax H3 video and audio" description = "Integrated N-chunk continuation for ComfyUI native MiniMax H3 video and audio"
readme = "README.md" readme = "README.md"
requires-python = ">=3.10" requires-python = ">=3.10"
+401 -176
View File
@@ -3,6 +3,7 @@
from __future__ import annotations from __future__ import annotations
import contextvars import contextvars
import copy
import hashlib import hashlib
import json import json
import marshal import marshal
@@ -13,8 +14,10 @@ import time
import socket import socket
import uuid import uuid
from datetime import datetime, timezone from datetime import datetime, timezone
from dataclasses import dataclass
from pathlib import Path from pathlib import Path
from typing import Any from types import MappingProxyType
from typing import Any, Mapping
import torch import torch
from safetensors import safe_open from safetensors import safe_open
@@ -48,7 +51,9 @@ from .v3.review_control import (
make_review_pause_metadata, make_review_pause_metadata,
resolve_review_execution, resolve_review_execution,
resolve_take_execution, resolve_take_execution,
validate_review_prefix_metadata,
) )
from .v3.planning_types import PrefixFacts
RUN_STORAGE_SCHEMA_VERSION = 3 RUN_STORAGE_SCHEMA_VERSION = 3
@@ -81,6 +86,62 @@ class RunStorageError(RuntimeError):
pass pass
@dataclass(frozen=True, slots=True)
class ValidatedPrefix:
"""One immutable Run Storage prefix after manifest/raw/group validation."""
entries: tuple[dict[str, Any], ...]
records: tuple[dict[str, Any], ...]
manifest: Mapping[str, Any] | None
revision_id: str | None
status: str | None
review_unit: ReviewUnit | None
effective_nonce: int
branch_regenerate_from: int
physical_group_boundaries: tuple[tuple[int, int], ...]
configured_chunks: int
def to_planning_facts(self) -> PrefixFacts:
return PrefixFacts(
accepted_chunks=len(self.entries),
configured_chunks=int(self.configured_chunks),
revision_id=self.revision_id,
status=self.status,
review_unit=self.review_unit,
effective_nonce=int(self.effective_nonce),
branch_regenerate_from=int(self.branch_regenerate_from),
physical_group_boundaries=self.physical_group_boundaries,
)
@dataclass(frozen=True, slots=True)
class EmptyValidatedPrefix:
"""The absence of a Run Storage prefix, not of other continuation sources."""
configured_chunks: int
entries: tuple = ()
records: tuple = ()
manifest: None = None
revision_id: None = None
status: None = None
review_unit: None = None
effective_nonce: int = 0
branch_regenerate_from: int = 0
physical_group_boundaries: tuple = ()
def to_planning_facts(self) -> PrefixFacts:
return PrefixFacts(
accepted_chunks=0,
configured_chunks=int(self.configured_chunks),
revision_id=None,
status=None,
review_unit=None,
effective_nonce=0,
branch_regenerate_from=0,
physical_group_boundaries=(),
)
def _now() -> str: def _now() -> str:
return datetime.now(timezone.utc).replace(microsecond=0).isoformat() return datetime.now(timezone.utc).replace(microsecond=0).isoformat()
@@ -1175,6 +1236,11 @@ class RunStorageController:
self.review_manual_regenerate_from: int = 0 self.review_manual_regenerate_from: int = 0
self.review_execution = None self.review_execution = None
self.review_head: dict[str, Any] | None = None self.review_head: dict[str, Any] | None = None
self.validated_prefix: ValidatedPrefix | EmptyValidatedPrefix | None = None
self.review_runtime_metrics = {
"review_decision_created": 0,
"review_reconcile": 0,
}
self.inherited_review_unit: dict[str, int] | None = None self.inherited_review_unit: dict[str, int] | None = None
self.pending_review_pause_metadata: dict[str, Any] | None = None self.pending_review_pause_metadata: dict[str, Any] | None = None
self.take_action = TAKE_ACTION_AUTOMATIC self.take_action = TAKE_ACTION_AUTOMATIC
@@ -1779,9 +1845,23 @@ class RunStorageController:
} }
self._write_manifest() self._write_manifest()
records = [] records = []
for position, entry in enumerate(imported["entries"]): imported_entries = list(imported["entries"])
self.commit_chunk(entry, position=position) groups = physical_groups(
records.append(dict(self.manifest["chunks"][-1])) chunks=int((self.contract or {})["chunk_count"]),
terminal_merge_enabled=_terminal_merge_enabled(self.contract or {}),
)
for group in groups:
if group.end > len(imported_entries):
break
positions = tuple(range(group.start - 1, group.end))
self.commit_group(
tuple(imported_entries[position] for position in positions),
positions=positions,
)
records.extend(
dict(record)
for record in self.manifest["chunks"][-len(positions):]
)
self.generated_count = 0 # Copies are reused work, never new Sampling. self.generated_count = 0 # Copies are reused work, never new Sampling.
self.notes.append(f"Imported {len(records)} verified prefix chunks into the new plan; originals preserved") self.notes.append(f"Imported {len(records)} verified prefix chunks into the new plan; originals preserved")
return records return records
@@ -1886,6 +1966,7 @@ class RunStorageController:
"records": records, "records": records,
"entries": entries, "entries": entries,
"chain": chain, "chain": chain,
"manifest": manifests.get(str(selected["storage_revision_id"])),
} }
def _validated_review_head( def _validated_review_head(
@@ -1986,15 +2067,11 @@ class RunStorageController:
) )
terminal_pair_start = chunks - 1 if terminal_merge_enabled else None terminal_pair_start = chunks - 1 if terminal_merge_enabled else None
try: try:
resolve_review_execution( normalized_review_unit = validate_review_prefix_metadata(
generation_mode=GENERATION_MODE_REVIEW,
review_action=REVIEW_ACTION_CONTINUE,
configured_chunks=chunks, configured_chunks=chunks,
validated_prefix_count=prefix, validated_prefix_count=prefix,
terminal_merge_enabled=terminal_merge_enabled, terminal_merge_enabled=terminal_merge_enabled,
terminal_pair_start=terminal_pair_start, terminal_pair_start=terminal_pair_start,
manual_regenerate_from=0,
run_storage_mode=RUN_STORAGE_SAVE_AUTO_RESUME,
latest_review_unit=review_unit, latest_review_unit=review_unit,
latest_revision_status=status, latest_revision_status=status,
latest_effective_nonce=effective_nonce, latest_effective_nonce=effective_nonce,
@@ -2019,6 +2096,9 @@ class RunStorageController:
"effective_reroll_nonce": effective_nonce, "effective_reroll_nonce": effective_nonce,
"updated_utc": updated_utc, "updated_utc": updated_utc,
"manifest": manifest, "manifest": manifest,
"entries": entries,
"records": accepted,
"normalized_review_unit": normalized_review_unit,
} }
def find_latest_review_head( def find_latest_review_head(
@@ -2089,17 +2169,82 @@ class RunStorageController:
self.notes.append(f"review head {revision_id} incompatible: {detail}") self.notes.append(f"review head {revision_id} incompatible: {detail}")
return None return None
def _resolve_review_contract( def _freeze_validated_prefix(
self,
candidate: dict[str, Any] | None,
*,
contract: dict[str, Any],
) -> ValidatedPrefix | EmptyValidatedPrefix:
"""Freeze the one repository result that may drive this Queue."""
configured_chunks = int(contract["chunk_count"])
if candidate is None:
return EmptyValidatedPrefix(configured_chunks=configured_chunks)
entries = tuple(dict(entry) for entry in candidate.get("entries") or ())
records = tuple(dict(record) for record in candidate.get("records") or ())
if len(entries) != len(records):
raise RunStorageError("validated prefix entry/record counts differ")
if int(candidate.get("validated_prefix_count", -1)) != len(entries):
raise RunStorageError("validated prefix count does not match loaded raw entries")
status = str(candidate.get("status", "")) or None
terminal_merge_enabled = _terminal_merge_enabled(contract)
review_unit = validate_review_prefix_metadata(
configured_chunks=configured_chunks,
validated_prefix_count=len(entries),
terminal_merge_enabled=terminal_merge_enabled,
terminal_pair_start=(
configured_chunks - 1 if terminal_merge_enabled else None
),
latest_review_unit=candidate.get("review_unit"),
latest_revision_status=status,
latest_effective_nonce=int(candidate.get("effective_reroll_nonce", 0)),
latest_branch_regenerate_from=int(
candidate.get("branch_regenerate_from", 0)
),
)
boundaries = tuple(
(group.start, group.end)
for group in physical_groups(
chunks=configured_chunks,
terminal_merge_enabled=terminal_merge_enabled,
)
if group.end <= len(entries)
)
if boundaries and boundaries[-1][1] != len(entries):
raise RunStorageError("validated prefix ends inside a physical group")
if entries and not boundaries:
raise RunStorageError("validated prefix has no complete physical group")
source_manifest = candidate.get("manifest")
frozen_manifest = (
None
if source_manifest is None
else MappingProxyType(copy.deepcopy(dict(source_manifest)))
)
revision_id = str(candidate.get("revision_id", "")) or None
return ValidatedPrefix(
entries=entries,
records=records,
manifest=frozen_manifest,
revision_id=revision_id,
status=status,
review_unit=review_unit,
effective_nonce=int(candidate.get("effective_reroll_nonce", 0)),
branch_regenerate_from=int(candidate.get("branch_regenerate_from", 0)),
physical_group_boundaries=boundaries,
configured_chunks=configured_chunks,
)
def _load_validated_review_prefix(
self, self,
contract: dict[str, Any], contract: dict[str, Any],
*, *,
requested_nonce: int,
resume_safe: bool, resume_safe: bool,
) -> tuple[dict[str, Any], int, str]: ) -> ValidatedPrefix | EmptyValidatedPrefix:
"""Resolve persisted review state through the Phase B pure policy.""" """Select, fully validate, load, and freeze one branch-neutral prefix."""
if self.review_generation_mode is None or self.review_action is None: if self.review_generation_mode is None or self.review_action is None:
raise RunStorageError("review execution intent is incomplete") raise RunStorageError("review execution intent is incomplete")
candidate = None
if self.take_action != TAKE_ACTION_AUTOMATIC: if self.take_action != TAKE_ACTION_AUTOMATIC:
if self.review_generation_mode != GENERATION_MODE_REVIEW: if self.review_generation_mode != GENERATION_MODE_REVIEW:
raise RunStorageError("Take selection requires Review Each Chunk") raise RunStorageError("Take selection requires Review Each Chunk")
@@ -2107,30 +2252,89 @@ class RunStorageController:
raise RunStorageError( raise RunStorageError(
"Take selection cannot be combined with manual Regenerate From" "Take selection cannot be combined with manual Regenerate From"
) )
selected = self._validated_take_selection(contract) candidate = self._validated_take_selection(contract)
self.selected_take_chain = list(selected["chain"]) self.selected_take_chain = list(candidate["chain"])
self.selected_take_records = list(selected["records"]) self.selected_take_records = list(candidate["records"])
self.selected_take_revision = dict(selected) self.selected_take_revision = dict(candidate)
self.review_head = dict(selected) else:
self.inherited_review_unit = dict(selected["review_unit"]) smart_only = self.review_action == REVIEW_ACTION_REGENERATE_CURRENT
candidate = self.find_latest_review_head(
contract,
smart_regenerate_only=smart_only,
)
if candidate is None and not smart_only and resume_safe:
self._plan_import = self._find_plan_import(
contract,
stop_before=self.review_manual_regenerate_from,
)
candidate = self._plan_import
if candidate is None and smart_only:
details = "\n".join(self.notes[-6:]) or (
"No compatible saved review head was found."
)
raise ReviewControlError(
"Regenerate Current requires an existing reviewed unit. "
"The saved review could not be matched to this execution.\n"
+ details
)
self.review_head = candidate
self.inherited_review_unit = (
None
if candidate is None or candidate.get("review_unit") is None
else dict(candidate["review_unit"])
)
frozen = self._freeze_validated_prefix(candidate, contract=contract)
self.validated_prefix = frozen
return frozen
def _record_review_decision_created(self) -> None:
created = int(self.review_runtime_metrics["review_decision_created"])
if created != 0:
raise RunStorageError("Review Decision was already created for this Queue")
self.review_runtime_metrics["review_decision_created"] = 1
def _resolve_review_contract(
self,
contract: dict[str, Any],
*,
requested_nonce: int,
resume_safe: bool,
validated_prefix: ValidatedPrefix | EmptyValidatedPrefix | None = None,
) -> tuple[dict[str, Any], int, str]:
"""Create the single Review Decision from an immutable validated prefix."""
if self.review_generation_mode is None or self.review_action is None:
raise RunStorageError("review execution intent is incomplete")
if validated_prefix is None:
validated_prefix = self._load_validated_review_prefix(
contract,
resume_safe=resume_safe,
)
if self.validated_prefix is None:
self.validated_prefix = validated_prefix
elif self.validated_prefix is not validated_prefix:
raise RunStorageError(
"Review Decision cannot replace the fixed ValidatedPrefix"
)
facts = validated_prefix.to_planning_facts()
if self.take_action != TAKE_ACTION_AUTOMATIC:
next_nonce = self._highest_lineage_nonce( next_nonce = self._highest_lineage_nonce(
str(contract["nonce_lineage_sha256"]) str(contract["nonce_lineage_sha256"])
) + 1 ) + 1
self._record_review_decision_created()
execution = resolve_take_execution( execution = resolve_take_execution(
take_action=self.take_action, take_action=self.take_action,
configured_chunks=int(contract["chunk_count"]), configured_chunks=int(contract["chunk_count"]),
selected_prefix_count=int(selected["validated_prefix_count"]), selected_prefix_count=facts.accepted_chunks,
terminal_merge_enabled=_terminal_merge_enabled(contract), terminal_merge_enabled=_terminal_merge_enabled(contract),
terminal_pair_start=( terminal_pair_start=(
int(contract["chunk_count"]) - 1 int(contract["chunk_count"]) - 1
if _terminal_merge_enabled(contract) if _terminal_merge_enabled(contract)
else None else None
), ),
selected_review_unit=selected["review_unit"], selected_review_unit=facts.review_unit,
selected_effective_nonce=int(selected["effective_reroll_nonce"]), selected_effective_nonce=facts.effective_nonce,
selected_branch_regenerate_from=int( selected_branch_regenerate_from=facts.branch_regenerate_from,
selected["branch_regenerate_from"]
),
next_effective_nonce=next_nonce, next_effective_nonce=next_nonce,
) )
boundary = int(execution.effective_regenerate_from) boundary = int(execution.effective_regenerate_from)
@@ -2143,66 +2347,40 @@ class RunStorageController:
) )
self.review_execution = execution self.review_execution = execution
self.pending_branch_cut = { self.pending_branch_cut = {
"selected_revision_id": str(selected["revision_id"]), "selected_revision_id": str(facts.revision_id),
"after_physical_group": int(selected["review_unit"]["physical_group"]), "after_physical_group": int(facts.review_unit.physical_group),
} }
self.storage_revision_id_override = _storage_revision_identity( self.storage_revision_id_override = _storage_revision_identity(
contract_sha256=revision_identity(resolved)[1], contract_sha256=revision_identity(resolved)[1],
take_action=self.take_action, take_action=self.take_action,
selected_revision_id=str(selected["revision_id"]), selected_revision_id=str(facts.revision_id),
effective_nonce=effective_nonce, effective_nonce=effective_nonce,
branch_boundary=boundary, branch_boundary=boundary,
) )
return resolved, effective_nonce, ( return resolved, effective_nonce, (
"select_take" if self.take_action == TAKE_ACTION_USE else "branch_from_take" "select_take" if self.take_action == TAKE_ACTION_USE else "branch_from_take"
) )
smart_only = self.review_action == REVIEW_ACTION_REGENERATE_CURRENT
head = self.find_latest_review_head(
contract,
smart_regenerate_only=smart_only,
)
if head is None and not smart_only and resume_safe:
self._plan_import = self._find_plan_import(
contract, stop_before=self.review_manual_regenerate_from,
)
head = self._plan_import
self.review_head = head
self.inherited_review_unit = (
None if head is None or head.get("review_unit") is None
else dict(head["review_unit"])
)
if head is None and smart_only:
details = "\n".join(self.notes[-6:]) or "No compatible saved review head was found."
raise ReviewControlError(
"Regenerate Current requires an existing reviewed unit. "
"The saved review could not be matched to this execution.\n" + details
)
semantics = (contract.get("global") or {}).get("execution_semantics") or {} semantics = (contract.get("global") or {}).get("execution_semantics") or {}
terminal_merge_enabled = ( terminal_merge_enabled = (
semantics.get("flf_execution") == "terminal_merged_10s_seed_v2" semantics.get("flf_execution") == "terminal_merged_10s_seed_v2"
) )
configured_chunks = int(contract["chunk_count"]) configured_chunks = int(contract["chunk_count"])
self._record_review_decision_created()
execution = resolve_review_execution( execution = resolve_review_execution(
generation_mode=self.review_generation_mode, generation_mode=self.review_generation_mode,
review_action=self.review_action, review_action=self.review_action,
configured_chunks=configured_chunks, configured_chunks=configured_chunks,
validated_prefix_count=( validated_prefix_count=facts.accepted_chunks,
0 if head is None else int(head["validated_prefix_count"])
),
terminal_merge_enabled=terminal_merge_enabled, terminal_merge_enabled=terminal_merge_enabled,
terminal_pair_start=( terminal_pair_start=(
configured_chunks - 1 if terminal_merge_enabled else None configured_chunks - 1 if terminal_merge_enabled else None
), ),
manual_regenerate_from=self.review_manual_regenerate_from, manual_regenerate_from=self.review_manual_regenerate_from,
run_storage_mode=RUN_STORAGE_SAVE_AUTO_RESUME, run_storage_mode=RUN_STORAGE_SAVE_AUTO_RESUME,
latest_review_unit=None if head is None else head["review_unit"], latest_review_unit=facts.review_unit,
latest_revision_status=None if head is None else head["status"], latest_revision_status=facts.status,
latest_effective_nonce=( latest_effective_nonce=facts.effective_nonce,
0 if head is None else int(head["effective_reroll_nonce"]) latest_branch_regenerate_from=facts.branch_regenerate_from,
),
latest_branch_regenerate_from=(
0 if head is None else int(head["branch_regenerate_from"])
),
) )
boundary = int(execution.effective_regenerate_from) boundary = int(execution.effective_regenerate_from)
if execution.requested_effective_nonce is None: if execution.requested_effective_nonce is None:
@@ -2231,70 +2409,6 @@ class RunStorageController:
self.review_execution = execution self.review_execution = execution
return resolved, effective_nonce, decision return resolved, effective_nonce, decision
def _reconcile_review_execution_with_reused_prefix(self, prefix_count: int) -> None:
"""Make ordinary Review continuation follow the prefix actually reused.
Run Storage candidate selection is the final authority for which saved
prefix survived integrity/contract validation. A stale or missed review
head must never make the Review controller expect Chunk 1 while the
sampler has already restored Chunk 1 and is about to generate Chunk 2.
Explicit regeneration and Take actions keep their resolved boundaries.
"""
execution = self.review_execution
if (
execution is None
or self.review_generation_mode != GENERATION_MODE_REVIEW
or self.review_action != REVIEW_ACTION_CONTINUE
or self.take_action != TAKE_ACTION_AUTOMATIC
or self.review_manual_regenerate_from
):
return
contract = self.contract or {}
chunks = int(contract.get("chunk_count", 0))
prefix = int(prefix_count)
if chunks <= 0 or prefix < 0 or prefix > chunks:
raise RunStorageError("reused review prefix is outside the configured chunk range")
status = (
None
if prefix == 0
else REVISION_STATUS_COMPLETE
if prefix == chunks
else REVISION_STATUS_REVIEW_READY
)
terminal_merge_enabled = _terminal_merge_enabled(contract)
resolved = resolve_review_execution(
generation_mode=GENERATION_MODE_REVIEW,
review_action=REVIEW_ACTION_CONTINUE,
configured_chunks=chunks,
validated_prefix_count=prefix,
terminal_merge_enabled=terminal_merge_enabled,
terminal_pair_start=(chunks - 1 if terminal_merge_enabled else None),
manual_regenerate_from=0,
run_storage_mode=RUN_STORAGE_SAVE_AUTO_RESUME,
latest_review_unit=None,
latest_revision_status=status,
latest_effective_nonce=int(self.effective_reroll_nonce),
latest_branch_regenerate_from=int(contract.get("reroll_from_chunk", 0)),
)
old_expected = (
execution.next_review_unit_start,
execution.next_review_unit_end,
execution.next_review_physical_group,
)
new_expected = (
resolved.next_review_unit_start,
resolved.next_review_unit_end,
resolved.next_review_physical_group,
)
if old_expected != new_expected or execution.projected_prefix_count != resolved.projected_prefix_count:
self.notes.append(
"Review continuation reconciled to validated saved prefix "
f"{prefix}/{chunks}: expected {old_expected} -> {new_expected}."
)
self.review_execution = resolved
def _resolve_effective_nonce( def _resolve_effective_nonce(
self, contract: dict[str, Any], *, requested_nonce: int, resume_safe: bool, self, contract: dict[str, Any], *, requested_nonce: int, resume_safe: bool,
) -> tuple[int, str]: ) -> tuple[int, str]:
@@ -2364,6 +2478,11 @@ class RunStorageController:
or guide_contract is not None or guide_contract is not None
), ),
require_reference_audio_vae=reference_audio_contract is not None, require_reference_audio_vae=reference_audio_contract is not None,
reference_audio_route=(
"audio_references"
if "reference_audio_bundle_contract_version" in (reference_audio_contract or {})
else "reference_audio_vae"
),
require_audio_vae=driving_audio_contract is not None, require_audio_vae=driving_audio_contract is not None,
) )
contract, safe, reasons = build_sampling_contract( contract, safe, reasons = build_sampling_contract(
@@ -2392,10 +2511,15 @@ class RunStorageController:
) )
self.contract = contract self.contract = contract
if self.review_generation_mode is not None or self.review_action is not None: if self.review_generation_mode is not None or self.review_action is not None:
validated_prefix = self._load_validated_review_prefix(
contract,
resume_safe=safe,
)
contract, effective_nonce, nonce_decision = self._resolve_review_contract( contract, effective_nonce, nonce_decision = self._resolve_review_contract(
contract, contract,
requested_nonce=int(reroll_nonce), requested_nonce=int(reroll_nonce),
resume_safe=safe, resume_safe=safe,
validated_prefix=validated_prefix,
) )
else: else:
if safe: if safe:
@@ -2453,14 +2577,29 @@ class RunStorageController:
hashes = list(contract["chunk_contract_hashes"]) hashes = list(contract["chunk_contract_hashes"])
best_entries: list[dict[str, Any]] = [] best_entries: list[dict[str, Any]] = []
best_records: list[dict[str, Any]] = [] best_records: list[dict[str, Any]] = []
if exact is not None: review_queue = self.review_generation_mode is not None or self.review_action is not None
if exact is not None and not review_queue:
self._plan_import = None self._plan_import = None
if self._plan_import is not None: if review_queue:
if self.validated_prefix is None:
raise RunStorageError("Review Decision has no fixed ValidatedPrefix")
best_entries = list(self.validated_prefix.entries)
best_records = list(self.validated_prefix.records)
if self._plan_import is not None:
# Imported raw tensors become records owned by the new plan only
# after the initial manifest has been created.
best_records = []
execution = self.review_execution
if execution is None:
raise RunStorageError("Review Decision was not created")
if bool(execution.smart_regenerate) or self.review_manual_regenerate_from:
reusable = max(0, int(execution.effective_regenerate_from) - 1)
best_entries = best_entries[:reusable]
if self._plan_import is None:
best_records = best_records[:reusable]
elif self._plan_import is not None:
best_entries = list(self._plan_import["entries"]) best_entries = list(self._plan_import["entries"])
best_records = [] # Populated with new-plan-owned copies after manifest creation. best_records = [] # Populated with new-plan-owned copies after manifest creation.
elif self.selected_take_revision is not None:
best_entries = list(self.selected_take_revision["entries"])
best_records = list(self.selected_take_records)
else: else:
candidates = [exact] if exact is not None and safe else [] candidates = [exact] if exact is not None and safe else []
if safe and exact is None and self.revisions_root.exists(): if safe and exact is None and self.revisions_root.exists():
@@ -2496,7 +2635,6 @@ class RunStorageController:
if len(entries) > len(best_entries): if len(entries) > len(best_entries):
best_entries, best_records = entries, records best_entries, best_records = entries, records
self._reconcile_review_execution_with_reused_prefix(len(best_entries))
self.reused_count = len(best_entries) self.reused_count = len(best_entries)
now = _now() now = _now()
self.manifest = { self.manifest = {
@@ -2610,57 +2748,148 @@ class RunStorageController:
) )
def commit_chunk(self, entry: dict[str, Any], *, position: int) -> None: def commit_chunk(self, entry: dict[str, Any], *, position: int) -> None:
"""Compatibility entry point for one-logical-chunk physical groups."""
self.commit_group((entry,), positions=(position,))
def commit_group(
self,
entries: tuple[dict[str, Any], ...] | list[dict[str, Any]],
*,
positions: tuple[int, ...] | list[int],
) -> None:
"""Durably publish one complete physical group with one manifest switch."""
if self.manifest is None or self.revision_root is None: if self.manifest is None or self.revision_root is None:
return return
validated = validate_chunk_entry(entry) entry_values = tuple(entries)
if isinstance(position, bool) or not isinstance(position, int): position_values = tuple(positions)
raise RunStorageError("Run Storage chunk position must be an integer") if not entry_values or len(entry_values) != len(position_values):
expected = int((self.contract or {}).get("chunk_count", 0))
if position < 0 or position >= expected:
raise RunStorageError( raise RunStorageError(
f"Run Storage chunk position {position} is outside 0..{expected - 1}" "Run Storage physical group entries and positions must be non-empty and equal"
) )
existing_records = list(self.manifest.get("chunks") or []) if any(
if len(existing_records) < position: isinstance(position, bool) or not isinstance(position, int)
for position in position_values
):
raise RunStorageError("Run Storage chunk positions must be integers")
expected = int((self.contract or {}).get("chunk_count", 0))
if any(position < 0 or position >= expected for position in position_values):
raise RunStorageError( raise RunStorageError(
f"Run Storage cannot commit chunk {position + 1} before chunk {position}" "Run Storage physical group position is outside "
f"0..{expected - 1}: {position_values}"
)
groups = physical_groups(
chunks=expected,
terminal_merge_enabled=_terminal_merge_enabled(self.contract or {}),
)
matched_group = next(
(
group
for group in groups
if position_values == tuple(range(group.start - 1, group.end))
),
None,
)
if matched_group is None:
raise RunStorageError(
"Run Storage physical group is incomplete or crosses a group boundary: "
f"{position_values}"
)
validated_entries = tuple(
validate_chunk_entry(entry) for entry in entry_values
)
existing_records = list(self.manifest.get("chunks") or [])
first_position = position_values[0]
if len(existing_records) < first_position:
raise RunStorageError(
"Run Storage cannot commit physical group starting at chunk "
f"{first_position + 1} before chunk {first_position}"
) )
chunks_root = self.revision_root / "chunks" chunks_root = self.revision_root / "chunks"
chunks_root.mkdir(parents=True, exist_ok=True) chunks_root.mkdir(parents=True, exist_ok=True)
filename = f"chunk_{position + 1:04d}.safetensors" revision_id = str(self.revision_id or "")
target = chunks_root / filename if not revision_id or not re.fullmatch(r"[A-Za-z0-9._-]+", revision_id):
temporary = chunks_root / f".{filename}.{uuid.uuid4().hex}.tmp" raise RunStorageError("Run Storage revision id is invalid for raw storage")
tensors = { transaction_id = uuid.uuid4().hex
"video": validated["video"].detach().to("cpu").contiguous(), new_records: list[dict[str, Any]] = []
"audio": validated["audio"].detach().to("cpu").contiguous(), for validated, position in zip(
} validated_entries, position_values, strict=True
try: ):
save_file(tensors, str(temporary), metadata={ filename = (
"h3_continuum_run_storage": str(RUN_STORAGE_SCHEMA_VERSION), f"rev-{revision_id}-txn-{transaction_id}-"
"revision_id": self.revision_id, f"chunk-{position + 1:04d}.safetensors"
"chunk_number": str(position + 1), )
target = chunks_root / filename
temporary = chunks_root / f".{filename}.{uuid.uuid4().hex}.tmp"
if target.exists():
raise RunStorageError(
f"immutable Run Storage raw already exists: {filename}"
)
tensors = {
"video": validated["video"].detach().to("cpu").contiguous(),
"audio": validated["audio"].detach().to("cpu").contiguous(),
}
try:
save_file(tensors, str(temporary), metadata={
"h3_continuum_run_storage": str(RUN_STORAGE_SCHEMA_VERSION),
"revision_id": revision_id,
"chunk_number": str(position + 1),
})
_fsync_file(temporary)
os.replace(temporary, target)
finally:
if temporary.exists():
temporary.unlink()
file_size = target.stat().st_size
file_sha256 = _file_sha256(target)
with safe_open(str(target), framework="pt", device="cpu") as handle:
if set(handle.keys()) != {"audio", "video"}:
raise RunStorageError(
f"persisted physical group tensors are invalid: {filename}"
)
metadata = handle.metadata() or {}
if (
metadata.get("h3_continuum_run_storage")
!= str(RUN_STORAGE_SCHEMA_VERSION)
or metadata.get("revision_id") != revision_id
or metadata.get("chunk_number") != str(position + 1)
):
raise RunStorageError(
f"persisted physical group metadata is invalid: {filename}"
)
if (
target.stat().st_size != file_size
or _file_sha256(target) != file_sha256
):
raise RunStorageError(
f"persisted physical group SHA-256 verification failed: {filename}"
)
storage_entry = dict(validated)
storage_entry["sequence_index"] = position
new_records.append({
"sequence_index": position,
"storage_revision_id": revision_id,
"filename": filename,
"file_size": file_size,
"file_sha256": file_sha256,
"entry": _entry_metadata(storage_entry),
}) })
_fsync_file(temporary) _fsync_dir(chunks_root)
os.replace(temporary, target) records = existing_records[:first_position]
_fsync_dir(chunks_root) records.extend(new_records)
finally: candidate_manifest = dict(self.manifest)
if temporary.exists(): candidate_manifest.update(
temporary.unlink() chunks=records,
storage_entry = dict(validated) updated_utc=_now(),
storage_entry["sequence_index"] = position status="in_progress",
record = { )
"sequence_index": position, # Assign only after every raw in the physical group is complete and
"storage_revision_id": self.revision_id, # verified. __exit__ may then recover this complete candidate after a
"filename": filename, # catchable manifest-write exception, preserving the R0 contract.
"file_size": target.stat().st_size, self.manifest = candidate_manifest
"file_sha256": _file_sha256(target),
"entry": _entry_metadata(storage_entry),
}
records = existing_records[:position]
records.append(record)
self.manifest.update(chunks=records, updated_utc=_now(), status="in_progress")
self._write_manifest() self._write_manifest()
self.generated_count += 1 self.generated_count += len(new_records)
def summary(self, *, detailed: bool = False) -> str: def summary(self, *, detailed: bool = False) -> str:
total = int((self.contract or {}).get("chunk_count", 0)) total = int((self.contract or {}).get("chunk_count", 0))
@@ -2751,17 +2980,13 @@ class RunStorageController:
else REVISION_STATUS_REVIEW_READY else REVISION_STATUS_REVIEW_READY
) )
try: try:
resolve_review_execution( validate_review_prefix_metadata(
generation_mode=GENERATION_MODE_REVIEW,
review_action=REVIEW_ACTION_CONTINUE,
configured_chunks=expected, configured_chunks=expected,
validated_prefix_count=completed, validated_prefix_count=completed,
terminal_merge_enabled=terminal_merge_enabled, terminal_merge_enabled=terminal_merge_enabled,
terminal_pair_start=( terminal_pair_start=(
expected - 1 if terminal_merge_enabled else None expected - 1 if terminal_merge_enabled else None
), ),
manual_regenerate_from=0,
run_storage_mode=RUN_STORAGE_SAVE_AUTO_RESUME,
latest_review_unit=canonical_pause["review_unit"], latest_review_unit=canonical_pause["review_unit"],
latest_revision_status=candidate_status, latest_revision_status=candidate_status,
latest_effective_nonce=int(self.effective_reroll_nonce), latest_effective_nonce=int(self.effective_reroll_nonce),
+7 -5
View File
@@ -52,7 +52,7 @@ function environment() {
.replace(/import \{ app \} from "\.\.\/\.\.\/scripts\/app.js";/,'') .replace(/import \{ app \} from "\.\.\/\.\.\/scripts\/app.js";/,'')
.replace(/import \{ api \} from "\.\.\/\.\.\/scripts\/api.js";/,'') .replace(/import \{ api \} from "\.\.\/\.\.\/scripts\/api.js";/,'')
.replace(/import \{ normalizeReferenceAudioLabels \} from "\.\/reference_audio_ui.js";/,'function normalizeReferenceAudioLabels() {}'); .replace(/import \{ normalizeReferenceAudioLabels \} from "\.\/reference_audio_ui.js";/,'function normalizeReferenceAudioLabels() {}');
vm.runInNewContext(src+`\nglobalThis.testFns={configureNode,loadTakeHistory,prepareReviewQueueIntent,takeCatalog,selectTakeOffset,selectTakeAction,reviewStatus,reviewSettingsChanged,synchronizeReviewQueue};`,sandbox); vm.runInNewContext(src+`\nglobalThis.testFns={configureNode,loadTakeHistory,takeCatalog,selectTakeOffset,selectTakeAction,reviewStatus,reviewSettingsChanged,synchronizeReviewQueue};`,sandbox);
app.extension.setup(); app.extension.setup();
const f=sandbox.testFns; const f=sandbox.testFns;
function makeNode(id=312,run='fixture'){ function makeNode(id=312,run='fixture'){
@@ -292,12 +292,14 @@ await test('removing one sampler does not discard another accepted sampler',asyn
e.setSaved(project(1,3,'two-r1','two'));await e.emit('execution_success',{prompt_id:q.prompt_id}); e.setSaved(project(1,3,'two-r1','two'));await e.emit('execution_success',{prompt_id:q.prompt_id});
assert(e.visible(b,'Use it and continue')); assert(e.visible(b,'Use it and continue'));
}); });
await test('same setup request is not mutated by legacy preparation then API preparation',async e=>{ await test('queue adapter owns setup preparation without mutating the caller payload',async e=>{
const n=e.makeNode();await e.load(n,project(3,3));e.w(n,'chunks').value=5;e.w(n,'Run').callback('Review Each Chunk'); const n=e.makeNode();await e.load(n,project(3,3));e.w(n,'chunks').value=5;e.w(n,'Run').callback('Review Each Chunk');
const inputs=await e.inputs(n);e.f.prepareReviewQueueIntent(n,inputs);const once=JSON.stringify(inputs); const inputs=await e.inputs(n);const before=JSON.stringify(inputs);
e.f.prepareReviewQueueIntent(n,inputs);assert.equal(JSON.stringify(inputs),once);
await e.api.queuePrompt(0,{output:{'312':{class_type:n.comfyClass,inputs}},workflow:{}}); await e.api.queuePrompt(0,{output:{'312':{class_type:n.comfyClass,inputs}},workflow:{}});
assert.equal(JSON.stringify(e.submissions.at(-1).data.output['312'].inputs),once); assert.equal(JSON.stringify(inputs),before);
const sent=e.submissions.at(-1).data.output['312'].inputs;
assert.equal(sent.reroll_from_chunk,'Auto');assert.equal(sent.review_action,'Continue / Next');
assert.equal(sent.take_action,'Automatic');
}); });
+165
View File
@@ -0,0 +1,165 @@
from __future__ import annotations
import importlib.util
import json
import os
from pathlib import Path
import sys
import time
ROOT = Path(__file__).resolve().parents[2]
PACKAGE_NAME = "ComfyUI_H3_Continuum_Join"
if PACKAGE_NAME not in sys.modules:
spec = importlib.util.spec_from_file_location(
PACKAGE_NAME,
ROOT / "__init__.py",
submodule_search_locations=[str(ROOT)],
)
package = importlib.util.module_from_spec(spec)
package.__path__ = [str(ROOT)]
sys.modules[PACKAGE_NAME] = package
import ComfyUI_H3_Continuum_Join.run_storage as storage_runtime
def _load_storage_cases():
path = ROOT / "tests" / "test_v38_review_run_storage.py"
spec = importlib.util.spec_from_file_location("r5_worker_storage_cases", path)
module = importlib.util.module_from_spec(spec)
sys.modules[spec.name] = module
spec.loader.exec_module(module)
return module
def main() -> None:
scenario_root = Path(sys.argv[1]).resolve()
stage = sys.argv[2]
scenario_root.mkdir(parents=True, exist_ok=True)
signal = scenario_root / "reached.json"
def reached() -> None:
signal.write_text(
json.dumps({"stage": stage, "pid": os.getpid()}),
encoding="utf-8",
)
while True:
time.sleep(1)
cases = _load_storage_cases()
contract = cases._contract(chunks=2, terminal=True)
controller = cases._controller(scenario_root, contract)
controller.revision_root.mkdir(parents=True, exist_ok=True)
controller._write_manifest()
entries = (cases._entry(0, contract), cases._entry(1, contract))
if stage == "raw_before":
reached()
if stage == "raw_mid":
def partial_save(tensors, filename, *, metadata):
with open(filename, "wb") as handle:
handle.write(b"partial-r5-raw")
handle.flush()
os.fsync(handle.fileno())
reached()
storage_runtime.save_file = partial_save
if stage == "first_raw_done":
original_hash = storage_runtime._file_sha256
hash_calls = 0
def observed_hash(path):
nonlocal hash_calls
value = original_hash(path)
hash_calls += 1
if hash_calls == 2:
reached()
return value
storage_runtime._file_sha256 = observed_hash
if stage == "before_manifest":
original_write_manifest = controller._write_manifest
def before_manifest():
reached()
return original_write_manifest()
controller._write_manifest = before_manifest
if stage == "manifest_temp_mid":
def partial_json_dump(payload, handle, **kwargs):
handle.write('{"partial":')
handle.flush()
os.fsync(handle.fileno())
reached()
storage_runtime.json.dump = partial_json_dump
if stage in {"before_replace", "after_replace"}:
original_replace = storage_runtime._replace_json_atomically
def observed_replace(temporary, destination):
if Path(destination).name != "manifest.json":
return original_replace(temporary, destination)
if stage == "before_replace":
reached()
result = original_replace(temporary, destination)
reached()
return result
storage_runtime._replace_json_atomically = observed_replace
if stage == "after_directory_durability":
original_fsync_dir = storage_runtime._fsync_dir
def observed_fsync_dir(path):
result = original_fsync_dir(path)
if Path(path).resolve() == controller.revision_root.resolve():
reached()
return result
storage_runtime._fsync_dir = observed_fsync_dir
controller.commit_group(entries, positions=(0, 1))
if stage in {"finalize_manifest_1", "finalize_manifest_2"}:
original_finalize_write = controller._write_manifest
finalize_writes = 0
def observed_finalize_write():
nonlocal finalize_writes
result = original_finalize_write()
finalize_writes += 1
expected = 1 if stage == "finalize_manifest_1" else 2
if finalize_writes == expected:
reached()
return result
controller._write_manifest = observed_finalize_write
if stage in {"project_before_replace", "project_after_replace"}:
original_project_replace = storage_runtime._replace_json_atomically
def observed_project_replace(temporary, destination):
if Path(destination).name != "project.json":
return original_project_replace(temporary, destination)
if stage == "project_before_replace":
reached()
result = original_project_replace(temporary, destination)
reached()
return result
storage_runtime._replace_json_atomically = observed_project_replace
controller.finalize(
session={"session_id": "r5-crash-worker", "chunks": list(entries)},
report="r5 process crash fixture",
)
raise RuntimeError(f"stage did not block: {stage}")
if __name__ == "__main__":
main()
+226
View File
@@ -0,0 +1,226 @@
from collections.abc import Mapping
import copy
import json
import pytest
import torch
from ComfyUI_H3_Continuum_Join.graph_contract import build_upstream_graph_contract
from ComfyUI_H3_Continuum_Join.v2.prompts import make_prompt_plan
from ComfyUI_H3_Continuum_Join.v2.session import make_session
from ComfyUI_H3_Continuum_Join.constants import PROMPT_MODE_LIST
from . import test_v38_review_execution_cap as cap
from .test_v36_masked_video_prefix import _install_nested_tensor
from .test_v35_context_sampler import _capture_sequence
from .test_v31_run_storage import _controller
def test_v3_reference_video_imports_the_shared_temporal_helper():
from ComfyUI_H3_Continuum_Join.temporal import align_frame_count_up as shared
from ComfyUI_H3_Continuum_Join.v3.reference_video import align_frame_count_up
assert align_frame_count_up is shared
def test_reference_bundle_fingerprint_ignores_unused_legacy_vae():
graph = {
"1": {"class_type": "H3ContinuumSamplerV38", "inputs": {
"model": ["2", 0], "clip": ["3", 0],
"audio_references": ["4", 0], "reference_audio_vae": ["5", 0]}},
"2": {"class_type": "UNETLoader", "inputs": {"unet_name": "model"}},
"3": {"class_type": "CLIPLoader", "inputs": {"clip_name": "clip"}},
"4": {"class_type": "H3ContinuumReferenceAudios", "inputs": {
"reference_audio_vae": ["6", 0], "reference_audio_1": ["7", 0]}},
"5": {"class_type": "VAELoader", "inputs": {"vae_name": "unused"}},
"6": {"class_type": "VAELoader", "inputs": {"vae_name": "active"}},
"7": {"class_type": "LoadAudio", "inputs": {"audio": "voice.wav"}},
}
def contract(value):
result, safe, _ = build_upstream_graph_contract(
value, "1", require_video_vae=False, require_reference_audio_vae=True)
assert safe
return result
original = contract(graph)
assert original["routes"]["reference_audio_vae"]["node"]["node_id"] == "4"
active = copy.deepcopy(graph)
active["6"]["inputs"]["vae_name"] = "new-active"
assert contract(active)["sha256"] != original["sha256"]
unused = copy.deepcopy(graph)
unused["5"]["inputs"]["vae_name"] = "new-unused"
assert contract(unused) == original
legacy = copy.deepcopy(graph)
del legacy["1"]["inputs"]["audio_references"]
assert contract(legacy)["routes"]["reference_audio_vae"]["node"]["node_id"] == "5"
# A connected but empty bundle can return None; execution then uses legacy
# audio. Run Storage supplies this resolved route, not just graph priority.
resolved, safe, _ = build_upstream_graph_contract(
graph, "1", require_video_vae=False, require_reference_audio_vae=True,
reference_audio_route="reference_audio_vae")
assert safe
assert resolved["routes"]["reference_audio_vae"]["node"]["node_id"] == "5"
def assert_nested_equal(actual, expected):
if torch.is_tensor(expected):
torch.testing.assert_close(actual, expected, rtol=0, atol=0)
elif isinstance(expected, Mapping):
assert actual.keys() == expected.keys()
for key in expected:
assert_nested_equal(actual[key], expected[key])
elif isinstance(expected, (tuple, list)):
assert len(actual) == len(expected)
for a, b in zip(actual, expected, strict=True):
assert_nested_equal(a, b)
else:
assert actual == expected
@pytest.mark.parametrize("transport", ["reference_context_v1", "masked_av_prefix_22_v1", "masked_video_prefix_v1"])
@pytest.mark.parametrize("anchors", ["none", "first", "first_last"])
@pytest.mark.parametrize("chunks", [1, 3, 6])
def test_review_and_complete_reuse_preserve_full_refine_context(monkeypatch, transport, anchors, chunks):
_install_nested_tensor(monkeypatch)
first = torch.zeros(1, 64, 96, 3) if anchors != "none" else None
last = torch.ones(1, 64, 96, 3) if anchors == "first_last" else None
runtime = cap._install_fake_runtime(monkeypatch, first_frame=first, last_frame=last)
real = cap.sequence.run_sequence
def run(**kwargs):
kwargs["continuation_transport"] = transport
return real(**kwargs)
monkeypatch.setattr(cap.sequence, "run_sequence", run)
options = dict(chunks=chunks, first_frame=first, last_frame=last, capture_refine_context=True)
full = cap._run_sequence(runtime, **options)
assert full[4]["complete"]
expected_sample_count = len(runtime.samples)
runtime.samples.clear()
session = None
for _ in range(chunks):
before = len(runtime.samples)
reviewed = cap._run_sequence(runtime, **options, limit=1, session=session)
session = reviewed[2]
assert len(runtime.samples) - before == 1
if len(reviewed[0]) == chunks:
break
assert not reviewed[4]["complete"]
assert len(runtime.samples) == expected_sample_count
cap._assert_entry_parity(reviewed[0], full[0])
assert reviewed[4]["complete"]
assert_nested_equal(reviewed[4], full[4])
runtime.samples.clear()
reused = cap._run_sequence(runtime, **options, session=session)
assert runtime.samples == []
cap._assert_entry_parity(reused[0], full[0])
assert_nested_equal(reused[4], full[4])
def test_review_does_not_encode_future_prompts(monkeypatch):
runtime = cap._install_fake_runtime(monkeypatch)
real = cap.sequence.run_sequence
encoded = []
encoder = runtime.clip.encode_from_tokens_scheduled
monkeypatch.setattr(runtime.clip, "encode_from_tokens_scheduled",
lambda prompt: (encoded.append(prompt), encoder(prompt))[1])
def run(**kwargs):
kwargs["prompt_plan"] = make_prompt_plan(
mode=PROMPT_MODE_LIST, script=json.dumps([f"action {i}" for i in range(6)]),
chunks=6, chunk_seconds=5.0)
return real(**kwargs)
monkeypatch.setattr(cap.sequence, "run_sequence", run)
cap._run_sequence(runtime, chunks=6, limit=1, capture_refine_context=True)
assert len(runtime.samples) == 1
assert encoded == ["action 0"]
@pytest.mark.parametrize("transport", ["reference_context_v1", "masked_av_prefix_22_v1", "masked_video_prefix_v1"])
@pytest.mark.parametrize("terminal", [False, True])
@pytest.mark.parametrize("image,audio", [(True, False), (False, True), (True, True)])
def test_review_reconstructs_reference_conditions(monkeypatch, transport, terminal, image, audio):
real = cap.sequence.run_sequence
state = {"limit": None, "samples": 0}
def run(**kwargs):
sample = cap.sequence.sample_chunk
def counted(**sample_kwargs):
state["samples"] += 1
return sample(**sample_kwargs)
monkeypatch.setattr(cap.sequence, "sample_chunk", counted)
kwargs["max_new_physical_groups"] = state["limit"]
return real(**kwargs)
monkeypatch.setattr(cap.sequence, "run_sequence", run)
options = dict(terminal=terminal, reference_image=image, reference_audio=audio,
continuation_transport=transport)
full = _capture_sequence(monkeypatch, **options)
assert state["samples"] == 2
state.update(limit=1, samples=0)
first = _capture_sequence(monkeypatch, **options)
assert state["samples"] == 1
assert not first[4]["complete"]
final = _capture_sequence(monkeypatch, **options, session=first[2])
assert state["samples"] == 2
assert_nested_equal(final[4], full[4])
state.update(limit=None, samples=0)
reused = _capture_sequence(monkeypatch, **options, session=final[2])
assert state["samples"] == 0
assert_nested_equal(reused[4], full[4])
def test_full_reuse_without_refine_capture_does_not_encode_or_sample(monkeypatch):
runtime = cap._install_fake_runtime(monkeypatch)
full = cap._run_sequence(runtime, chunks=3)
runtime.samples.clear()
def unexpected(*args, **kwargs):
pytest.fail("Full reuse without refine capture must not encode or sample")
monkeypatch.setattr(cap.sequence, "encode_identity_latents", unexpected)
monkeypatch.setattr(runtime.clip, "encode_from_tokens_scheduled", unexpected)
monkeypatch.setattr(cap.sequence, "sample_chunk", unexpected)
reused = cap._run_sequence(runtime, chunks=3, session=full[2])
assert len(reused) == 4
cap._assert_entry_parity(reused[0], full[0])
@pytest.mark.parametrize("terminal", [False, True])
def test_refine_context_rebuild_after_safetensors_storage_roundtrip(monkeypatch, tmp_path, terminal):
_install_nested_tensor(monkeypatch)
first = torch.zeros(1, 64, 96, 3) if terminal else None
last = torch.ones(1, 64, 96, 3) if terminal else None
runtime = cap._install_fake_runtime(monkeypatch, first_frame=first, last_frame=last)
options = dict(chunks=3, first_frame=first, last_frame=last, capture_refine_context=True)
full = cap._run_sequence(runtime, **options)
writer, hashes = _controller(tmp_path)
writer.prompts = ["continuous shot"] * 3
for index, entry in enumerate(full[0]):
writer.commit_chunk(entry, position=index)
reader, _ = _controller(tmp_path)
reader.prompts = writer.prompts[:]
reader.manifest = json.loads(writer._manifest_path().read_text(encoding="utf-8"))
loaded, records = reader._valid_prefix(reader.manifest, hashes)
assert len(records) == len(loaded) == 3
assert loaded[0]["video"].data_ptr() != full[0][0]["video"].data_ptr()
prior = full[2]
# The normal storage adapter invokes make_session to convert disk positions
# (zero-based) to Session indices (one-based); exercise that owner as well.
session = make_session(
chunks=loaded, width=prior["width"], height=prior["height"],
chunk_seconds=prior["chunk_seconds"], identity_hash=prior["identity_hash"],
model_fingerprint_value=prior["model_fingerprint"],
parent_session_id=prior["session_id"], reroll_from_chunk=0,
settings=prior["settings"])
runtime.samples.clear()
before = {path: path.read_bytes() for path in tmp_path.rglob("*") if path.is_file()}
restored = cap._run_sequence(runtime, **options, session=session)
assert runtime.samples == []
assert_nested_equal(restored[4], full[4])
cap._assert_entry_parity(restored[0], full[0])
assert {path: path.read_bytes() for path in tmp_path.rglob("*") if path.is_file()} == before
+4 -3
View File
@@ -6,7 +6,7 @@ import tomllib
ROOT = Path(__file__).resolve().parents[1] ROOT = Path(__file__).resolve().parents[1]
EXPECTED_VERSION = "3.8.0" EXPECTED_VERSION = "3.8.1"
def test_v35_release_metadata_is_consistent(): def test_v35_release_metadata_is_consistent():
@@ -25,6 +25,7 @@ def test_v35_public_documents_identify_the_current_release():
readme_ja = (ROOT / "README_JA.md").read_text(encoding="utf-8") readme_ja = (ROOT / "README_JA.md").read_text(encoding="utf-8")
changelog = (ROOT / "CHANGELOG.md").read_text(encoding="utf-8") changelog = (ROOT / "CHANGELOG.md").read_text(encoding="utf-8")
assert readme.startswith(f"# ComfyUI-H3-Continuum {EXPECTED_VERSION}\n") expected_heading = f"# ComfyUI-H3-Continuum {EXPECTED_VERSION} — V3.8X\n"
assert readme_ja.startswith(f"# ComfyUI-H3-Continuum {EXPECTED_VERSION}\n") assert readme.startswith(expected_heading)
assert readme_ja.startswith(expected_heading)
assert f"## {EXPECTED_VERSION}" in changelog assert f"## {EXPECTED_VERSION}" in changelog
@@ -0,0 +1,403 @@
from __future__ import annotations
import json
from types import SimpleNamespace
import pytest
import ComfyUI_H3_Continuum_Join.run_storage as storage_runtime
from ComfyUI_H3_Continuum_Join.run_storage import RunStorageController, RunStorageError
from ComfyUI_H3_Continuum_Join.v2 import sequence
from ComfyUI_H3_Continuum_Join.v2.session import entry_to_state
from ComfyUI_H3_Continuum_Join.v3.review_control import (
GENERATION_MODE_REVIEW,
REVIEW_ACTION_CONTINUE,
REVISION_STATUS_REVIEW_READY,
)
from . import test_v38_review_execution_cap as cap
from . import test_v38_review_run_storage as storage_cases
def _run_with_sources(
monkeypatch,
runtime,
*,
chunks: int,
session=None,
initial_state=None,
reroll_from_chunk: int = 0,
continuity: str | None = None,
limit: int | None = None,
):
"""Exercise the unchanged public run_sequence contract with extra sources."""
original = cap.sequence.run_sequence
def forwarded(**kwargs):
kwargs["initial_state"] = initial_state
kwargs["reroll_from_chunk"] = reroll_from_chunk
if continuity is not None:
kwargs["continuity"] = continuity
return original(**kwargs)
with monkeypatch.context() as local:
local.setattr(cap.sequence, "run_sequence", forwarded)
return cap._run_sequence(
runtime,
chunks=chunks,
session=session,
limit=limit,
)
def _state_from_session(session: dict, *, clip_index: int = 9) -> dict:
state = dict(entry_to_state(session["chunks"][-1]))
state["clip_index"] = clip_index
return state
def test_r0_storage_off_plain_full_run_uses_no_review_policy_or_filesystem(
monkeypatch, tmp_path
):
runtime = cap._install_fake_runtime(monkeypatch)
def unexpected(*args, **kwargs):
pytest.fail("Storage OFF Full Run must not resolve Run Storage Review policy")
monkeypatch.setattr(storage_runtime, "resolve_review_execution", unexpected)
entries, last_state, session, _ = cap._run_sequence(runtime, chunks=3)
assert len(entries) == len(session["chunks"]) == len(runtime.samples) == 3
assert last_state["clip_index"] == 3
assert list(tmp_path.rglob("*")) == []
def test_r0_storage_off_compatible_session_restores_prefix(monkeypatch):
runtime = cap._install_fake_runtime(monkeypatch)
_, _, saved, _ = cap._run_sequence(runtime, chunks=1)
runtime.samples.clear()
entries, last_state, session, _ = cap._run_sequence(
runtime,
chunks=2,
session=saved,
)
assert len(entries) == len(session["chunks"]) == 2
assert entries[0]["reused"] is True
assert len(runtime.samples) == 1
assert last_state["clip_index"] == 2
def test_r0_storage_off_session_regenerate_from_preserves_only_prior_prefix(monkeypatch):
runtime = cap._install_fake_runtime(monkeypatch)
_, _, saved, _ = cap._run_sequence(runtime, chunks=3)
runtime.samples.clear()
entries, last_state, session, _ = _run_with_sources(
monkeypatch,
runtime,
chunks=3,
session=saved,
reroll_from_chunk=2,
)
assert len(entries) == len(session["chunks"]) == 3
assert [entry["reused"] for entry in entries] == [True, False, False]
assert len(runtime.samples) == 2
assert last_state["clip_index"] == 3
def test_r0_storage_off_incompatible_session_is_advisory_and_starts_fresh(monkeypatch):
runtime = cap._install_fake_runtime(monkeypatch)
_, _, saved, _ = cap._run_sequence(runtime, chunks=1)
incompatible = dict(saved)
incompatible["width"] = 128
runtime.samples.clear()
entries, last_state, session, report = cap._run_sequence(
runtime,
chunks=1,
session=incompatible,
)
assert len(entries) == len(session["chunks"]) == len(runtime.samples) == 1
assert entries[0]["reused"] is False
assert last_state["clip_index"] == 1
assert "saved session was ignored; generated a fresh run" in report
def test_r0_storage_off_invalid_session_suppresses_valid_state_without_fallback(
monkeypatch,
):
runtime = cap._install_fake_runtime(monkeypatch)
_, _, source, _ = cap._run_sequence(runtime, chunks=1)
state = _state_from_session(source)
runtime.samples.clear()
entries, last_state, session, report = _run_with_sources(
monkeypatch,
runtime,
chunks=1,
session={"magic": "not-a-session"},
initial_state=state,
)
# Current V3.8 behavior is advisory, not an exception: the invalid Session
# is rejected, the simultaneously supplied State remains suppressed, and a
# fresh Chunk 1 is generated. R0 records this fact without changing it.
assert len(entries) == len(session["chunks"]) == len(runtime.samples) == 1
assert last_state["clip_index"] == 1
assert entries[0]["plan"]["continuation"] is False
assert "saved session was ignored; generated a fresh run" in report
def test_r0_storage_off_compatible_session_suppresses_initial_state(monkeypatch, caplog):
runtime = cap._install_fake_runtime(monkeypatch)
_, _, saved, _ = cap._run_sequence(runtime, chunks=1)
state = _state_from_session(saved)
runtime.samples.clear()
entries, last_state, _, _ = _run_with_sources(
monkeypatch,
runtime,
chunks=2,
session=saved,
initial_state=state,
)
assert len(entries) == 2
assert entries[0]["reused"] is True
assert len(runtime.samples) == 1
assert last_state["clip_index"] == 2
assert "using the session and ignoring initial_state" in caplog.text
def test_r0_storage_off_initial_state_continues_without_session(monkeypatch):
runtime = cap._install_fake_runtime(monkeypatch)
_, _, source, _ = cap._run_sequence(runtime, chunks=1)
state = _state_from_session(source)
runtime.samples.clear()
entries, last_state, session, _ = _run_with_sources(
monkeypatch,
runtime,
chunks=1,
initial_state=state,
)
assert len(entries) == len(session["chunks"]) == len(runtime.samples) == 1
assert entries[0]["plan"]["continuation"] is True
assert entries[0]["plan"]["clip_index"] == 10
assert last_state["clip_index"] == 10
def test_r0_storage_off_initial_state_rejects_invalid_regenerate_from(monkeypatch):
runtime = cap._install_fake_runtime(monkeypatch)
_, _, source, _ = cap._run_sequence(runtime, chunks=1)
state = _state_from_session(source)
with pytest.raises(
sequence.SequenceRuntimeError,
match="with initial_state, reroll_from_chunk can only be 0 or 1",
):
_run_with_sources(
monkeypatch,
runtime,
chunks=3,
initial_state=state,
reroll_from_chunk=2,
)
def test_r0_run_storage_on_rejects_explicit_session_before_filesystem_io(
monkeypatch, tmp_path
):
runtime = cap._install_fake_runtime(monkeypatch)
_, _, saved, _ = cap._run_sequence(runtime, chunks=1)
monkeypatch.setattr(storage_runtime, "_output_root", lambda: tmp_path)
controller = RunStorageController("r0-explicit-session")
monkeypatch.setattr(storage_runtime, "get_active_run_storage", lambda: controller)
with pytest.raises(
RunStorageError,
match="Run Storage cannot be combined with an explicit Session",
):
cap._run_sequence(runtime, chunks=2, session=saved)
assert list(tmp_path.rglob("*")) == []
def test_r0_run_storage_saved_prefix_precedes_initial_state(monkeypatch):
runtime = cap._install_fake_runtime(monkeypatch)
_, _, saved, _ = cap._run_sequence(runtime, chunks=1)
state = _state_from_session(saved)
runtime.samples.clear()
storage = cap._CommitRecorder(runtime.timeline)
storage.prepare = lambda **kwargs: saved
monkeypatch.setattr(storage_runtime, "get_active_run_storage", lambda: storage)
entries, last_state, _, _ = _run_with_sources(
monkeypatch,
runtime,
chunks=2,
initial_state=state,
)
assert len(entries) == 2
assert entries[0]["reused"] is True
assert len(runtime.samples) == 1
assert last_state["clip_index"] == 2
def test_r0_run_storage_without_prefix_uses_initial_state(monkeypatch):
runtime = cap._install_fake_runtime(monkeypatch)
_, _, source, _ = cap._run_sequence(runtime, chunks=1)
state = _state_from_session(source)
runtime.samples.clear()
storage = cap._CommitRecorder(runtime.timeline)
monkeypatch.setattr(storage_runtime, "get_active_run_storage", lambda: storage)
entries, last_state, _, _ = _run_with_sources(
monkeypatch,
runtime,
chunks=1,
initial_state=state,
)
assert len(entries) == len(runtime.samples) == 1
assert entries[0]["plan"]["continuation"] is True
assert last_state["clip_index"] == 10
@pytest.mark.parametrize(
("continuity", "expected_context"),
(("Balanced — 22 frames", 22), ("Strong — 39 frames (Experimental)", 39)),
)
def test_r0_continuity_modes_keep_their_context_contract(
monkeypatch, continuity, expected_context
):
runtime = cap._install_fake_runtime(monkeypatch)
entries, _, _, _ = _run_with_sources(
monkeypatch,
runtime,
chunks=2,
continuity=continuity,
)
assert entries[0]["plan"]["context_frames"] == 5
assert entries[1]["plan"]["context_frames"] == expected_context
assert entries[1]["plan"]["state_capacity_frames"] == 39
def _failure_controller(tmp_path, contract: dict) -> RunStorageController:
controller = storage_cases._controller(tmp_path, contract)
controller.lock = storage_runtime._RunLock(controller.run_root / ".lock")
controller.revision_root.mkdir(parents=True, exist_ok=True)
controller._write_manifest()
return controller
@pytest.mark.parametrize(
("stage", "committed"),
(
("before sampling", 0),
("after sampling before chunk commit", 0),
("after manifest update", 1),
("before output projection", 1),
("during output projection", 1),
("before storage finalize", 1),
),
)
def test_r0_failure_baseline_marks_revision_interrupted(
tmp_path, stage, committed
):
contract = storage_cases._contract(chunks=1)
controller = _failure_controller(tmp_path, contract)
with pytest.raises(RuntimeError, match=stage):
with controller:
if committed:
controller.commit_chunk(storage_cases._entry(0, contract), position=0)
raise RuntimeError(stage)
manifest = json.loads(controller._manifest_path().read_text(encoding="utf-8"))
assert manifest["status"] == "interrupted"
assert len(manifest["chunks"]) == committed
assert stage in manifest["last_error"]
def test_r5_terminal_entry_cannot_expose_an_interrupted_half_group(
tmp_path,
):
contract = storage_cases._contract(chunks=2, terminal=True)
controller = _failure_controller(tmp_path, contract)
with pytest.raises(RunStorageError, match="physical group is incomplete"):
with controller:
controller.commit_chunk(storage_cases._entry(0, contract), position=0)
manifest = json.loads(controller._manifest_path().read_text(encoding="utf-8"))
assert manifest["status"] == "interrupted"
assert manifest["chunks"] == []
project = json.loads((controller.run_root / "project.json").read_text(encoding="utf-8"))
assert project["canonical_storage_revision_id"] is None
def test_r0_failure_before_manifest_update_is_recovered_by_exception_handler(
monkeypatch, tmp_path
):
contract = storage_cases._contract(chunks=1)
controller = _failure_controller(tmp_path, contract)
original = controller._write_manifest
calls = 0
def fail_once():
nonlocal calls
calls += 1
if calls == 1:
raise RuntimeError("before manifest update")
return original()
monkeypatch.setattr(controller, "_write_manifest", fail_once)
with pytest.raises(RuntimeError, match="before manifest update"):
with controller:
controller.commit_chunk(storage_cases._entry(0, contract), position=0)
manifest = json.loads(controller._manifest_path().read_text(encoding="utf-8"))
assert manifest["status"] == "interrupted"
assert len(manifest["chunks"]) == 1
assert calls == 2
def test_r0_failure_before_canonical_update_keeps_current_recovery_semantics(
monkeypatch, tmp_path
):
contract = storage_cases._contract(chunks=1)
controller = _failure_controller(tmp_path, contract)
entry = storage_cases._entry(0, contract)
original = controller._write_project
calls = 0
def fail_once(*, set_canonical=False):
nonlocal calls
calls += 1
if calls == 1:
raise RuntimeError("before canonical pointer update")
return original(set_canonical=set_canonical)
monkeypatch.setattr(controller, "_write_project", fail_once)
with pytest.raises(RuntimeError, match="before canonical pointer update"):
with controller:
controller.commit_chunk(entry, position=0)
controller.finalize(
session={"session_id": "r0", "chunks": [entry]},
report="r0 failure baseline",
)
manifest = json.loads(controller._manifest_path().read_text(encoding="utf-8"))
project = json.loads((controller.run_root / "project.json").read_text(encoding="utf-8"))
assert manifest["status"] == "interrupted"
assert calls == 2
assert project["canonical_storage_revision_id"] is None
@@ -0,0 +1,214 @@
from __future__ import annotations
from dataclasses import FrozenInstanceError
import pytest
import ComfyUI_H3_Continuum_Join.run_storage as storage_runtime
from ComfyUI_H3_Continuum_Join.run_storage import (
EmptyValidatedPrefix,
RunStorageController,
ValidatedPrefix,
)
from ComfyUI_H3_Continuum_Join.v3.planning_types import PrefixFacts
from ComfyUI_H3_Continuum_Join.v3.review_control import (
GENERATION_MODE_REVIEW,
REVIEW_ACTION_CONTINUE,
)
from . import test_v38_review_run_storage as cases
def _review_controller(tmp_path, contract: dict) -> RunStorageController:
controller = RunStorageController("phase-d-review")
controller.run_root = tmp_path / "run"
controller.revisions_root = controller.run_root / "revisions"
controller.prompts = [
f"prompt {index + 1}" for index in range(contract["chunk_count"])
]
controller.configure_review(
generation_mode=GENERATION_MODE_REVIEW,
review_action=REVIEW_ACTION_CONTINUE,
)
return controller
def test_r2_raw_prefix_is_loaded_before_the_single_review_decision(
monkeypatch, tmp_path
):
contract = cases._contract(chunks=3)
cases._persist(
tmp_path,
contract,
prefix=1,
review_unit=(1, 1),
updated_utc="2026-09-14T00:00:00+00:00",
)
controller = _review_controller(tmp_path, contract)
events = []
original_load = controller._load_entry
original_resolve = storage_runtime.resolve_review_execution
def load(*args, **kwargs):
events.append("raw_loaded")
return original_load(*args, **kwargs)
def resolve(**kwargs):
events.append("review_decision")
return original_resolve(**kwargs)
monkeypatch.setattr(controller, "_load_entry", load)
monkeypatch.setattr(storage_runtime, "resolve_review_execution", resolve)
prefix = controller._load_validated_review_prefix(contract, resume_safe=True)
assert isinstance(prefix, ValidatedPrefix)
assert events == ["raw_loaded"]
controller._resolve_review_contract(
contract,
requested_nonce=0,
resume_safe=True,
validated_prefix=prefix,
)
assert events == ["raw_loaded", "review_decision"]
assert controller.review_runtime_metrics == {
"review_decision_created": 1,
"review_reconcile": 0,
}
assert not hasattr(controller, "_reconcile_review_execution_with_reused_prefix")
def test_r2_validated_prefix_is_structurally_immutable_and_defensive(tmp_path):
contract = cases._contract(chunks=3)
cases._persist(
tmp_path,
contract,
prefix=1,
review_unit=(1, 1),
updated_utc="2026-09-14T00:00:00+00:00",
)
controller = _review_controller(tmp_path, contract)
candidate = controller.find_latest_review_head(contract)
prefix = controller._freeze_validated_prefix(candidate, contract=contract)
assert isinstance(prefix.entries, tuple)
assert isinstance(prefix.records, tuple)
assert prefix.physical_group_boundaries == ((1, 1),)
with pytest.raises(FrozenInstanceError):
prefix.status = "changed"
with pytest.raises(TypeError):
prefix.manifest["status"] = "changed"
candidate["manifest"]["status"] = "changed-after-freeze"
assert prefix.manifest["status"] != "changed-after-freeze"
facts = prefix.to_planning_facts()
assert isinstance(facts, PrefixFacts)
assert facts.accepted_chunks == 1
assert facts.configured_chunks == 3
assert facts.review_unit.start == facts.review_unit.end == 1
def test_r2_empty_validated_prefix_only_means_no_run_storage_prefix():
prefix = EmptyValidatedPrefix(configured_chunks=3)
facts = prefix.to_planning_facts()
assert prefix.entries == prefix.records == ()
assert facts == PrefixFacts(
accepted_chunks=0,
configured_chunks=3,
revision_id=None,
status=None,
review_unit=None,
effective_nonce=0,
branch_regenerate_from=0,
physical_group_boundaries=(),
)
def test_r2_repository_validation_and_finalize_do_not_create_review_decisions(
monkeypatch, tmp_path
):
contract = cases._contract(chunks=3)
def unexpected(**kwargs):
pytest.fail("metadata validation must not create a Review Decision")
monkeypatch.setattr(storage_runtime, "resolve_review_execution", unexpected)
cases._persist(
tmp_path,
contract,
prefix=1,
review_unit=(1, 1),
updated_utc="2026-09-14T00:00:00+00:00",
)
controller = _review_controller(tmp_path, contract)
prefix = controller._load_validated_review_prefix(contract, resume_safe=True)
assert isinstance(prefix, ValidatedPrefix)
assert controller.review_runtime_metrics["review_decision_created"] == 0
def test_r2_a_second_review_decision_is_rejected(tmp_path):
contract = cases._contract(chunks=3)
controller = _review_controller(tmp_path, contract)
prefix = controller._load_validated_review_prefix(contract, resume_safe=True)
controller._resolve_review_contract(
contract,
requested_nonce=0,
resume_safe=True,
validated_prefix=prefix,
)
with pytest.raises(storage_runtime.RunStorageError, match="already created"):
controller._resolve_review_contract(
contract,
requested_nonce=0,
resume_safe=True,
validated_prefix=prefix,
)
def test_r2_fixed_prefix_cannot_be_replaced_before_decision(tmp_path):
contract = cases._contract(chunks=3)
controller = _review_controller(tmp_path, contract)
fixed = controller._load_validated_review_prefix(contract, resume_safe=True)
replacement = EmptyValidatedPrefix(configured_chunks=3)
assert replacement is not fixed
with pytest.raises(storage_runtime.RunStorageError, match="cannot replace"):
controller._resolve_review_contract(
contract,
requested_nonce=0,
resume_safe=True,
validated_prefix=replacement,
)
assert controller.review_runtime_metrics == {
"review_decision_created": 0,
"review_reconcile": 0,
}
def test_r2_take_policy_also_creates_exactly_one_decision(tmp_path):
contract = cases._contract(chunks=3, boundary=2, nonce=1)
saved = cases._persist(
tmp_path,
contract,
prefix=2,
review_unit=(2, 2),
updated_utc="2026-09-14T00:00:01+00:00",
)
revision = cases._take(cases._project(saved), group=2, nonce=1)
controller, _, _, _ = cases._resolve(
tmp_path,
cases._contract(chunks=3),
take_action=storage_runtime.TAKE_ACTION_CONTINUE,
take_group=2,
take_revision_id=revision["revision_id"],
)
assert isinstance(controller.validated_prefix, ValidatedPrefix)
assert controller.review_runtime_metrics == {
"review_decision_created": 1,
"review_reconcile": 0,
}
@@ -0,0 +1,220 @@
from __future__ import annotations
import ast
import inspect
from pathlib import Path
import ComfyUI_H3_Continuum_Join.run_storage as storage_runtime
from ComfyUI_H3_Continuum_Join.run_storage import EmptyValidatedPrefix
from ComfyUI_H3_Continuum_Join.v3.runtime_coordinator import (
project_selected_continuation_source,
)
from ComfyUI_H3_Continuum_Join.v3.execution_planner import (
PROJECTION_CURRENT_REVIEW_UNIT,
PROJECTION_FULL_ACCEPTED_PREFIX,
build_execution_plan,
)
from ComfyUI_H3_Continuum_Join.v3.planning_types import (
ContinuationSourceFacts,
PrefixFacts,
)
from ComfyUI_H3_Continuum_Join.v3.review_control import (
GENERATION_MODE_REVIEW,
REVIEW_ACTION_CONTINUE,
REVISION_STATUS_COMPLETE,
REVISION_STATUS_REVIEW_READY,
RUN_STORAGE_SAVE_AUTO_RESUME,
ReviewUnit,
resolve_review_execution,
)
from . import test_v38_review_execution_cap as cap
def _source(
kind: str,
*,
accepted: int,
reroll: int,
boundaries: tuple[tuple[int, int], ...],
) -> ContinuationSourceFacts:
return project_selected_continuation_source(
kind=kind,
selected_source={
"accepted_chunks": accepted,
"reroll_from_chunk": reroll,
"physical_group_boundaries": boundaries,
},
)
def _review_continue(*, chunks: int, prefix: int, terminal: bool):
return resolve_review_execution(
generation_mode=GENERATION_MODE_REVIEW,
review_action=REVIEW_ACTION_CONTINUE,
configured_chunks=chunks,
validated_prefix_count=prefix,
terminal_merge_enabled=terminal,
terminal_pair_start=(chunks - 1 if terminal else None),
manual_regenerate_from=0,
run_storage_mode=RUN_STORAGE_SAVE_AUTO_RESUME,
latest_review_unit=(
None
if prefix == 0
else ReviewUnit(start=prefix, end=prefix, physical_group=prefix)
),
latest_revision_status=(
None if prefix == 0 else REVISION_STATUS_REVIEW_READY
),
latest_effective_nonce=0,
)
def test_r3_projects_each_already_selected_continuation_source_kind():
run_storage = _source(
"run_storage",
accepted=2,
reroll=0,
boundaries=((1, 1), (2, 2)),
)
explicit_session = _source(
"explicit_session",
accepted=1,
reroll=2,
boundaries=((1, 1),),
)
initial_state = _source(
"initial_state",
accepted=0,
reroll=1,
boundaries=(),
)
none = project_selected_continuation_source(
kind="none",
selected_source=None,
)
assert run_storage == ContinuationSourceFacts(
"run_storage", 2, 0, ((1, 1), (2, 2))
)
assert explicit_session == ContinuationSourceFacts(
"explicit_session", 1, 2, ((1, 1),)
)
assert initial_state == ContinuationSourceFacts(
"initial_state", 0, 1, ()
)
assert none == ContinuationSourceFacts("none", 0, 0, ())
def test_r3_projection_boundary_has_no_selection_policy_calls():
tree = ast.parse(inspect.getsource(project_selected_continuation_source))
called_names = {
node.func.id
for node in ast.walk(tree)
if isinstance(node, ast.Call) and isinstance(node.func, ast.Name)
}
assert called_names.isdisjoint(
{
"find_latest_review_head",
"resolve_review_execution",
"resolve_take_execution",
"validate_session",
"validate_state",
}
)
def test_r3_full_plan_owns_all_pending_physical_groups():
plan = build_execution_plan(
continuation_source_facts=ContinuationSourceFacts("none", 0, 0, ()),
configured_chunks=3,
terminal_merge_enabled=False,
max_new_physical_groups=None,
review_execution=None,
)
assert [group.logical_chunks for group in plan.groups_to_generate] == [
(1,),
(2,),
(3,),
]
assert plan.expected_status == REVISION_STATUS_COMPLETE
assert plan.expected_review_unit is None
assert plan.projection.kind == PROJECTION_FULL_ACCEPTED_PREFIX
def test_r3_review_plan_generates_one_group_and_projects_only_that_unit():
execution = _review_continue(chunks=3, prefix=1, terminal=False)
plan = build_execution_plan(
continuation_source_facts=ContinuationSourceFacts(
"run_storage", 1, 0, ((1, 1),)
),
configured_chunks=3,
terminal_merge_enabled=False,
max_new_physical_groups=execution.max_new_physical_groups,
review_execution=execution,
retained_review_unit=ReviewUnit(1, 1, 1),
)
assert [group.logical_chunks for group in plan.groups_to_generate] == [(2,)]
assert plan.expected_status == REVISION_STATUS_REVIEW_READY
assert plan.expected_review_unit == ReviewUnit(2, 2, 2)
assert plan.projection.kind == PROJECTION_CURRENT_REVIEW_UNIT
assert (plan.projection.start_chunk, plan.projection.end_chunk) == (2, 2)
def test_r3_terminal_group_is_atomic_and_completion_projects_full_prefix():
execution = _review_continue(chunks=3, prefix=1, terminal=True)
plan = build_execution_plan(
continuation_source_facts=ContinuationSourceFacts(
"run_storage", 1, 0, ((1, 1),)
),
configured_chunks=3,
terminal_merge_enabled=True,
max_new_physical_groups=execution.max_new_physical_groups,
review_execution=execution,
retained_review_unit=ReviewUnit(1, 1, 1),
)
assert len(plan.groups_to_generate) == 1
assert plan.groups_to_generate[0].logical_chunks == (2, 3)
assert plan.groups_to_generate[0].terminal_atomic is True
assert plan.expected_status == REVISION_STATUS_COMPLETE
assert plan.expected_review_unit == ReviewUnit(2, 3, 2)
assert plan.projection.kind == PROJECTION_FULL_ACCEPTED_PREFIX
def test_r3_planner_api_accepts_only_one_selected_source():
parameters = inspect.signature(build_execution_plan).parameters
assert "continuation_source_facts" in parameters
assert "storage_prefix_facts" not in parameters
assert "explicit_session_facts" not in parameters
assert "initial_state_facts" not in parameters
def test_r3_planner_module_imports_no_torch_or_comfyui():
module_path = Path(inspect.getsourcefile(build_execution_plan))
tree = ast.parse(module_path.read_text(encoding="utf-8"))
imported = []
for node in ast.walk(tree):
if isinstance(node, ast.Import):
imported.extend(alias.name for alias in node.names)
elif isinstance(node, ast.ImportFrom) and node.module:
imported.append(node.module)
assert not any(name == "torch" or name.startswith("torch.") for name in imported)
assert not any("comfy" in name.lower() for name in imported)
def test_r3_validated_prefix_projection_contract_remains_prefix_facts():
facts = EmptyValidatedPrefix(configured_chunks=3).to_planning_facts()
assert isinstance(facts, PrefixFacts)
assert not isinstance(facts, ContinuationSourceFacts)
def test_r3_storage_off_runtime_consumes_the_pure_group_plan(monkeypatch):
runtime = cap._install_fake_runtime(monkeypatch)
entries, _, session, _ = cap._run_sequence(runtime, chunks=3)
assert len(entries) == len(session["chunks"]) == 3
assert len(runtime.samples) == 3
assert storage_runtime.get_active_run_storage() is None
@@ -0,0 +1,209 @@
from __future__ import annotations
import ast
import inspect
import pytest
from ComfyUI_H3_Continuum_Join.run_storage import RunStorageError
from ComfyUI_H3_Continuum_Join.v2 import sequence
from ComfyUI_H3_Continuum_Join.v3 import runtime_coordinator as coordinator_module
from ComfyUI_H3_Continuum_Join.v3.runtime_coordinator import (
InternalRuntimeCoordinator,
)
from ComfyUI_H3_Continuum_Join.v3.sampling_engine import sample_physical_group
EXPECTED_RUN_SEQUENCE_PARAMETERS = (
"model", "clip", "video_vae", "audio_vae", "sampler", "sigmas",
"first_frame", "last_frame", "prompt_plan", "width", "height",
"continuity", "base_seed", "audio_continuity", "exact_total_duration",
"diagnostics_mode", "reroll_from_chunk", "reroll_nonce",
"strict_compatibility", "debug", "seam_correction", "enable_preview",
"session", "initial_state", "latent_only", "reference_assets",
"reference_audio_source", "reference_audio_vae",
"driving_audio_source", "driving_audio_vae", "reference_video_source",
"timeline_video_source", "guide_source", "capture_refine_context",
"memory_attribution", "prompt_conditioning_cache",
"reference_encode_cache", "continuation_transport",
"max_new_physical_groups", "_memory_attribution_collector",
"_diagnostic_continuation_policy",
)
def _coordinator(*, storage=False, session=None, state=None):
return InternalRuntimeCoordinator(
storage_controller=(object() if storage else None),
input_session=session,
initial_state=state,
)
def test_r4_run_sequence_keeps_the_exact_explicit_41_keyword_signature():
public = inspect.signature(sequence.run_sequence)
internal = inspect.signature(sequence._run_runtime_internal)
assert tuple(public.parameters) == EXPECTED_RUN_SEQUENCE_PARAMETERS
assert tuple(internal.parameters) == EXPECTED_RUN_SEQUENCE_PARAMETERS
assert public == internal
assert all(
parameter.kind is inspect.Parameter.KEYWORD_ONLY
for parameter in public.parameters.values()
)
def test_r4_storage_plus_explicit_session_keeps_existing_error():
coordinator = _coordinator(storage=True, session={"session": True})
with pytest.raises(
RunStorageError,
match="Run Storage cannot be combined with an explicit Session",
):
coordinator.assert_storage_session_compatible()
def test_r4_explicit_session_suppresses_state_before_session_validation(caplog):
state = {"would": "otherwise be considered"}
coordinator = _coordinator(
session={"invalid": "session payload"},
state=state,
)
session, effective_state = coordinator.prepare_inputs()
assert session == {"invalid": "session payload"}
assert effective_state is None
assert coordinator.initial_state is None
assert "using the session and ignoring initial_state" in caplog.text
def test_r4_usable_storage_prefix_precedes_initial_state(monkeypatch):
state = {"state": True}
coordinator = _coordinator(storage=True, state=state)
monkeypatch.setattr(
coordinator_module,
"entry_to_state",
lambda entry: {"width": 64, "height": 64, "source": entry["source"]},
)
selected = coordinator.select_continuation_source(
preserved=[{"source": "storage"}],
initial_state=state,
chunks=2,
width=64,
height=64,
reroll_from_chunk=0,
effective_reroll_from_chunk=0,
terminal_merge_enabled=False,
)
assert selected.continuation_source_facts.kind == "run_storage"
assert selected.continuation_source_facts.accepted_chunks == 1
assert selected.previous_state["source"] == "storage"
def test_r4_initial_state_is_considered_only_without_usable_prefix(monkeypatch):
state = {"state": True}
coordinator = _coordinator(storage=True, state=state)
monkeypatch.setattr(
coordinator_module,
"validate_state",
lambda value: {"width": 64, "height": 64, "source": value["state"]},
)
selected = coordinator.select_continuation_source(
preserved=[],
initial_state=state,
chunks=2,
width=64,
height=64,
reroll_from_chunk=0,
effective_reroll_from_chunk=0,
terminal_merge_enabled=False,
)
assert selected.continuation_source_facts.kind == "initial_state"
assert selected.continuation_source_facts.accepted_chunks == 0
assert selected.previous_state["source"] is True
def test_r4_sampling_engine_owns_one_sample_and_preserves_observer_order():
events = []
class Sigmas:
shape = (5,)
class LayoutProfiler:
def begin_sampling_group(self, **kwargs):
events.append(("layout_begin", kwargs))
return "layout-token"
def finish_sampling_group(self, token):
events.append(("layout_finish", token))
class DiagnosticPolicy:
def before_sampling(self, **kwargs):
events.append(("diagnostic_before", kwargs))
return "diagnostic-token"
def planner_event(_planner, event, **kwargs):
events.append((f"planner_{event}", kwargs))
def sample_callable(**kwargs):
events.append(("sample", kwargs))
return "sampled"
sampled, diagnostic_token = sample_physical_group(
sample_callable=sample_callable,
model="model",
conditioning="conditioning",
latent="latent",
sampler="sampler",
sigmas=Sigmas(),
seed=42,
enable_preview=True,
physical_group=2,
logical_chunks=(2,),
terminal_atomic=False,
layout_validation_profiler=LayoutProfiler(),
packed_row_planner="planner",
planner_event=planner_event,
diagnostic_policy=DiagnosticPolicy(),
context_frames=22,
)
assert sampled == "sampled"
assert diagnostic_token == "diagnostic-token"
assert [name for name, _ in events] == [
"layout_begin",
"diagnostic_before",
"planner_begin_group",
"sample",
"planner_finish_group",
"layout_finish",
]
def test_r4_runtime_uses_sampling_engine_and_engine_has_no_storage_import():
runtime_tree = ast.parse(inspect.getsource(sequence._run_runtime_internal))
calls = [
node.func.id
for node in ast.walk(runtime_tree)
if isinstance(node, ast.Call) and isinstance(node.func, ast.Name)
]
engine_source = inspect.getsource(inspect.getmodule(sample_physical_group))
assert calls.count("sample_physical_group") == 2
assert calls.count("sample_chunk") == 0
assert "run_storage" not in engine_source.lower()
def test_r4_continuation_priority_branches_have_one_owner():
runtime_source = inspect.getsource(coordinator_module)
sequence_source = inspect.getsource(sequence._run_runtime_internal)
assert runtime_source.count("class InternalRuntimeCoordinator") == 1
assert runtime_source.count("def project_selected_continuation_source") == 1
assert "selected_kind" in runtime_source
assert "selected_source_kind" not in sequence_source
assert "validate_state(initial_state)" not in sequence_source
@@ -0,0 +1,318 @@
from __future__ import annotations
import hashlib
import json
from pathlib import Path
import subprocess
import sys
import time
import pytest
import ComfyUI_H3_Continuum_Join.run_storage as storage_runtime
from ComfyUI_H3_Continuum_Join.run_storage import RunStorageError
from ComfyUI_H3_Continuum_Join.v2.session import SessionValidationError
from . import test_v38_review_run_storage as storage_cases
def _ready_controller(tmp_path, *, chunks: int = 2, terminal: bool = False):
contract = storage_cases._contract(chunks=chunks, terminal=terminal)
controller = storage_cases._controller(tmp_path, contract)
controller.lock = storage_runtime._RunLock(controller.run_root / ".lock")
controller.revision_root.mkdir(parents=True, exist_ok=True)
controller._write_manifest()
return controller, contract
def _raw_path(controller, record: dict) -> Path:
return controller.revision_root / "chunks" / record["filename"]
def test_r5_retry_uses_a_new_raw_without_overwriting_the_accepted_raw(tmp_path):
controller, contract = _ready_controller(tmp_path, chunks=1)
controller.commit_group(
(storage_cases._entry(0, contract),), positions=(0,)
)
first = dict(controller.manifest["chunks"][0])
first_path = _raw_path(controller, first)
first_bytes = first_path.read_bytes()
replacement = storage_cases._entry(0, contract)
replacement["video"] = replacement["video"] + 1
controller.commit_group((replacement,), positions=(0,))
second = dict(controller.manifest["chunks"][0])
assert second["filename"] != first["filename"]
assert first_path.read_bytes() == first_bytes
assert hashlib.sha256(first_bytes).hexdigest() == first["file_sha256"]
assert _raw_path(controller, second).is_file()
def test_r5_terminal_group_uses_one_transaction_and_one_manifest_switch(
monkeypatch, tmp_path
):
controller, contract = _ready_controller(tmp_path, terminal=True)
writes = 0
original = controller._write_manifest
def counted_write():
nonlocal writes
writes += 1
return original()
monkeypatch.setattr(controller, "_write_manifest", counted_write)
controller.commit_group(
(
storage_cases._entry(0, contract),
storage_cases._entry(1, contract),
),
positions=(0, 1),
)
records = controller.manifest["chunks"]
assert writes == 1
assert [record["sequence_index"] for record in records] == [0, 1]
transaction_parts = [
record["filename"].split("-txn-", 1)[1].split("-chunk-", 1)[0]
for record in records
]
assert len(set(transaction_parts)) == 1
def test_r5_terminal_half_is_rejected_before_any_raw_write(tmp_path):
controller, contract = _ready_controller(tmp_path, terminal=True)
with pytest.raises(RunStorageError, match="physical group is incomplete"):
controller.commit_chunk(storage_cases._entry(0, contract), position=0)
assert controller.manifest["chunks"] == []
assert not list((controller.revision_root / "chunks").glob("*.safetensors"))
def test_r5_validates_every_entry_before_writing_group_raw(tmp_path):
controller, contract = _ready_controller(tmp_path, terminal=True)
invalid = dict(storage_cases._entry(1, contract))
invalid.pop("video")
with pytest.raises(SessionValidationError):
controller.commit_group(
(storage_cases._entry(0, contract), invalid), positions=(0, 1)
)
assert controller.manifest["chunks"] == []
assert not list((controller.revision_root / "chunks").glob("*.safetensors"))
def test_r5_second_raw_failure_leaves_only_unreferenced_orphan(
monkeypatch, tmp_path
):
controller, contract = _ready_controller(tmp_path, terminal=True)
original = storage_runtime.save_file
calls = 0
def fail_second(tensors, filename, *, metadata):
nonlocal calls
calls += 1
if calls == 2:
raise RuntimeError("synthetic second raw failure")
return original(tensors, filename, metadata=metadata)
monkeypatch.setattr(storage_runtime, "save_file", fail_second)
with pytest.raises(RuntimeError, match="second raw failure"):
controller.commit_group(
(
storage_cases._entry(0, contract),
storage_cases._entry(1, contract),
),
positions=(0, 1),
)
persisted = json.loads(controller._manifest_path().read_text(encoding="utf-8"))
assert persisted["chunks"] == []
assert controller.manifest["chunks"] == []
assert len(list((controller.revision_root / "chunks").glob("*.safetensors"))) == 1
def test_r5_catchable_manifest_failure_recovers_only_the_complete_group(
monkeypatch, tmp_path
):
controller, contract = _ready_controller(tmp_path, terminal=True)
original = controller._write_manifest
calls = 0
def fail_once():
nonlocal calls
calls += 1
if calls == 1:
raise RuntimeError("synthetic manifest switch failure")
return original()
monkeypatch.setattr(controller, "_write_manifest", fail_once)
with pytest.raises(RuntimeError, match="manifest switch failure"):
with controller:
controller.commit_group(
(
storage_cases._entry(0, contract),
storage_cases._entry(1, contract),
),
positions=(0, 1),
)
persisted = json.loads(controller._manifest_path().read_text(encoding="utf-8"))
assert calls == 2
assert persisted["status"] == "interrupted"
assert [record["sequence_index"] for record in persisted["chunks"]] == [0, 1]
def test_r5_commit_group_does_not_write_the_canonical_project(monkeypatch, tmp_path):
controller, contract = _ready_controller(tmp_path, chunks=1)
project_writes = 0
def unexpected_project_write(*, set_canonical=False):
nonlocal project_writes
project_writes += 1
monkeypatch.setattr(controller, "_write_project", unexpected_project_write)
controller.commit_group(
(storage_cases._entry(0, contract),), positions=(0,)
)
assert project_writes == 0
assert not (controller.run_root / "project.json").exists()
def test_r5_reader_keeps_legacy_chunk_filename_compatibility(tmp_path):
controller, contract = _ready_controller(tmp_path, chunks=1)
controller.commit_group(
(storage_cases._entry(0, contract),), positions=(0,)
)
record = controller.manifest["chunks"][0]
current_path = _raw_path(controller, record)
legacy_path = current_path.with_name("chunk_0001.safetensors")
current_path.replace(legacy_path)
record["filename"] = legacy_path.name
record["file_size"] = legacy_path.stat().st_size
record["file_sha256"] = hashlib.sha256(legacy_path.read_bytes()).hexdigest()
controller._write_manifest()
entries, records = controller._valid_prefix(
controller.manifest,
list(contract["chunk_contract_hashes"]),
current_contract=contract,
)
assert len(entries) == len(records) == 1
assert records[0]["filename"] == "chunk_0001.safetensors"
@pytest.mark.parametrize(
("stage", "expected_records", "expected_raws"),
(
("raw_before", 0, 0),
("raw_mid", 0, 0),
("first_raw_done", 0, 1),
("before_manifest", 0, 2),
("manifest_temp_mid", 0, 2),
("before_replace", 0, 2),
("after_replace", 2, 2),
("after_directory_durability", 2, 2),
),
)
def test_r5_fresh_process_kill_never_exposes_a_partial_terminal_group(
tmp_path, stage, expected_records, expected_raws
):
worker = (
Path(__file__).parent / "helpers" / "r5_process_crash_worker.py"
)
scenario_root = tmp_path / stage
process = subprocess.Popen(
[sys.executable, str(worker), str(scenario_root), stage],
cwd=str(Path(__file__).resolve().parents[1]),
)
signal = scenario_root / "reached.json"
deadline = time.monotonic() + 30
try:
while time.monotonic() < deadline and not signal.exists():
if process.poll() is not None:
raise AssertionError(
f"crash worker exited before {stage}: {process.returncode}"
)
time.sleep(0.05)
assert signal.exists(), f"crash worker did not reach {stage}"
process.terminate()
process.wait(timeout=15)
finally:
if process.poll() is None:
process.kill()
process.wait(timeout=15)
manifest_paths = list((scenario_root / "run" / "revisions").glob("*/manifest.json"))
assert len(manifest_paths) == 1
manifest = json.loads(manifest_paths[0].read_text(encoding="utf-8"))
assert len(manifest["chunks"]) == expected_records
raw_paths = list((manifest_paths[0].parent / "chunks").glob("*.safetensors"))
assert len(raw_paths) == expected_raws
for record in manifest["chunks"]:
raw = manifest_paths[0].parent / "chunks" / record["filename"]
assert raw.is_file()
assert raw.stat().st_size == record["file_size"]
assert hashlib.sha256(raw.read_bytes()).hexdigest() == record["file_sha256"]
@pytest.mark.parametrize(
("stage", "project_exists"),
(
("finalize_manifest_1", False),
("finalize_manifest_2", False),
("project_before_replace", False),
("project_after_replace", True),
),
)
def test_r5_finalize_and_canonical_kill_windows_preserve_fresh_reader_selection(
tmp_path, stage, project_exists
):
worker = Path(__file__).parent / "helpers" / "r5_process_crash_worker.py"
scenario_root = tmp_path / stage
process = subprocess.Popen(
[sys.executable, str(worker), str(scenario_root), stage],
cwd=str(Path(__file__).resolve().parents[1]),
)
signal = scenario_root / "reached.json"
deadline = time.monotonic() + 30
try:
while time.monotonic() < deadline and not signal.exists():
if process.poll() is not None:
raise AssertionError(
f"crash worker exited before {stage}: {process.returncode}"
)
time.sleep(0.05)
assert signal.exists(), f"crash worker did not reach {stage}"
process.terminate()
process.wait(timeout=15)
finally:
if process.poll() is None:
process.kill()
process.wait(timeout=15)
run_root = scenario_root / "run"
project_path = run_root / "project.json"
assert project_path.exists() is project_exists
manifests = list((run_root / "revisions").glob("*/manifest.json"))
assert len(manifests) == 1
manifest = json.loads(manifests[0].read_text(encoding="utf-8"))
assert len(manifest["chunks"]) == 2
fresh = storage_runtime.RunStorageController("phase-d-review")
fresh.run_root = run_root
fresh.revisions_root = run_root / "revisions"
_, catalog, chains = fresh._provenance_catalog()
selected_revision, selected_chain = fresh._canonical_project_selection(
catalog=catalog,
chains=chains,
)
# The R0 fallback selects a complete legacy-style manifest even before its
# provenance and project pointer are published. R5 preserves that exact
# fresh-reader behavior; only commit_group raw publication changes.
assert selected_revision == manifest["revision_id"]
assert selected_chain
@@ -0,0 +1,204 @@
from __future__ import annotations
import ast
from dataclasses import dataclass
from pathlib import Path
import pytest
from ComfyUI_H3_Continuum_Join.v3 import driving_nodes
from ComfyUI_H3_Continuum_Join.v3.node_facade import (
RuntimeOutput,
execute_v38_runtime_request,
make_runtime_request,
)
from ComfyUI_H3_Continuum_Join.v3.resolution import (
H3_SIZE_SOURCE_LEGACY,
H3_SIZE_SOURCE_MANUAL,
)
ROOT = Path(__file__).resolve().parents[1]
@dataclass(frozen=True)
class _Resolution:
width: int = 704
height: int = 1024
actual_mp: float = 0.720896
aspect_source: str = "Manual Width / Height"
warnings: tuple[str, ...] = ()
def _request(*, mode="Off", size_source=H3_SIZE_SOURCE_LEGACY, inputs=None):
return make_runtime_request(
runtime_kwargs={"marker": object()},
fixed_runtime_kwargs={"width": 704, "height": 1024},
resolution=_Resolution(),
size_source=size_source,
diagnostics_mode=mode,
diagnostics_inputs={"chunk_seconds": 5.0, **(inputs or {})},
)
def _append(status, diagnostics, *, mode):
return f"{status}|{mode}|{diagnostics}"
def test_r6_request_freezes_keyword_containers_without_copying_runtime_objects():
marker = object()
request = make_runtime_request(
runtime_kwargs={"marker": marker},
fixed_runtime_kwargs={"width": 704},
resolution=_Resolution(),
size_source=H3_SIZE_SOURCE_LEGACY,
diagnostics_mode="Off",
diagnostics_inputs={"chunk_seconds": 5.0, "reference": marker},
)
assert request.runtime_kwargs["marker"] is marker
assert request.diagnostics_inputs["reference"] is marker
with pytest.raises(TypeError):
request.runtime_kwargs["other"] = object()
with pytest.raises(TypeError):
request.diagnostics_inputs["other"] = object()
def test_r6_request_rejects_duplicate_runtime_keywords():
with pytest.raises(TypeError, match="multiple values"):
make_runtime_request(
runtime_kwargs={"width": 1},
fixed_runtime_kwargs={"width": 704},
resolution=_Resolution(),
size_source=H3_SIZE_SOURCE_LEGACY,
diagnostics_mode="Off",
diagnostics_inputs={},
)
def test_r6_runtime_output_preserves_nonstandard_values_and_tuple_identity():
marker = object()
assert RuntimeOutput(marker).as_public_tuple() is marker
output = (object(), object(), object(), "status", object())
request = _request()
result = execute_v38_runtime_request(
request,
runtime_adapter=lambda **kwargs: output,
legacy_size_source=H3_SIZE_SOURCE_LEGACY,
diagnostics_off="Off",
diagnostics_full="Detailed Report",
reference_video_size_default="Efficient",
build_diagnostics=lambda **kwargs: pytest.fail("must not run"),
append_status=_append,
)
assert result is output
def test_r6_facade_decorates_status_only_after_existing_runtime_returns():
video, audio, plan, tail = object(), object(), object(), object()
output = (video, audio, plan, "base", tail)
seen = {}
request = _request(
mode="Basic",
size_source=H3_SIZE_SOURCE_MANUAL,
inputs={
"reference_image_1": "image-1",
"reference_size": "Match Output",
"reference_video_1": "guide",
"guide": "still",
},
)
def build(**kwargs):
seen.update(kwargs)
return "diagnostics"
result = execute_v38_runtime_request(
request,
runtime_adapter=lambda **kwargs: output,
legacy_size_source=H3_SIZE_SOURCE_LEGACY,
diagnostics_off="Off",
diagnostics_full="Detailed Report",
reference_video_size_default="Efficient",
build_diagnostics=build,
append_status=_append,
)
assert result[:3] == output[:3]
assert result[4] is tail
assert "Resolution: 704 x 1024 (0.72 MP)" in result[3]
assert result[3].endswith("|Basic|diagnostics")
assert seen["video_latents"] is video
assert seen["audio_latents"] is audio
assert seen["assembly_plan"] is plan
assert seen["reference_images"] == ("image-1", None, None)
assert seen["still_guide_active"] is True
def test_r6_diagnostic_failure_keeps_runtime_payloads_and_returns_status_warning():
payload = (object(), object(), object(), "base", object())
result = execute_v38_runtime_request(
_request(mode="Detailed Report"),
runtime_adapter=lambda **kwargs: payload,
legacy_size_source=H3_SIZE_SOURCE_LEGACY,
diagnostics_off="Off",
diagnostics_full="Detailed Report",
reference_video_size_default="Efficient",
build_diagnostics=lambda **kwargs: (_ for _ in ()).throw(RuntimeError("bad")),
append_status=_append,
)
assert result[:3] == payload[:3]
assert result[4] is payload[4]
assert "generation result was preserved" in result[3]
assert "RuntimeError: bad" in result[3]
def test_r6_v38_node_builds_one_request_then_delegates_to_existing_runtime_adapter(monkeypatch):
captured = {}
def facade(request, **kwargs):
captured["request"] = request
captured["adapter"] = kwargs["runtime_adapter"]
return "facade-result"
monkeypatch.setattr(driving_nodes, "execute_v38_runtime_request", facade)
result = driving_nodes.H3ContinuumSamplerV38().run(
chunk_seconds=5.0,
size_source=H3_SIZE_SOURCE_MANUAL,
width=704,
height=1024,
project_id="stable-project",
)
request = captured["request"]
assert result == "facade-result"
assert request.runtime_kwargs["width"] == 704
assert request.runtime_kwargs["height"] == 1024
assert request.runtime_kwargs["project_id"] == "stable-project"
assert request.runtime_kwargs["reference_encode_cache"] is True
assert "size_source" not in request.runtime_kwargs
assert callable(captured["adapter"])
def test_r6_facade_module_has_no_runtime_owner_imports():
tree = ast.parse((ROOT / "v3" / "node_facade.py").read_text(encoding="utf-8"))
imported = set()
for node in ast.walk(tree):
if isinstance(node, ast.Import):
imported.update(alias.name for alias in node.names)
elif isinstance(node, ast.ImportFrom) and node.module:
imported.add(node.module)
forbidden = {
"torch",
"run_storage",
"runtime_coordinator",
"execution_planner",
"sampling_engine",
}
assert not any(
name == forbidden_name or name.endswith(f".{forbidden_name}")
for name in imported
for forbidden_name in forbidden
)
+1 -1
View File
@@ -145,4 +145,4 @@ def test_v217_result_pack_expands_legacy_outputs():
def test_v217_has_no_frontend_display_controller(): def test_v217_has_no_frontend_display_controller():
assert not (ROOT / "web" / "h3_continuum_v2.js").exists() assert not (ROOT / "web" / "h3_continuum_v2.js").exists()
version_source = (ROOT / "version.py").read_text(encoding="utf-8") version_source = (ROOT / "version.py").read_text(encoding="utf-8")
assert 'PACKAGE_VERSION = "3.8.0"' in version_source assert 'PACKAGE_VERSION = "3.8.1"' in version_source
-13
View File
@@ -1,6 +1,3 @@
import json
from pathlib import Path
from ComfyUI_H3_Continuum_Join.constants import DIAGNOSTICS_BASIC from ComfyUI_H3_Continuum_Join.constants import DIAGNOSTICS_BASIC
from ComfyUI_H3_Continuum_Join.v2.nodes import _repair_v200_example_widget_shift from ComfyUI_H3_Continuum_Join.v2.nodes import _repair_v200_example_widget_shift
@@ -29,13 +26,3 @@ def test_valid_v2_widget_values_are_unchanged():
debug=True, debug=True,
) )
assert values == (False, False, DIAGNOSTICS_BASIC, 2, 7, True, True) assert values == (False, False, DIAGNOSTICS_BASIC, 2, 7, True, True)
def test_bundled_v2_example_serializes_control_after_generate_slot():
root = Path(__file__).resolve().parents[1]
data = json.loads((root / "examples" / "H3_Continuum_V2_3x5s.json").read_text(encoding="utf-8"))
node = next(n for n in data["nodes"] if n["type"] == "H3ContinuumSamplerV2")
values = node["widgets_values"]
assert len(values) == 16
assert values[8] in {"fixed", "increment", "decrement", "randomize"}
assert values[11] in {"Basic", "Full", "Off"}
+25 -19
View File
@@ -109,11 +109,14 @@ def test_three_chunks_are_committed_to_distinct_files(tmp_path):
controller.commit_chunk(entry, position=position) controller.commit_chunk(entry, position=position)
chunks_root = controller.revision_root / "chunks" chunks_root = controller.revision_root / "chunks"
assert [path.name for path in sorted(chunks_root.glob("*.safetensors"))] == [ raw_names = [path.name for path in chunks_root.glob("*.safetensors")]
"chunk_0001.safetensors", assert len(raw_names) == 3
"chunk_0002.safetensors", assert all(name.startswith("rev-revision-test-txn-") for name in raw_names)
"chunk_0003.safetensors", assert sorted(name.rsplit("-", 2)[-2] for name in raw_names) == [
] "chunk",
"chunk",
"chunk",
]
records = controller.manifest["chunks"] records = controller.manifest["chunks"]
assert [record["sequence_index"] for record in records] == [0, 1, 2] assert [record["sequence_index"] for record in records] == [0, 1, 2]
assert [record["entry"]["sequence_index"] for record in records] == [0, 1, 2] assert [record["entry"]["sequence_index"] for record in records] == [0, 1, 2]
@@ -121,11 +124,14 @@ def test_three_chunks_are_committed_to_distinct_files(tmp_path):
assert [entry["sequence_index"] for entry in source_entries] == [0, 0, 0] assert [entry["sequence_index"] for entry in source_entries] == [0, 0, 0]
persisted = json.loads(controller._manifest_path().read_text(encoding="utf-8")) persisted = json.loads(controller._manifest_path().read_text(encoding="utf-8"))
assert [record["filename"] for record in persisted["chunks"]] == [ assert [record["filename"] for record in persisted["chunks"]] == [
"chunk_0001.safetensors", record["filename"] for record in records
"chunk_0002.safetensors", ]
"chunk_0003.safetensors", assert [name[-22:] for name in (record["filename"] for record in records)] == [
] "chunk-0001.safetensors",
"chunk-0002.safetensors",
"chunk-0003.safetensors",
]
def test_interrupted_fixed_prompt_run_resumes_the_correct_prefix(tmp_path): def test_interrupted_fixed_prompt_run_resumes_the_correct_prefix(tmp_path):
@@ -139,17 +145,17 @@ def test_interrupted_fixed_prompt_run_resumes_the_correct_prefix(tmp_path):
assert [entry["seed"] for entry in entries] == [100, 101] assert [entry["seed"] for entry in entries] == [100, 101]
assert [entry["clip_index"] for entry in entries] == [1, 2] assert [entry["clip_index"] for entry in entries] == [1, 2]
assert [record["filename"] for record in records] == [ assert [record["filename"][-22:] for record in records] == [
"chunk_0001.safetensors", "chunk-0001.safetensors",
"chunk_0002.safetensors", "chunk-0002.safetensors",
] ]
resumed.commit_chunk(_entry(2), position=2) resumed.commit_chunk(_entry(2), position=2)
assert [record["filename"] for record in resumed.manifest["chunks"]] == [ assert [record["filename"][-22:] for record in resumed.manifest["chunks"]] == [
"chunk_0001.safetensors", "chunk-0001.safetensors",
"chunk_0002.safetensors", "chunk-0002.safetensors",
"chunk_0003.safetensors", "chunk-0003.safetensors",
] ]
def test_fsync_file_accepts_a_completed_file_on_windows(tmp_path): def test_fsync_file_accepts_a_completed_file_on_windows(tmp_path):
+3 -49
View File
@@ -1,23 +1,14 @@
from __future__ import annotations from __future__ import annotations
import json import shutil
import shutil import subprocess
import subprocess
from pathlib import Path from pathlib import Path
ROOT = Path(__file__).resolve().parents[1] ROOT = Path(__file__).resolve().parents[1]
PROJECT_ID_JS = ROOT / "web" / "project_id.js" PROJECT_ID_JS = ROOT / "web" / "project_id.js"
REFERENCE_AUDIO_UI_JS = ROOT / "web" / "reference_audio_ui.js" REFERENCE_AUDIO_UI_JS = ROOT / "web" / "reference_audio_ui.js"
BRIDGE_WORKFLOW = ( def test_v35_keeps_reference_audio_inputs_permanent_after_node_setup():
ROOT
/ "examples"
/ "workflows"
/ "MiniMax_H3_Continuum_V351_LBH_Conditioning_Bridge.json"
)
def test_v35_keeps_reference_audio_inputs_permanent_after_node_setup():
project_source = PROJECT_ID_JS.read_text(encoding="utf-8") project_source = PROJECT_ID_JS.read_text(encoding="utf-8")
reference_source = REFERENCE_AUDIO_UI_JS.read_text(encoding="utf-8") reference_source = REFERENCE_AUDIO_UI_JS.read_text(encoding="utf-8")
@@ -173,40 +164,3 @@ assert.deepEqual(
check=False, check=False,
) )
assert result.returncode == 0, result.stdout + result.stderr assert result.returncode == 0, result.stdout + result.stderr
def test_bundled_bridge_workflow_has_permanent_sockets_and_aligned_widgets():
workflow = json.loads(BRIDGE_WORKFLOW.read_text(encoding="utf-8"))
sampler = next(
node for node in workflow["nodes"] if node["type"] == "H3ContinuumSamplerV35"
)
expected = {
"prompt_mode": "Auto",
"chunks": 1,
"chunk_seconds": 5,
"width": 1344,
"height": 768,
"continuity": "Fast — 5 frames",
"base_seed": 783839598838387,
"control_after_generate": "randomize",
"audio_continuity": True,
"diagnostics": "Detailed Report",
"reroll_from_chunk": "Auto",
"reroll_nonce": 0,
"strict_compatibility": False,
"debug": False,
"show_preview": True,
"run_storage": "Off",
"run_name": "",
"reference_size": "Match Output",
"project_id": "d1c61168-c72e-44d1-9b78-1c9adb4eba0e",
"video_reference_size": "Efficient - 0.4 MP",
}
assert sampler["widgets_values"] == list(expected.values())
assert sampler["widgets_values_named"] == expected
input_names = [input_["name"] for input_ in sampler["inputs"]]
assert input_names[input_names.index("audio_vae") + 1 : input_names.index("width")] == [
"reference_audio_1",
"reference_audio_vae",
]
+4 -4
View File
@@ -404,7 +404,7 @@ def test_masked_av_preserves_image_and_audio_refs_in_terminal_groups(monkeypatch
assert [ref["kind"] for ref in refs] == ["image", "audio"] assert [ref["kind"] for ref in refs] == ["image", "audio"]
def test_reused_session_returns_incomplete_context_without_stopping(monkeypatch): def test_reused_session_reconstructs_complete_context_without_stopping(monkeypatch):
first_outputs = _capture_sequence(monkeypatch, terminal=False) first_outputs = _capture_sequence(monkeypatch, terminal=False)
reused_outputs = _capture_sequence( reused_outputs = _capture_sequence(
monkeypatch, monkeypatch,
@@ -412,10 +412,10 @@ def test_reused_session_returns_incomplete_context_without_stopping(monkeypatch)
session=first_outputs[2], session=first_outputs[2],
) )
context = reused_outputs[4] context = reused_outputs[4]
assert context["complete"] is False assert context["complete"] is True
assert context["groups"] == () assert [group["logical_chunks"] for group in context["groups"]] == [(1,), (2,)]
assert len(reused_outputs[0]) == 2 assert len(reused_outputs[0]) == 2
assert any("Run Storage" in note for note in context["notes"]) assert context["notes"] == first_outputs[4]["notes"]
def test_v35_full_memory_events_follow_physical_terminal_group_order(monkeypatch): def test_v35_full_memory_events_follow_physical_terminal_group_order(monkeypatch):
-32
View File
@@ -1,8 +1,5 @@
from __future__ import annotations from __future__ import annotations
import json
from pathlib import Path
import pytest import pytest
from ComfyUI_H3_Continuum_Join import nodes as root_nodes from ComfyUI_H3_Continuum_Join import nodes as root_nodes
@@ -28,9 +25,6 @@ from ComfyUI_H3_Continuum_Join.constants import (
from ComfyUI_H3_Continuum_Join.v3.nodes import H3ContinuumSamplerProduction from ComfyUI_H3_Continuum_Join.v3.nodes import H3ContinuumSamplerProduction
ROOT = Path(__file__).resolve().parents[1]
def test_v36_is_registered_without_replacing_v35(): def test_v36_is_registered_without_replacing_v35():
assert NODE_CLASS_MAPPINGS["H3ContinuumSamplerV36"] is H3ContinuumSamplerV36 assert NODE_CLASS_MAPPINGS["H3ContinuumSamplerV36"] is H3ContinuumSamplerV36
assert NODE_DISPLAY_NAME_MAPPINGS["H3ContinuumSamplerV36"] == ( assert NODE_DISPLAY_NAME_MAPPINGS["H3ContinuumSamplerV36"] == (
@@ -189,29 +183,3 @@ def test_v36_non_balanced_fallback_uses_legacy_reference_revision_identity():
assert reference_identity == base_identity assert reference_identity == base_identity
assert masked_identity != reference_identity assert masked_identity != reference_identity
def test_v36_template_uses_standard_backend_and_v35_template_is_unchanged():
v36 = json.loads(
(ROOT / "examples/workflows/MiniMax_H3_Continuum_V36.json").read_text(
encoding="utf-8"
)
)
v35 = json.loads(
(ROOT / "examples/workflows/MiniMax_H3_Continuum_V35.json").read_text(
encoding="utf-8"
)
)
v36_sampler = next(node for node in v36["nodes"] if node["id"] == 305)
v35_sampler = next(node for node in v35["nodes"] if node["id"] == 305)
assert v36_sampler["type"] == "H3ContinuumSamplerV36"
assert v36_sampler["properties"]["Node name for S&R"] == (
"H3ContinuumSamplerV36"
)
assert v36_sampler["widgets_values"][-1] == CONTINUATION_BACKEND_STANDARD
assert v36_sampler["widgets_values_named"]["continuation_backend"] == (
CONTINUATION_BACKEND_STANDARD
)
assert v35_sampler["type"] == "H3ContinuumSamplerV35"
assert "continuation_backend" not in v35_sampler["widgets_values_named"]
-40
View File
@@ -1,40 +0,0 @@
from __future__ import annotations
import copy
import json
import zipfile
from pathlib import Path
ROOT = Path(__file__).resolve().parents[1]
WORKFLOW_DIR = ROOT / "examples" / "workflows"
V36_PATH = WORKFLOW_DIR / "MiniMax_H3_Continuum_V36.json"
V37_PATH = WORKFLOW_DIR / "MiniMax_H3_Continuum_V37.json"
V37_ZIP_PATH = WORKFLOW_DIR / "MiniMax_H3_Continuum_V37.zip"
def _load(path: Path) -> dict:
return json.loads(path.read_text(encoding="utf-8"))
def test_v37_template_is_the_v36_graph_with_only_the_sampler_class_replaced():
v36 = _load(V36_PATH)
v37 = _load(V37_PATH)
sampler = next(node for node in v37["nodes"] if node["id"] == 305)
assert sampler["type"] == "H3ContinuumSamplerV37"
assert sampler["properties"]["Node name for S&R"] == "H3ContinuumSamplerV37"
assert sampler["widgets_values_named"]["continuation_backend"] == "Standard"
assert all(input_["name"] != "guide" for input_ in sampler["inputs"])
normalized = copy.deepcopy(v37)
normalized_sampler = next(node for node in normalized["nodes"] if node["id"] == 305)
normalized_sampler["type"] = "H3ContinuumSamplerV36"
normalized_sampler["properties"]["Node name for S&R"] = "H3ContinuumSamplerV36"
assert normalized == v36
def test_v37_zip_contains_the_exact_public_workflow_json():
with zipfile.ZipFile(V37_ZIP_PATH) as archive:
assert archive.namelist() == [V37_PATH.name]
assert archive.read(V37_PATH.name) == V37_PATH.read_bytes()
+1 -1
View File
@@ -6,6 +6,6 @@ def test_completed_review_lifecycle_with_real_frontend(review_queue_results):
"same completed revision reuse exits setup without new Sampling", "same completed revision reuse exits setup without new Sampling",
"three review queues advance without any executed events", "three review queues advance without any executed events",
"settings edited during execution remain out of date after readback", "settings edited during execution remain out of date after readback",
"same setup request is not mutated by legacy preparation then API preparation", "queue adapter owns setup preparation without mutating the caller payload",
): ):
assert review_queue_results[case]["pass"] assert review_queue_results[case]["pass"]
-214
View File
@@ -1,214 +0,0 @@
from __future__ import annotations
import json
from pathlib import Path
ROOT = Path(__file__).resolve().parents[1]
WORKFLOW_PATH = (
ROOT / "examples" / "workflows" / "MiniMax_H3_Continuum_Easy_V38.json"
)
def _workflow() -> dict:
return json.loads(WORKFLOW_PATH.read_text(encoding="utf-8"))
def _one_node(workflow: dict, node_type: str) -> dict:
values = [node for node in workflow["nodes"] if node["type"] == node_type]
assert len(values) == 1
return values[0]
def _link_map(workflow: dict) -> dict[int, list]:
return {int(link[0]): link for link in workflow["links"]}
FORBIDDEN_MINIMAL_MARKERS = (
"power lora loader",
"rgthree",
"easy cleangpuused",
"spectrum",
"hires",
"hi-res",
"second pass",
"secondpass",
"upscale",
"minimaxchunkfeedforward",
"sageattention",
)
def test_v38_easy_public_workflow_uses_the_approved_default_contract():
workflow = _workflow()
easy = _one_node(workflow, "H3ContinuumEasyV38")
helper = _one_node(workflow, "H3ContinuumEasyReferences")
assert easy["widgets_values"][:10] == [
"",
10,
0,
"randomize",
"Randomize",
"Auto from First Image",
"Draft — 0.30 MP",
0.3,
"Off",
"",
]
easy_widget_names = [
"prompt_text",
"duration",
"seed",
"control_after_generate",
"seed_mode",
"aspect",
"preset",
"custom_mp",
"run_storage",
"run_name",
"project_id",
]
assert easy["widgets_values"] == [
easy["widgets_values_named"][name] for name in easy_widget_names
]
assert [item["name"] for item in easy["inputs"]] == [
"model",
"clip",
"video_vae",
"sampler",
"sigmas",
"first_frame",
"last_frame",
"references",
"driving_audio",
"audio_vae",
"prompt_text",
]
assert helper["outputs"][0]["type"] == "H3_CONTINUUM_EASY_REFERENCES"
assert [item["name"] for item in helper["inputs"]] == [
"reference_image_1",
"reference_image_2",
"reference_image_3",
]
assert not {
"reference_audio_1",
"reference_video_1",
"timeline_video",
"guide",
} & {item["name"] for item in easy["inputs"]}
assert len(workflow["nodes"]) == 20
assert len([node for node in workflow["nodes"] if node["type"] == "H3EasyLoadImage"]) == 5
audio_loader = _one_node(workflow, "H3EasyLoadAudio")
assert int(audio_loader["mode"]) == 4
assert audio_loader.get("title", "") == ""
assert [output["type"] for output in audio_loader["outputs"]] == ["AUDIO"]
assert not [node for node in workflow["nodes"] if node["type"] == "LoadImage"]
assert workflow["extra"] == {
"frontendVersion": "1.49.6",
"ds": workflow["extra"]["ds"],
}
def test_v38_easy_public_workflow_is_strict_minimal():
workflow = _workflow()
node_types = [str(node["type"]) for node in workflow["nodes"]]
searchable = "\n".join(node_types).lower()
assert not [marker for marker in FORBIDDEN_MINIMAL_MARKERS if marker in searchable]
assert not [
node
for node in workflow["nodes"]
if node.get("properties", {}).get("cnr_id")
not in {None, "", "comfy-core"}
]
assert "PreviewAny" not in node_types
assert "MarkdownNote" not in node_types
scheduler = _one_node(workflow, "BasicScheduler")
assert scheduler["widgets_values_named"] == {
"scheduler": "simple",
"steps": 20,
"denoise": 1,
}
def test_v38_easy_public_workflow_defaults_to_t2va_with_optional_hybrids():
workflow = _workflow()
nodes = {int(node["id"]): node for node in workflow["nodes"]}
links = _link_map(workflow)
easy = _one_node(workflow, "H3ContinuumEasyV38")
helper = _one_node(workflow, "H3ContinuumEasyReferences")
helper_inputs = {item["name"]: item for item in helper["inputs"]}
source_modes = {}
for name, input_ in helper_inputs.items():
link = links[int(input_["link"])]
source_modes[name] = int(nodes[int(link[1])]["mode"])
assert source_modes == {
"reference_image_1": 4,
"reference_image_2": 4,
"reference_image_3": 4,
}
easy_inputs = {item["name"]: item for item in easy["inputs"]}
first_source = nodes[int(links[int(easy_inputs["first_frame"]["link"])][1])]
last_source = nodes[int(links[int(easy_inputs["last_frame"]["link"])][1])]
assert int(first_source["mode"]) == 4
assert int(last_source["mode"]) == 4
assert links[int(easy_inputs["references"]["link"])][1] == helper["id"]
prompt_link = links[int(easy_inputs["prompt_text"]["link"])]
prompt_node = nodes[int(prompt_link[1])]
assert "<Picture" not in prompt_node["widgets_values"][0]
def test_v38_easy_public_workflow_keeps_core_display_titles_standard():
workflow = _workflow()
core_nodes = [
node
for node in workflow["nodes"]
if node.get("properties", {}).get("cnr_id") == "comfy-core"
]
assert core_nodes
assert all(not node.get("title") for node in core_nodes)
def test_v38_easy_public_workflow_links_are_closed_and_unique():
workflow = _workflow()
nodes = {int(node["id"]) for node in workflow["nodes"]}
links = _link_map(workflow)
assert len(links) == len(workflow["links"])
for link_id, link in links.items():
assert int(link[0]) == link_id
assert int(link[1]) in nodes
assert int(link[3]) in nodes
for node in workflow["nodes"]:
for input_ in node.get("inputs", []):
if input_.get("link") is not None:
assert int(input_["link"]) in links
for output in node.get("outputs", []):
for link_id in output.get("links") or []:
assert int(link_id) in links
assert json.loads(json.dumps(workflow, ensure_ascii=False)) == workflow
assert len({int(node["id"]) for node in workflow["nodes"]}) == len(
workflow["nodes"]
)
def test_easy_image_loaders_use_native_modes_without_custom_titles():
workflow = _workflow()
loaders = {
int(node["id"]): node
for node in workflow["nodes"]
if node["type"] == "H3EasyLoadImage"
}
assert {node_id: int(node["mode"]) for node_id, node in loaders.items()} == {
114: 4,
290: 4,
258: 4,
257: 4,
264: 4,
}
for node in loaders.values():
assert node.get("title", "") == ""
assert node["properties"] == {"Node name for S&R": "H3EasyLoadImage"}
assert [output["type"] for output in node["outputs"]] == ["IMAGE", "MASK"]
+5 -5
View File
@@ -123,12 +123,12 @@ def test_registry_package_keeps_one_workflow_and_excludes_development_assets():
assert "examples/*" in rules assert "examples/*" in rules
assert "!examples/workflows/" in rules assert "!examples/workflows/" in rules
assert "examples/workflows/*" in rules assert "examples/workflows/*" in rules
assert "!examples/workflows/MiniMax_H3_Continuum_V38.json" in rules assert "!examples/workflows/MiniMax_H3_Continuum_V38x.json" in rules
assert "!examples/workflows/MiniMax_H3_Continuum_V38.zip" in rules assert "!examples/workflows/MiniMax_H3_Continuum_V38x.zip" in rules
assert "*.zip" in rules assert "*.zip" in rules
workflow = json.loads( workflow = json.loads(
(ROOT / "examples/workflows/MiniMax_H3_Continuum_V38.json").read_text( (ROOT / "examples/workflows/MiniMax_H3_Continuum_V38x.json").read_text(
encoding="utf-8" encoding="utf-8"
) )
) )
@@ -170,8 +170,8 @@ def test_registry_manifest_matches_every_declared_source_file():
assert { assert {
path for path in entries if path.startswith("examples/") path for path in entries if path.startswith("examples/")
} == { } == {
"examples/workflows/MiniMax_H3_Continuum_V38.json", "examples/workflows/MiniMax_H3_Continuum_V38x.json",
"examples/workflows/MiniMax_H3_Continuum_V38.zip", "examples/workflows/MiniMax_H3_Continuum_V38x.zip",
} }
for relative_path, expected_digest in entries.items(): for relative_path, expected_digest in entries.items():
+22 -24
View File
@@ -7,16 +7,16 @@ from zipfile import ZipFile
ROOT = Path(__file__).resolve().parents[1] ROOT = Path(__file__).resolve().parents[1]
WORKFLOW_PATH = ROOT / "examples" / "workflows" / "MiniMax_H3_Continuum_V38.json" WORKFLOW_PATH = ROOT / "examples" / "workflows" / "MiniMax_H3_Continuum_V38x.json"
# User-approved final distribution. Do not sanitize or reserialize this graph. # User-approved final distribution. Do not sanitize or reserialize this graph.
WORKFLOW_SHA256 = "e490c87e4995930f95c8fffc4c678111d7897e74003e1962b9b4a247ba43f4ac" WORKFLOW_SHA256 = "26bbca92b5f7cac4cbde89290b3f801b7a895df76a07493ca6f65c18d5b1154a"
ZIP_SHA256 = "83d28cc0cd549066962dc21ceae05d2b189fe22391b556887eab2cc1800e1e80" ZIP_SHA256 = "df4e0e355020d2e731932cff86a4b00932b4f193ec7ed513be0db994ec0e71bb"
ZIP_WORKFLOW_NAME = "MiniMax_H3_Continuum_V38x.json"
EXTERNAL_PACKAGES = { EXTERNAL_PACKAGES = {
"comfyui-spectrum-minimax-h3", "comfyui-spectrum-minimax-h3",
"rgthree-comfy", "rgthree-comfy",
"comfyui-kjnodes", "comfyui-kjnodes",
"comfyui-easy-use",
} }
@@ -53,8 +53,8 @@ def _graph(workflow: dict) -> tuple[dict[int, dict], dict[int, list]]:
def test_v38_public_workflow_declares_external_dependencies_and_is_reloadable(): def test_v38_public_workflow_declares_external_dependencies_and_is_reloadable():
workflow = _workflow() workflow = _workflow()
assert len(workflow["nodes"]) == 32 assert len(workflow["nodes"]) == 30
assert len(workflow["links"]) == 38 assert len(workflow["links"]) == 36
packages = { packages = {
node.get("properties", {}).get("cnr_id") for node in workflow["nodes"] node.get("properties", {}).get("cnr_id") for node in workflow["nodes"]
} - {None, "", "comfy-core"} } - {None, "", "comfy-core"}
@@ -62,7 +62,7 @@ def test_v38_public_workflow_declares_external_dependencies_and_is_reloadable():
node_types = {node["type"] for node in workflow["nodes"]} node_types = {node["type"] for node in workflow["nodes"]}
assert { assert {
"SpectrumApplyMiniMaxH3", "Power Lora Loader (rgthree)", "SpectrumApplyMiniMaxH3", "Power Lora Loader (rgthree)",
"Fast Groups Bypasser (rgthree)", "easy cleanGpuUsed", "Fast Groups Bypasser (rgthree)",
"MiniMaxH3MemoryEfficientSageAttentionPatch", "MiniMaxH3MemoryEfficientSageAttentionPatch",
} <= node_types } <= node_types
assert not any("hires" in name.lower() for name in node_types) assert not any("hires" in name.lower() for name in node_types)
@@ -78,9 +78,9 @@ def test_v38_public_workflow_and_zip_preserve_supplied_bytes():
assert hashlib.sha256(payload).hexdigest() == WORKFLOW_SHA256 assert hashlib.sha256(payload).hexdigest() == WORKFLOW_SHA256
assert hashlib.sha256(archive_path.read_bytes()).hexdigest() == ZIP_SHA256 assert hashlib.sha256(archive_path.read_bytes()).hexdigest() == ZIP_SHA256
with ZipFile(archive_path) as archive: with ZipFile(archive_path) as archive:
assert archive.namelist() == [WORKFLOW_PATH.name] assert archive.namelist() == [ZIP_WORKFLOW_NAME]
assert archive.testzip() is None assert archive.testzip() is None
assert archive.read(WORKFLOW_PATH.name) == payload assert archive.read(ZIP_WORKFLOW_NAME) == payload
def test_v38_public_workflow_preserves_sampler_widget_positions(): def test_v38_public_workflow_preserves_sampler_widget_positions():
@@ -128,11 +128,11 @@ def test_v38_public_workflow_preserves_sampler_widget_positions():
assert sampler["widgets_values_named"]["aspect"] == "Auto from First Image" assert sampler["widgets_values_named"]["aspect"] == "Auto from First Image"
assert sampler["widgets_values_named"]["preset"] == "Draft — 0.30 MP" assert sampler["widgets_values_named"]["preset"] == "Draft — 0.30 MP"
assert sampler["widgets_values_named"]["size_source"] == "First Image" assert sampler["widgets_values_named"]["size_source"] == "First Image"
assert sampler["widgets_values_named"]["width"] == 640 assert sampler["widgets_values_named"]["width"] == 448
assert sampler["widgets_values_named"]["height"] == 640 assert sampler["widgets_values_named"]["height"] == 672
assert sampler["widgets_values_named"]["chunks"] == 2 assert sampler["widgets_values_named"]["chunks"] == 1
assert sampler["widgets_values_named"]["chunk_seconds"] == 5 assert sampler["widgets_values_named"]["chunk_seconds"] == 10
assert sampler["widgets_values_named"]["control_after_generate"] == "fixed" assert sampler["widgets_values_named"]["control_after_generate"] == "randomize"
assert sampler["widgets_values_named"]["continuation_backend"] == "Standard" assert sampler["widgets_values_named"]["continuation_backend"] == "Standard"
@@ -167,18 +167,18 @@ def test_v38_public_workflow_keeps_required_and_optional_connections():
assert source_types["sampler"] == "KSamplerSelect" assert source_types["sampler"] == "KSamplerSelect"
assert source_types["sigmas"] == "BasicScheduler" assert source_types["sigmas"] == "BasicScheduler"
assert source_types["sequence_prompt"] == "PrimitiveStringMultiline" assert source_types["sequence_prompt"] == "PrimitiveStringMultiline"
assert source_types["first_frame"] == "easy cleanGpuUsed" assert source_types["first_frame"] == "H3EasyLoadImage"
assert source_modes["first_frame"] == 0 assert source_modes["first_frame"] == 0
assert source_modes["last_frame"] == 4 assert source_modes["last_frame"] == 4
assert source_modes["reference_image_1"] == 0 assert source_modes["reference_image_1"] == 4
assert source_modes["reference_image_2"] == 0 assert source_modes["reference_image_2"] == 4
assert source_modes["reference_image_3"] == 0 assert source_modes["reference_image_3"] == 4
assert source_modes["driving_audio"] == 4 assert source_modes["driving_audio"] == 4
assert source_modes["reference_video_1"] == 4 assert source_modes["reference_video_1"] == 4
assert source_types["audio_references"] == "H3ContinuumReferenceAudios" assert source_types["audio_references"] == "H3ContinuumReferenceAudios"
def test_v38_public_workflow_preserves_spectrum_default_and_model_chain(): def test_v38_public_workflow_preserves_accelerator_defaults_and_model_chain():
workflow = _workflow() workflow = _workflow()
nodes, links = _graph(workflow) nodes, links = _graph(workflow)
@@ -189,7 +189,7 @@ def test_v38_public_workflow_preserves_spectrum_default_and_model_chain():
sampler = _one_node(workflow, "H3ContinuumSamplerV38") sampler = _one_node(workflow, "H3ContinuumSamplerV38")
spectrum = source(sampler, "model") spectrum = source(sampler, "model")
assert spectrum["type"] == "SpectrumApplyMiniMaxH3" assert spectrum["type"] == "SpectrumApplyMiniMaxH3"
assert spectrum["widgets_values"][0] is True assert spectrum["widgets_values"][0] is False
lora = source(spectrum, "model") lora = source(spectrum, "model")
assert lora["type"] == "Power Lora Loader (rgthree)" assert lora["type"] == "Power Lora Loader (rgthree)"
loras = [item for item in lora["widgets_values"] if isinstance(item, dict) and "lora" in item] loras = [item for item in lora["widgets_values"] if isinstance(item, dict) and "lora" in item]
@@ -208,11 +208,9 @@ def test_v38_public_workflow_keeps_decode_finalize_create_save_chain():
workflow = _workflow() workflow = _workflow()
nodes, links = _graph(workflow) nodes, links = _graph(workflow)
save = _one_node(workflow, "SaveVideo") save = _one_node(workflow, "SaveVideo")
cleanup = nodes[links[int(save["inputs"][0]["link"])][1]] create_link = links[int(save["inputs"][0]["link"])]
assert cleanup["type"] == "easy cleanGpuUsed"
create_link = links[int(cleanup["inputs"][0]["link"])]
assert nodes[int(create_link[1])]["type"] == "CreateVideo"
create = nodes[int(create_link[1])] create = nodes[int(create_link[1])]
assert create["type"] == "CreateVideo"
assert all(item["link"] is not None for item in create["inputs"][:2]) assert all(item["link"] is not None for item in create["inputs"][:2])
finalize = _one_node(workflow, "H3ContinuumAssembleSeamV35") finalize = _one_node(workflow, "H3ContinuumAssembleSeamV35")
assert [links[item["link"]][1] for item in create["inputs"][:2]] == [finalize["id"]] * 2 assert [links[item["link"]][1] for item in create["inputs"][:2]] == [finalize["id"]] * 2
+7 -7
View File
@@ -475,18 +475,18 @@ def test_cache_flag_is_not_part_of_run_storage_or_public_workflow_identity():
encoding="utf-8" encoding="utf-8"
) )
assert "reference_encode_cache" not in ( assert "reference_encode_cache" not in (
ROOT / "examples" / "workflows" / "MiniMax_H3_Continuum_V38.json" ROOT / "examples" / "workflows" / "MiniMax_H3_Continuum_V38x.json"
).read_text(encoding="utf-8") ).read_text(encoding="utf-8")
def test_full_reuse_skips_cache_and_partial_regenerate_enters_cached_encode_stage(): def test_encode_stage_is_required_for_new_groups_or_refine_context_reconstruction():
source = (ROOT / "v2" / "sequence.py").read_text(encoding="utf-8") source = (ROOT / "v2" / "sequence.py").read_text(encoding="utf-8")
partial_regenerate_guard = source.index("if len(preserved)<chunks:") planner = source.index("execution_plan=build_execution_plan(")
partial_regenerate_guard = source.index("if len(preserved)<chunks or capture_refine_context:")
image = source.index("encode_reference_latents_cached", partial_regenerate_guard) image = source.index("encode_reference_latents_cached", partial_regenerate_guard)
audio = source.index("encode_reference_audio_input", partial_regenerate_guard) audio = source.index("encode_reference_audio_input", partial_regenerate_guard)
video = source.index("encode_reference_video_cached", partial_regenerate_guard) video = source.index("encode_reference_video_cached", partial_regenerate_guard)
entries = source.index("entries=preserved[:]", partial_regenerate_guard)
assert partial_regenerate_guard < image < entries assert planner < partial_regenerate_guard < image
assert partial_regenerate_guard < audio < entries assert planner < partial_regenerate_guard < audio
assert partial_regenerate_guard < video < entries assert planner < partial_regenerate_guard < video
+51 -6
View File
@@ -23,6 +23,7 @@ from ComfyUI_H3_Continuum_Join.v3.driving_nodes import (
from ComfyUI_H3_Continuum_Join.v3.nodes import ( from ComfyUI_H3_Continuum_Join.v3.nodes import (
H3ContinuumSamplerProduction, H3ContinuumSamplerProduction,
H3ContinuumSamplerV3, H3ContinuumSamplerV3,
_apply_review_decode_scope,
) )
from ComfyUI_H3_Continuum_Join.v3.plan import prepare_physical_decode_entries from ComfyUI_H3_Continuum_Join.v3.plan import prepare_physical_decode_entries
@@ -502,8 +503,8 @@ class _CommitRecorder:
self.prepare_kwargs = kwargs self.prepare_kwargs = kwargs
return None return None
def commit_chunk(self, entry, *, position): def commit_group(self, entries, *, positions):
self.timeline.append(("commit", position)) self.timeline.append(("commit_group", tuple(positions)))
def mark_review_group(self, *, start, end, physical_group): def mark_review_group(self, *, start, end, physical_group):
self.review_groups.append((start, end, physical_group)) self.review_groups.append((start, end, physical_group))
@@ -562,8 +563,8 @@ def test_normal_group_stops_only_after_commit(monkeypatch):
monkeypatch.setattr(run_storage, "get_active_run_storage", lambda: storage) monkeypatch.setattr(run_storage, "get_active_run_storage", lambda: storage)
entries, _, _, _ = _run_sequence(runtime, chunks=3, limit=1) entries, _, _, _ = _run_sequence(runtime, chunks=3, limit=1)
assert len(entries) == 1 assert len(entries) == 1
assert [event[0] for event in timeline] == ["sample", "commit"] assert [event[0] for event in timeline] == ["sample", "commit_group"]
assert timeline[-1] == ("commit", 0) assert timeline[-1] == ("commit_group", (0,))
assert "max_new_physical_groups" not in storage.prepare_kwargs assert "max_new_physical_groups" not in storage.prepare_kwargs
@@ -589,12 +590,56 @@ def test_terminal_group_counts_once_after_both_logical_commits(monkeypatch):
last_frame=last, last_frame=last,
) )
assert len(entries) == 2 assert len(entries) == 2
assert [event[0] for event in timeline] == ["sample", "commit", "commit"] assert [event[0] for event in timeline] == ["sample", "commit_group"]
assert timeline[-2:] == [("commit", 0), ("commit", 1)] assert timeline[-1] == ("commit_group", (0, 1))
assert "1 new physical group(s) completed; 2/2 logical chunks" in report assert "1 new physical group(s) completed; 2/2 logical chunks" in report
assert "max_new_physical_groups" not in storage.prepare_kwargs assert "max_new_physical_groups" not in storage.prepare_kwargs
def test_terminal_retry_scope_keeps_the_physical_pair_together(monkeypatch):
first = torch.zeros(1, 64, 96, 3)
last = torch.ones(1, 64, 96, 3)
runtime = _install_fake_runtime(
monkeypatch,
first_frame=first,
last_frame=last,
)
outputs = _run_v3_node(
runtime,
chunks=3,
first_frame=first,
last_frame=last,
)
storage = SimpleNamespace(
review_generation_mode="Review Each Chunk",
review_execution=SimpleNamespace(
finish_remaining=False,
next_review_unit_start=2,
next_review_unit_end=3,
partial_review=False,
smart_regenerate=True,
),
)
scoped = _apply_review_decode_scope(
outputs,
storage=storage,
capture_refine_context=False,
configured_chunks=3,
chunk_seconds=5.0,
first_frame=first,
last_frame=last,
timeline_video_source=None,
)
assert len(scoped[0]) == len(scoped[1]) == 1
assert scoped[2]["logical_chunk_count"] == 2
assert scoped[2]["physical_decode_group_count"] == 1
assert scoped[2]["decode_groups"][0]["logical_chunk_indices"] == [2, 3]
assert len(scoped[3]["session"]["chunks"]) == 3
assert scoped[3]["report"].endswith("Decode preview: Chunks 2-3")
def test_partial_refine_context_is_explicitly_incomplete(monkeypatch): def test_partial_refine_context_is_explicitly_incomplete(monkeypatch):
runtime = _install_fake_runtime(monkeypatch) runtime = _install_fake_runtime(monkeypatch)
entries, _, session, report, refine_context = _run_sequence( entries, _, session, report, refine_context = _run_sequence(
+242 -7
View File
@@ -21,12 +21,21 @@ from ComfyUI_H3_Continuum_Join.run_storage import (
from ComfyUI_H3_Continuum_Join.branch_provenance import ( from ComfyUI_H3_Continuum_Join.branch_provenance import (
TAKE_ACTION_CONTINUE, TAKE_ACTION_CONTINUE,
TAKE_ACTION_USE, TAKE_ACTION_USE,
physical_groups,
) )
from ComfyUI_H3_Continuum_Join.state import make_plan from ComfyUI_H3_Continuum_Join.state import make_plan
from ComfyUI_H3_Continuum_Join.v2.seeds import derive_chunk_seed from ComfyUI_H3_Continuum_Join.v2.seeds import derive_chunk_seed
from ComfyUI_H3_Continuum_Join.v2.session import make_chunk_entry from ComfyUI_H3_Continuum_Join.v2.session import make_chunk_entry
from ComfyUI_H3_Continuum_Join.v3.nodes import H3ContinuumSamplerProduction from ComfyUI_H3_Continuum_Join.v3.nodes import (
from ComfyUI_H3_Continuum_Join.v3.nodes import H3ContinuumSamplerV3 H3ContinuumSamplerProduction,
H3ContinuumSamplerV3,
PROJECTION_CURRENT_REVIEW_UNIT,
PROJECTION_FULL_ACCEPTED_PREFIX,
_apply_review_decode_scope,
_review_decode_chunk_range,
resolve_projection_decision,
)
from ComfyUI_H3_Continuum_Join.v3.plan import prepare_physical_decode_entries
from ComfyUI_H3_Continuum_Join.v3.review_control import ( from ComfyUI_H3_Continuum_Join.v3.review_control import (
GENERATION_MODE_FULL_RUN, GENERATION_MODE_FULL_RUN,
GENERATION_MODE_REVIEW, GENERATION_MODE_REVIEW,
@@ -186,11 +195,23 @@ def _persist(
updated_utc: str, updated_utc: str,
) -> RunStorageController: ) -> RunStorageController:
controller = _controller(tmp_path, contract) controller = _controller(tmp_path, contract)
entries = [] entries = [_entry(position, contract) for position in range(prefix)]
for position in range(prefix): terminal = bool(
entry = _entry(position, contract) ((contract.get("global") or {}).get("execution_semantics") or {}).get(
entries.append(entry) "flf_execution"
controller.commit_chunk(entry, position=position) ) == "terminal_merged_10s_seed_v2"
)
for group in physical_groups(
chunks=int(contract["chunk_count"]),
terminal_merge_enabled=terminal,
):
if group.end > prefix:
break
positions = tuple(range(group.start - 1, group.end))
controller.commit_group(
tuple(entries[position] for position in positions),
positions=positions,
)
if review_unit is not None: if review_unit is not None:
start, end = review_unit start, end = review_unit
controller.review_generation_mode = GENERATION_MODE_REVIEW controller.review_generation_mode = GENERATION_MODE_REVIEW
@@ -1225,6 +1246,220 @@ def test_production_internal_review_configures_storage_and_finalizes_metadata(
assert "review status" in outputs[3] assert "review status" in outputs[3]
def test_production_uses_reconciled_review_unit_for_decode_scope(monkeypatch):
import ComfyUI_H3_Continuum_Join.run_storage as run_storage
contract = _contract(chunks=3)
entries = [_entry(position, contract) for position in range(3)]
full_decode, full_plan = prepare_physical_decode_entries(
entries,
chunk_seconds=5.0,
preserve_final_frame=False,
terminal_merged=False,
)
class _Storage:
review_generation_mode = None
review_execution = None
finalized = None
def __enter__(self):
return self
def __exit__(self, exc_type, exc, traceback):
return False
def configure_review(self, **kwargs):
self.review_generation_mode = kwargs["generation_mode"]
def summary(self, *, detailed=False):
return "storage summary"
def review_pause_metadata(self):
return {
"review_unit": {"start": 2, "end": 2, "physical_group": 2},
"review_pause_reason": "review_each_chunk",
}
def finalize(self, **kwargs):
self.finalized = kwargs
storage = _Storage()
monkeypatch.setattr(run_storage, "run_storage_scope", lambda *a, **k: storage)
monkeypatch.setattr(run_storage, "automatic_project_key", lambda *a, **k: "key")
def fake_v3_run(self, **kwargs):
storage.review_execution = SimpleNamespace(
status_hint="review status",
finish_remaining=False,
next_review_unit_start=2,
next_review_unit_end=2,
partial_review=True,
smart_regenerate=False,
)
return (
[{"samples": entry["video"]} for entry in full_decode],
[{"samples": entry["audio"]} for entry in full_decode],
full_plan,
{
"last_state": {},
"session": {"session_id": "session", "chunks": entries},
"report": "sampling report",
},
)
monkeypatch.setattr(H3ContinuumSamplerV3, "run", fake_v3_run)
kwargs = _production_kwargs()
kwargs["chunks"] = 3
outputs = H3ContinuumSamplerProduction().run(**kwargs)
assert len(outputs[0]) == len(outputs[1]) == 1
assert torch.equal(outputs[0][0]["samples"], entries[1]["video"])
assert outputs[2]["target_frames"] == 120
assert outputs[2]["chunks"][0]["chunk_index"] == 2
assert len(storage.finalized["session"]["chunks"]) == 3
assert "Decode preview: Chunk 2" in outputs[3]
def test_review_decode_range_only_selects_a_current_review_unit():
execution = SimpleNamespace(
finish_remaining=False,
next_review_unit_start=2,
next_review_unit_end=2,
partial_review=True,
smart_regenerate=False,
)
storage = SimpleNamespace(
review_generation_mode=GENERATION_MODE_REVIEW,
review_execution=execution,
)
assert _review_decode_chunk_range(
storage,
capture_refine_context=False,
) == (2, 2)
assert _review_decode_chunk_range(
storage,
capture_refine_context=True,
) == (2, 2)
execution.partial_review = False
assert _review_decode_chunk_range(
storage,
capture_refine_context=False,
) is None
execution.smart_regenerate = True
assert _review_decode_chunk_range(
storage,
capture_refine_context=False,
) == (2, 2)
execution.finish_remaining = True
assert _review_decode_chunk_range(
storage,
capture_refine_context=False,
) is None
def test_projection_decision_is_pure_and_refuses_to_split_physical_groups():
session = {"chunks": [{}, {}, {}]}
execution = SimpleNamespace(
finish_remaining=False,
next_review_unit_start=2,
next_review_unit_end=3,
partial_review=False,
smart_regenerate=True,
)
decision = resolve_projection_decision(
review_execution=execution,
effective_result_status=REVISION_STATUS_REVIEW_READY,
session=session,
physical_group_facts=((1,), (2, 3)),
)
assert decision.kind == PROJECTION_CURRENT_REVIEW_UNIT
assert (decision.start_chunk, decision.end_chunk) == (2, 3)
split_terminal_group = resolve_projection_decision(
review_execution=SimpleNamespace(
finish_remaining=False,
next_review_unit_start=2,
next_review_unit_end=2,
partial_review=True,
smart_regenerate=False,
),
effective_result_status=REVISION_STATUS_REVIEW_READY,
session=session,
physical_group_facts=((1,), (2, 3)),
)
assert split_terminal_group.kind == PROJECTION_FULL_ACCEPTED_PREFIX
complete = resolve_projection_decision(
review_execution=execution,
effective_result_status=REVISION_STATUS_COMPLETE,
session=session,
physical_group_facts=((1,), (2, 3)),
)
assert complete.kind == PROJECTION_FULL_ACCEPTED_PREFIX
def test_partial_review_rebuilds_decode_outputs_without_truncating_session():
contract = _contract(chunks=3)
entries = [_entry(position, contract) for position in range(3)]
full_decode, full_plan = prepare_physical_decode_entries(
entries,
chunk_seconds=5.0,
preserve_final_frame=False,
terminal_merged=False,
)
result = {
"last_state": {},
"session": {"session_id": "session", "chunks": entries},
"report": "sampling report",
}
outputs = (
[{"samples": entry["video"]} for entry in full_decode],
[{"samples": entry["audio"]} for entry in full_decode],
full_plan,
result,
{"full_refine_context": True},
)
refine_context = outputs[4]
storage = SimpleNamespace(
review_generation_mode=GENERATION_MODE_REVIEW,
review_execution=SimpleNamespace(
finish_remaining=False,
next_review_unit_start=2,
next_review_unit_end=2,
partial_review=True,
smart_regenerate=False,
),
)
scoped = _apply_review_decode_scope(
outputs,
storage=storage,
capture_refine_context=True,
configured_chunks=3,
chunk_seconds=5.0,
first_frame=None,
last_frame=None,
timeline_video_source=None,
)
assert len(scoped[0]) == len(scoped[1]) == 1
assert torch.equal(scoped[0][0]["samples"], entries[1]["video"])
assert torch.equal(scoped[1][0]["samples"], entries[1]["audio"])
assert scoped[2]["target_frames"] == 120
assert scoped[2]["chunks"][0]["sequence_index"] == 1
assert scoped[2]["chunks"][0]["chunk_index"] == 2
assert scoped[2]["second_pass_contract"]["physical_groups"][0][
"logical_chunks"
] == [2]
assert len(scoped[3]["session"]["chunks"]) == 3
assert scoped[3]["session"] is result["session"]
assert scoped[3]["report"].endswith("Decode preview: Chunk 2")
assert scoped[4] is refine_context
def test_production_review_mode_rejects_run_storage_off(): def test_production_review_mode_rejects_run_storage_off():
kwargs = _production_kwargs() kwargs = _production_kwargs()
kwargs["run_storage"] = "Off" kwargs["run_storage"] = "Off"
+4 -2
View File
@@ -260,12 +260,14 @@ def test_f0_f7_frontend_review_lifecycle(review_queue_results):
): ):
assert review_queue_results[case]["pass"] assert review_queue_results[case]["pass"]
def test_frontend_uses_scoped_acceptance_adapter_without_app_queue_override(): def test_api_queue_adapter_is_the_single_v38_review_intent_owner():
source = PROJECT_ID_JS.read_text(encoding="utf-8") source = PROJECT_ID_JS.read_text(encoding="utf-8")
assert "actionWidget.afterQueued = function" in source assert "actionWidget.afterQueued = function" in source
assert "prepareReviewQueueIntent(node, apiNode.inputs);" in source assert "const inputs = buildReviewQueueInputs(node, normalizedInputs);" in source
assert "prepareReviewQueueIntent" not in source
assert "normalizeReviewActionOnLoad(node);" in source assert "normalizeReviewActionOnLoad(node);" in source
assert "app.queuePrompt =" not in source assert "app.queuePrompt =" not in source
assert "api.queuePrompt = async function" in source
assert "api.__h3ContinuumReviewQueueAdapter" in source assert "api.__h3ContinuumReviewQueueAdapter" in source
-1
View File
@@ -389,7 +389,6 @@ def _initialize_comfy(comfy_root: Path):
"ComfyUI-H3-Continuum", "ComfyUI-H3-Continuum",
"ComfyUI-Spectrum-MiniMax-H3", "ComfyUI-Spectrum-MiniMax-H3",
"ComfyUI-SolAttn_triton", "ComfyUI-SolAttn_triton",
"comfyui-easy-use",
"comfyui-kjnodes", "comfyui-kjnodes",
"rgthree-comfy", "rgthree-comfy",
] ]
+395 -233
View File
@@ -6,9 +6,10 @@ runs for every chunk without intermediate VAE decoding, and decoding/assembly
happens after the sampling phase. happens after the sampling phase.
""" """
from __future__ import annotations from __future__ import annotations
import copy, hashlib, logging import copy, hashlib, logging
from typing import Any from typing import Any
import torch import torch
from ..branch_provenance import physical_groups
from ..compatibility import accelerator_summary, check_comfy_h3_runtime from ..compatibility import accelerator_summary, check_comfy_h3_runtime
from ..constants import ( from ..constants import (
DIAGNOSTICS_FULL, DIAGNOSTICS_OFF, DIAGNOSTICS_OPTIONS, FPS, DIAGNOSTICS_FULL, DIAGNOSTICS_OFF, DIAGNOSTICS_OPTIONS, FPS,
@@ -30,7 +31,7 @@ from ..guide_timeline import (
validate_guide_visible_range, validate_guide_visible_range,
) )
from ..model_patch import LayoutValidationProfiler, clone_model_for_chunk from ..model_patch import LayoutValidationProfiler, clone_model_for_chunk
from ..state import assert_context_unchanged, context_fingerprint, make_plan, select_context, validate_state from ..state import assert_context_unchanged, context_fingerprint, make_plan, select_context
from ..temporal import ( from ..temporal import (
align_frame_count_up, align_frame_count_up,
audio_latent_t, audio_latent_t,
@@ -40,6 +41,7 @@ from ..temporal import (
video_latent_t, video_latent_t,
) )
from ..version import PACKAGE_VERSION from ..version import PACKAGE_VERSION
from .decoder import decode_sequence, decode_sequence_with_seam, enforce_total_frames from .decoder import decode_sequence, decode_sequence_with_seam, enforce_total_frames
from .context_diagnostics import ContextDiagnosticsTracker from .context_diagnostics import ContextDiagnosticsTracker
from .h3_builder import attach_keyframes, empty_h3_latent, encode_identity_latents, encode_prompt_conditioning, encode_prompt_conditioning_cached, prepare_identity_assets from .h3_builder import attach_keyframes, empty_h3_latent, encode_identity_latents, encode_prompt_conditioning, encode_prompt_conditioning_cached, prepare_identity_assets
@@ -238,22 +240,6 @@ def _terminal_strategy_mismatch(
return saved_strategy != FLF_STRATEGY return saved_strategy != FLF_STRATEGY
def _terminal_sampling_plan(
*,
chunks: int,
completed: int,
merge_enabled: bool,
) -> tuple[tuple[int, ...], bool]:
if completed >= int(chunks):
return (), False
if not merge_enabled:
return tuple(range(completed, int(chunks))), False
pair_start = int(chunks) - 2
if completed > pair_start:
raise SequenceRuntimeError("terminal merged pair cannot resume from only one logical half")
return tuple(range(completed, pair_start)), True
def _physical_group_limit(value: int | None) -> int | None: def _physical_group_limit(value: int | None) -> int | None:
"""Validate the private V3 execution cap without changing sampling identity.""" """Validate the private V3 execution cap without changing sampling identity."""
@@ -264,9 +250,55 @@ def _physical_group_limit(value: int | None) -> int | None:
"max_new_physical_groups must be None or a positive integer" "max_new_physical_groups must be None or a positive integer"
) )
return value return value
def _terminal_physical_seed_plan( def _terminal_sampling_plan(
*,
chunks: int,
completed: int,
merge_enabled: bool,
) -> tuple[tuple[int, ...], bool]:
"""Legacy internal adapter delegated to the R3 Pure Planner."""
from ..v3.execution_planner import ExecutionPlanningError, build_execution_plan
from ..v3.planning_types import ContinuationSourceFacts
boundaries=tuple(
(int(group.start),int(group.end))
for group in physical_groups(
chunks=int(chunks),
terminal_merge_enabled=bool(merge_enabled),
)
if int(group.end)<=int(completed)
)
facts=ContinuationSourceFacts(
kind=("explicit_session" if int(completed)>0 else "none"),
accepted_chunks=int(completed),
reroll_from_chunk=0,
physical_group_boundaries=boundaries,
)
try:
plan=build_execution_plan(
continuation_source_facts=facts,
configured_chunks=int(chunks),
terminal_merge_enabled=bool(merge_enabled),
max_new_physical_groups=None,
review_execution=None,
)
except ExecutionPlanningError as exc:
raise SequenceRuntimeError(str(exc)) from exc
normal_indices=tuple(
descriptor.logical_chunks[0]-1
for descriptor in plan.groups_to_generate
if not descriptor.terminal_atomic
)
terminal_pending=any(
descriptor.terminal_atomic for descriptor in plan.groups_to_generate
)
return normal_indices,terminal_pending
def _terminal_physical_seed_plan(
*, *,
base_seed: int, base_seed: int,
physical_window_start_index: int, physical_window_start_index: int,
@@ -415,10 +447,22 @@ def _attach_terminal_flf_keyframes(
metadata["minimax_frame_count"] = int(frame_count) metadata["minimax_frame_count"] = int(frame_count)
return conditioning return conditioning
def run_sequence(*,model:Any,clip:Any,video_vae:Any,audio_vae:Any,sampler:Any,sigmas:torch.Tensor,first_frame:torch.Tensor|None,last_frame:torch.Tensor|None,prompt_plan:dict[str,Any],width:int,height:int,continuity:str,base_seed:int,audio_continuity:bool,exact_total_duration:bool,diagnostics_mode:str,reroll_from_chunk:int,reroll_nonce:int,strict_compatibility:bool,debug:bool,seam_correction:str=SEAM_CORRECTION_OFF,enable_preview:bool=True,session:dict[str,Any]|None=None,initial_state:dict[str,Any]|None=None,latent_only:bool=False,reference_assets=None,reference_audio_source=None,reference_audio_vae=None,driving_audio_source=None,driving_audio_vae=None,reference_video_source=None,timeline_video_source=None,guide_source=None,capture_refine_context:bool=False,memory_attribution:bool=False,prompt_conditioning_cache:bool=False,reference_encode_cache:bool=False,continuation_transport:str=REFERENCE_CONTEXT_V1,max_new_physical_groups:int|None=None,_memory_attribution_collector:Any=None,_diagnostic_continuation_policy:Any=None): def _run_runtime_internal(*,model:Any,clip:Any,video_vae:Any,audio_vae:Any,sampler:Any,sigmas:torch.Tensor,first_frame:torch.Tensor|None,last_frame:torch.Tensor|None,prompt_plan:dict[str,Any],width:int,height:int,continuity:str,base_seed:int,audio_continuity:bool,exact_total_duration:bool,diagnostics_mode:str,reroll_from_chunk:int,reroll_nonce:int,strict_compatibility:bool,debug:bool,seam_correction:str=SEAM_CORRECTION_OFF,enable_preview:bool=True,session:dict[str,Any]|None=None,initial_state:dict[str,Any]|None=None,latent_only:bool=False,reference_assets=None,reference_audio_source=None,reference_audio_vae=None,driving_audio_source=None,driving_audio_vae=None,reference_video_source=None,timeline_video_source=None,guide_source=None,capture_refine_context:bool=False,memory_attribution:bool=False,prompt_conditioning_cache:bool=False,reference_encode_cache:bool=False,continuation_transport:str=REFERENCE_CONTEXT_V1,max_new_physical_groups:int|None=None,_memory_attribution_collector:Any=None,_diagnostic_continuation_policy:Any=None):
from ..conditioning import detect_conditioning_mode, conditioning_display_label from ..conditioning import detect_conditioning_mode, conditioning_display_label
from ..run_storage import get_active_run_storage from ..run_storage import get_active_run_storage
from ..v3.runtime_coordinator import (
InternalRuntimeCoordinator,
RuntimeCoordinatorError,
)
from ..v3.sampling_engine import sample_physical_group
storage_controller=get_active_run_storage() storage_controller=get_active_run_storage()
runtime_coordinator=InternalRuntimeCoordinator(
storage_controller=storage_controller,
input_session=session,
initial_state=initial_state,
)
session,initial_state=runtime_coordinator.prepare_inputs()
review_execution=None
capture_refine_context=bool(capture_refine_context and latent_only) capture_refine_context=bool(capture_refine_context and latent_only)
memory_attribution=bool(memory_attribution and capture_refine_context) memory_attribution=bool(memory_attribution and capture_refine_context)
prompt_conditioning_cache=bool(prompt_conditioning_cache and capture_refine_context and latent_only) prompt_conditioning_cache=bool(prompt_conditioning_cache and capture_refine_context and latent_only)
@@ -450,13 +494,13 @@ def run_sequence(*,model:Any,clip:Any,video_vae:Any,audio_vae:Any,sampler:Any,si
# Legacy workflow input only. Runtime compatibility is advisory in V3.4. # Legacy workflow input only. Runtime compatibility is advisory in V3.4.
strict_compatibility=False strict_compatibility=False
if width<=0 or height<=0 or width%32 or height%32: raise SequenceRuntimeError("width and height must be positive multiples of 32") if width<=0 or height<=0 or width%32 or height%32: raise SequenceRuntimeError("width and height must be positive multiples of 32")
if session is not None and initial_state is not None: if diagnostics_mode not in DIAGNOSTICS_OPTIONS: raise SequenceRuntimeError(f"unknown diagnostics mode: {diagnostics_mode!r}")
LOG.warning("Both session and initial_state were supplied; using the session and ignoring initial_state") if seam_correction not in SEAM_CORRECTION_OPTIONS: raise SequenceRuntimeError(f"unknown seam correction mode: {seam_correction!r}")
initial_state=None if not 0<=int(reroll_from_chunk)<=chunks: raise SequenceRuntimeError("reroll_from_chunk must be 0 or a valid one-based chunk index")
if diagnostics_mode not in DIAGNOSTICS_OPTIONS: raise SequenceRuntimeError(f"unknown diagnostics mode: {diagnostics_mode!r}") try:
if seam_correction not in SEAM_CORRECTION_OPTIONS: raise SequenceRuntimeError(f"unknown seam correction mode: {seam_correction!r}") runtime_coordinator.validate_initial_state_reroll(reroll_from_chunk)
if not 0<=int(reroll_from_chunk)<=chunks: raise SequenceRuntimeError("reroll_from_chunk must be 0 or a valid one-based chunk index") except RuntimeCoordinatorError as exc:
if initial_state is not None and int(reroll_from_chunk) not in (0,1): raise SequenceRuntimeError("with initial_state, reroll_from_chunk can only be 0 or 1") raise SequenceRuntimeError(str(exc)) from exc
try: conditioning_mode=detect_conditioning_mode(first_frame=first_frame,last_frame=last_frame,reference_assets=reference_assets) try: conditioning_mode=detect_conditioning_mode(first_frame=first_frame,last_frame=last_frame,reference_assets=reference_assets)
except ValueError as exc: raise SequenceRuntimeError(str(exc)) from exc except ValueError as exc: raise SequenceRuntimeError(str(exc)) from exc
conditioning_display=conditioning_display_label(has_first=first_frame is not None,has_last=last_frame is not None,has_reference=reference_assets is not None) conditioning_display=conditioning_display_label(has_first=first_frame is not None,has_last=last_frame is not None,has_reference=reference_assets is not None)
@@ -500,8 +544,9 @@ def run_sequence(*,model:Any,clip:Any,video_vae:Any,audio_vae:Any,sampler:Any,si
if multi_chunk_flf: if multi_chunk_flf:
sequence_identity_hash=_flf_contract_identity(sequence_identity_hash) sequence_identity_hash=_flf_contract_identity(sequence_identity_hash)
sequence_identity_hash=_continuation_transport_identity(sequence_identity_hash,continuation_transport) sequence_identity_hash=_continuation_transport_identity(sequence_identity_hash,continuation_transport)
current_model_fingerprint=model_fingerprint(model,extra_wrapper_keys=("h3_continuum_join.apply_model.v1",)) current_model_fingerprint=model_fingerprint(model,extra_wrapper_keys=("h3_continuum_join.apply_model.v1",))
if storage_controller is not None: if storage_controller is not None:
runtime_coordinator.assert_storage_session_compatible()
stored_session=storage_controller.prepare(model=model,model_fingerprint_value=current_model_fingerprint,clip=clip,video_vae=video_vae,sampler=sampler,sigmas=sigmas,prompt_plan=plan,width=width,height=height,chunk_seconds=chunk_seconds,continuity=continuity,audio_continuity=audio_continuity,base_seed=base_seed,reroll_from_chunk=reroll_from_chunk,reroll_nonce=reroll_nonce,first_frame_hash=assets.first_frame_hash,last_frame_hash=assets.last_frame_hash,identity_hash=sequence_identity_hash,strict_compatibility=strict_compatibility,existing_session=session,reference_contract=reference_assets.contract if reference_assets is not None else None,conditioning_mode=conditioning_mode,reference_audio_contract=reference_audio_source.contract if reference_audio_source is not None else None,reference_audio_vae=reference_audio_vae,driving_audio_contract=driving_audio_source.contract if driving_audio_source is not None else None,driving_audio_vae=driving_audio_vae,reference_video_contract=reference_video_source.contract if reference_video_source is not None else None,timeline_video_contract=timeline_video_source.contract if timeline_video_source is not None else None,guide_contract=guide_source.contract if guide_source is not None else None,execution_semantics=_terminal_execution_semantics(merge_enabled=terminal_merge_enabled,prompt_policy=terminal_prompt_policy,continuation_transport=continuation_transport)) stored_session=storage_controller.prepare(model=model,model_fingerprint_value=current_model_fingerprint,clip=clip,video_vae=video_vae,sampler=sampler,sigmas=sigmas,prompt_plan=plan,width=width,height=height,chunk_seconds=chunk_seconds,continuity=continuity,audio_continuity=audio_continuity,base_seed=base_seed,reroll_from_chunk=reroll_from_chunk,reroll_nonce=reroll_nonce,first_frame_hash=assets.first_frame_hash,last_frame_hash=assets.last_frame_hash,identity_hash=sequence_identity_hash,strict_compatibility=strict_compatibility,existing_session=session,reference_contract=reference_assets.contract if reference_assets is not None else None,conditioning_mode=conditioning_mode,reference_audio_contract=reference_audio_source.contract if reference_audio_source is not None else None,reference_audio_vae=reference_audio_vae,driving_audio_contract=driving_audio_source.contract if driving_audio_source is not None else None,driving_audio_vae=driving_audio_vae,reference_video_contract=reference_video_source.contract if reference_video_source is not None else None,timeline_video_contract=timeline_video_source.contract if timeline_video_source is not None else None,guide_contract=guide_source.contract if guide_source is not None else None,execution_semantics=_terminal_execution_semantics(merge_enabled=terminal_merge_enabled,prompt_policy=terminal_prompt_policy,continuation_transport=continuation_transport))
reroll_nonce=storage_controller.effective_reroll_nonce reroll_nonce=storage_controller.effective_reroll_nonce
review_execution=getattr(storage_controller,"review_execution",None) review_execution=getattr(storage_controller,"review_execution",None)
@@ -579,12 +624,62 @@ def run_sequence(*,model:Any,clip:Any,video_vae:Any,audio_vae:Any,sampler:Any,si
f"{guide_source.absolute_frame}; mode={guide_source.contract['mode']}; " f"{guide_source.absolute_frame}; mode={guide_source.contract['mode']}; "
f"schema={guide_source.contract['schema_version']}.", f"schema={guide_source.contract['schema_version']}.",
) )
if session is not None: if session is not None:
old_fingerprint=str(session.get("model_fingerprint","")) old_fingerprint=str(session.get("model_fingerprint",""))
if old_fingerprint and old_fingerprint!=current_model_fingerprint: reuse_notes.append("model/accelerator fingerprint differs from the saved session; accepted chunks were kept") if old_fingerprint and old_fingerprint!=current_model_fingerprint: reuse_notes.append("model/accelerator fingerprint differs from the saved session; accepted chunks were kept")
# R4: the Coordinator is the sole owner of Storage / Session / State
# priority. The Pure Planner receives only its selected-source projection.
try:
continuation_selection=runtime_coordinator.select_continuation_source(
preserved=preserved,
initial_state=initial_state,
chunks=chunks,
width=width,
height=height,
reroll_from_chunk=int(reroll_from_chunk),
effective_reroll_from_chunk=int(effective_reroll_from_chunk),
terminal_merge_enabled=terminal_merge_enabled,
)
except RuntimeCoordinatorError as exc:
raise SequenceRuntimeError(str(exc)) from exc
entries=continuation_selection.entries
previous_state=continuation_selection.previous_state
continuation_source_facts=continuation_selection.continuation_source_facts
reuse_notes.extend(continuation_selection.notes)
retained_review_unit=None
inherited_review_unit=(
getattr(storage_controller,"inherited_review_unit",None)
if storage_controller is not None
else None
)
if isinstance(inherited_review_unit,dict):
from ..v3.review_control import ReviewUnit
retained_review_unit=ReviewUnit(
start=int(inherited_review_unit["start"]),
end=int(inherited_review_unit["end"]),
physical_group=int(inherited_review_unit["physical_group"]),
)
from ..v3.execution_planner import ExecutionPlanningError,build_execution_plan
try:
execution_plan=build_execution_plan(
continuation_source_facts=continuation_source_facts,
configured_chunks=chunks,
terminal_merge_enabled=terminal_merge_enabled,
max_new_physical_groups=max_new_physical_groups,
review_execution=review_execution,
retained_review_unit=retained_review_unit,
)
except ExecutionPlanningError as exc:
raise SequenceRuntimeError(str(exc)) from exc
if storage_controller is not None:
# Queue-local planning result only. No Run Storage schema or persisted
# metadata is changed in R3.
storage_controller.execution_plan=execution_plan
cache={} cache={}
guide_assets=None guide_assets=None
if len(preserved)<chunks: if len(preserved)<chunks or capture_refine_context:
if memory_collector is not None: if memory_collector is not None:
capture_memory(memory_collector, "start_phase", phase="conditioning") capture_memory(memory_collector, "start_phase", phase="conditioning")
capture_memory(memory_collector, "start_phase", phase="conditioning_identity_video_vae") capture_memory(memory_collector, "start_phase", phase="conditioning_identity_video_vae")
@@ -651,8 +746,37 @@ def run_sequence(*,model:Any,clip:Any,video_vae:Any,audio_vae:Any,sampler:Any,si
if timeline_video_source is None: if timeline_video_source is None:
if memory_collector is not None: if memory_collector is not None:
capture_memory(memory_collector, "start_phase", phase="conditioning_prompt_clip") capture_memory(memory_collector, "start_phase", phase="conditioning_prompt_clip")
cache=_conditioning_cache(clip=clip,prompts=prompts,assets=assets,final_has_last_frame=last_frame is not None,reference_assets=reference_assets,reference_audio_assets=reference_audio_assets,timeline_video_assets=reference_video_assets,prompt_conditioning_cache=prompt_conditioning_cache,prompt_cache_event=prompt_cache_events.append) planned_normal_indices=tuple(
if terminal_merge_enabled and terminal_prompt is not None: descriptor.logical_chunks[0]-1
for descriptor in execution_plan.groups_to_generate
if not descriptor.terminal_atomic
)
if max_new_physical_groups is None:
# Preserve the established Full Run conditioning/cache set,
# including both logical prompts covered by Terminal Merge.
prepared_indices=tuple(range(chunks))
elif capture_refine_context:
normal_stop=chunks-2 if terminal_merge_enabled else chunks
reused_normal_indices=tuple(range(min(len(entries),normal_stop)))
prepared_indices=tuple(dict.fromkeys(
reused_normal_indices+planned_normal_indices
))
else:
prepared_indices=planned_normal_indices
prepared_prompts=[prompts[index] for index in prepared_indices]
prepare_last=bool(last_frame is not None and (
max_new_physical_groups is None or chunks-1 in prepared_indices
))
prepare_terminal=any(
descriptor.terminal_atomic
for descriptor in execution_plan.groups_to_generate
) or bool(
capture_refine_context
and terminal_merge_enabled
and len(entries)==chunks
)
cache=_conditioning_cache(clip=clip,prompts=prepared_prompts,assets=assets,final_has_last_frame=prepare_last,reference_assets=reference_assets,reference_audio_assets=reference_audio_assets,timeline_video_assets=reference_video_assets,prompt_conditioning_cache=prompt_conditioning_cache,prompt_cache_event=prompt_cache_events.append)
if prepare_terminal and terminal_prompt is not None:
terminal_key=_conditioning_cache_key(terminal_prompt,include_last=True,reference_assets=reference_assets) terminal_key=_conditioning_cache_key(terminal_prompt,include_last=True,reference_assets=reference_assets)
if terminal_key not in cache: if terminal_key not in cache:
cache.update(_conditioning_cache(clip=clip,prompts=[terminal_prompt],assets=assets,final_has_last_frame=True,reference_assets=reference_assets,reference_audio_assets=reference_audio_assets,timeline_video_assets=reference_video_assets,prompt_conditioning_cache=prompt_conditioning_cache,prompt_cache_event=prompt_cache_events.append)) cache.update(_conditioning_cache(clip=clip,prompts=[terminal_prompt],assets=assets,final_has_last_frame=True,reference_assets=reference_assets,reference_audio_assets=reference_audio_assets,timeline_video_assets=reference_video_assets,prompt_conditioning_cache=prompt_conditioning_cache,prompt_cache_event=prompt_cache_events.append))
@@ -660,21 +784,7 @@ def run_sequence(*,model:Any,clip:Any,video_vae:Any,audio_vae:Any,sampler:Any,si
capture_memory(memory_collector, "finish_phase", phase="conditioning_prompt_clip") capture_memory(memory_collector, "finish_phase", phase="conditioning_prompt_clip")
if memory_collector is not None: if memory_collector is not None:
capture_memory(memory_collector, "finish_phase", phase="conditioning") capture_memory(memory_collector, "finish_phase", phase="conditioning")
entries=preserved[:]; previous_state=None initial_frame_count=align_frame_count_up(int(round(chunk_seconds*FPS))); retained_frames=sum(int(entry["plan"]["net_frames"]) for entry in entries); sampling_reports=[]
if entries:
try: previous_state=entry_to_state(entries[-1])
except (SessionValidationError, ValueError) as exc:
reuse_notes.append(f"saved continuation state was rejected; generated a fresh run ({exc})")
entries=[]; previous_state=None
elif initial_state is not None:
try:
candidate=validate_state(initial_state)
if int(candidate["width"])!=width or int(candidate["height"])!=height:
reuse_notes.append("initial_state resolution differs; generated a fresh run")
else: previous_state=candidate
except ValueError as exc:
reuse_notes.append(f"initial_state was rejected; generated a fresh run ({exc})")
initial_frame_count=align_frame_count_up(int(round(chunk_seconds*FPS))); retained_frames=sum(int(entry["plan"]["net_frames"]) for entry in entries); sampling_reports=[]
context_diagnostics=ContextDiagnosticsTracker() if bool(debug) else None context_diagnostics=ContextDiagnosticsTracker() if bool(debug) else None
if context_diagnostics is not None: if context_diagnostics is not None:
if entries: if entries:
@@ -682,10 +792,26 @@ def run_sequence(*,model:Any,clip:Any,video_vae:Any,audio_vae:Any,sampler:Any,si
_record_context_diagnostics(tracker=context_diagnostics,reports=sampling_reports,state=entry_to_state(reused_entry),continuity=continuity,reused=True) _record_context_diagnostics(tracker=context_diagnostics,reports=sampling_reports,state=entry_to_state(reused_entry),continuity=continuity,reused=True)
elif previous_state is not None: elif previous_state is not None:
_record_context_diagnostics(tracker=context_diagnostics,reports=sampling_reports,state=previous_state,continuity=continuity,reused=True) _record_context_diagnostics(tracker=context_diagnostics,reports=sampling_reports,state=previous_state,continuity=continuity,reused=True)
normal_indices,terminal_merge_pending=_terminal_sampling_plan(chunks=chunks,completed=len(entries),merge_enabled=terminal_merge_enabled) normal_indices=tuple(
if max_new_physical_groups == 0: descriptor.logical_chunks[0]-1
normal_indices=() for descriptor in execution_plan.groups_to_generate
terminal_merge_pending=False if not descriptor.terminal_atomic
)
terminal_merge_pending=any(
descriptor.terminal_atomic
for descriptor in execution_plan.groups_to_generate
)
# Reuse the same group preparation for context capture; never resample or
# recommit accepted entries. An external initial State is not reconstructible
# from the saved prefix alone, so retain incomplete-context behavior for it.
reused_count=len(entries)
rebuild_prefix=bool(capture_refine_context and entries and not entries[0]["plan"]["continuation"])
terminal_reused=bool(rebuild_prefix and terminal_merge_enabled and reused_count==chunks)
if rebuild_prefix:
normal_stop=chunks-2 if terminal_merge_enabled else chunks
normal_indices=tuple(range(min(reused_count,normal_stop)))+tuple(normal_indices)
previous_state=None
retained_frames=0
if adaptive_observer_event is not None: if adaptive_observer_event is not None:
adaptive_observer_event( adaptive_observer_event(
adaptive_continuity_observer, adaptive_continuity_observer,
@@ -699,6 +825,7 @@ def run_sequence(*,model:Any,clip:Any,video_vae:Any,audio_vae:Any,sampler:Any,si
if memory_collector is not None: if memory_collector is not None:
capture_memory(memory_collector, "finish_phase", phase="preparation") capture_memory(memory_collector, "finish_phase", phase="preparation")
for sequence_index in normal_indices: for sequence_index in normal_indices:
reusing_group=sequence_index<reused_count
if memory_collector is not None: if memory_collector is not None:
capture_memory(memory_collector, "start_phase", phase="group_prepare", physical_group=sequence_index+1, logical_chunks=(sequence_index+1,)) capture_memory(memory_collector, "start_phase", phase="group_prepare", physical_group=sequence_index+1, logical_chunks=(sequence_index+1,))
prompt=prompts[sequence_index]; prompt_hash_value=prompt_hashes[sequence_index]; is_final=sequence_index==chunks-1; effective_reroll_nonce=int(reroll_nonce) if int(reroll_from_chunk)>0 and sequence_index+1>=int(reroll_from_chunk) else 0; seed=derive_chunk_seed(base_seed,sequence_index,effective_reroll_nonce); motion_score=0.0; video_context=None; audio_context=None; context_before=None; context_interop_emitted=False prompt=prompts[sequence_index]; prompt_hash_value=prompt_hashes[sequence_index]; is_final=sequence_index==chunks-1; effective_reroll_nonce=int(reroll_nonce) if int(reroll_from_chunk)>0 and sequence_index+1>=int(reroll_from_chunk) else 0; seed=derive_chunk_seed(base_seed,sequence_index,effective_reroll_nonce); motion_score=0.0; video_context=None; audio_context=None; context_before=None; context_interop_emitted=False
@@ -776,7 +903,7 @@ def run_sequence(*,model:Any,clip:Any,video_vae:Any,audio_vae:Any,sampler:Any,si
conditioning=prepare_conditioning(base_conditioning,video_context=video_context,audio_context=audio_context,audio_grid_offset=grid_offset,context_frames=context_frames,new_frame_count=shape.total_frames,first_frame_policy=POLICY_REPLACE,preserve_last_frame=True) conditioning=prepare_conditioning(base_conditioning,video_context=video_context,audio_context=audio_context,audio_grid_offset=grid_offset,context_frames=context_frames,new_frame_count=shape.total_frames,first_frame_policy=POLICY_REPLACE,preserve_last_frame=True)
context_interop_emitted=True context_interop_emitted=True
clip_index=int(previous_state["clip_index"])+1; chunk_plan=make_plan(continuation=True,clip_index=clip_index,total_frames=shape.total_frames,trim_frames=context_frames,width=width,height=height,context_frames=context_frames,state_capacity_frames=largest_context_capacity(shape.net_new_frames),requested_extend_seconds=chunk_seconds,debug=debug) clip_index=int(previous_state["clip_index"])+1; chunk_plan=make_plan(continuation=True,clip_index=clip_index,total_frames=shape.total_frames,trim_frames=context_frames,width=width,height=height,context_frames=context_frames,state_capacity_frames=largest_context_capacity(shape.net_new_frames),requested_extend_seconds=chunk_seconds,debug=debug)
if adaptive_observer_event is not None: if adaptive_observer_event is not None and not reusing_group:
from ..v3.adaptive_continuity import INITIAL_TRANSPORT from ..v3.adaptive_continuity import INITIAL_TRANSPORT
adaptive_observer_event( adaptive_observer_event(
adaptive_continuity_observer, adaptive_continuity_observer,
@@ -821,7 +948,8 @@ def run_sequence(*,model:Any,clip:Any,video_vae:Any,audio_vae:Any,sampler:Any,si
clone_kwargs={"strict":bool(strict_compatibility),"debug":bool(debug),"chunk_index":clip_index,"context_frames":context_frames if context_interop_emitted else None} clone_kwargs={"strict":bool(strict_compatibility),"debug":bool(debug),"chunk_index":clip_index,"context_frames":context_frames if context_interop_emitted else None}
if layout_validation_profiler is not None: clone_kwargs["validation_profiler"]=layout_validation_profiler if layout_validation_profiler is not None: clone_kwargs["validation_profiler"]=layout_validation_profiler
if packed_row_planner is not None: clone_kwargs["packed_row_planner"]=packed_row_planner if packed_row_planner is not None: clone_kwargs["packed_row_planner"]=packed_row_planner
chunk_model=clone_model_for_chunk(model,**clone_kwargs) if not reusing_group:
chunk_model=clone_model_for_chunk(model,**clone_kwargs)
if memory_collector is not None: if memory_collector is not None:
capture_memory(memory_collector, "finish_phase", phase="group_prepare", physical_group=sequence_index+1, logical_chunks=(sequence_index+1,)) capture_memory(memory_collector, "finish_phase", phase="group_prepare", physical_group=sequence_index+1, logical_chunks=(sequence_index+1,))
capture_memory(memory_collector, "start_phase", phase="refine_context", physical_group=sequence_index+1, logical_chunks=(sequence_index+1,)) capture_memory(memory_collector, "start_phase", phase="refine_context", physical_group=sequence_index+1, logical_chunks=(sequence_index+1,))
@@ -855,6 +983,13 @@ def run_sequence(*,model:Any,clip:Any,video_vae:Any,audio_vae:Any,sampler:Any,si
del source_video,_ del source_video,_
if memory_collector is not None: if memory_collector is not None:
capture_memory(memory_collector, "finish_phase", phase="refine_context", physical_group=sequence_index+1, logical_chunks=(sequence_index+1,)) capture_memory(memory_collector, "finish_phase", phase="refine_context", physical_group=sequence_index+1, logical_chunks=(sequence_index+1,))
if reusing_group:
previous_state=entry_to_state(entries[sequence_index])
retained_frames+=int(entries[sequence_index]["plan"]["net_frames"])
del latent,conditioning,chunk_cache
if timeline_video_source is not None:
del timeline_video_assets
continue
if memory_collector is not None: if memory_collector is not None:
capture_memory(memory_collector, "capture_group", capture_memory(memory_collector, "capture_group",
physical_group=sequence_index+1, physical_group=sequence_index+1,
@@ -866,39 +1001,24 @@ def run_sequence(*,model:Any,clip:Any,video_vae:Any,audio_vae:Any,sampler:Any,si
) )
if memory_collector is not None: if memory_collector is not None:
capture_memory(memory_collector, "start_phase", phase="sampling", physical_group=sequence_index+1, logical_chunks=(sequence_index+1,)) capture_memory(memory_collector, "start_phase", phase="sampling", physical_group=sequence_index+1, logical_chunks=(sequence_index+1,))
layout_profile_token=( sampled,diagnostic_sample_token=sample_physical_group(
layout_validation_profiler.begin_sampling_group( sample_callable=sample_chunk,
physical_group=sequence_index+1, model=chunk_model,
logical_chunks=(sequence_index+1,), conditioning=conditioning,
sampling_steps=max(0,int(sigmas.shape[-1])-1), latent=latent,
) sampler=sampler,
if layout_validation_profiler is not None sigmas=sigmas,
else None seed=seed,
enable_preview=bool(enable_preview),
physical_group=sequence_index+1,
logical_chunks=(sequence_index+1,),
terminal_atomic=False,
layout_validation_profiler=layout_validation_profiler,
packed_row_planner=packed_row_planner,
planner_event=planner_event,
diagnostic_policy=_diagnostic_continuation_policy,
context_frames=context_frames,
) )
diagnostic_sample_token=None
if _diagnostic_continuation_policy is not None:
diagnostic_sample_token=_diagnostic_continuation_policy.before_sampling(
physical_group=sequence_index+1,
logical_chunks=(sequence_index+1,),
context_frames=context_frames,
latent=latent,
conditioning=conditioning,
seed=seed,
sigmas=sigmas,
)
if planner_event is not None:
planner_event(
packed_row_planner,
"begin_group",
physical_group=sequence_index+1,
logical_chunks=(sequence_index+1,),
terminal_atomic=False,
)
sampled=sample_chunk(model=chunk_model,conditioning=conditioning,latent=latent,sampler=sampler,sigmas=sigmas,seed=seed,enable_preview=bool(enable_preview))
if planner_event is not None:
planner_event(packed_row_planner,"finish_group")
if layout_validation_profiler is not None and layout_profile_token is not None:
layout_validation_profiler.finish_sampling_group(layout_profile_token)
if previous_state is not None and continuation_transport in (MASKED_VIDEO_PREFIX_V1,MASKED_AV_PREFIX_22_V1,MASKED_AV_PREFIX_39_V1): if previous_state is not None and continuation_transport in (MASKED_VIDEO_PREFIX_V1,MASKED_AV_PREFIX_22_V1,MASKED_AV_PREFIX_39_V1):
if continuation_transport in (MASKED_AV_PREFIX_22_V1,MASKED_AV_PREFIX_39_V1): if continuation_transport in (MASKED_AV_PREFIX_22_V1,MASKED_AV_PREFIX_39_V1):
from ..v3.masked_continuation import restore_masked_av_prefix from ..v3.masked_continuation import restore_masked_av_prefix
@@ -933,7 +1053,7 @@ def run_sequence(*,model:Any,clip:Any,video_vae:Any,audio_vae:Any,sampler:Any,si
if context_before is not None and video_context is not None: assert_context_unchanged(video_context,audio_context,context_before) if context_before is not None and video_context is not None: assert_context_unchanged(video_context,audio_context,context_before)
entry=make_chunk_entry(latent=sampled,plan=chunk_plan,prompt=prompt,prompt_hash=prompt_hash_value,seed=seed,context_frames=context_frames,motion_score=motion_score,reused=False); previous_state=entry_to_state(entry); entries.append(entry) entry=make_chunk_entry(latent=sampled,plan=chunk_plan,prompt=prompt,prompt_hash=prompt_hash_value,seed=seed,context_frames=context_frames,motion_score=motion_score,reused=False); previous_state=entry_to_state(entry); entries.append(entry)
_record_context_diagnostics(tracker=context_diagnostics,reports=sampling_reports,state=previous_state,continuity=continuity,reused=False) _record_context_diagnostics(tracker=context_diagnostics,reports=sampling_reports,state=previous_state,continuity=continuity,reused=False)
if storage_controller is not None: storage_controller.commit_chunk(entry, position=sequence_index) if storage_controller is not None: storage_controller.commit_group((entry,), positions=(sequence_index,))
if memory_collector is not None: if memory_collector is not None:
capture_memory(memory_collector, "finish_phase", phase="cpu_commit_validation", physical_group=sequence_index+1, logical_chunks=(sequence_index+1,)) capture_memory(memory_collector, "finish_phase", phase="cpu_commit_validation", physical_group=sequence_index+1, logical_chunks=(sequence_index+1,))
retained_frames+=int(chunk_plan["net_frames"]) retained_frames+=int(chunk_plan["net_frames"])
@@ -956,18 +1076,9 @@ def run_sequence(*,model:Any,clip:Any,video_vae:Any,audio_vae:Any,sampler:Any,si
physical_group=sequence_index+1, physical_group=sequence_index+1,
) )
new_physical_groups+=1 new_physical_groups+=1
if ( if terminal_reused or terminal_merge_pending:
max_new_physical_groups is not None
and new_physical_groups>=max_new_physical_groups
):
break
terminal_budget_available=(
max_new_physical_groups is None
or new_physical_groups<max_new_physical_groups
)
if terminal_merge_pending and terminal_budget_available:
pair_start=chunks-2 pair_start=chunks-2
if len(entries)!=pair_start: if len(entries)!=(chunks if terminal_reused else pair_start):
raise SequenceRuntimeError(f"terminal merged pair expected {pair_start} completed chunks, got {len(entries)}") raise SequenceRuntimeError(f"terminal merged pair expected {pair_start} completed chunks, got {len(entries)}")
terminal_physical_group=pair_start+1 terminal_physical_group=pair_start+1
terminal_logical_chunks=(pair_start+1,chunks) terminal_logical_chunks=(pair_start+1,chunks)
@@ -1044,7 +1155,7 @@ def run_sequence(*,model:Any,clip:Any,video_vae:Any,audio_vae:Any,sampler:Any,si
conditioning=prepare_conditioning(base_conditioning,video_context=video_context,audio_context=audio_context,audio_grid_offset=grid_offset,context_frames=TERMINAL_MERGE_CONTEXT_FRAMES,new_frame_count=physical_frames,first_frame_policy=POLICY_REPLACE,preserve_last_frame=True) conditioning=prepare_conditioning(base_conditioning,video_context=video_context,audio_context=audio_context,audio_grid_offset=grid_offset,context_frames=TERMINAL_MERGE_CONTEXT_FRAMES,new_frame_count=physical_frames,first_frame_policy=POLICY_REPLACE,preserve_last_frame=True)
reason=f"terminal merged 10-second sample with 22-frame context; continuity selection was {selected_context} ({selected_reason})" reason=f"terminal merged 10-second sample with 22-frame context; continuity selection was {selected_context} ({selected_reason})"
physical_clip_index=int(previous_state["clip_index"])+1 physical_clip_index=int(previous_state["clip_index"])+1
if adaptive_observer_event is not None: if adaptive_observer_event is not None and not terminal_reused:
from ..v3.adaptive_continuity import INITIAL_TRANSPORT from ..v3.adaptive_continuity import INITIAL_TRANSPORT
adaptive_observer_event( adaptive_observer_event(
adaptive_continuity_observer, adaptive_continuity_observer,
@@ -1090,27 +1201,28 @@ def run_sequence(*,model:Any,clip:Any,video_vae:Any,audio_vae:Any,sampler:Any,si
) )
driving_audio_latent=slice_driving_audio_latent(driving_audio_assets,cumulative_retained_before=retained_frames,total_frames=physical_frames,trim_frames=physical_context_frames,fps=FPS) driving_audio_latent=slice_driving_audio_latent(driving_audio_assets,cumulative_retained_before=retained_frames,total_frames=physical_frames,trim_frames=physical_context_frames,fps=FPS)
conditioning=attach_driving_audio(conditioning,driving_audio_latent) conditioning=attach_driving_audio(conditioning,driving_audio_latent)
chunk_model=clone_model_for_chunk( if not terminal_reused:
model, chunk_model=clone_model_for_chunk(
strict=bool(strict_compatibility), model,
debug=bool(debug), strict=bool(strict_compatibility),
chunk_index=physical_clip_index, debug=bool(debug),
context_frames=( chunk_index=physical_clip_index,
physical_context_frames context_frames=(
if not initial_pair and not terminal_masked physical_context_frames
else None if not initial_pair and not terminal_masked
), else None
**( ),
{"validation_profiler": layout_validation_profiler} **(
if layout_validation_profiler is not None {"validation_profiler": layout_validation_profiler}
else {} if layout_validation_profiler is not None
), else {}
**( ),
{"packed_row_planner": packed_row_planner} **(
if packed_row_planner is not None {"packed_row_planner": packed_row_planner}
else {} if packed_row_planner is not None
), else {}
) ),
)
if memory_collector is not None: if memory_collector is not None:
capture_memory(memory_collector, "finish_phase", phase="group_prepare", physical_group=terminal_physical_group, logical_chunks=terminal_logical_chunks) capture_memory(memory_collector, "finish_phase", phase="group_prepare", physical_group=terminal_physical_group, logical_chunks=terminal_logical_chunks)
capture_memory(memory_collector, "start_phase", phase="refine_context", physical_group=terminal_physical_group, logical_chunks=terminal_logical_chunks) capture_memory(memory_collector, "start_phase", phase="refine_context", physical_group=terminal_physical_group, logical_chunks=terminal_logical_chunks)
@@ -1144,111 +1256,115 @@ def run_sequence(*,model:Any,clip:Any,video_vae:Any,audio_vae:Any,sampler:Any,si
del source_video,_ del source_video,_
if memory_collector is not None: if memory_collector is not None:
capture_memory(memory_collector, "finish_phase", phase="refine_context", physical_group=terminal_physical_group, logical_chunks=terminal_logical_chunks) capture_memory(memory_collector, "finish_phase", phase="refine_context", physical_group=terminal_physical_group, logical_chunks=terminal_logical_chunks)
if memory_collector is not None: if not terminal_reused:
capture_memory(memory_collector, "capture_group", if memory_collector is not None:
physical_group=terminal_physical_group, capture_memory(memory_collector, "capture_group",
logical_chunks=terminal_logical_chunks, physical_group=terminal_physical_group,
stage="before sampling", logical_chunks=terminal_logical_chunks,
retained_entries=entries, stage="before sampling",
observed_latent=latent, retained_entries=entries,
retained_refine_context=refine_groups, observed_latent=latent,
) retained_refine_context=refine_groups,
if memory_collector is not None: )
capture_memory(memory_collector, "start_phase", phase="sampling", physical_group=terminal_physical_group, logical_chunks=terminal_logical_chunks) if memory_collector is not None:
layout_profile_token=( capture_memory(memory_collector, "start_phase", phase="sampling", physical_group=terminal_physical_group, logical_chunks=terminal_logical_chunks)
layout_validation_profiler.begin_sampling_group( sampled,_=sample_physical_group(
physical_group=terminal_physical_group, sample_callable=sample_chunk,
logical_chunks=terminal_logical_chunks, model=chunk_model,
sampling_steps=max(0,int(sigmas.shape[-1])-1), conditioning=conditioning,
) latent=latent,
if layout_validation_profiler is not None sampler=sampler,
else None sigmas=sigmas,
) seed=physical_seed,
if planner_event is not None: enable_preview=bool(enable_preview),
planner_event(
packed_row_planner,
"begin_group",
physical_group=terminal_physical_group, physical_group=terminal_physical_group,
logical_chunks=terminal_logical_chunks, logical_chunks=terminal_logical_chunks,
terminal_atomic=True, terminal_atomic=True,
layout_validation_profiler=layout_validation_profiler,
packed_row_planner=packed_row_planner,
planner_event=planner_event,
) )
sampled=sample_chunk(model=chunk_model,conditioning=conditioning,latent=latent,sampler=sampler,sigmas=sigmas,seed=physical_seed,enable_preview=bool(enable_preview)) if terminal_masked:
if planner_event is not None: if continuation_transport==MASKED_AV_PREFIX_22_V1:
planner_event(packed_row_planner,"finish_group") from ..v3.masked_continuation import restore_masked_av_prefix
if layout_validation_profiler is not None and layout_profile_token is not None: sampled=restore_masked_av_prefix(
layout_validation_profiler.finish_sampling_group(layout_profile_token) sampled,
if terminal_masked: latent,
if continuation_transport==MASKED_AV_PREFIX_22_V1: TERMINAL_MERGE_CONTEXT_FRAMES,
from ..v3.masked_continuation import restore_masked_av_prefix )
sampled=restore_masked_av_prefix( else:
sampled, from ..v3.masked_continuation import restore_masked_video_prefix
latent, sampled=restore_masked_video_prefix(
TERMINAL_MERGE_CONTEXT_FRAMES, sampled,
latent,
TERMINAL_MERGE_CONTEXT_FRAMES,
)
if memory_collector is not None:
capture_memory(memory_collector, "finish_phase", phase="sampling", physical_group=terminal_physical_group, logical_chunks=terminal_logical_chunks)
if memory_collector is not None:
capture_memory(memory_collector, "capture_group",
physical_group=terminal_physical_group,
logical_chunks=terminal_logical_chunks,
stage="after sampling",
retained_entries=entries,
observed_latent=sampled,
retained_refine_context=refine_groups,
) )
else: if memory_collector is not None:
from ..v3.masked_continuation import restore_masked_video_prefix capture_memory(memory_collector, "start_phase", phase="cpu_commit_validation", physical_group=terminal_physical_group, logical_chunks=terminal_logical_chunks)
sampled=restore_masked_video_prefix( if context_before is not None and video_context is not None:
sampled, assert_context_unchanged(video_context,audio_context,context_before)
latent, sampled_video,sampled_audio=latent_to_cpu(sampled)
TERMINAL_MERGE_CONTEXT_FRAMES, logical_parts=_split_terminal_merged_latents(sampled_video,sampled_audio,contract)
sampling_reports.append(f"terminal physical sample: terminal_pair={pair_start+1}-{chunks}, physical_seed={physical_seed}, physical_frames={physical_frames}, sampling_passes=1, shared_physical_sample=true, terminal_prompt_policy={terminal_prompt_policy}, trim={physical_context_frames}, reason={reason}")
terminal_commit_entries=[]
terminal_commit_positions=[]
for offset,(video_part,audio_part) in enumerate(logical_parts):
sequence_index=pair_start+offset
total_frames=int(contract["logical_frames"][offset])
trim_frames=int(contract["logical_trims"][offset])
continuation=bool(trim_frames)
clip_index=physical_clip_index+offset
context_frames=trim_frames if continuation else 5
chunk_plan=make_plan(continuation=continuation,clip_index=clip_index,total_frames=total_frames,trim_frames=trim_frames,width=width,height=height,context_frames=context_frames,state_capacity_frames=largest_context_capacity(total_frames-trim_frames),requested_extend_seconds=chunk_seconds,debug=debug)
logical_latent=latent_from_cpu(video_part,audio_part)
logical_seed=int(terminal_seed_plan["logical_entry_seeds"][offset])
entry=make_chunk_entry(latent=logical_latent,plan=chunk_plan,prompt=prompts[sequence_index],prompt_hash=prompt_hashes[sequence_index],seed=logical_seed,context_frames=trim_frames,motion_score=motion_score,reused=False)
entries.append(entry)
previous_state=entry_to_state(entry)
_record_context_diagnostics(tracker=context_diagnostics,reports=sampling_reports,state=previous_state,continuity=continuity,reused=False)
terminal_commit_entries.append(entry)
terminal_commit_positions.append(sequence_index)
retained_frames+=int(chunk_plan["net_frames"])
sampling_reports.append(f"chunk {sequence_index+1}/{chunks}: seed={logical_seed}, frames={total_frames}, trim={trim_frames}, retained_total={retained_frames}, context={trim_frames}, shared_physical_sample=terminal_10s_seed_v2")
del logical_latent
if storage_controller is not None:
storage_controller.commit_group(
tuple(terminal_commit_entries),
positions=tuple(terminal_commit_positions),
) )
if memory_collector is not None: if memory_collector is not None:
capture_memory(memory_collector, "finish_phase", phase="sampling", physical_group=terminal_physical_group, logical_chunks=terminal_logical_chunks) capture_memory(memory_collector, "finish_phase", phase="cpu_commit_validation", physical_group=terminal_physical_group, logical_chunks=terminal_logical_chunks)
if memory_collector is not None: del sampled,sampled_video,sampled_audio,logical_parts,latent,conditioning,chunk_model
capture_memory(memory_collector, "capture_group", del video_part,audio_part
physical_group=terminal_physical_group, if memory_collector is not None:
logical_chunks=terminal_logical_chunks, capture_memory(memory_collector, "capture_group",
stage="after sampling", physical_group=terminal_physical_group,
retained_entries=entries, logical_chunks=terminal_logical_chunks,
observed_latent=sampled, stage="after CPU commit",
retained_refine_context=refine_groups, retained_entries=entries,
) retained_refine_context=refine_groups,
if memory_collector is not None: )
capture_memory(memory_collector, "start_phase", phase="cpu_commit_validation", physical_group=terminal_physical_group, logical_chunks=terminal_logical_chunks) mark_review_group=getattr(storage_controller,"mark_review_group",None)
if context_before is not None and video_context is not None: if callable(mark_review_group):
assert_context_unchanged(video_context,audio_context,context_before) mark_review_group(
sampled_video,sampled_audio=latent_to_cpu(sampled) start=pair_start+1,
logical_parts=_split_terminal_merged_latents(sampled_video,sampled_audio,contract) end=chunks,
sampling_reports.append(f"terminal physical sample: terminal_pair={pair_start+1}-{chunks}, physical_seed={physical_seed}, physical_frames={physical_frames}, sampling_passes=1, shared_physical_sample=true, terminal_prompt_policy={terminal_prompt_policy}, trim={physical_context_frames}, reason={reason}") physical_group=terminal_physical_group,
for offset,(video_part,audio_part) in enumerate(logical_parts): )
sequence_index=pair_start+offset new_physical_groups+=1
total_frames=int(contract["logical_frames"][offset]) else:
trim_frames=int(contract["logical_trims"][offset]) del latent,conditioning
continuation=bool(trim_frames)
clip_index=physical_clip_index+offset
context_frames=trim_frames if continuation else 5
chunk_plan=make_plan(continuation=continuation,clip_index=clip_index,total_frames=total_frames,trim_frames=trim_frames,width=width,height=height,context_frames=context_frames,state_capacity_frames=largest_context_capacity(total_frames-trim_frames),requested_extend_seconds=chunk_seconds,debug=debug)
logical_latent=latent_from_cpu(video_part,audio_part)
logical_seed=int(terminal_seed_plan["logical_entry_seeds"][offset])
entry=make_chunk_entry(latent=logical_latent,plan=chunk_plan,prompt=prompts[sequence_index],prompt_hash=prompt_hashes[sequence_index],seed=logical_seed,context_frames=trim_frames,motion_score=motion_score,reused=False)
entries.append(entry)
previous_state=entry_to_state(entry)
_record_context_diagnostics(tracker=context_diagnostics,reports=sampling_reports,state=previous_state,continuity=continuity,reused=False)
if storage_controller is not None:
storage_controller.commit_chunk(entry,position=sequence_index)
retained_frames+=int(chunk_plan["net_frames"])
sampling_reports.append(f"chunk {sequence_index+1}/{chunks}: seed={logical_seed}, frames={total_frames}, trim={trim_frames}, retained_total={retained_frames}, context={trim_frames}, shared_physical_sample=terminal_10s_seed_v2")
del logical_latent
if memory_collector is not None:
capture_memory(memory_collector, "finish_phase", phase="cpu_commit_validation", physical_group=terminal_physical_group, logical_chunks=terminal_logical_chunks)
del sampled,sampled_video,sampled_audio,logical_parts,latent,conditioning,chunk_model
del video_part,audio_part
if memory_collector is not None:
capture_memory(memory_collector, "capture_group",
physical_group=terminal_physical_group,
logical_chunks=terminal_logical_chunks,
stage="after CPU commit",
retained_entries=entries,
retained_refine_context=refine_groups,
)
mark_review_group=getattr(storage_controller,"mark_review_group",None)
if callable(mark_review_group):
mark_review_group(
start=pair_start+1,
end=chunks,
physical_group=terminal_physical_group,
)
new_physical_groups+=1
if memory_collector is not None: if memory_collector is not None:
capture_memory(memory_collector, "start_phase", phase="finalization") capture_memory(memory_collector, "start_phase", phase="finalization")
if layout_validation_profiler is not None: if layout_validation_profiler is not None:
@@ -1351,11 +1467,57 @@ def run_sequence(*,model:Any,clip:Any,video_vae:Any,audio_vae:Any,sampler:Any,si
if duration_report: report_lines.append(duration_report) if duration_report: report_lines.append(duration_report)
report_lines.extend([session_summary(new_session),f"Output: {images.shape[0]} frames ({images.shape[0]/FPS:.3f}s), audio samples={audio['waveform'].shape[-1]}, decoded tensor≈{decoded_gib:.2f} GiB."]) report_lines.extend([session_summary(new_session),f"Output: {images.shape[0]} frames ({images.shape[0]/FPS:.3f}s), audio samples={audio['waveform'].shape[-1]}, decoded tensor≈{decoded_gib:.2f} GiB."])
return images,audio,last_state,new_session,"\n".join(report_lines) return images,audio,last_state,new_session,"\n".join(report_lines)
# V3.0.1 hardening integration: Detailed Report only; generation semantics unchanged. # V3.0.1 hardening integration: Detailed Report only; generation semantics unchanged.
from ..hardening import run_sequence_with_hardening as _run_sequence_with_hardening from ..hardening import run_sequence_with_hardening as _run_sequence_with_hardening
_run_sequence_v300 = run_sequence
def run_sequence(*,model:Any,clip:Any,video_vae:Any,audio_vae:Any,sampler:Any,sigmas:torch.Tensor,first_frame:torch.Tensor|None,last_frame:torch.Tensor|None,prompt_plan:dict[str,Any],width:int,height:int,continuity:str,base_seed:int,audio_continuity:bool,exact_total_duration:bool,diagnostics_mode:str,reroll_from_chunk:int,reroll_nonce:int,strict_compatibility:bool,debug:bool,seam_correction:str=SEAM_CORRECTION_OFF,enable_preview:bool=True,session:dict[str,Any]|None=None,initial_state:dict[str,Any]|None=None,latent_only:bool=False,reference_assets=None,reference_audio_source=None,reference_audio_vae=None,driving_audio_source=None,driving_audio_vae=None,reference_video_source=None,timeline_video_source=None,guide_source=None,capture_refine_context:bool=False,memory_attribution:bool=False,prompt_conditioning_cache:bool=False,reference_encode_cache:bool=False,continuation_transport:str=REFERENCE_CONTEXT_V1,max_new_physical_groups:int|None=None,_memory_attribution_collector:Any=None,_diagnostic_continuation_policy:Any=None):
"""Signature-compatible adapter into the R4 internal runtime."""
def run_sequence(*args, **kwargs):
return _run_sequence_with_hardening(_run_sequence_v300, args, kwargs) return _run_sequence_with_hardening(
_run_runtime_internal,
(),
{
"model":model,
"clip":clip,
"video_vae":video_vae,
"audio_vae":audio_vae,
"sampler":sampler,
"sigmas":sigmas,
"first_frame":first_frame,
"last_frame":last_frame,
"prompt_plan":prompt_plan,
"width":width,
"height":height,
"continuity":continuity,
"base_seed":base_seed,
"audio_continuity":audio_continuity,
"exact_total_duration":exact_total_duration,
"diagnostics_mode":diagnostics_mode,
"reroll_from_chunk":reroll_from_chunk,
"reroll_nonce":reroll_nonce,
"strict_compatibility":strict_compatibility,
"debug":debug,
"seam_correction":seam_correction,
"enable_preview":enable_preview,
"session":session,
"initial_state":initial_state,
"latent_only":latent_only,
"reference_assets":reference_assets,
"reference_audio_source":reference_audio_source,
"reference_audio_vae":reference_audio_vae,
"driving_audio_source":driving_audio_source,
"driving_audio_vae":driving_audio_vae,
"reference_video_source":reference_video_source,
"timeline_video_source":timeline_video_source,
"guide_source":guide_source,
"capture_refine_context":capture_refine_context,
"memory_attribution":memory_attribution,
"prompt_conditioning_cache":prompt_conditioning_cache,
"reference_encode_cache":reference_encode_cache,
"continuation_transport":continuation_transport,
"max_new_physical_groups":max_new_physical_groups,
"_memory_attribution_collector":_memory_attribution_collector,
"_diagnostic_continuation_policy":_diagnostic_continuation_policy,
},
)
+28 -67
View File
@@ -53,6 +53,7 @@ from .memory_action_policy import (
make_memory_action_policy, make_memory_action_policy,
resolve_memory_action_policy, resolve_memory_action_policy,
) )
from .node_facade import execute_v38_runtime_request, make_runtime_request
from .nodes import CATEGORY as CONTINUUM_CATEGORY, H3ContinuumSamplerProduction from .nodes import CATEGORY as CONTINUUM_CATEGORY, H3ContinuumSamplerProduction
from .resolution import ( from .resolution import (
H3_ASPECT_AUTO, H3_ASPECT_AUTO,
@@ -732,75 +733,35 @@ class H3ContinuumSamplerV38(H3ContinuumSamplerV37):
custom_mp=custom_mp, custom_mp=custom_mp,
first_frame=kwargs.get("first_frame"), first_frame=kwargs.get("first_frame"),
) )
outputs = super().run(
width=resolution.width,
height=resolution.height,
generation_mode=generation_mode,
review_action=review_action,
take_group=take_group,
take_revision_id=take_revision_id,
take_action=take_action,
reference_encode_cache=True,
**kwargs,
)
# Preserve non-runtime test doubles and any future non-standard facade
# result rather than turning diagnostics into an execution requirement.
if not isinstance(outputs, tuple) or len(outputs) < 4:
return outputs
if size_source != H3_SIZE_SOURCE_LEGACY:
resolution_lines = [
(
f"Resolution: {resolution.width} x {resolution.height} "
f"({resolution.actual_mp:.2f} MP); source={resolution.aspect_source}."
)
]
resolution_lines.extend(resolution.warnings)
status = str(outputs[3]).rstrip() + "\n" + "\n".join(resolution_lines)
outputs = (*outputs[:3], status, *outputs[4:])
diagnostics_mode = str(kwargs.get("diagnostics", "Basic")) diagnostics_mode = str(kwargs.get("diagnostics", "Basic"))
normalized_diagnostics_mode = normalize_diagnostics_mode(diagnostics_mode) normalized_diagnostics_mode = normalize_diagnostics_mode(diagnostics_mode)
if normalized_diagnostics_mode == DIAGNOSTICS_OFF: request = make_runtime_request(
return outputs runtime_kwargs=kwargs,
try: fixed_runtime_kwargs={
diagnostics = build_v38_diagnostics( "width": resolution.width,
video_latents=outputs[0], "height": resolution.height,
audio_latents=outputs[1], "generation_mode": generation_mode,
assembly_plan=outputs[2], "review_action": review_action,
output_width=resolution.width, "take_group": take_group,
output_height=resolution.height, "take_revision_id": take_revision_id,
chunk_seconds=float(kwargs["chunk_seconds"]), "take_action": take_action,
reference_images=( "reference_encode_cache": True,
kwargs.get("reference_image_1"), },
kwargs.get("reference_image_2"), resolution=resolution,
kwargs.get("reference_image_3"), size_source=size_source,
), diagnostics_mode=normalized_diagnostics_mode,
reference_size=str(kwargs.get("reference_size", "Match Output")), diagnostics_inputs=kwargs,
video_guide=kwargs.get("reference_video_1"), )
video_guide_size=str( return execute_v38_runtime_request(
kwargs.get( request,
"video_reference_size", runtime_adapter=super(H3ContinuumSamplerV38, self).run,
REFERENCE_VIDEO_SIZE_EFFICIENT, legacy_size_source=H3_SIZE_SOURCE_LEGACY,
) diagnostics_off=DIAGNOSTICS_OFF,
), diagnostics_full=DIAGNOSTICS_FULL,
still_guide_active=kwargs.get("guide") is not None, reference_video_size_default=REFERENCE_VIDEO_SIZE_EFFICIENT,
) build_diagnostics=build_v38_diagnostics,
status = append_v38_status( append_status=append_v38_status,
outputs[3], )
diagnostics,
mode=diagnostics_mode,
)
except Exception as exc:
# Generation already succeeded. Reliability reporting must never
# discard or replace a valid Production result.
status = str(outputs[3])
message = (
"V3.8 Reliability\n"
"Reliability diagnostics unavailable; generation result was preserved."
)
if normalized_diagnostics_mode == DIAGNOSTICS_FULL:
message += f" ({type(exc).__name__}: {exc})"
status = status.rstrip() + "\n" + message
return (*outputs[:3], status, *outputs[4:])
class H3ContinuumMemoryActionPolicyExperimental: class H3ContinuumMemoryActionPolicyExperimental:
+191
View File
@@ -0,0 +1,191 @@
"""Pure physical-group planner for the staged V3.8 runtime redesign.
The caller owns continuation-source priority and passes exactly one selected
``ContinuationSourceFacts``. This module performs no repository, Session,
State, tensor, ComfyUI, or sampling work.
"""
from __future__ import annotations
from ..branch_provenance import BranchProvenanceError, physical_groups
from .planning_types import (
ContinuationSourceFacts,
ExecutionPlan,
PhysicalGroupDescriptor,
ProjectionDecision,
)
from .review_control import (
REVISION_STATUS_COMPLETE,
REVISION_STATUS_INTERRUPTED,
REVISION_STATUS_REVIEW_READY,
ReviewExecution,
ReviewUnit,
)
PROJECTION_FULL_ACCEPTED_PREFIX = "full_accepted_prefix"
PROJECTION_CURRENT_REVIEW_UNIT = "current_review_unit"
class ExecutionPlanningError(ValueError):
"""Raised when already-selected planning facts are internally inconsistent."""
def resolve_projection_decision(
*,
review_execution: ReviewExecution | None,
effective_result_status: str,
accepted_chunks: int,
physical_group_facts: tuple[tuple[int, ...], ...],
) -> ProjectionDecision:
"""Resolve output-only projection from finalized, source-neutral facts."""
full = ProjectionDecision(PROJECTION_FULL_ACCEPTED_PREFIX)
if str(effective_result_status) != REVISION_STATUS_REVIEW_READY:
return full
if review_execution is None or bool(
getattr(review_execution, "finish_remaining", False)
):
return full
if not (
bool(getattr(review_execution, "partial_review", False))
or bool(getattr(review_execution, "smart_regenerate", False))
):
return full
start = getattr(review_execution, "next_review_unit_start", None)
end = getattr(review_execution, "next_review_unit_end", None)
if start is None or end is None:
return full
start, end = int(start), int(end)
if start < 1 or end < start or end > int(accepted_chunks):
return full
selected = set(range(start, end + 1))
if not physical_group_facts:
return full
for group in physical_group_facts:
group_indices = set(group)
if selected.intersection(group_indices) and not group_indices.issubset(selected):
return full
return ProjectionDecision(PROJECTION_CURRENT_REVIEW_UNIT, start, end)
def build_execution_plan(
*,
continuation_source_facts: ContinuationSourceFacts,
configured_chunks: int,
terminal_merge_enabled: bool,
max_new_physical_groups: int | None,
review_execution: ReviewExecution | None,
retained_review_unit: ReviewUnit | None = None,
) -> ExecutionPlan:
"""Plan physical groups without selecting or validating runtime sources."""
if not isinstance(continuation_source_facts, ContinuationSourceFacts):
raise ExecutionPlanningError(
"continuation_source_facts must be one selected ContinuationSourceFacts"
)
if continuation_source_facts.kind not in {
"run_storage",
"explicit_session",
"initial_state",
"none",
}:
raise ExecutionPlanningError(
f"unknown continuation source kind: {continuation_source_facts.kind!r}"
)
if isinstance(configured_chunks, bool) or not isinstance(configured_chunks, int):
raise ExecutionPlanningError("configured_chunks must be an integer")
if configured_chunks < 1:
raise ExecutionPlanningError("configured_chunks must be positive")
if type(terminal_merge_enabled) is not bool:
raise ExecutionPlanningError("terminal_merge_enabled must be a boolean")
if max_new_physical_groups is not None and (
isinstance(max_new_physical_groups, bool)
or not isinstance(max_new_physical_groups, int)
or max_new_physical_groups < 0
):
raise ExecutionPlanningError(
"max_new_physical_groups must be None or a non-negative integer"
)
accepted = continuation_source_facts.accepted_chunks
if isinstance(accepted, bool) or not isinstance(accepted, int):
raise ExecutionPlanningError("accepted_chunks must be an integer")
if not 0 <= accepted <= configured_chunks:
raise ExecutionPlanningError(
"accepted_chunks must be within the configured sequence"
)
try:
runtime_groups = physical_groups(
chunks=configured_chunks,
terminal_merge_enabled=terminal_merge_enabled,
)
except BranchProvenanceError as exc:
raise ExecutionPlanningError(str(exc)) from exc
descriptors = tuple(
PhysicalGroupDescriptor(
physical_group=int(group.physical_group),
logical_chunks=tuple(range(int(group.start), int(group.end) + 1)),
terminal_atomic=int(group.start) != int(group.end),
)
for group in runtime_groups
)
accepted_boundaries = tuple(
(descriptor.logical_chunks[0], descriptor.logical_chunks[-1])
for descriptor in descriptors
if descriptor.logical_chunks[-1] <= accepted
)
if accepted_boundaries and accepted_boundaries[-1][1] != accepted:
raise ExecutionPlanningError("accepted prefix ends inside a physical group")
if accepted and not accepted_boundaries:
raise ExecutionPlanningError("accepted prefix has no complete physical group")
if continuation_source_facts.physical_group_boundaries != accepted_boundaries:
raise ExecutionPlanningError(
"selected continuation source physical groups do not match its prefix"
)
pending = tuple(
descriptor
for descriptor in descriptors
if descriptor.logical_chunks[0] > accepted
)
groups_to_generate = (
pending
if max_new_physical_groups is None
else pending[:max_new_physical_groups]
)
expected_chunks = accepted + sum(
len(descriptor.logical_chunks) for descriptor in groups_to_generate
)
expected_review_unit = retained_review_unit
if groups_to_generate and max_new_physical_groups is not None:
final_group = groups_to_generate[-1]
expected_review_unit = ReviewUnit(
start=final_group.logical_chunks[0],
end=final_group.logical_chunks[-1],
physical_group=final_group.physical_group,
)
if expected_chunks == configured_chunks:
expected_status = REVISION_STATUS_COMPLETE
elif max_new_physical_groups is not None and expected_review_unit is not None:
expected_status = REVISION_STATUS_REVIEW_READY
else:
expected_status = REVISION_STATUS_INTERRUPTED
projection = resolve_projection_decision(
review_execution=review_execution,
effective_result_status=expected_status,
accepted_chunks=expected_chunks,
physical_group_facts=tuple(
descriptor.logical_chunks for descriptor in descriptors
),
)
return ExecutionPlan(
groups_to_generate=groups_to_generate,
projection=projection,
expected_status=expected_status,
expected_review_unit=expected_review_unit,
)
+165
View File
@@ -0,0 +1,165 @@
"""Thin V3.8 public-node to runtime boundary.
This module deliberately owns no continuation, review, storage, planning, or
sampling decision. It only carries already-resolved public-node values into
the existing hardening/runtime call and preserves its public return value.
"""
from __future__ import annotations
from collections.abc import Callable, Mapping
from dataclasses import dataclass
from types import MappingProxyType
from typing import Any
@dataclass(frozen=True)
class RuntimeRequest:
"""Resolved V3.8 node inputs for one existing runtime invocation.
Tensor and model objects deliberately keep their identity. Only the two
keyword containers are copied and frozen so the facade cannot mutate the
caller's widget/input mapping after the request boundary.
"""
runtime_kwargs: Mapping[str, Any]
resolution: Any
size_source: str
diagnostics_mode: str
diagnostics_inputs: Mapping[str, Any]
def __post_init__(self) -> None:
object.__setattr__(
self,
"runtime_kwargs",
MappingProxyType(dict(self.runtime_kwargs)),
)
object.__setattr__(
self,
"diagnostics_inputs",
MappingProxyType(dict(self.diagnostics_inputs)),
)
@dataclass(frozen=True)
class RuntimeOutput:
"""Existing runtime result with status-only facade decoration helpers."""
value: Any
@property
def has_status(self) -> bool:
return isinstance(self.value, tuple) and len(self.value) >= 4
@property
def status(self) -> str:
if not self.has_status:
raise TypeError("runtime output has no public status field")
return str(self.value[3])
def with_status(self, status: str) -> "RuntimeOutput":
if not self.has_status:
return self
return RuntimeOutput((*self.value[:3], str(status), *self.value[4:]))
def as_public_tuple(self) -> Any:
"""Return the unchanged nonstandard test double or public tuple."""
return self.value
def make_runtime_request(
*,
runtime_kwargs: Mapping[str, Any],
fixed_runtime_kwargs: Mapping[str, Any],
resolution: Any,
size_source: str,
diagnostics_mode: str,
diagnostics_inputs: Mapping[str, Any],
) -> RuntimeRequest:
"""Build the one R6 request without silently accepting duplicate inputs."""
duplicate = set(runtime_kwargs).intersection(fixed_runtime_kwargs)
if duplicate:
name = sorted(duplicate)[0]
raise TypeError(
"H3 Continuum Sampler V3.8 received multiple values for "
f"runtime keyword {name!r}"
)
merged = dict(runtime_kwargs)
merged.update(fixed_runtime_kwargs)
return RuntimeRequest(
runtime_kwargs=merged,
resolution=resolution,
size_source=str(size_source),
diagnostics_mode=str(diagnostics_mode),
diagnostics_inputs=diagnostics_inputs,
)
def execute_v38_runtime_request(
request: RuntimeRequest,
*,
runtime_adapter: Callable[..., Any],
legacy_size_source: str,
diagnostics_off: str,
diagnostics_full: str,
reference_video_size_default: str,
build_diagnostics: Callable[..., Any],
append_status: Callable[..., str],
) -> Any:
"""Call the existing runtime once and add V3.8 display-only diagnostics."""
output = RuntimeOutput(runtime_adapter(**request.runtime_kwargs))
if not output.has_status:
return output.as_public_tuple()
if request.size_source != legacy_size_source:
resolution = request.resolution
lines = [
(
f"Resolution: {resolution.width} x {resolution.height} "
f"({resolution.actual_mp:.2f} MP); source={resolution.aspect_source}."
)
]
lines.extend(resolution.warnings)
output = output.with_status(output.status.rstrip() + "\n" + "\n".join(lines))
if request.diagnostics_mode == diagnostics_off:
return output.as_public_tuple()
try:
inputs = request.diagnostics_inputs
diagnostics = build_diagnostics(
video_latents=output.value[0],
audio_latents=output.value[1],
assembly_plan=output.value[2],
output_width=request.resolution.width,
output_height=request.resolution.height,
chunk_seconds=float(inputs["chunk_seconds"]),
reference_images=(
inputs.get("reference_image_1"),
inputs.get("reference_image_2"),
inputs.get("reference_image_3"),
),
reference_size=str(inputs.get("reference_size", "Match Output")),
video_guide=inputs.get("reference_video_1"),
video_guide_size=str(
inputs.get("video_reference_size", reference_video_size_default)
),
still_guide_active=inputs.get("guide") is not None,
)
status = append_status(
output.status,
diagnostics,
mode=request.diagnostics_mode,
)
except Exception as exc:
message = (
"V3.8 Reliability\n"
"Reliability diagnostics unavailable; generation result was preserved."
)
if request.diagnostics_mode == diagnostics_full:
message += f" ({type(exc).__name__}: {exc})"
status = output.status.rstrip() + "\n" + message
return output.with_status(status).as_public_tuple()
+168 -5
View File
@@ -1,8 +1,8 @@
"""Public latent-first facade nodes for H3 Continuum V3.""" """Public latent-first facade nodes for H3 Continuum V3."""
from __future__ import annotations from __future__ import annotations
import time import time
from ..constants import ( from ..constants import (
CHUNK_SECONDS_DEFAULT, CHUNK_SECONDS_DEFAULT,
@@ -23,8 +23,15 @@ from ..v2.nodes import (
validate_sparse_prompt_overrides, validate_sparse_prompt_overrides,
) )
from .assembly import H3ContinuumAssembleSeamExperimental, H3ContinuumAssembleV3 from .assembly import H3ContinuumAssembleSeamExperimental, H3ContinuumAssembleV3
from .plan import make_assembly_plan from .plan import make_assembly_plan
from ..timeline_video import TIMELINE_VIDEO_SIZE_OPTIONS from .execution_planner import (
PROJECTION_CURRENT_REVIEW_UNIT,
PROJECTION_FULL_ACCEPTED_PREFIX,
resolve_projection_decision as _resolve_projection_decision,
)
from .planning_types import ProjectionDecision
from .review_control import REVISION_STATUS_REVIEW_READY
from ..timeline_video import TIMELINE_VIDEO_SIZE_OPTIONS
REGENERATE_AUTO = "Auto" REGENERATE_AUTO = "Auto"
@@ -67,6 +74,51 @@ _PARTIAL_REVIEW_SECOND_PASS_WARNING = (
) )
def resolve_projection_decision(
*,
review_execution,
effective_result_status: str,
session,
physical_group_facts: tuple[tuple[int, ...], ...],
) -> ProjectionDecision:
"""Compatibility adapter for the R1 pure resolver API."""
entries = session.get("chunks") if isinstance(session, dict) else None
return _resolve_projection_decision(
review_execution=review_execution,
effective_result_status=effective_result_status,
accepted_chunks=(len(entries) if isinstance(entries, list) else 0),
physical_group_facts=physical_group_facts,
)
def _physical_group_facts(assembly_plan) -> tuple[tuple[int, ...], ...]:
"""Extract immutable logical membership facts from an existing assembly plan."""
if not isinstance(assembly_plan, dict):
return ()
groups = assembly_plan.get("decode_groups") or assembly_plan.get("chunks")
if not isinstance(groups, list):
return ()
facts = []
for group in groups:
if not isinstance(group, dict):
return ()
indices = group.get("logical_chunk_indices")
if indices is None:
indices = [group.get("chunk_index")]
if not isinstance(indices, list) or not indices:
return ()
try:
normalized = tuple(int(index) for index in indices)
except (TypeError, ValueError):
return ()
if any(index < 1 for index in normalized):
return ()
facts.append(normalized)
return tuple(facts)
def _partial_review_warning(storage, *, capture_refine_context: bool) -> str: def _partial_review_warning(storage, *, capture_refine_context: bool) -> str:
execution = getattr(storage, "review_execution", None) execution = getattr(storage, "review_execution", None)
if ( if (
@@ -78,6 +130,107 @@ def _partial_review_warning(storage, *, capture_refine_context: bool) -> str:
return "" return ""
def _review_decode_chunk_range(storage, *, capture_refine_context: bool):
# Refine context is a separate, preserved output; capturing it does not
# require external VAE nodes to decode the entire accepted prefix.
if getattr(storage, "review_generation_mode", None) != "Review Each Chunk":
return None
execution = getattr(storage, "review_execution", None)
if execution is None or bool(getattr(execution, "finish_remaining", False)):
return None
start = getattr(execution, "next_review_unit_start", None)
end = getattr(execution, "next_review_unit_end", None)
if start is None or end is None:
return None
if not (
bool(getattr(execution, "partial_review", False))
or bool(getattr(execution, "smart_regenerate", False))
):
return None
return int(start), int(end)
def _apply_review_decode_scope(
outputs,
*,
storage,
capture_refine_context: bool,
configured_chunks: int,
chunk_seconds: float,
first_frame,
last_frame,
timeline_video_source,
):
_, _, assembly_plan, result, *tail = outputs
session = result.get("session") if isinstance(result, dict) else None
entries = session.get("chunks") if isinstance(session, dict) else None
if not isinstance(entries, list):
return outputs
execution_plan = getattr(storage, "execution_plan", None)
decision = getattr(execution_plan, "projection", None)
if not isinstance(decision, ProjectionDecision):
# Compatibility for isolated callers that replace the sequence runtime
# and therefore cannot carry its Queue-local plan. The same pure
# resolver remains the only Projection owner.
effective_status = (
REVISION_STATUS_REVIEW_READY
if getattr(storage, "review_generation_mode", None)
== "Review Each Chunk"
else "complete"
)
decision = resolve_projection_decision(
review_execution=getattr(storage, "review_execution", None),
effective_result_status=effective_status,
session=session,
physical_group_facts=_physical_group_facts(assembly_plan),
)
if decision.kind != PROJECTION_CURRENT_REVIEW_UNIT:
return outputs
start = int(decision.start_chunk)
end = int(decision.end_chunk)
selected_entries = entries[start - 1 : end]
sequence_complete = len(entries) == int(configured_chunks)
from ..v2.sequence import _terminal_flf_merge_enabled
from .plan import prepare_physical_decode_entries
terminal_merged = sequence_complete and _terminal_flf_merge_enabled(
multi_chunk_flf=(
first_frame is not None
and last_frame is not None
and int(configured_chunks) > 1
),
chunks=int(configured_chunks),
chunk_seconds=float(chunk_seconds),
prompt_hashes=[str(entry["prompt_hash"]) for entry in entries],
timeline_video_source=timeline_video_source,
)
selected_terminal_merged = terminal_merged and (
end == int(configured_chunks)
and start <= int(configured_chunks) - 1
)
decode_entries, scoped_plan = prepare_physical_decode_entries(
selected_entries,
chunk_seconds=float(chunk_seconds),
preserve_final_frame=(
sequence_complete
and end == int(configured_chunks)
and last_frame is not None
),
terminal_merged=selected_terminal_merged,
terminal_initial_pair=(start == 1),
)
scoped_video = [{"samples": entry["video"]} for entry in decode_entries]
scoped_audio = [{"samples": entry["audio"]} for entry in decode_entries]
scoped_result = dict(result)
scoped_result["report"] = str(scoped_result.get("report", "")).rstrip() + (
f"\nDecode preview: Chunk {start}"
if start == end
else f"\nDecode preview: Chunks {start}-{end}"
)
return (scoped_video, scoped_audio, scoped_plan, scoped_result, *tail)
def _format_review_status(storage, *, detailed: bool = False) -> str: def _format_review_status(storage, *, detailed: bool = False) -> str:
"""Format Phase D facts after finalize without reading storage in frontend.""" """Format Phase D facts after finalize without reading storage in frontend."""
@@ -1005,6 +1158,16 @@ class H3ContinuumSamplerProduction(H3ContinuumSamplerV3):
take_action=str(take_action), take_action=str(take_action),
) )
execute_outputs = execute() execute_outputs = execute()
execute_outputs = _apply_review_decode_scope(
execute_outputs,
storage=storage,
capture_refine_context=bool(capture_refine_context),
configured_chunks=int(chunks),
chunk_seconds=float(chunk_seconds),
first_frame=first_frame,
last_frame=last_frame,
timeline_video_source=timeline_video_source,
)
if bool(capture_refine_context): if bool(capture_refine_context):
video_latents, audio_latents, assembly_plan, result, refine_context = execute_outputs video_latents, audio_latents, assembly_plan, result, refine_context = execute_outputs
else: else:
+35 -13
View File
@@ -223,13 +223,21 @@ def _attach_second_pass_contract(
logical_entries: list[dict[str, Any]], logical_entries: list[dict[str, Any]],
physical_entries: list[dict[str, Any]], physical_entries: list[dict[str, Any]],
chunk_seconds: float, chunk_seconds: float,
logical_chunk_indices: list[int] | None = None,
) -> None: ) -> None:
"""Attach additive V3.5 metadata without changing V3.4 generation semantics.""" """Attach additive V3.5 metadata without changing V3.4 generation semantics."""
chunk_indices = (
list(range(1, len(logical_entries) + 1))
if logical_chunk_indices is None
else [int(value) for value in logical_chunk_indices]
)
if len(chunk_indices) != len(logical_entries):
raise ValueError("logical chunk identity count does not match entries")
decode_groups = plan.get("decode_groups") decode_groups = plan.get("decode_groups")
if not isinstance(decode_groups, list): if not isinstance(decode_groups, list):
decode_groups = [ decode_groups = [
{ {
"logical_chunk_indices": [index + 1], "logical_chunk_indices": [chunk_indices[index]],
"terminal_merged": False, "terminal_merged": False,
"total_frames": plan["chunks"][index]["total_frames"], "total_frames": plan["chunks"][index]["total_frames"],
"trim_frames": plan["chunks"][index]["trim_frames"], "trim_frames": plan["chunks"][index]["trim_frames"],
@@ -237,6 +245,10 @@ def _attach_second_pass_contract(
for index in range(len(physical_entries)) for index in range(len(physical_entries))
] ]
prompt_by_chunk = {
chunk_indices[index]: str(entry.get("prompt", ""))
for index, entry in enumerate(logical_entries)
}
groups: list[dict[str, Any]] = [] groups: list[dict[str, Any]] = []
for group_id, (entry, decode_group) in enumerate( for group_id, (entry, decode_group) in enumerate(
zip(physical_entries, decode_groups, strict=True) zip(physical_entries, decode_groups, strict=True)
@@ -244,7 +256,7 @@ def _attach_second_pass_contract(
video = entry["video"] video = entry["video"]
audio = entry["audio"] audio = entry["audio"]
logical_chunks = [int(value) for value in decode_group["logical_chunk_indices"]] logical_chunks = [int(value) for value in decode_group["logical_chunk_indices"]]
prompts = [str(logical_entries[index - 1].get("prompt", "")) for index in logical_chunks] prompts = [prompt_by_chunk[index] for index in logical_chunks]
if len(prompts) == 1: if len(prompts) == 1:
physical_prompt = prompts[0] physical_prompt = prompts[0]
prompt_policy = "single" prompt_policy = "single"
@@ -284,26 +296,31 @@ def _attach_second_pass_contract(
def prepare_physical_decode_entries( def prepare_physical_decode_entries(
entries, entries,
*, *,
chunk_seconds: float, chunk_seconds: float,
preserve_final_frame: bool, preserve_final_frame: bool,
terminal_merged: bool, terminal_merged: bool,
): terminal_initial_pair: bool | None = None,
):
"""Return external-VAE decode units while preserving logical plan metadata.""" """Return external-VAE decode units while preserving logical plan metadata."""
logical_entries = list(entries) logical_entries = list(entries)
plan = make_assembly_plan( plan = make_assembly_plan(
logical_entries, logical_entries,
chunk_seconds=float(chunk_seconds), chunk_seconds=float(chunk_seconds),
preserve_final_frame=bool(preserve_final_frame), preserve_final_frame=bool(preserve_final_frame),
) )
logical_chunk_indices = [
int(chunk["chunk_index"]) for chunk in plan["chunks"]
]
if not terminal_merged: if not terminal_merged:
_attach_second_pass_contract( _attach_second_pass_contract(
plan, plan,
logical_entries=logical_entries, logical_entries=logical_entries,
physical_entries=logical_entries, physical_entries=logical_entries,
chunk_seconds=float(chunk_seconds), chunk_seconds=float(chunk_seconds),
logical_chunk_indices=logical_chunk_indices,
) )
return logical_entries, plan return logical_entries, plan
if len(logical_entries) < 2: if len(logical_entries) < 2:
@@ -311,7 +328,11 @@ def prepare_physical_decode_entries(
from ..v2.sequence import _terminal_pair_contract from ..v2.sequence import _terminal_pair_contract
initial_pair = len(logical_entries) == 2 initial_pair = (
len(logical_entries) == 2
if terminal_initial_pair is None
else bool(terminal_initial_pair)
)
contract = _terminal_pair_contract( contract = _terminal_pair_contract(
initial_pair=initial_pair, initial_pair=initial_pair,
chunk_seconds=float(chunk_seconds), chunk_seconds=float(chunk_seconds),
@@ -382,6 +403,7 @@ def prepare_physical_decode_entries(
logical_entries=logical_entries, logical_entries=logical_entries,
physical_entries=decode_entries, physical_entries=decode_entries,
chunk_seconds=float(chunk_seconds), chunk_seconds=float(chunk_seconds),
logical_chunk_indices=logical_chunk_indices,
) )
validate_assembly_plan(plan) validate_assembly_plan(plan)
return decode_entries, plan return decode_entries, plan
+83
View File
@@ -0,0 +1,83 @@
"""Immutable facts shared by the pure Continuum execution planner.
This module must remain free of torch and ComfyUI imports. Runtime payloads
stay in their existing adapters and are projected into these facts only after
the active continuation source has already been selected.
"""
from __future__ import annotations
from dataclasses import dataclass
from .review_control import ReviewUnit
@dataclass(frozen=True, slots=True)
class PrefixFacts:
"""Immutable planning projection of one fully validated storage prefix."""
accepted_chunks: int
configured_chunks: int
revision_id: str | None
status: str | None
review_unit: ReviewUnit | None
effective_nonce: int
branch_regenerate_from: int
physical_group_boundaries: tuple[tuple[int, int], ...]
@dataclass(frozen=True, slots=True)
class ExplicitSessionFacts:
"""Characterized facts for an explicit Session runtime input."""
present: bool
compatible: bool
accepted_chunks: int
reroll_from_chunk: int | None
physical_group_boundaries: tuple[tuple[int, int], ...]
@dataclass(frozen=True, slots=True)
class InitialStateFacts:
"""Characterized facts for an initial State runtime input."""
present: bool
usable: bool
@dataclass(frozen=True, slots=True)
class ContinuationSourceFacts:
"""Planning projection of the single source selected by the runtime."""
kind: str
accepted_chunks: int
reroll_from_chunk: int | None
physical_group_boundaries: tuple[tuple[int, int], ...]
@dataclass(frozen=True, slots=True)
class ProjectionDecision:
"""Describe which accepted chunks may be exposed to external decode."""
kind: str
start_chunk: int | None = None
end_chunk: int | None = None
@dataclass(frozen=True, slots=True)
class PhysicalGroupDescriptor:
"""One atomic sampling group expressed in one-based logical chunks."""
physical_group: int
logical_chunks: tuple[int, ...]
terminal_atomic: bool
@dataclass(frozen=True, slots=True)
class ExecutionPlan:
"""Pure plan consumed by the unchanged runtime execution loops."""
groups_to_generate: tuple[PhysicalGroupDescriptor, ...]
projection: ProjectionDecision
expected_status: str
expected_review_unit: ReviewUnit | None
+1 -2
View File
@@ -10,7 +10,7 @@ from typing import Any
import torch import torch
from .temporal import align_frame_count_up from ..temporal import align_frame_count_up
REFERENCE_VIDEO_CONTRACT_VERSION = 1 REFERENCE_VIDEO_CONTRACT_VERSION = 1
@@ -279,4 +279,3 @@ def validate_reference_video_prompts(
"<Video 1> tag; video still conditions generation, but an explicit tag is " "<Video 1> tag; video still conditions generation, but an explicit tag is "
"recommended." "recommended."
) )
+45
View File
@@ -397,6 +397,51 @@ def _branch_contract(
return nonce, branch_start return nonce, branch_start
def validate_review_prefix_metadata(
*,
configured_chunks: int,
validated_prefix_count: int,
terminal_merge_enabled: bool,
terminal_pair_start: int | None,
latest_review_unit: ReviewUnit | Mapping[str, Any] | None,
latest_revision_status: str | None,
latest_effective_nonce: int,
latest_branch_regenerate_from: Any = 0,
) -> ReviewUnit | None:
"""Validate persisted Review metadata without creating an execution decision.
Repository reads and finalization use this boundary after raw prefix
validation. It deliberately returns no ``ReviewExecution`` so those paths
cannot become a second policy owner.
"""
chunks, prefix, pair_start = _review_geometry(
configured_chunks=configured_chunks,
validated_prefix_count=validated_prefix_count,
terminal_merge_enabled=terminal_merge_enabled,
terminal_pair_start=terminal_pair_start,
)
status = _revision_status(
latest_revision_status,
prefix=prefix,
chunks=chunks,
)
unit = _validated_review_unit(
latest_review_unit,
configured_chunks=chunks,
validated_prefix_count=prefix,
terminal_pair_start=pair_start,
)
_branch_contract(
latest_effective_nonce=latest_effective_nonce,
latest_branch_regenerate_from=latest_branch_regenerate_from,
validated_prefix_count=prefix,
configured_chunks=chunks,
latest_revision_status=status,
)
return unit
def _nonce_decision( def _nonce_decision(
*, *,
manual_regenerate_from: int, manual_regenerate_from: int,
+223
View File
@@ -0,0 +1,223 @@
"""Internal owner of Continuum runtime continuation-source priority.
The pure execution planner receives only the source selected here. Runtime
payload validation remains outside the planner so Run Storage, explicit
Session, and initial State can never become competing planner inputs.
"""
from __future__ import annotations
from dataclasses import dataclass
import logging
from typing import Any
from ..branch_provenance import physical_groups
from ..run_storage import RunStorageError
from ..state import validate_state
from ..v2.session import SessionValidationError, entry_to_state
from .planning_types import ContinuationSourceFacts
LOG = logging.getLogger("h3_continuum_join")
class RuntimeCoordinatorError(ValueError):
"""Raised when the characterized runtime source contract is invalid."""
@dataclass(slots=True)
class RuntimeContinuationSelection:
"""Selected runtime payload plus its single planning projection."""
entries: list[dict[str, Any]]
previous_state: dict[str, Any] | None
continuation_source_facts: ContinuationSourceFacts
notes: tuple[str, ...]
def project_selected_continuation_source(
*,
kind: str,
selected_source: dict[str, Any] | None,
) -> ContinuationSourceFacts:
"""Project one already-selected runtime source into planning-only facts."""
normalized_kind = str(kind)
if normalized_kind == "none":
if selected_source is not None:
raise RuntimeCoordinatorError("the none continuation source has no payload")
return ContinuationSourceFacts(
kind="none",
accepted_chunks=0,
reroll_from_chunk=0,
physical_group_boundaries=(),
)
if normalized_kind not in {
"run_storage",
"explicit_session",
"initial_state",
}:
raise RuntimeCoordinatorError(
f"unknown selected continuation source: {normalized_kind!r}"
)
if not isinstance(selected_source, dict):
raise RuntimeCoordinatorError(
"the selected continuation source requires normalized runtime facts"
)
try:
accepted_chunks = int(selected_source["accepted_chunks"])
reroll_from_chunk = int(selected_source["reroll_from_chunk"])
boundaries = tuple(
(int(start), int(end))
for start, end in selected_source["physical_group_boundaries"]
)
except (KeyError, TypeError, ValueError) as exc:
raise RuntimeCoordinatorError(
"selected continuation source facts are invalid"
) from exc
return ContinuationSourceFacts(
kind=normalized_kind,
accepted_chunks=accepted_chunks,
reroll_from_chunk=reroll_from_chunk,
physical_group_boundaries=boundaries,
)
class InternalRuntimeCoordinator:
"""Own the established Storage / Session / State priority contract."""
def __init__(
self,
*,
storage_controller: Any,
input_session: dict[str, Any] | None,
initial_state: dict[str, Any] | None,
) -> None:
self.storage_controller = storage_controller
self.input_session = input_session
self.initial_state = initial_state
self.session_present = input_session is not None
@property
def storage_enabled(self) -> bool:
return self.storage_controller is not None
def prepare_inputs(
self,
) -> tuple[dict[str, Any] | None, dict[str, Any] | None]:
"""Suppress State as soon as an explicit Session is present."""
if self.session_present and self.initial_state is not None:
LOG.warning(
"Both session and initial_state were supplied; using the session "
"and ignoring initial_state"
)
self.initial_state = None
return self.input_session, self.initial_state
def assert_storage_session_compatible(self) -> None:
"""Preserve the existing Run Storage plus explicit Session hard error."""
if self.storage_enabled and self.session_present:
raise RunStorageError(
"Run Storage cannot be combined with an explicit Session"
)
def validate_initial_state_reroll(self, reroll_from_chunk: int) -> None:
"""Apply the existing reroll restriction to the effective State only."""
if self.initial_state is not None and int(reroll_from_chunk) not in (0, 1):
raise RuntimeCoordinatorError(
"with initial_state, reroll_from_chunk can only be 0 or 1"
)
def select_continuation_source(
self,
*,
preserved: list[dict[str, Any]],
initial_state: dict[str, Any] | None,
chunks: int,
width: int,
height: int,
reroll_from_chunk: int,
effective_reroll_from_chunk: int,
terminal_merge_enabled: bool,
) -> RuntimeContinuationSelection:
"""Select exactly one runtime continuation source, then project it."""
entries = preserved[:]
previous_state = None
notes: list[str] = []
if entries:
try:
previous_state = entry_to_state(entries[-1])
except (SessionValidationError, ValueError) as exc:
notes.append(
"saved continuation state was rejected; generated a fresh run "
f"({exc})"
)
entries = []
previous_state = None
# An initial State is considered only if no usable Storage/Session prefix
# survived. Explicit Session presence already suppressed it in
# prepare_inputs(), before Session validity was known.
if not entries and initial_state is not None:
try:
candidate = validate_state(initial_state)
if int(candidate["width"]) != int(width) or int(
candidate["height"]
) != int(height):
notes.append(
"initial_state resolution differs; generated a fresh run"
)
else:
previous_state = candidate
except ValueError as exc:
notes.append(
f"initial_state was rejected; generated a fresh run ({exc})"
)
if entries:
selected_kind = (
"run_storage" if self.storage_enabled else "explicit_session"
)
source_reroll = (
int(reroll_from_chunk)
if self.storage_enabled
else int(effective_reroll_from_chunk)
)
accepted_boundaries = tuple(
(int(group.start), int(group.end))
for group in physical_groups(
chunks=int(chunks),
terminal_merge_enabled=bool(terminal_merge_enabled),
)
if int(group.end) <= len(entries)
)
selected_source = {
"accepted_chunks": len(entries),
"reroll_from_chunk": source_reroll,
"physical_group_boundaries": accepted_boundaries,
}
elif previous_state is not None and initial_state is not None:
selected_kind = "initial_state"
selected_source = {
"accepted_chunks": 0,
"reroll_from_chunk": int(reroll_from_chunk),
"physical_group_boundaries": (),
}
else:
selected_kind = "none"
selected_source = None
return RuntimeContinuationSelection(
entries=entries,
previous_state=previous_state,
continuation_source_facts=project_selected_continuation_source(
kind=selected_kind,
selected_source=selected_source,
),
notes=tuple(notes),
)
+71
View File
@@ -0,0 +1,71 @@
"""One-physical-group Sampling Engine for the Continuum runtime."""
from __future__ import annotations
from typing import Any, Callable
def sample_physical_group(
*,
sample_callable: Callable[..., Any],
model: Any,
conditioning: Any,
latent: Any,
sampler: Any,
sigmas: Any,
seed: int,
enable_preview: bool,
physical_group: int,
logical_chunks: tuple[int, ...],
terminal_atomic: bool,
layout_validation_profiler: Any = None,
packed_row_planner: Any = None,
planner_event: Any = None,
diagnostic_policy: Any = None,
context_frames: int = 0,
) -> tuple[Any, Any]:
"""Run exactly one physical sample with unchanged observer ordering."""
normalized_chunks = tuple(int(value) for value in logical_chunks)
layout_profile_token = (
layout_validation_profiler.begin_sampling_group(
physical_group=int(physical_group),
logical_chunks=normalized_chunks,
sampling_steps=max(0, int(sigmas.shape[-1]) - 1),
)
if layout_validation_profiler is not None
else None
)
diagnostic_sample_token = None
if diagnostic_policy is not None:
diagnostic_sample_token = diagnostic_policy.before_sampling(
physical_group=int(physical_group),
logical_chunks=normalized_chunks,
context_frames=int(context_frames),
latent=latent,
conditioning=conditioning,
seed=int(seed),
sigmas=sigmas,
)
if planner_event is not None:
planner_event(
packed_row_planner,
"begin_group",
physical_group=int(physical_group),
logical_chunks=normalized_chunks,
terminal_atomic=bool(terminal_atomic),
)
sampled = sample_callable(
model=model,
conditioning=conditioning,
latent=latent,
sampler=sampler,
sigmas=sigmas,
seed=int(seed),
enable_preview=bool(enable_preview),
)
if planner_event is not None:
planner_event(packed_row_planner, "finish_group")
if layout_validation_profiler is not None and layout_profile_token is not None:
layout_validation_profiler.finish_sampling_group(layout_profile_token)
return sampled, diagnostic_sample_token
+1 -1
View File
@@ -1,6 +1,6 @@
"""Package version and public schema identifiers.""" """Package version and public schema identifiers."""
PACKAGE_VERSION = "3.8.0" PACKAGE_VERSION = "3.8.1"
STATE_SCHEMA_VERSION = 1 STATE_SCHEMA_VERSION = 1
PLAN_SCHEMA_VERSION = 1 PLAN_SCHEMA_VERSION = 1
PUBLIC_API_VERSION = 3 PUBLIC_API_VERSION = 3
+3 -9
View File
@@ -2956,12 +2956,6 @@ function buildReviewQueueInputs(node, apiInputs) {
return result; return result;
} }
function prepareReviewQueueIntent(node, apiInputs) {
if (node.comfyClass !== V38_NODE_CLASS || !apiInputs) return false;
Object.assign(apiInputs, buildReviewQueueInputs(node, apiInputs));
return true;
}
function configureReviewControls(node) { function configureReviewControls(node) {
if (node.comfyClass !== V38_NODE_CLASS) { if (node.comfyClass !== V38_NODE_CLASS) {
return; return;
@@ -3174,9 +3168,9 @@ app.registerExtension({
|| node.comfyClass === V38_NODE_CLASS || node.comfyClass === V38_NODE_CLASS
) { ) {
node.__h3ContinuumResolutionUxRefresh?.(); node.__h3ContinuumResolutionUxRefresh?.();
requireFixedSeedForReview(node); if (node.comfyClass !== V38_NODE_CLASS) {
normalizeRunStorageState(node, apiNode.inputs); normalizeRunStorageState(node, apiNode.inputs);
prepareReviewQueueIntent(node, apiNode.inputs); }
apiNode.inputs.diagnostics = settingValue(SETTINGS.detailedReport, false) apiNode.inputs.diagnostics = settingValue(SETTINGS.detailedReport, false)
? "Detailed Report" ? "Detailed Report"
: "Basic"; : "Basic";