Release V3.5.1 conditioning bridge and reference audio
This commit is contained in:
@@ -11,6 +11,7 @@ MiniMax H3 Continuum V3.4 for ComfyUI. Treat the V3.4 sampler and assembler as t
|
||||
- Unknown upstream nodes, models, wrappers, or merged models must not be rejected solely because they are unknown.
|
||||
- Keep legacy `strict_compatibility` inputs loadable for old workflows, but ignore their value. They must never enable blocking behavior.
|
||||
- Before every change, run `tools\snapshot.ps1` against the authoritative source. Preserve the compact V3.4 UI unless the user explicitly approves a UI change.
|
||||
- In public templates, connection examples, screenshots, and documentation, keep ComfyUI Core nodes on their standard display titles. Do not assign custom titles to Core nodes, because users must be able to distinguish Core nodes from Continuum and third-party custom nodes immediately.
|
||||
- Runtime tests must record the workflow, prompt, media inputs, model/LoRA/sampler/step settings, dimensions, chunk count/duration, elapsed time, and observed result. Inspect embedded workflow metadata when present.
|
||||
- Do not globally replace `PackedLayout`, `MiniMaxH3.extra_conds`, or other ComfyUI classes.
|
||||
- Keep SageAttention, Sol-Attn, and Spectrum external; integrate through public ComfyUI wrappers and H3 payload contracts.
|
||||
|
||||
+11
-3
@@ -1,5 +1,13 @@
|
||||
# Changelog
|
||||
|
||||
## 3.5.1
|
||||
|
||||
- Added `H3 Continuum Conditioning Bridge V3.5`, exposing one complete Core-compatible MODEL and CONDITIONING object per Continuum physical group without flattening CONDITIONING entries.
|
||||
- Added optional standalone Reference Audio conditioning to Sampler V3.5. Its sockets default to hidden when unlinked, automatically reopen for connected workflows, and never remove graph links.
|
||||
- Added Last Queued Seed Reuse for the V3.5 sampler, restoring the seed used by the previous queue when switching from ComfyUI Randomize to Fixed while respecting manual seed edits and normal cache behavior.
|
||||
- Renamed the displayed video-guide inputs to `Video Guide Frames` and `Video Guide Size` to distinguish a video loader's IMAGE frame batch from still Reference Images. Backend input keys and saved-workflow links are unchanged.
|
||||
- GPU-accepted Conditioning Bridge generation, Reference Audio/Image retention, and the V3.5 Second Pass/Hi-Res paths while preserving physical-group, Terminal Merge, Run Storage, and audio contracts.
|
||||
|
||||
## 3.5.0
|
||||
|
||||
- Added `H3 Continuum Sampler V3.5` with a Continuum-aware refine-context output while preserving the V3.4 sampler path.
|
||||
@@ -7,7 +15,7 @@
|
||||
- Added experimental `H3 Continuum Hi-Res Fix V3.5`, using a bounded pixel/VAE resize round trip before low-denoise Second Pass sampling.
|
||||
- Added `H3 Continuum Latent Resize V3.5` as an advanced utility; direct high-ratio latent interpolation is not the recommended main Hi-Res Fix path.
|
||||
- Added `H3 Continuum Assemble + Seam V3.5` with Auto, RAM, and Windows-safe disk-backed video buffers while keeping audio in RAM.
|
||||
- Added the recommended V3.5 template workflow with optional Hi-Res Fix, Auto assembly, shared still-image megapixel sizing, and separate VHS Video Reference sizing.
|
||||
- Added the recommended V3.5 template workflow with optional Hi-Res Fix, Auto assembly, shared still-image megapixel sizing, and separate Video Guide Frames sizing.
|
||||
- Preserved Exact Duration, seam behavior, physical decode-group ordering, first-pass audio passthrough, and external Core VAE Decode contracts.
|
||||
- Kept V3.4 nodes and saved-workflow compatibility unchanged.
|
||||
- Validated a 9.49 GiB final IMAGE with hash-identical RAM/Disk-backed output and approximately 9.50 GiB lower Windows private memory in Disk-backed mode.
|
||||
@@ -17,8 +25,8 @@
|
||||
|
||||
- Completed the V3.4 runtime path from the public sampler through V3/V2 to `run_sequence()`.
|
||||
- Added Driving Audio with absolute-time guide slices while preserving the original source for final output.
|
||||
- Added persistent Video Reference conditioning with Efficient 0.4 MP, Balanced 0.6 MP, and Match Output modes.
|
||||
- Included Driving Audio and Video Reference identities in Run Storage contracts.
|
||||
- Added persistent Video Guide Frames conditioning with Efficient 0.4 MP, Balanced 0.6 MP, and Match Output modes.
|
||||
- Included Driving Audio and Video Guide Frames identities in Run Storage contracts.
|
||||
- Changed malformed or empty prompts to warning-and-fallback behavior instead of stopping generation.
|
||||
- Removed independent compatibility, model, and upstream-node restrictions that were stricter than ComfyUI Core.
|
||||
- Added V3.4 runtime, driving-audio, and context diagnostics coverage.
|
||||
|
||||
+33
-21
@@ -1,8 +1,8 @@
|
||||
dca65fb1393e67f59c6f81f9411e3e745eb8f1097e9a2adf7ffc6f4e3901ca9f __init__.py
|
||||
15b900d02624bea6cfe8ea25b22266a0c68b38b9f10c9089be0e38988bf2e34d .github/workflows/tests.yml
|
||||
0a2f69d4cec89d440f5d5aa1ec68a7c9a741382d313f80dcddf96d13f70b3e68 .gitignore
|
||||
16ea21aa8fe115ce8f6538a0268bc64762be2fd6931b3a0071a86a8cc9d218cf AGENTS.md
|
||||
1313e8e2301cfd6aff6c97bc50858bf9450210c83bd4166a74e61fd9c66c0498 CHANGELOG.md
|
||||
7b138feaa7f46f9ff13c2f969a85c10c69ddea899ef95b10d6a4227e3dcf6da1 AGENTS.md
|
||||
b661a8e372078271b1e0902d59c1585d10d599a8a596820e2ccf348dbfb636d9 CHANGELOG.md
|
||||
e97e47c7585e81d9ec5fd32c0ca0b64699fd4610cd03e9d6575a91c30a10ca4e compatibility.py
|
||||
4d62508f900af9f93ec320afb900c27cc9a300d1e0c0a94714258498c5ede5fc conditioning.py
|
||||
71e3df269e226b1ecad597f9831c2a10b2215c8a3783652e9e9f536e99ce46c9 constants.py
|
||||
@@ -26,6 +26,10 @@ ff8d901d05aa89f9b698c60b3d11534ef97982b3e22e9ede6255a85149a669c4 docs/images/v3
|
||||
301afedc3e0922a4bf3bcf445734b5adcdd5c35384132b24a38098c66750f499 docs/images/v34-workflow-overview.png
|
||||
a53796f7a904d675e80a2276c20d68502f03a3958529278e6ce9465baaf1c4af docs/images/v35-hires-fix-node.png
|
||||
5a23f232a8b795226e8255e6e2e3248b0130f1c7ce276d50370d0333d6a62ef0 docs/images/v35-second-pass-node.png
|
||||
04a34b1b55b627553d08b7b10de71295d55ea9e4ac9815b6dd8ce6d268098851 docs/images/v351-lbh-conditioning-bridge-flow.svg
|
||||
70714d9c1c35fd636fbf960fab8f857bec1aff9f0def49bea2d85e5fb1ee54ed docs/images/v351-reference-audio-hidden.png
|
||||
d00156106e2c3fe45678f9b77c5d755d0f9c7f9889f60b6a787567b43412fc8f docs/images/v351-reference-audio-show.png
|
||||
68f8d485a98e71e53ed20e813b36e788e1784669547da7cb6574dd03e326aba8 docs/images/v351-video-guide-frames.png
|
||||
93f07aa727b34802bce3d333426b8ba2af522500882a6d222d00cf577ca82e49 docs/SEAM_TEST_SOURCE_JA.md
|
||||
2c13aefd137db92a3dbf5576e9442d58012b1f0de1240c07d039ceeb702e7c1f docs/V2_1_4_UI_SIMPLIFICATION.md
|
||||
b08022df068576c759c8bf80ac6b6519693f3c65c917f1822aeb06ea359aa5b1 docs/V2_1_5_UI_SERIALIZATION_STABILITY.md
|
||||
@@ -53,6 +57,7 @@ b8275c8cecde12aee0418cea456d1e7f4b875cbb1bce32f1f3d9e06a44dd0be1 examples/v2_pr
|
||||
5eab33c110e07ec08ac66f289f20c295a90ca026ea5231ad6121755a28a2ded8 examples/workflows/MiniMax_H3_Continuum_V34_turbo.json
|
||||
660e955c983e41947f5abfd89e66fbe5759ffda01e6c1a7164d580b0c41b2120 examples/workflows/MiniMax_H3_Continuum_V34.json
|
||||
ed31ddd3d0af5e6f8dbd609e5ef51872322dbe52eaad8cae35e16342ac53dbfa examples/workflows/MiniMax_H3_Continuum_V35.json
|
||||
adafee6b894eefd1b9f913ecd82010acac75ae6c1d653d0f7396a9b38694d4f9 examples/workflows/MiniMax_H3_Continuum_V351_LBH_Conditioning_Bridge.json
|
||||
e8f41dee2240f1fcc6e8fd12448856513483ff3ae0427b2c554bb351f9ae8047 graph_contract.py
|
||||
3d14acac341c63207995e2bd45cd407fdb3e2308273b1c90605adfe6f2e0bd8f hardening.py
|
||||
6abdbc29472c7f9d447085b189fc47b69e110b94ef83192f9689d04000408843 INSTALL_JA.txt
|
||||
@@ -61,16 +66,16 @@ d74073e7ee292ebeba913af4288284f9f197cd91fceed6c62bf6c66b784c7cec install_window
|
||||
6aa3f5780baa7bb0c0672b5f01a2f77e5f209da93f6373468cb274ea2f643d4b layout_adapter.py
|
||||
c44abbd789091bbead01250dbd5453e60539d2665c69f162335fdbd2936019c2 LICENSE
|
||||
d3e213005670e94dee33a240349a4d245cf9a3b6602099f11ed30cf5a32e2c21 media.py
|
||||
84cc75b4583a2851e657f3142a1ec4e099091cb7a960be7355e376269e4d3048 metadata.ini
|
||||
06d05824778039ec2ba3bae7b62d85c2f0c7e2a60355e29d56cb8400a9792b5a metadata.ini
|
||||
ef705a476e3f5bbd05559e7a0e7d3dfb9275badef0f8f65fb1a36ce27fbcb537 model_patch.py
|
||||
01ea71240361725972e41746f5a1c4ff90653e6ccc673085f46f427fbf65e4be nodes.py
|
||||
a230cd2f772021a683432e41f7028f6ea628e34dd19f617a3f98c174fdc97d58 PACKAGE_INFO_JA.txt
|
||||
a7084bc1d12ab25a1ebe29a089dba72d6c1147e0f5556837e6321277562ad1f5 PACKAGE_VALIDATION.txt
|
||||
420f00c8193d527017720b26d6f7011d69c8f68a157b21c0102246cc98ad3a13 nodes.py
|
||||
1816bb4bc712288772dc8d670b91c9fec5487603886c02079a29740b965c4813 PACKAGE_INFO_JA.txt
|
||||
97142251bef6393635501f33e742b94c2eeabc8d58e1618c947f618d36396e83 PACKAGE_VALIDATION.txt
|
||||
b470819f16fc179654dc1600721a63f0a5a14e777f4c004d574b499da6886ba5 public_api.py
|
||||
16bc48b9ef6127af7e0e3ddd96791640cedf5159cd7c06452d72604f41998a52 pyproject.toml
|
||||
4015160058bc975f4ec85f59d41a6b57e95163090328e129df6b74738743cdad pyproject.toml
|
||||
94fdc2d545b2d4077a4d70229fd22ba3ccac21d49d1097d2873f76d04e9a3c7a pytest.ini
|
||||
3a3ab9f5b9860c4b5478e37e49c06b1b102d49a408c712a25e439b6a557d7071 README_JA.md
|
||||
dfcaceb3a9ed4784ca0017f864011cc9904c15dc95d5b59dd39d8a429aee28bb README.md
|
||||
f2f27046750fa3298158e388912229a0ab0e77008e89fc8660a7efe5378291f5 README_JA.md
|
||||
9f12b013363344f49b4c944bc8156f44eca1593fe1583cddc38668ec69518a74 README.md
|
||||
5d89c366b4f076fa73a2695557e0af749bf95df1dad0d55dbb2fe5b1c2519ad7 reference_audio.py
|
||||
8f1744dc99f1a3a222b7d6e986f6dac1edcc0abbbe8b61a1d2606b1ca3569b3d reference_video.py
|
||||
2995924fcb7bac27b548b01187d8276d2ab103c6f43416cf85400de3846c6297 reference.py
|
||||
@@ -92,7 +97,7 @@ c3ba92e6dc653ba9252a68e54df68a677132ab79f597e74005c9c0c746b01545 tests/test_p21
|
||||
d09d2bae2fac04a058ebce22fa0e761d90b267107923ab8cd01a99cc547624e6 tests/test_p23_assembly_v35.py
|
||||
d2a02c120e01d360ddca17a92d5bc53b12c9f0734d06440b3fc2fad2e754e549 tests/test_p23_video_seam_patches.py
|
||||
1ae0369943ba2fb13f21ad0cf56ee58621ba09bf20174379595e157a1775c7fd tests/test_public_api.py
|
||||
c1ed1671d126cd9969f4d896d89e0061fcab676aea961e3cd79b4433028d9f53 tests/test_release_metadata.py
|
||||
bb9b52a0981d7f453d6002a04fafe8788ea1ff8f16d1b43dbc08f1770e56192b tests/test_release_metadata.py
|
||||
d4c53d2c260b635d70fa211029d608f63776e0a56c20253475fa47c58363f8a7 tests/test_state_io.py
|
||||
98a33c75b33ff0c10a68e04bd856e4e43b3e70b6ae1ea458a2b21b4e4d74f46d tests/test_state.py
|
||||
58c06925ccf06c4feee19b927b3515c540c0536aa5f3f8d29be35b8e919915a7 tests/test_temporal.py
|
||||
@@ -105,15 +110,19 @@ d4c53d2c260b635d70fa211029d608f63776e0a56c20253475fa47c58363f8a7 tests/test_sta
|
||||
b42bcc0983147462d96c6b71cc4a38e846995dafa6eebefc3ae0d9bb36caf359 tests/test_v2_sequence_orchestration.py
|
||||
0b5b20a8318862d167f135720e0489b8d4f93406d67c6646e052e35b03dcb876 tests/test_v2_session.py
|
||||
58438c3ed814adf40cefde098a37cae00ddcb703b7e5548bbbb295e54bed5a6d tests/test_v2_widget_migration.py
|
||||
0410e2d10af76a83eee0e622d63b8d91662d9516c990aa657a15066e30604f58 tests/test_v217_stable_facade.py
|
||||
e96edf54cec3e4be0f7731be422e6a3e4a789b4443f15ac0c140e3aa3a27c1da tests/test_v217_stable_facade.py
|
||||
78bc478a5e4edda902c80849c911782a99e75c06dfb04127391b6cc5b27b28e1 tests/test_v3_hardening.py
|
||||
eb5b27f8f0d79529c56ef344a5601703642c3cba5388c9768116223e2ed58a36 tests/test_v3_video_seam.py
|
||||
eec67e2daddbbe4f5933a3ac0dd9c3188f750081d377b7d08fd6d5a02ff4a529 tests/test_v31_run_storage.py
|
||||
1f5310587d05eb5058ec94d9985138d25aa22b22fb0dd5c68518f2f2053116a4 tests/test_v31_run_storage.py
|
||||
3af78ab85c8e19dee8d0a98bfd11a2c0e88c30d87256da1f9699c49a19a684e9 tests/test_v32_reference.py
|
||||
f692476d0a7795b36bc5d9b97c10b7c6ba9686122b8f7987629948141e5dbab3 tests/test_v34_driving_audio.py
|
||||
72719bcd6686d84f518d80751e3754b875d34c2aa72e2183dfa05ac9158a9eb0 tests/test_v34_driving_audio.py
|
||||
d89d1ef8b230ebe1cc779ba65822fcdb5d4bd592d785a38aeff57bacb1066a09 tests/test_v351_reference_audio.py
|
||||
850858ce53943124bd01c8d80a2bd1ba8ce28a6de291619c851757257e758ab8 tests/test_v351_reference_audio_ui.py
|
||||
9cf7dfa6cceba0efb95b4900aacc1ddfbec86c0e1645209bbf4c7908337138da tests/test_v351_last_queued_seed_frontend.py
|
||||
cf1ca6342a89e4cb02b398b32edbe91b6c1353535383e9f51d459466305a0114 tests/test_v35_conditioning_bridge.py
|
||||
8b75c23dccfd1ac302596187f2fbbd1c9b71fddcb5e666aa4f9eedfd8b5b4b93 tests/test_v35_compact_ui_frontend.py
|
||||
c5a122cb9510320820f6057fc29e6bef4b42e19f141d4d9090c817702e7d151e tests/test_v35_context_sampler.py
|
||||
c97d1323fa3d66c28dd1974340dbc17a3e6d5a79d4a5206b82d48bfb1a14b4ce tests/test_v35_hires_fix.py
|
||||
b7267778fd1e77bd12d7c6e71c200fd0a4367cd8ae3276823ddeba16e015cfa6 tests/test_v35_context_sampler.py
|
||||
8afd55c2db712ec5102295e03d9d82d8b0de46edad70ab70b61d4cbc588ff652 tests/test_v35_hires_fix.py
|
||||
9ceac8c3c6e4e57ec8b53b48f3b547c204df36a3f6281328aa9ab5ebc2e6a0b6 tests/test_v35_latent_resize.py
|
||||
59a07f2172014dfdc0a447775324d7cd049f20b823276dfaf9b7b3f79628f5a8 tests/test_v35_pixel_vae_resize.py
|
||||
4508d4d15bf48046b1664e385157f8f7f8cabdd7e6694726c8fa6e0b90ecbd1e tests/test_v35_refine_context.py
|
||||
@@ -123,7 +132,7 @@ c97d1323fa3d66c28dd1974340dbc17a3e6d5a79d4a5206b82d48bfb1a14b4ce tests/test_v35
|
||||
0dbe8a5f71c92f3523942343b40787104c8b96781461ba3ba82934a6bdbe5834 THIRD_PARTY_NOTICES.md
|
||||
f218e1a93c42467c6057c5c1d04d57cc82f6331b97ec9257e4e2dfb9c831876a timeline_video.py
|
||||
e5a84569953ee63b9625f4f2e3195ec368204fddcfc746564cfbd0e8449bb8e9 tools/p20_file_backed_tensor_poc.py
|
||||
2ff3f91da273cddefb47c9f4537326ae85642eaef3182b85d13497729d175a07 tools/verify_runtime.py
|
||||
b2d512bccb324e2022de24538ed4de1f3d7cdf3bfc749d8a7cf206cb86d74170 tools/verify_runtime.py
|
||||
ffd61f3f31c9b6430e1169007ee906c8f5000eba63ee44e2976ad4f5f1112671 v2/__init__.py
|
||||
2003902c87bba09cfa143f5a9e4248f3a78c0fb544449a75fd40ba2cacb35655 v2/context_diagnostics.py
|
||||
cde27db19b677e318cc4dfb4235be7a11429c19945f4083052a91fe117e74c82 v2/decoder.py
|
||||
@@ -142,9 +151,10 @@ e6c15105fe66b9d7786602c8e6d51dd256428d80635cee686b0e35d66ab3b794 v2/sequence.py
|
||||
78c830cdf49034c6e3b2cd3da5914d5cfc5638eb63ec6dbd1bab13c50d6d4caf v3/__init__.py
|
||||
b3dc61503d35d9ef0a0dc7fed1c9b2fdc00fcb2072d4e39f64ae0826f9ec7dca v3/assembly_v35.py
|
||||
7815230e0a9540bc2edeaf818e940b7a1fdd817fd217ba8a4f9cb21aaf6a308e v3/assembly.py
|
||||
1465a4cd53e4a90788c7cdbbbef5f7bc0dee2a8be04cc4c707863837077d9a47 v3/driving_nodes.py
|
||||
3f62fdb35e804f42d7cbf0828b4e87e69a2b99246c3f7467fe4fa698f1d803c9 v3/conditioning_bridge_nodes.py
|
||||
062ebb90b184e8bd38b3cb6dfe48a458e407dc1dce1214c1276ee81c3a6567e4 v3/driving_nodes.py
|
||||
6cc7ed74666084c55beb9075304e92a9defafd81b9c6678239ca3859a08cddd7 v3/file_backed_buffer.py
|
||||
897343a4845f4ed59828bbfcfb16a22fcfce2c22907548bb3234c98dabcefff6 v3/hires_fix_nodes.py
|
||||
039f03431c341aa0229f749699fd92272c77097e00b08649aded8328dfd83970 v3/hires_fix_nodes.py
|
||||
0858487e2b8c0060a856273ffc65d23165b2f253d183f506e27e419aea0da561 v3/latent_resize_nodes.py
|
||||
45bd1945b984b56369234053be2edb8455d4cff7bf976f7d9c7bef77a762b7eb v3/memory_attribution.py
|
||||
f8708118f70fa2aae22951e025ed3b9499951088988c817c28f6ef7f388f2570 v3/nodes.py
|
||||
@@ -153,8 +163,10 @@ b7c4a35a5e73f528492bc6946b97b687c412f1d3f5f976c19d45c6dc20288c9a v3/pixel_vae_r
|
||||
10eaab14eb8a70dea3345bf8bb20069d78ec5464aef5542a9a80f1ccfdeeb9b0 v3/refine_context.py
|
||||
519586b1b3f48c73d329f7a2aaa8a1bfc6fe31ac2ecb64f2b1fdf9c19026001a v3/refine_sampling.py
|
||||
da5edf3b4392c41e12ef73a0cd21799be42a327b18bd5a6989447b75163dcab1 v3/second_pass_nodes.py
|
||||
998d002c73c59ce88de1cf72afbb5f481a57cc31d365ba2fb4889ebf405dedc8 v3/second_pass.py
|
||||
23a412ce55797cbe6ea19c4379053855ff21bca233e3c373577225b761cc03d0 v3/second_pass.py
|
||||
4178dcfa442abdb06ce276e05bd7bcbaa6da28469ba5e57d3da3c663de4e4a9d v3/video_seam_v35.py
|
||||
2f07ace1462644f0bee553827b3571535de4d0c2d9ef847bd9e0ca73a4eed5cb v3/video_seam.py
|
||||
343bf84d768b93a59c8a418635bcad4133961431c9c6f7975d7d65b0fac25eb4 version.py
|
||||
ea79af984eb7d615f0d79384c8b505442af2b00cf7babfd53e82da2733927bcc web/project_id.js
|
||||
e981f75faff574b8e9ab3e9be8b68559e3e7a22f6220d3d073e7769f5fc0dc74 version.py
|
||||
dac5dc14e432956c44e11cc672c3a7a050375e0fdae2f2b7a738da10ad23f837 web/last_queued_seed.js
|
||||
9305b91d766a8a922f352c466829781bda38d8ce1f5c3c51e824649bebdce210 web/project_id.js
|
||||
8fa2aeba8a7e963fa627c25f484c0d375fedfff18d62800e7e11663fc292472d web/reference_audio_ui.js
|
||||
|
||||
+8
-1
@@ -1,7 +1,14 @@
|
||||
ComfyUI-H3-Continuum V3.5.0
|
||||
ComfyUI-H3-Continuum V3.5.1
|
||||
|
||||
MiniMax H3の5秒ChunkをAV latent contextで継続し、長尺映像として組み立てるComfyUIカスタムノードです。
|
||||
|
||||
V3.5.1:
|
||||
- physical groupごとに完全なMODEL / CONDITIONINGを公開するConditioning Bridge V3.5
|
||||
- 生成音声を置換しない任意のReference Audio conditioningとHidden / Show UI
|
||||
- RandomizeからFixedへ戻す際のLast Queued Seed Reuse
|
||||
- Video loaderのIMAGE frame batchを示すVideo Guide Frames / Video Guide Size表示名
|
||||
- backend socket key、既存workflow接続、V3.4 sampling契約を維持
|
||||
|
||||
V3.5.0:
|
||||
- 外部加工したH3 latentをphysical group構造のまま再SamplingするSecond Pass
|
||||
- Pixel/VAE round tripを使うHi-Res Fix(Experimental)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
ComfyUI-H3-Continuum V3.5.0 package validation
|
||||
ComfyUI-H3-Continuum V3.5.1 package validation
|
||||
|
||||
Status: V3.5.0 release. Stable V3.5 paths are validated; integrated Hi-Res Fix remains Experimental.
|
||||
Status: V3.5.1 release. Stable V3.5 paths, Conditioning Bridge, Reference Audio, and Last Queued Seed Reuse are validated; integrated Hi-Res Fix remains Experimental.
|
||||
|
||||
Required automated checks:
|
||||
- python -m compileall -q .
|
||||
@@ -9,6 +9,9 @@ Required automated checks:
|
||||
|
||||
Validated runtime paths include:
|
||||
- V3.5 refine-context contract and Advanced Second Pass Bridge
|
||||
- Conditioning Bridge MODEL / CONDITIONING alignment per physical group without CONDITIONING-entry flattening
|
||||
- Optional Reference Audio Hidden / Show UI, saved-link recovery, and conditioning retention
|
||||
- Last Queued Seed Reuse with manual seed edits and ComfyUI cache behavior preserved
|
||||
- 1x5 T2VA, 3x5 T2VA, and 3x5 FL2VA Long Terminal Merge Second Pass GPU acceptance
|
||||
- First-pass audio LATENT object passthrough through Second Pass
|
||||
- H3 Continuum Assemble + Seam V3.5 RAM / Disk-backed output equivalence
|
||||
@@ -19,16 +22,16 @@ Validated runtime paths include:
|
||||
- Production sampler and Core VAE Decode assembly
|
||||
- Reference Image 1-3
|
||||
- Driving Audio absolute-time guide conditioning with original-source final output
|
||||
- Persistent Video Reference conditioning
|
||||
- Video Reference Size: Efficient 0.4 MP / Balanced 0.6 MP / Match Output
|
||||
- Persistent Video Guide Frames conditioning
|
||||
- Video Guide Size: Efficient 0.4 MP / Balanced 0.6 MP / Match Output
|
||||
- Run Storage save, checksum verification, and complete reuse
|
||||
- Run Storage identity coverage for Driving Audio and Video Reference
|
||||
- Run Storage identity coverage for Driving Audio and Video Guide Frames
|
||||
- Permissive prompt warning/fallback behavior
|
||||
- Spectrum Interop API v1 with Actual Prefix 2 on continuation chunks
|
||||
- Audio Seam Auto
|
||||
- Video Seam Auto guarded transient and micro-flash correction
|
||||
|
||||
Latest verified automated result: 430 passed.
|
||||
Latest verified automated result: 450 passed.
|
||||
|
||||
Hi-Res Fix and Auto 2 remain experimental. Main 3x5 2x is not accepted on the tested RTX 5060 Ti 16 GiB because the terminal 77T Second Pass group exceeded VRAM; longer Reference/Hybrid acceptance remains pending.
|
||||
|
||||
|
||||
+45
-5
@@ -10,19 +10,59 @@
|
||||
- E2-8A Contract, E2-8B1 CPU/static validation, E2-8B2 external LBH GPU PoC, and E2-8C Second Pass GPU acceptance are formally PASS. The E2-8C CPU baseline is `260 passed`.
|
||||
- External LATENT nodes may discard custom dictionary metadata. Identically shaped group reordering therefore cannot be cryptographically detected; count, position, T, geometry, and audio-shape checks are enforced.
|
||||
|
||||
Updated: 2026-08-24
|
||||
Updated: 2026-08-25
|
||||
|
||||
## V3.5.1 Issue #9 Conditioning Bridge candidate (2026-08-24)
|
||||
|
||||
- Added `H3ContinuumConditioningBridgeV35` / `H3 Continuum Conditioning Bridge V3.5` under `MiniMax H3/Continuum/Advanced`.
|
||||
- The Bridge accepts externally processed physical-group video LATENTs plus the matching Assembly Plan and required V3.5 refine context. It returns one paired MODEL and one complete ComfyUI CONDITIONING object per physical group, plus a target-geometry Assembly Plan and status.
|
||||
- The fixed list contract is `OUTPUT_IS_LIST = (True, True, False, False)` and `len(group_models) == len(conditioning) == physical group count`. CONDITIONING entries are appended as one inner object and are never flattened into the outer physical-group list.
|
||||
- Second Pass and Bridge share the same context validation, target adaptation, prompt fallback, MODEL clone, and geometry update helper. Built-in Second Pass still samples groups sequentially and retains responsibility for Nested AV, video noise, Audio Lock, and audio passthrough; the Bridge deliberately leaves AV LATENT construction, noise, Audio Lock, and external sampling to the workflow.
|
||||
- CPU coverage includes the 3-logical / 2-physical Terminal Merge shape (`[1] / 37T`, `[2,3] / 77T`), MODEL/CONDITIONING alignment, non-flattening, schema/registration, and existing Reference Image/Audio/context adaptation regressions. Focused validation is `33 passed`; full source pytest is `442 passed` with only the known `pynvml` FutureWarning.
|
||||
- Only `nodes.py`, `v3/second_pass.py`, `v3/conditioning_bridge_nodes.py`, and `tools/verify_runtime.py` were synchronized to ComfyUI_W; every source/runtime SHA-256 matches. Runtime registration, native PackedLayout, and Fixed 3x5 prompt planning pass with the new Bridge registered as a non-legacy node.
|
||||
- GPU acceptance through Basic Guider and an external sampler passed for three `1 x 5s` runs: LBH `1.2x` with `simple / 4 steps / denoise 0.3` produced 704x704 twice, and LBH `1.5x` with `simple / 10 steps / denoise 0.3` produced 864x864. Every run kept one MODEL and one complete CONDITIONING for one physical group, completed external sampling/Core decode/Assembly, and produced finite 120-frame/5.000-second video with 32 kHz stereo audio. The existing Issue #10 Reference Audio working-tree changes were preserved without reset or reorganization.
|
||||
|
||||
## V3.5.1 Issue #10 Reference Audio candidate (2026-08-24)
|
||||
|
||||
- Target version is V3.5.1. The backend keeps the optional `reference_audio_1` and `reference_audio_vae` sockets in their existing input order. The frontend presents them as `Reference Audio (Optional)` and `Reference Audio VAE (Optional)` behind the UI-only `Reference Audio Inputs` dropdown.
|
||||
- New or unlinked nodes default to `Hidden`. `Show` restores both sockets at their original positions. A saved workflow with either socket connected opens in `Show`, and `Hidden` is rejected while either link exists; the UI never removes a graph link. The dropdown is added only after Core graph configuration and is excluded from Workflow JSON widget values, preventing widget-value shifts on reload.
|
||||
- Related display labels are now `Video Guide Frames`, `Driving Audio`, and `Driving Audio VAE`. Input keys, order, types, Node IDs, and runtime contracts remain unchanged.
|
||||
- This exposes the existing Core-compatible standalone Reference Audio 1 path; it adds no new audio encoding, strength control, model allowlist, source-audio copy, or lip-sync guarantee.
|
||||
- V3.4 input keys/order/types, Node ID, sockets, and behavior remain unchanged; only the human-facing labels/tooltips are clarified. Its internal `run()` accepts the two values only so V3.5 can forward them to the existing Production path.
|
||||
- Reference Audio conditions generated video/audio and leaves generated audio as final. Driving Audio remains the separate timeline-guide path whose original source is selected as final output.
|
||||
- CPU integration confirms Reference Audio survives every normal physical group and the FL2VA Terminal Merge group (`logical [2,3]`, `paired_timeline_v1`) in `refine_context`. Run Storage ignores an unused Reference Audio VAE, separates changed audio contracts, and restores the disconnected revision identity.
|
||||
- Final canonical validation after the conditional UI change is `450 passed` with only the known `pynvml` FutureWarning. JavaScript syntax, `git diff --check`, ComfyUI_W registration/native PackedLayout/Fixed 3x5 verification, and source/runtime SHA-256 equality for synchronized implementation files pass.
|
||||
- Live ComfyUI acceptance passed for unlinked `Hidden`, `Hidden -> Show -> Hidden`, original-position socket restoration, clarified labels, linked-workflow auto-`Show`, and rejection of `Hidden` while linked. The user had already accepted the V3.5.1 generation test categories as all-clear; this UI-only step did not queue another GPU generation.
|
||||
- The CPU-validated public feature files were previously published from the isolated clone as `a704aa961fc2ba0c19aef6f2ecfdcb46fa9384b2`. GPU acceptance is now complete and package metadata plus public documentation are being formalized as V3.5.1.
|
||||
- V3.5.1 release validation is `450 passed` from the ComfyUI_W root, JavaScript syntax PASS, `git diff --check` PASS, and all 172 distribution Manifest entries match SHA-256. README English/Japanese use the user-supplied normal-state screenshots for Video Guide Frames and Reference Audio Hidden/Show.
|
||||
- The public LBH/Conditioning Bridge connection example is `examples/workflows/MiniMax_H3_Continuum_V351_LBH_Conditioning_Bridge.json`; its README chart is `docs/images/v351-lbh-conditioning-bridge-flow.svg`. It is a separate example and does not replace or modify the recommended V3.5 template.
|
||||
|
||||
## V3.5.1 Last Queued Seed reuse candidate (2026-08-24)
|
||||
|
||||
- The fix is limited to `H3 Continuum Sampler V3.5` frontend state. It does not change V3.4, backend Sampling, Second Pass, Terminal Merge, Assembly, Seam, Run Storage, Node IDs, display names, or public sockets.
|
||||
- Per-node session-only state is `last_queued_seed`, `auto_updated_seed`, `previous_control_mode`, and `auto_update_pending`. Nothing is serialized into Workflow JSON or carried across a browser/ComfyUI restart.
|
||||
- `beforeQueuePrompt` records the actual `base_seed` submitted for the V3.5 sampler. After Generate records only the automatic Randomize update. A `Randomize -> Fixed` transition restores the prior queued seed only while the displayed value still equals the recorded automatic update; an intervening manual Seed edit cancels restoration and remains authoritative.
|
||||
- Restoring the Seed only makes the First Pass inputs eligible for normal ComfyUI cache reuse. If the cache is absent or evicted, First Pass regenerates normally with the same Seed. Run Storage seed contracts remain strict and unchanged.
|
||||
- The implementation is isolated in `web/last_queued_seed.js` and integrated through the existing `web/project_id.js` extension. JavaScript syntax and focused frontend behavior validation are `5 passed`; full source pytest is `445 passed`. The two Production frontend files match ComfyUI_W by SHA-256, whose runtime verifier and existing compact-UI regression pass. Real UI/cache acceptance remains pending.
|
||||
|
||||
## V3.5.1 Hi-Res Fix Core canvas alignment (2026-08-24)
|
||||
|
||||
- A real `576x576`, `scale_by=1.2` run exposed an invalid `43x43` H3 video/conditioning latent. Core MiniMax H3 patchifies spatial latents in `2x2` blocks and exposes pixel dimensions in 32-pixel steps, so the odd latent failed in Core with `24 * 43 * 43 = 44376` elements.
|
||||
- Manual Hi-Res Fix targets now use ComfyUI Core's `CANVAS_MULTIPLE` and preserve-or-enlarge each axis on that grid. The failing case resolves to `704x704` / `44x44`; a `1024x576` source at `1.2x` resolves to `1216x704` / `76x44`. The Pixel/VAE, conditioning adaptation, and Second Pass paths remain unchanged.
|
||||
- Focused Hi-Res/Second Pass validation is `48 passed`; full source pytest is `448 passed`. `v3/hires_fix_nodes.py` is synchronized to ComfyUI_W by SHA-256, and runtime registration/native PackedLayout/Fixed 3x5 verification passes. GPU acceptance after a ComfyUI process restart remains pending.
|
||||
- The same attempt did not validate Last Queued Seed cache reuse: the second prompt was queued at `21:24:38` before the first prompt completed at `21:26:02`, and the log shows another First Pass `20/20`. Retry only after the first prompt has completely finished.
|
||||
|
||||
## V3.5 recommended template workflow (2026-08-24)
|
||||
|
||||
- `examples/workflows/MiniMax_H3_Continuum_V35.json` is the recommended V3.5 starting workflow.
|
||||
- Hi-Res Fix is disabled by default and `H3 Continuum Assemble + Seam V3.5` uses Auto backend selection.
|
||||
- First Frame, Last Frame, and Reference Images 1-3 share one 0.3 MP control. Video Reference remains independently sized by the VHS loader.
|
||||
- Reference Images 1-3 and Video Reference are routed to their matching V3.5 sampler sockets; `refine_context` and `video_vae` are connected to the integrated Hi-Res Fix path.
|
||||
- First Frame, Last Frame, and Reference Images 1-3 share one 0.3 MP control. Video Guide Frames remains independently sized.
|
||||
- Reference Images 1-3 and Video Guide Frames are routed to their matching V3.5 sampler sockets; `refine_context` and `video_vae` are connected to the integrated Hi-Res Fix path.
|
||||
- V3.4 standard and Turbo templates remain available for saved-workflow compatibility.
|
||||
|
||||
## Baseline
|
||||
|
||||
- Current public baseline: V3.4.0
|
||||
- Current public baseline: V3.5.1
|
||||
- Authoritative working repository: `D:\Codex\_git_push_work\ComfyUI-H3-Continuum`
|
||||
- Primary tested runtime: `D:\StabilityMatrix\Data\Packages\ComfyUI_W\custom_nodes\ComfyUI-H3-Continuum`
|
||||
- Secondary runtime: `D:\StabilityMatrix\Data\Packages\ComfyUI_WAN\custom_nodes\ComfyUI-H3-Continuum`
|
||||
@@ -31,7 +71,7 @@ Updated: 2026-08-24
|
||||
## Active direction
|
||||
|
||||
- Driving Audio preserves the supplied audio as final output while conditioning every chunk.
|
||||
- Video Reference is persistent across chunks and supports selectable reference sizing.
|
||||
- Video Guide Frames is persistent across chunks and supports selectable guide sizing.
|
||||
- Prompt syntax is permissive: invalid or empty input warns and falls back instead of blocking generation.
|
||||
- Unknown models, wrappers, merged models, and upstream nodes are not rejected merely because they are unknown.
|
||||
- Legacy `strict_compatibility` remains loadable only for workflow compatibility and must not enforce a stop.
|
||||
|
||||
@@ -1,8 +1,66 @@
|
||||
# ComfyUI-H3-Continuum 3.5.0
|
||||
# ComfyUI-H3-Continuum 3.5.1
|
||||
|
||||
Long-form MiniMax H3 video generation for ComfyUI with Continuum-aware Second Pass refinement, optional Hi-Res Fix, low-memory disk-backed assembly, restartable chunks, persistent references, and optional Spectrum interoperability.
|
||||
|
||||
> **V3.5.0 is the current release.** All V3.4 node IDs remain registered intentionally for saved-workflow compatibility. Existing V3.4 workflows continue unchanged; new workflows can opt into the independent V3.5 nodes.
|
||||
> **V3.5.1 is the current release.** All V3.4 node IDs and backend socket keys remain registered intentionally for saved-workflow compatibility. Existing V3.4/V3.5 workflows continue to load; V3.5.1 clarifies the displayed input names without rewriting saved links.
|
||||
|
||||
## What's new in V3.5.1
|
||||
|
||||
V3.5.1 completes three focused additions without changing the V3.4 Sampling, Conditioning, Terminal Merge, Assembly, Seam, or Run Storage contracts:
|
||||
|
||||
1. **Optional Reference Audio** — native H3 audio conditioning that does not replace the generated final audio. The two additional sockets stay hidden until `Reference Audio Inputs` is set to `Show`.
|
||||
2. **Conditioning Bridge V3.5** — exposes one complete Core-compatible `MODEL` and one complete `CONDITIONING` object per Continuum physical group for an external sampler workflow.
|
||||
3. **Last queued seed reuse** — when ComfyUI changes a randomized seed after generation, switching the Sampler back to Fixed restores the seed used by the last queued run when it is still safe to do so. Existing ComfyUI cache behavior is not overridden.
|
||||
|
||||
### Reference inputs at a glance
|
||||
|
||||
The displayed names intentionally describe different jobs. They are not interchangeable pairs:
|
||||
|
||||
| Displayed input | Connect from | Purpose | Final audio behavior |
|
||||
|---|---|---|---|
|
||||
| `reference_image_1`–`reference_image_3` | Still-image `IMAGE` | Persistent identity, subject, or appearance references | No audio |
|
||||
| `Video Guide Frames` | Video loader `IMAGE` frame batch | Persistent motion, framing, timing, and appearance guidance across chunks | Does not carry the video's audio |
|
||||
| `Driving Audio` + `Driving Audio VAE` | Audio loader, or video loader `AUDIO`, plus the matching audio VAE | Audio guidance whose effective source stream is preserved for final output | Replaces generated final audio with the selected source stream |
|
||||
| `Reference Audio (Optional)` + `Reference Audio VAE (Optional)` | Standalone audio plus the matching audio VAE | Native H3 conditioning only | Does not copy or replace the generated final audio |
|
||||
|
||||
For the common video-with-sound case, connect the loader's `IMAGE` output to `Video Guide Frames` and its `AUDIO` output to `Driving Audio`. Do not connect that audio to `Reference Audio (Optional)` unless conditioning-only behavior is specifically intended.
|
||||
|
||||

|
||||
|
||||
`Reference Audio Inputs` is a UI-only visibility control:
|
||||
|
||||
- `Hidden` is the uncluttered default for unlinked inputs.
|
||||
- `Show` displays both optional Reference Audio sockets.
|
||||
- A saved workflow with either socket connected opens in `Show` automatically.
|
||||
- Connected sockets cannot be hidden, so the UI never removes a graph link.
|
||||
- The control is not serialized into workflow widget values; backend input keys and existing workflow links remain unchanged.
|
||||
|
||||
| Hidden — normal uncluttered view | Show — optional conditioning sockets visible |
|
||||
|---|---|
|
||||
|  |  |
|
||||
|
||||
### Conditioning Bridge V3.5
|
||||
|
||||
`H3 Continuum Conditioning Bridge V3.5` is the Advanced connection point for external sampling. Connect `model`, `clip`, the externally processed `video_latents`, `assembly_plan`, and `refine_context`; connect `video_vae` only when the selected conditioning path requires it. The node returns parallel `group_models` and `conditioning` lists whose length equals the physical-group count. Each list item remains a complete ComfyUI object—conditioning entries are never flattened into the physical-group list.
|
||||
|
||||
```text
|
||||
H3 Continuum Sampler V3.5.video_latents
|
||||
-> external H3 latent processor (for example LBH)
|
||||
-> H3 Continuum Conditioning Bridge V3.5
|
||||
-> Core BasicGuider + external sampler
|
||||
-> Core Video / Audio VAE Decode
|
||||
-> H3 Continuum Assemble + Seam V3.5
|
||||
```
|
||||
|
||||
The external workflow owns AV LATENT pairing, noise, SIGMAS, Audio Lock, sampling, and audio passthrough. The Bridge only exposes the prepared `MODEL` and `CONDITIONING` objects plus the updated Assembly Plan.
|
||||
|
||||

|
||||
|
||||
Download the complete connection example: [V3.5.1 LBH + Conditioning Bridge workflow](examples/workflows/MiniMax_H3_Continuum_V351_LBH_Conditioning_Bridge.json).
|
||||
|
||||
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.
|
||||
|
||||
LBH changes latent geometry only. It has no Continuum denoise-strength control: use the external `BasicScheduler` SIGMAS to decide how strongly the resized latent is regenerated. A larger LBH scale such as 1.5x may still be fast, but memory, decode, and sampling costs increase with the target canvas.
|
||||
|
||||
## What's new in V3.5
|
||||
|
||||
@@ -100,7 +158,7 @@ V3.4 nodes are retained specifically so saved workflows do not break. Their Node
|
||||
V3.4 focuses on the two reference workflows that are most useful in normal production:
|
||||
|
||||
- **Driving Audio**: use an existing audio source as the preserved final audio while it guides the H3 generation across chunks.
|
||||
- **Video Reference**: use an existing video as persistent visual reference for appearance, motion, framing, and timing without treating it as a frame-by-frame copy.
|
||||
- **Video Guide Frames**: use a video loader's IMAGE frame batch as persistent guidance for appearance, motion, framing, and timing without treating it as a frame-by-frame copy.
|
||||
- **Hybrid FLF + Reference**: use First Frame, Last Frame, and persistent Reference Images together without adding a separate mode or model allowlist.
|
||||
- **FL2VA Terminal Merge**: keep the final two 5-second FL2VA chunks as one physical 10-second sampling and decode unit for Core-equivalent Last Frame handling.
|
||||
- **Restartable chunks**: reuse completed chunks with Run Storage and regenerate only the selected part when the generation contract remains compatible.
|
||||
@@ -115,7 +173,7 @@ Earlier development explored Timeline Video and timeline-audio conditioning. Tho
|
||||
V3.4 therefore prioritizes:
|
||||
|
||||
1. **Driving Audio** for cases where the supplied audio should remain the final audio stream.
|
||||
2. **Video Reference** for cases where the supplied video should guide the generated result without requiring exact frame reproduction.
|
||||
2. **Video Guide Frames** for cases where a supplied video should guide the generated result without requiring exact frame reproduction.
|
||||
3. **Chunked generation and Run Storage** for practical retries and long-form work.
|
||||
|
||||
This is a usability and reliability decision, not a claim that the experimental timeline paths are impossible. They are hidden from the stable interface while the public workflow stays focused on predictable user-controlled inputs.
|
||||
@@ -123,10 +181,11 @@ This is a usability and reliability decision, not a claim that the experimental
|
||||
## Example workflows
|
||||
|
||||
- [V3.5 recommended template](examples/workflows/MiniMax_H3_Continuum_V35.json)
|
||||
- [V3.5.1 LBH + Conditioning Bridge connection example](examples/workflows/MiniMax_H3_Continuum_V351_LBH_Conditioning_Bridge.json)
|
||||
- [V3.4 standard](examples/workflows/MiniMax_H3_Continuum_V34.json)
|
||||
- [V3.4 Turbo](examples/workflows/MiniMax_H3_Continuum_V34_turbo.json)
|
||||
|
||||
The V3.5 template is the recommended starting point. Hi-Res Fix is disabled by default, the V3.5 Assemble backend is set to Auto, and First Frame, Last Frame, and Reference Images 1-3 share one megapixel control. Video Reference sizing remains controlled by the VHS loader. Advanced users can bypass or rearrange the optional sections as needed.
|
||||
The V3.5 template is the recommended starting point. Hi-Res Fix is disabled by default, the V3.5 Assemble backend is set to Auto, and First Frame, Last Frame, and Reference Images 1-3 share one megapixel control. `Video Guide Size` controls the frame batch used by `Video Guide Frames`; the video loader remains responsible for decoding and frame-rate conversion. Advanced users can bypass or rearrange the optional sections as needed.
|
||||
|
||||
The V3.4 templates remain valid for saved-workflow compatibility.
|
||||
|
||||
@@ -144,16 +203,16 @@ Driving Audio is the primary V3.4 audio path.
|
||||
- Audio is not independently rewritten at every chunk boundary.
|
||||
- Perfect lip sync is not guaranteed; results still depend on H3, source material, prompts, and sampling.
|
||||
|
||||
### Video Reference
|
||||
### Video Guide Frames
|
||||
|
||||
Video Reference provides a persistent native H3 video reference across all chunks.
|
||||
`Video Guide Frames` provides a persistent native H3 video guide across all chunks. Despite its ComfyUI `IMAGE` socket color, it expects the frame batch produced by a video loader rather than one ordinary still-image reference.
|
||||
|
||||
- It guides motion, framing, timing, and appearance.
|
||||
- It is not a direct pixel-copy or deterministic identity-transfer system.
|
||||
- Video and audio are independent. Route a loader's IMAGE output to Video Reference and AUDIO output to Driving Audio.
|
||||
- Video and audio are independent. Route a loader's IMAGE output to `Video Guide Frames` and AUDIO output to `Driving Audio`.
|
||||
- Source decoding and frame-rate conversion remain loader responsibilities. Continuum does not impose an unnecessary forced 24 fps conversion.
|
||||
|
||||
| Video Reference Size | Purpose |
|
||||
| Video Guide Size | Purpose |
|
||||
|---|---|
|
||||
| Efficient - 0.4 MP | Default; lower token cost and faster iteration. |
|
||||
| Balanced - 0.6 MP | More detail at a higher compute cost. |
|
||||
@@ -208,7 +267,7 @@ The public nodes focus on normal production controls. Developer diagnostics and
|
||||
|
||||
### Timeline paths
|
||||
|
||||
Experimental Timeline Video and earlier timeline-audio paths are no longer public V3.4 inputs. They are hidden rather than destructively removed. Existing V3.3 workflows can continue through legacy nodes, but new stable workflows should use Driving Audio and Video Reference.
|
||||
Experimental Timeline Video and earlier timeline-audio paths are no longer public V3.4 inputs. They are hidden rather than destructively removed. Existing V3.3 workflows can continue through legacy nodes, but new stable workflows should use `Driving Audio` and `Video Guide Frames`.
|
||||
|
||||
## Installation
|
||||
|
||||
@@ -236,7 +295,11 @@ Restart ComfyUI after installation or update.
|
||||
|
||||
### H3 Continuum Sampler V3.5
|
||||
|
||||
The V3.5 sampler preserves V3.4 generation behavior and adds `refine_context` as the sixth output. Connect it only to V3.5 Hi-Res Fix or Second Pass paths that need the original conditioning context.
|
||||
The V3.5 sampler preserves V3.4 generation behavior and adds `refine_context` as the sixth output. Connect it to V3.5 Hi-Res Fix, Second Pass, or Conditioning Bridge paths that need the original conditioning context. V3.5.1 also provides optional Reference Audio sockets through the `Reference Audio Inputs` visibility control.
|
||||
|
||||
### H3 Continuum Conditioning Bridge V3.5
|
||||
|
||||
Advanced external-sampler bridge. It returns aligned `group_models` and complete `conditioning` objects per physical group together with the updated Assembly Plan. It does not create AV LATENT pairs, noise, SIGMAS, Audio Lock, or external sampling policy.
|
||||
|
||||
### H3 Continuum Hi-Res Fix V3.5 (Experimental)
|
||||
|
||||
@@ -264,7 +327,7 @@ Main inputs:
|
||||
- Sequence Prompt
|
||||
- first_frame, last_frame
|
||||
- reference_image_1 through reference_image_3
|
||||
- Video Reference
|
||||
- Video Guide Frames
|
||||
- driving_audio, audio_vae
|
||||
|
||||
Outputs:
|
||||
@@ -281,7 +344,7 @@ Visible controls:
|
||||
- audio_continuity
|
||||
- Run Storage
|
||||
- Reference Size
|
||||
- Video Reference Size
|
||||
- Video Guide Size
|
||||
|
||||
### H3 Continuum Assemble + Seam V3.4
|
||||
|
||||
@@ -312,7 +375,7 @@ driving_audio -------------------------------------+
|
||||
For a source video with sound:
|
||||
|
||||
~~~text
|
||||
Video loader IMAGE -> Video Reference
|
||||
Video loader IMAGE -> Video Guide Frames
|
||||
Video loader AUDIO -> driving_audio
|
||||
~~~
|
||||
|
||||
@@ -469,35 +532,35 @@ PR #5 is the consolidated upstream-to-fork proposal covering current H3 compatib
|
||||
|
||||
## V3.4 input connection patterns
|
||||
|
||||
V3.4 separates the visual reference input from the driving-audio input. Choose the connection pattern that matches your source material.
|
||||
V3.4 separates the video-guide frame input from the driving-audio input. Choose the connection pattern that matches your source material.
|
||||
|
||||
### 1. Audio only
|
||||
|
||||
Connect `Load Audio` to `driving_audio`. Use this when an existing song, dialogue track, or sound effect should remain the final audio. A `Video Reference` is not required.
|
||||
Connect `Load Audio` to `Driving Audio`. Use this when an existing song, dialogue track, or sound effect should remain the final audio. `Video Guide Frames` is not required.
|
||||
|
||||

|
||||
|
||||
### 2. Video with its own audio
|
||||
|
||||
Connect `Load Video (Upload)` `IMAGE` to `Video Reference`. If the uploaded video contains the audio you want to preserve, connect its `AUDIO` output to `driving_audio` as well.
|
||||
Connect `Load Video (Upload)` `IMAGE` to `Video Guide Frames`. If the uploaded video contains the audio you want to preserve, connect its `AUDIO` output to `Driving Audio` as well.
|
||||
|
||||

|
||||

|
||||
|
||||
### 3. Video and audio from separate sources
|
||||
|
||||
Connect `Load Video (Upload)` `IMAGE` to `Video Reference`, then connect a separate `Load Audio` node to `driving_audio`. Use this when the visual reference video and the final audio source are different files.
|
||||
Connect `Load Video (Upload)` `IMAGE` to `Video Guide Frames`, then connect a separate `Load Audio` node to `Driving Audio`. Use this when the video guide and the final audio source are different files.
|
||||
|
||||

|
||||

|
||||
|
||||
Both inputs are optional. Connect `Video Reference` when visual guidance is needed, and connect `driving_audio` when the supplied audio should be preserved in the final output.
|
||||
Both inputs are optional. Connect `Video Guide Frames` when video guidance is needed, and connect `Driving Audio` when the supplied audio should be preserved in the final output.
|
||||
|
||||
### Video Reference frame rate
|
||||
### Video Guide Frames frame rate
|
||||
|
||||
Use a 24 fps source for `Video Reference`. `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
|
||||
|
||||
The V3.5.0 release passes `430` automated tests, source/runtime registration verification, native PackedLayout, Fixed 3x5 prompt planning, and release metadata consistency. Representative GPU revalidation passed with accepted 3x5 FL2VA Long Terminal Merge latents through Core Video/Audio VAE Decode and Assemble V3.5 Auto: 3 logical chunks, 2 physical groups (`37T + 77T`), 640x640, 360 frames, 24 fps, and 15.000 seconds, with the accepted video/audio hashes reproduced exactly.
|
||||
The V3.5.1 release passes `450` automated tests, source/runtime registration verification, native PackedLayout, Fixed 3x5 prompt planning, JavaScript UI harnesses, and release metadata consistency. Representative GPU acceptance includes the V3.5 Conditioning Bridge path, Reference Audio/Image retention, Second Pass/Hi-Res paths, and accepted 3x5 FL2VA Long Terminal Merge latents through Core Video/Audio VAE Decode and Assemble V3.5 Auto.
|
||||
|
||||
V3.4 compatibility paths have been exercised locally with:
|
||||
|
||||
@@ -509,7 +572,7 @@ V3.4 compatibility paths have been exercised locally with:
|
||||
- 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 Reference with source audio routed separately
|
||||
- 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
|
||||
@@ -528,7 +591,7 @@ No OOM was observed in the cited recent local V3.4 checks, including two-chunk 8
|
||||
## Limits
|
||||
|
||||
- Continuation does not guarantee frame-perfect identity or motion.
|
||||
- Video Reference guides H3; it does not reproduce every source frame.
|
||||
- Video Guide Frames guides H3; it does not reproduce every source frame.
|
||||
- Driving Audio preserves selected audio, but visual lip synchronization remains model-dependent.
|
||||
- FL2VA may settle on the supplied Last Frame before the requested duration ends; equivalent Core runs can show the same behavior.
|
||||
- Long, high-resolution sequences may exceed system RAM during final decode and assembly even when chunk sampling succeeds.
|
||||
|
||||
+68
-9
@@ -1,9 +1,67 @@
|
||||
# ComfyUI-H3-Continuum 3.5.0
|
||||
# ComfyUI-H3-Continuum 3.5.1
|
||||
|
||||
**V3.5.0正式版:** V3.4互換を維持し、Second Pass Bridge、実験的Hi-Res Fix、Disk-backed Assembleを追加します。V3.4のNode IDは保存済みワークフロー互換のため意図的に残しており、既存V3.4ワークフローはそのまま使用できます。
|
||||
**V3.5.1正式版:** V3.4互換を維持し、Reference Audio、Conditioning Bridge、Last Queued Seed Reuseを追加します。V3.4のNode IDとbackend socket keyは保存済みワークフロー互換のため意図的に残しており、表示名を変更しても既存V3.4/V3.5ワークフローの接続は維持されます。
|
||||
|
||||
MiniMax H3を複数チャンクで連続生成し、直前チャンク末尾の**映像latent / 音声latentを直接**次チャンクへ継承するComfyUIカスタムノードです。チャンク間でVideo/Audio VAEのDecode→Encodeは行いません。
|
||||
|
||||
## V3.5.1の追加機能
|
||||
|
||||
V3.5.1では、V3.4のSampling、Conditioning、Terminal Merge、Assembly、Seam、Run Storage契約を変更せず、次の3点を追加します。
|
||||
|
||||
1. **Reference Audio(任意)**: 生成音声を置換しない、H3 nativeの音声conditioningです。`Reference Audio Inputs`を`Show`にしたときだけ2つのsocketを表示します。
|
||||
2. **Conditioning Bridge V3.5**: Continuumのphysical groupごとに、完全なCore互換`MODEL`と`CONDITIONING`を外部Samplerへ公開します。
|
||||
3. **Last Queued Seed Reuse**: Randomize生成後にComfyUIが自動更新したseedからFixedへ戻した場合、安全に判定できるときだけ直前Queueで実際に使ったseedを復元します。ComfyUI cache自体は操作しません。
|
||||
|
||||
### Reference系入力の違い
|
||||
|
||||
表示名は役割の違いを示しています。名前が似ていても同じ組み合わせではありません。
|
||||
|
||||
| 表示入力 | 接続元 | 用途 | 最終音声 |
|
||||
|---|---|---|---|
|
||||
| `reference_image_1`~`reference_image_3` | 静止画`IMAGE` | 人物、被写体、外観などの継続参照 | 音声なし |
|
||||
| `Video Guide Frames` | Video loaderの`IMAGE`フレームbatch | 全chunkでmotion、framing、timing、appearanceをガイド | 元動画の音声は含まない |
|
||||
| `Driving Audio` + `Driving Audio VAE` | Audio loader、またはVideo loaderの`AUDIO`と対応Audio VAE | 音声で生成をガイドし、入力音声を最終出力へ維持 | 生成音声を選択した元音声へ置換 |
|
||||
| `Reference Audio (Optional)` + `Reference Audio VAE (Optional)` | 単独Audioと対応Audio VAE | H3 native conditioning専用 | 生成音声をcopy・置換しない |
|
||||
|
||||
音声付き動画を使う通常の接続は、loaderの`IMAGE`を`Video Guide Frames`へ、`AUDIO`を`Driving Audio`へ接続します。conditioning専用動作が目的でない限り、動画の音声を`Reference Audio (Optional)`へ接続しないでください。
|
||||
|
||||

|
||||
|
||||
`Reference Audio Inputs`は表示だけを制御します。
|
||||
|
||||
- 未接続時は`Hidden`が既定です。
|
||||
- `Show`でReference Audioの2 socketを表示します。
|
||||
- 保存workflowでどちらかが接続済みなら自動的に`Show`で開きます。
|
||||
- 接続中は`Hidden`へ変更できず、graph linkを削除しません。
|
||||
- workflowのwidget値には保存せず、backend input keyと既存接続を変更しません。
|
||||
|
||||
| Hidden — 通常の簡潔表示 | Show — 任意conditioning socketを表示 |
|
||||
|---|---|
|
||||
|  |  |
|
||||
|
||||
### Conditioning Bridge V3.5
|
||||
|
||||
`H3 Continuum Conditioning Bridge V3.5`は外部sampling用のAdvanced接続点です。`model`、`clip`、外部処理後の`video_latents`、`assembly_plan`、`refine_context`を接続し、選択したconditioning経路で必要な場合だけ`video_vae`を接続します。出力`group_models`と`conditioning`はphysical group数と同数で、各要素は完全なComfyUI objectのままです。CONDITIONING内部entryをphysical-group listへflattenしません。
|
||||
|
||||
```text
|
||||
H3 Continuum Sampler V3.5.video_latents
|
||||
→ LBH等の外部H3 latent処理
|
||||
→ H3 Continuum Conditioning Bridge V3.5
|
||||
→ Core BasicGuider + 外部Sampler
|
||||
→ Core Video / Audio VAE Decode
|
||||
→ H3 Continuum Assemble + Seam V3.5
|
||||
```
|
||||
|
||||
AV LATENTの組、Noise、SIGMAS、Audio Lock、sampling、audio passthroughは外部workflow側の責任です。Bridgeは準備済み`MODEL`と`CONDITIONING`、更新済みAssembly Planだけを公開します。
|
||||
|
||||

|
||||
|
||||
完全な接続例: [V3.5.1 LBH+Conditioning Bridgeワークフロー](examples/workflows/MiniMax_H3_Continuum_V351_LBH_Conditioning_Bridge.json)
|
||||
|
||||
接続例ではCore標準名の`BasicGuider`、`BasicScheduler`、`SamplerCustomAdvanced`を変更していません。公開サンプルではCoreノードを独自タイトルへ変更せず、Continuumノードや外部カスタムノードと直感的に区別できる状態を維持します。LBH latent upscaler、AV LATENTの結合/分離、load/save、任意accelerationは外部ノードなので、各ComfyUI環境に合わせて導入または置換してください。
|
||||
|
||||
LBHはlatent geometryだけを変更し、Continuumのdenoise強度は持ちません。拡大後latentをどれだけ再生成するかは外部`BasicScheduler`のSIGMASで調整します。1.5x等へ上げても高速な場合がありますが、target canvasに応じてmemory、decode、sampling負荷は増加します。
|
||||
|
||||
## V3.5の主な追加機能
|
||||
|
||||
V3.5の大きな追加は2点です。
|
||||
@@ -73,8 +131,9 @@ Hi-Res Fixを接続しなければV3.4 Sampling経路は変わりません。強
|
||||
## 推奨テンプレートワークフロー
|
||||
|
||||
- [V3.5推奨テンプレート](examples/workflows/MiniMax_H3_Continuum_V35.json)
|
||||
- [V3.5.1 LBH+Conditioning Bridge接続例](examples/workflows/MiniMax_H3_Continuum_V351_LBH_Conditioning_Bridge.json)
|
||||
|
||||
V3.5テンプレートはHi-Res Fixが初期OFF、AssembleのBuffer BackendがAutoです。First Frame、Last Frame、Reference Image 1~3は1つのmegapixel設定を共有し、Video Referenceの解像度はVHS Load Video側で調整します。用途に応じて不要な補助経路を外したり、Advanced Second Pass経路へ組み替えたりできます。
|
||||
V3.5テンプレートはHi-Res Fixが初期OFF、AssembleのBuffer BackendがAutoです。First Frame、Last Frame、Reference Image 1~3は1つのmegapixel設定を共有します。`Video Guide Size`は`Video Guide Frames`に使うframe batchを調整し、decodeとframe-rate変換はVideo loader側で行います。用途に応じて不要な補助経路を外したり、Advanced Second Pass経路へ組み替えたりできます。
|
||||
|
||||
## V3.4互換
|
||||
|
||||
@@ -82,17 +141,17 @@ V3.4ノードは保存済みワークフローを壊さないため残してい
|
||||
|
||||
## V3.4.0 Stable
|
||||
|
||||
V3.4.0は、最大3枚のReference Image、Run Storage、Spectrum Interop、Decode後のAudio / Video Seam補正を維持し、Driving AudioとVideo Referenceを正式な入力として追加します。
|
||||
V3.4.0は、最大3枚のReference Image、Run Storage、Spectrum Interop、Decode後のAudio / Video Seam補正を維持し、`Driving Audio`と`Video Guide Frames`を正式な入力として追加します。
|
||||
|
||||
Driving Audioは入力音声を絶対時間で各Chunkのガイドに使い、最終出力には元音声を維持します。Video Referenceは参照映像を全Chunkで継続使用し、`Efficient - 0.4 MP`、`Balanced - 0.6 MP`、`Match Output`から処理解像度を選択できます。
|
||||
`Driving Audio`は入力音声を絶対時間で各Chunkのガイドに使い、最終出力には元音声を維持します。`Video Guide Frames`はVideo loaderが出力したIMAGE frame batchを全Chunkで継続使用し、`Efficient - 0.4 MP`、`Balanced - 0.6 MP`、`Match Output`から処理解像度を選択できます。青いIMAGE socketですが、通常の1枚の静止画参照ではなく動画フレーム列を接続します。
|
||||
|
||||
Reference入力のバイパスされたソケットは無視され、有効な画像だけがPicture 1から連続採番されます。空欄や不完全なプロンプトも停止せず、警告とFixed fallbackで生成を続行します。未知のモデル、ノード、プロンプト形式を独自判断で拒否する制限も撤廃しました。
|
||||
|
||||
Run Storageの保存契約にはDriving AudioとVideo Referenceのidentityを含め、入力変更後に古いChunkを誤再利用しないようにしています。
|
||||
Run Storageの保存契約にはDriving AudioとVideo Guide Framesのidentityを含め、入力変更後に古いChunkを誤再利用しないようにしています。
|
||||
|
||||
## Driving Audio / Video Reference / Seam
|
||||
## Driving Audio / Video Guide Frames / Seam
|
||||
|
||||
Driving Audioだけを使う、Video Referenceだけを使う、Video Referenceと別音声を組み合わせる、という3通りの接続に対応します。Video Referenceは24 fps入力を基準とし、異なるfpsの素材はLoad Video側で24 fpsへ設定してください。
|
||||
Driving Audioだけを使う、Video Guide Framesだけを使う、Video Guide Framesと別音声を組み合わせる、という3通りの接続に対応します。Video Guide Framesは24 fps入力を基準とし、異なるfpsの素材はLoad Video側で24 fpsへ設定してください。
|
||||
|
||||
H3 Continuum Assemble + SeamはAudio Seam AutoとVideo Seam Autoを既定とし、フレーム削除を行わずに境界の一時的な露出・色変化を補正します。Auto 2は露出ランプ向けの実験的な追加モードです。
|
||||
|
||||
@@ -162,7 +221,7 @@ ZIPを展開して、`ComfyUI-H3-Continuum`フォルダーを`ComfyUI/custom_nod
|
||||
|
||||
## 検査
|
||||
|
||||
V3.5.0正式版は全`430 passed`、source/runtime登録検証、PackedLayout、Fixed 3×5 Prompt Planを通過しています。代表GPU再検証では3×5秒FL2VA Long Terminal Mergeの受入済みlatentをCore Video/Audio VAE DecodeからAssemble V3.5 Autoへ通し、3 logical / 2 physical groups、640×640、360 frames、24 fps、15.000秒、既存受入済み映像/音声hashとの完全一致を確認しました。
|
||||
V3.5.1正式版は全`450 passed`、source/runtime登録検証、PackedLayout、Fixed 3×5 Prompt Plan、JavaScript UI harnessを通過しています。代表GPU受入にはConditioning Bridge、Reference Audio/Image保持、Second Pass/Hi-Res経路、3×5秒FL2VA Long Terminal MergeからCore Video/Audio VAE Decode、Assemble V3.5 Autoまでを含みます。
|
||||
|
||||
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を作る可能性は残ります。
|
||||
|
||||
|
||||
+54
@@ -1,5 +1,24 @@
|
||||
# Work Log
|
||||
|
||||
## 2026-08-24 - V3.5.1 Issue #9 Conditioning Bridge CPU implementation
|
||||
|
||||
- Preserved all Issue #10 changes and created accepted pre-change snapshots: `pre-issue9-conditioning-bridge-source-accepted-20260824_190823` (460 files) and `pre-issue9-conditioning-bridge-runtime-w-accepted-20260824_190823` (337 files), excluding top-level `.git` and the pre-existing inaccessible `.pytest_cache`.
|
||||
- Added `H3ContinuumConditioningBridgeV35` as an Advanced MODEL + CONDITIONING interoperability node. It exposes one aligned pair per Continuum physical group, preserves complete CONDITIONING inner lists, updates target geometry, and explicitly leaves AV LATENT/noise/Audio Lock behavior to the external workflow.
|
||||
- Extracted shared physical-group preparation from Second Pass. The built-in path consumes each prepared group immediately, so its prior group-by-group sampling order and low-memory behavior remain intact; no V3.4 sampling, conditioning, Terminal Merge, Assembly, Seam, or Run Storage code was changed.
|
||||
- Added schema, registration, 37T + 77T Terminal Merge alignment, target geometry, context identity, and non-flattening regressions. Focused result: `33 passed`; full source pytest: `442 passed`; only the known `pynvml` FutureWarning remains.
|
||||
- Synchronized only `nodes.py`, `v3/second_pass.py`, `v3/conditioning_bridge_nodes.py`, and `tools/verify_runtime.py` to ComfyUI_W and verified per-file SHA-256 equality. Runtime verification passed package 3.5.0 registration, native PackedLayout, and Fixed 3x5 planning with the Bridge visible as a current node. The 163-entry distribution Manifest validates completely.
|
||||
- GPU Basic Guider / external sampler acceptance remains pending. Commit and push were not performed.
|
||||
|
||||
## 2026-08-24 - V3.5.1 Issue #10 Reference Audio CPU implementation
|
||||
|
||||
- Preserved the V3.4 public schema and added only internal V3.4 forwarding parameters plus two V3.5 optional sockets: `Reference Audio` and `Reference Audio VAE`.
|
||||
- Reused the existing Production/Core-compatible Reference Audio path without duplicate preparation or encoding. Standalone Reference Audio 1 is the only V3.5.1 scope; generated audio remains final unless the separate Driving Audio path is connected.
|
||||
- Added regressions for socket append-only compatibility, published V3.5 template routes, unused-VAE behavior, required VAE validation, Run Storage revision separation/restoration, and Reference Audio retention in normal and Terminal Merge refine-context groups.
|
||||
- Verified snapshots: `pre-v351-reference-audio-source-verified-ee7b993-20260824_171013` (457 files) and `pre-v351-reference-audio-runtime-w-verified-20260824_171013` (336 files), both with zero SHA-256 mismatch. Earlier standard-script attempts are incomplete because the pre-existing `.pytest_cache` ACL denies traversal.
|
||||
- Source focused regression `62 passed`; full pytest `439 passed`. ComfyUI_W received one preserved-tooltip Production merge plus three related tests; runtime focused result is `41 passed, 1 skipped`, syntax and runtime verifier PASS. The skip is only the public workflow-route test because `examples/workflows` is not installed in that runtime copy.
|
||||
- GPU tests 1-4 and required normal/Terminal long-form cases remain pending. Package version and public README remain V3.5.0.
|
||||
- User authorized publication. To avoid pushing the canonical branch's four private/local commits, copied only Production, three regression files, and Manifest into the clean isolated clone at public `origin/main`. Regenerated the 161-entry Manifest from public Git index blobs, correcting 36 pre-existing public-tree hash mismatches. Full isolated-clone pytest remained `439 passed`; commit `a704aa961fc2ba0c19aef6f2ecfdcb46fa9384b2` was pushed and remote-read back exactly.
|
||||
|
||||
## 2026-08-24 - V3.5 recommended template workflow
|
||||
|
||||
- Added `examples/workflows/MiniMax_H3_Continuum_V35.json` as the recommended V3.5 template while retaining every V3.4 template.
|
||||
@@ -342,3 +361,38 @@ D:\Codex\_snapshots\ComfyUI-H3-Continuum\pre-rollback-after-00038-fail-20260821_
|
||||
- Added the validated 9.49 GiB stress numbers to both READMEs: private memory 12.41 -> 2.91 GiB and USS 10.29 -> 0.80 GiB, with hash-identical RAM/Disk output. Explicitly documented that this is host-RAM/private-commitment reduction, not sampler VRAM reduction, and that Disk-backed can affect final assembly I/O rather than model sampling speed.
|
||||
- Updated Changelog, package information, package validation, V3.5 guide wording, and the 159-entry Manifest. Full canonical pytest is `430 passed`; every Manifest hash, `git diff --check`, and ComfyUI_W runtime verification pass. Nine changed public files/assets were synchronized to ComfyUI_W with per-file SHA-256 equality.
|
||||
- User explicitly authorized committing and pushing the complete V3.5.0 release state to `origin/main`.
|
||||
|
||||
## 2026-08-24 - V3.5.1 Last Queued Seed reuse frontend fix
|
||||
|
||||
- Preserved all existing Issue #9/#10 and earlier uncommitted work. The standard snapshot script was attempted first and failed only on the known ACL-inaccessible top-level `.pytest_cache`; accepted SHA-256-verified snapshots are `pre-v351-last-queued-seed-fix-source-accepted-20260824_210526` (467 files) and `pre-v351-last-queued-seed-fix-runtime-w-accepted-20260824_210526` (339 files), excluding `.git` and `.pytest_cache`, both with zero mismatch at source revision `ee7b9937dc9bda5b4e55b012e8e725b7afc5f3aa`.
|
||||
- Added session-only V3.5 sampler Seed state in `web/last_queued_seed.js`: `last_queued_seed`, `auto_updated_seed`, `previous_control_mode`, and `auto_update_pending`. `beforeQueuePrompt` captures the submitted Seed; `Randomize -> Fixed` restores it only when the displayed value still equals the exact ComfyUI automatic After Generate update. A manual Seed edit clears pending restoration. Linked/missing Seed inputs clear the capture.
|
||||
- No Workflow JSON state, new widget, backend change, cache manipulation, Run Storage relaxation, Sampling/Second Pass/Terminal Merge/Assembly/Seam change, V3.4 behavior change, Node ID change, or display-name change was introduced. Seed restoration only restores normal cache eligibility; an absent cache regenerates normally with the same Seed.
|
||||
- Added `tests/test_v351_last_queued_seed_frontend.py` with an actual Node.js module harness covering automatic restore, manual override, consecutive Randomize queues, Before Generate/no-update behavior, Fixed baseline, and linked Seed cancellation. Focused frontend regression is `5 passed`; JavaScript syntax passes; canonical full pytest is `445 passed` with only the known `pynvml` FutureWarning; source Manifest has 165 entries with zero missing or mismatched hashes; `git diff --check` passes.
|
||||
- Synchronized only `web/project_id.js` and new `web/last_queued_seed.js` to ComfyUI_W; both match source SHA-256. The runtime-specific Manifest received only the matching frontend entry updates; its pre-existing unrelated divergence from the canonical source Manifest was not normalized or overwritten. Runtime JavaScript syntax, compact-UI regression (`2 passed`), package registration, native PackedLayout, and Fixed 3x5 planning pass. Real `Randomize -> Fixed -> Second Pass ON` browser/cache acceptance remains pending; ComfyUI_W was not restarted or reloaded. Commit/push not performed.
|
||||
|
||||
## 2026-08-24 - V3.5.1 Hi-Res Fix Core canvas alignment
|
||||
|
||||
- Preserved all existing Issue #9/#10/Seed Fix working-tree changes. The standard snapshot script again encountered only the known top-level `.pytest_cache` ACL denial; accepted SHA-256-verified snapshots are `pre-v351-hires-core-alignment-source-accepted-20260824_213303` (470 files) and `pre-v351-hires-core-alignment-runtime-w-accepted-20260824_213303` (340 files), excluding `.git` and `.pytest_cache`, with zero mismatch at source revision `ee7b9937dc9bda5b4e55b012e8e725b7afc5f3aa`.
|
||||
- Diagnosed the GPU failure `shape '[1, 24, 1, 1, 21, 2, 21, 2]' is invalid for input of size 44376`: manual `576x576 * 1.2` used `round(36 * 1.2) = 43`, while Core H3 requires a 32-pixel canvas grid / even latent dimensions for its `2x2` spatial patchifier.
|
||||
- Added Core-derived manual target alignment in `v3/hires_fix_nodes.py`. The failing case now produces `704x704` / `44x44`; rectangular `1024x576 * 1.2` produces `1216x704` / `76x44`. No Sampling, Conditioning adaptation, Terminal Merge, Assembly, Seam, Run Storage, node schema, ID, or display name changed.
|
||||
- Added direct and integrated square/rectangular regressions. Focused Hi-Res/Second Pass result is `48 passed`; full source pytest is `448 passed` with only the known `pynvml` FutureWarning. An initial full run's 97 setup errors were solely the existing inaccessible global pytest temp root and disappeared with an explicit writable `--basetemp`.
|
||||
- Synchronized only `v3/hires_fix_nodes.py` to ComfyUI_W and verified exact SHA-256 equality. Runtime verifier passed package registration, native PackedLayout, and Fixed 3x5 planning. The running ComfyUI process was not restarted, so GPU re-acceptance remains pending after a deliberate restart. The attempted Seed cache run was not valid because its second prompt was queued before the first completed; logs show First Pass `20/20` ran again. Commit/push not performed.
|
||||
|
||||
## 2026-08-25 - V3.5.1 Reference Audio conditional UI and naming
|
||||
|
||||
- Preserved all existing Issue #9/#10/Seed/Hi-Res working-tree changes. The standard snapshot attempt failed only on the known ACL-inaccessible top-level `.pytest_cache`; accepted SHA-256-verified snapshots are `pre-v351-reference-audio-conditional-ui-source-accepted-20260824_230702-ee7b993` (470 files) and `pre-v351-reference-audio-conditional-ui-runtime-w-accepted-20260824_230702` (340 files), excluding `.git` and `.pytest_cache`, with zero mismatch.
|
||||
- Added `web/reference_audio_ui.js`. V3.5 Reference Audio sockets default to `Hidden` when unlinked, can be restored with `Show`, retain their original input positions, auto-open for connected saved workflows, and cannot be hidden while linked. No graph link is removed. The UI widget is attached only after Core graph configuration and removed from serialized Workflow widget values to avoid reload shifts.
|
||||
- Clarified only human-facing labels/tooltips: `Video Guide Frames`, `Driving Audio`, `Driving Audio VAE`, `Reference Audio (Optional)`, and `Reference Audio VAE (Optional)`. Backend input keys, ordering, types, Node IDs, conditioning paths, Sampling, Terminal Merge, Assembly, Seam, and Run Storage contracts are unchanged.
|
||||
- Live Chrome/ComfyUI testing on the already-running `127.0.0.6:8188` instance found and corrected two integration-specific issues that the initial mock did not expose: current Core keeps widget descriptors after the Reference Audio sockets in `node.inputs`, and UI injection before graph configuration can shift saved widget values. Final live acceptance passed `Hidden`, `Hidden -> Show -> Hidden`, original-position restoration, connected auto-`Show`, and linked hide protection. Temporary workflows were closed without saving; the template workflows were not modified.
|
||||
- Added/updated real JavaScript harness coverage for Core-style non-terminal inputs, disconnected `-1`, workflow serialization, labels, show/hide, link protection, callback chaining, and absent-input recovery. Focused validation is `20 passed`; canonical full pytest is `450 passed`; JavaScript syntax, `git diff --check`, and ComfyUI_W runtime verification pass with only the known `pynvml` FutureWarning.
|
||||
|
||||
## 2026-08-25 - V3.5.1 release documentation and naming
|
||||
|
||||
- Renamed the displayed video-guide inputs to `Video Guide Frames` and `Video Guide Size`; backend keys, input order, Node IDs, graph links, and saved-workflow compatibility remain unchanged.
|
||||
- Expanded English/Japanese README guidance for V3.5.1 Reference Audio, Conditioning Bridge, Last Queued Seed Reuse, and the distinct roles of still Reference Images, Video Guide Frames, Driving Audio, and Reference Audio.
|
||||
- Updated package version metadata, Changelog, package information, package validation, release tests, project state, and distribution Manifest for V3.5.1.
|
||||
- User explicitly authorized committing and pushing the complete V3.5.1 release state after validation. The supplied screenshots still showed the old display label, so no stale screenshot was added to the release documentation.
|
||||
- Replaced the initially supplied stale/shifted screenshots with three user-approved normal-state images showing `Video Guide Frames`, `Reference Audio Inputs: Hidden`, and `Show`; both README editions reference the same assets.
|
||||
- Final release checks: canonical ComfyUI_W-root pytest `450 passed` with only the known `pynvml` warning; JavaScript syntax and `git diff --check` pass; all 172 Manifest entries and README image/workflow references verify.
|
||||
- Added the user-supplied LBH + Conditioning Bridge workflow as a separate public connection example and a lightweight SVG flow chart to both README editions. The recommended template remains unchanged, and Core nodes retain their standard display titles.
|
||||
- Synchronized only the relevant implementation/tests to ComfyUI_W and verified per-file SHA-256 equality. No ComfyUI process was started or stopped. Commit/push not performed.
|
||||
|
||||
@@ -0,0 +1,142 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="1400" height="820" viewBox="0 0 1400 820" role="img" aria-labelledby="title description">
|
||||
<title id="title">V3.5.1 LBH and Conditioning Bridge external sampling flow</title>
|
||||
<desc id="description">Connection flow from H3 Continuum Sampler through LBH latent upscaling, Conditioning Bridge, Core BasicGuider and SamplerCustomAdvanced, AV separation, Core decode, and Continuum assembly.</desc>
|
||||
<defs>
|
||||
<marker id="arrow" markerWidth="10" markerHeight="10" refX="9" refY="3" orient="auto" markerUnits="strokeWidth">
|
||||
<path d="M0,0 L0,6 L9,3 z" fill="#9ca3af"/>
|
||||
</marker>
|
||||
<style>
|
||||
.bg { fill: #0d1117; }
|
||||
.title { fill: #f3f4f6; font: 700 28px Arial, sans-serif; }
|
||||
.subtitle { fill: #9ca3af; font: 16px Arial, sans-serif; }
|
||||
.lane { fill: none; stroke: #30363d; stroke-width: 1.5; stroke-dasharray: 8 7; rx: 16; }
|
||||
.laneLabel { fill: #8b949e; font: 700 14px Arial, sans-serif; letter-spacing: 1px; }
|
||||
.box { fill: #161b22; stroke-width: 2; rx: 12; }
|
||||
.continuum { stroke: #4ade80; }
|
||||
.external { stroke: #fb923c; }
|
||||
.core { stroke: #a78bfa; }
|
||||
.boxTitle { fill: #f9fafb; font: 700 16px Arial, sans-serif; }
|
||||
.boxText { fill: #c9d1d9; font: 13px Arial, sans-serif; }
|
||||
.small { fill: #9ca3af; font: 12px Arial, sans-serif; }
|
||||
.arrow { fill: none; stroke: #9ca3af; stroke-width: 2.2; marker-end: url(#arrow); }
|
||||
.arrowGreen { fill: none; stroke: #4ade80; stroke-width: 2.5; marker-end: url(#arrow); }
|
||||
.arrowOrange { fill: none; stroke: #fb923c; stroke-width: 2.5; marker-end: url(#arrow); }
|
||||
.arrowPurple { fill: none; stroke: #a78bfa; stroke-width: 2.5; marker-end: url(#arrow); }
|
||||
.edgeText { fill: #d1d5db; font: 12px Arial, sans-serif; }
|
||||
.note { fill: #111827; stroke: #374151; stroke-width: 1.5; rx: 10; }
|
||||
.noteTitle { fill: #fbbf24; font: 700 14px Arial, sans-serif; }
|
||||
.noteText { fill: #d1d5db; font: 12px Arial, sans-serif; }
|
||||
</style>
|
||||
</defs>
|
||||
|
||||
<rect class="bg" width="1400" height="820"/>
|
||||
<text class="title" x="50" y="48">V3.5.1 — LBH + Conditioning Bridge connection example</text>
|
||||
<text class="subtitle" x="50" y="76">Green: H3 Continuum · Orange: third-party workflow nodes · Purple: ComfyUI Core nodes</text>
|
||||
|
||||
<rect class="lane" x="35" y="95" width="1330" height="205"/>
|
||||
<text class="laneLabel" x="55" y="122">FIRST PASS AND PHYSICAL-GROUP CONDITIONING</text>
|
||||
|
||||
<rect class="box continuum" x="55" y="145" width="255" height="115"/>
|
||||
<text class="boxTitle" x="75" y="174">H3 Continuum Sampler V3.5</text>
|
||||
<text class="boxText" x="75" y="200">video_latents · audio_latents</text>
|
||||
<text class="boxText" x="75" y="221">assembly_plan · refine_context</text>
|
||||
<text class="small" x="75" y="243">First Pass remains the source of truth</text>
|
||||
|
||||
<rect class="box external" x="370" y="145" width="245" height="115"/>
|
||||
<text class="boxTitle" x="390" y="174">LBH H3 Latent Upscaler 3D</text>
|
||||
<text class="boxText" x="390" y="202">Resize video latent geometry only</text>
|
||||
<text class="small" x="390" y="226">Example: 1.2x or 1.5x</text>
|
||||
<text class="small" x="390" y="246">No denoise-strength control</text>
|
||||
|
||||
<rect class="box continuum" x="680" y="135" width="305" height="135"/>
|
||||
<text class="boxTitle" x="700" y="164">Conditioning Bridge V3.5</text>
|
||||
<text class="boxText" x="700" y="191">model + clip + resized video_latents</text>
|
||||
<text class="boxText" x="700" y="212">assembly_plan + refine_context</text>
|
||||
<text class="boxText" x="700" y="233">→ group_models + conditioning</text>
|
||||
<text class="small" x="700" y="253">One complete pair per physical group</text>
|
||||
|
||||
<rect class="box core" x="1050" y="150" width="245" height="105"/>
|
||||
<text class="boxTitle" x="1070" y="180">BasicGuider</text>
|
||||
<text class="boxText" x="1070" y="207">MODEL + CONDITIONING</text>
|
||||
<text class="small" x="1070" y="231">Keep the Core node title unchanged</text>
|
||||
|
||||
<path class="arrowOrange" d="M310 185 H370"/>
|
||||
<text class="edgeText" x="316" y="174">video_latents</text>
|
||||
<path class="arrowGreen" d="M615 185 H680"/>
|
||||
<text class="edgeText" x="624" y="174">resized LATENT</text>
|
||||
<path class="arrowGreen" d="M310 235 C440 292, 565 292, 680 238"/>
|
||||
<text class="edgeText" x="430" y="287">assembly_plan · refine_context · model · clip</text>
|
||||
<path class="arrowPurple" d="M985 202 H1050"/>
|
||||
<text class="edgeText" x="991" y="191">paired lists</text>
|
||||
|
||||
<rect class="lane" x="35" y="325" width="1330" height="225"/>
|
||||
<text class="laneLabel" x="55" y="352">EXTERNAL SAMPLING WORKFLOW RESPONSIBILITY</text>
|
||||
|
||||
<rect class="box external" x="55" y="380" width="285" height="125"/>
|
||||
<text class="boxTitle" x="75" y="409">AV latent preparation</text>
|
||||
<text class="boxText" x="75" y="435">SetLatentNoiseMask</text>
|
||||
<text class="boxText" x="75" y="456">LTXVConcatAVLatent</text>
|
||||
<text class="small" x="75" y="481">resized video + First Pass audio</text>
|
||||
|
||||
<rect class="box external" x="400" y="380" width="245" height="125"/>
|
||||
<text class="boxTitle" x="420" y="409">Sampling controls</text>
|
||||
<text class="boxText" x="420" y="435">RandomNoise · KSamplerSelect</text>
|
||||
<text class="boxText" x="420" y="456">BasicScheduler → SIGMAS</text>
|
||||
<text class="small" x="420" y="481">SIGMAS controls refinement strength</text>
|
||||
|
||||
<rect class="box core" x="720" y="375" width="285" height="135"/>
|
||||
<text class="boxTitle" x="740" y="405">SamplerCustomAdvanced</text>
|
||||
<text class="boxText" x="740" y="432">noise + BasicGuider + sampler</text>
|
||||
<text class="boxText" x="740" y="453">SIGMAS + prepared AV LATENT</text>
|
||||
<text class="small" x="740" y="478">External workflow starts/completes sampling</text>
|
||||
<text class="small" x="740" y="497">Keep the Core node title unchanged</text>
|
||||
|
||||
<rect class="box external" x="1080" y="390" width="230" height="105"/>
|
||||
<text class="boxTitle" x="1100" y="420">LTXVSeparateAVLatent</text>
|
||||
<text class="boxText" x="1100" y="446">sampled video_latent</text>
|
||||
<text class="boxText" x="1100" y="467">sampled audio_latent</text>
|
||||
|
||||
<path class="arrowOrange" d="M492 260 V326 H197 V380"/>
|
||||
<text class="edgeText" x="210" y="343">resized video latent</text>
|
||||
<path class="arrow" d="M182 260 V345 H120 V380"/>
|
||||
<text class="edgeText" x="58" y="331">audio_latents</text>
|
||||
<path class="arrowPurple" d="M1172 255 V335 H900 V375"/>
|
||||
<text class="edgeText" x="1020" y="328">GUIDER</text>
|
||||
<path class="arrowOrange" d="M340 442 H720"/>
|
||||
<text class="edgeText" x="470" y="431">prepared AV LATENT</text>
|
||||
<path class="arrow" d="M645 442 H720"/>
|
||||
<path class="arrowPurple" d="M1005 442 H1080"/>
|
||||
|
||||
<rect class="lane" x="35" y="575" width="1330" height="135"/>
|
||||
<text class="laneLabel" x="55" y="602">CORE DECODE AND CONTINUUM ASSEMBLY</text>
|
||||
|
||||
<rect class="box core" x="180" y="625" width="245" height="65"/>
|
||||
<text class="boxTitle" x="200" y="652">Core Video / Audio VAE Decode</text>
|
||||
<text class="small" x="200" y="675">Decode separated latent outputs</text>
|
||||
|
||||
<rect class="box continuum" x="575" y="620" width="285" height="75"/>
|
||||
<text class="boxTitle" x="595" y="648">Assemble + Seam V3.5</text>
|
||||
<text class="boxText" x="595" y="673">updated plan + decoded IMAGE/AUDIO</text>
|
||||
|
||||
<rect class="box core" x="1015" y="625" width="205" height="65"/>
|
||||
<text class="boxTitle" x="1035" y="652">CreateVideo / SaveVideo</text>
|
||||
<text class="small" x="1035" y="675">Normal downstream output</text>
|
||||
|
||||
<path class="arrowPurple" d="M1195 495 V580 H425 V657"/>
|
||||
<path class="arrowGreen" d="M425 657 H575"/>
|
||||
<path class="arrow" d="M832 270 V590 H718 V620"/>
|
||||
<text class="edgeText" x="742" y="581">updated_assembly_plan</text>
|
||||
<path class="arrowPurple" d="M860 657 H1015"/>
|
||||
|
||||
<rect class="note" x="55" y="740" width="410" height="58"/>
|
||||
<text class="noteTitle" x="75" y="765">LBH</text>
|
||||
<text class="noteText" x="75" y="785">Resize only. Refinement strength belongs to workflow-side SIGMAS.</text>
|
||||
|
||||
<rect class="note" x="495" y="740" width="410" height="58"/>
|
||||
<text class="noteTitle" x="515" y="765">Conditioning Bridge</text>
|
||||
<text class="noteText" x="515" y="785">Publishes MODEL / CONDITIONING; it does not sample or lock audio.</text>
|
||||
|
||||
<rect class="note" x="935" y="740" width="410" height="58"/>
|
||||
<text class="noteTitle" x="955" y="765">External workflow</text>
|
||||
<text class="noteText" x="955" y="785">Owns AV pairing, noise, SIGMAS, sampling, Audio Lock, and passthrough.</text>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 8.3 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 57 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 65 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 104 KiB |
File diff suppressed because it is too large
Load Diff
+1
-1
@@ -1,4 +1,4 @@
|
||||
[project]
|
||||
name = H3 Continuum
|
||||
version = 3.5.0
|
||||
version = 3.5.1
|
||||
description = Native MiniMax H3 continuation with Second Pass, experimental Hi-Res Fix, and disk-backed assembly.
|
||||
|
||||
@@ -390,6 +390,16 @@ from .v3.second_pass_nodes import (
|
||||
NODE_CLASS_MAPPINGS.update(V35_NODE_CLASS_MAPPINGS)
|
||||
NODE_DISPLAY_NAME_MAPPINGS.update(V35_NODE_DISPLAY_NAME_MAPPINGS)
|
||||
|
||||
from .v3.conditioning_bridge_nodes import (
|
||||
NODE_CLASS_MAPPINGS as V35_CONDITIONING_BRIDGE_NODE_CLASS_MAPPINGS,
|
||||
NODE_DISPLAY_NAME_MAPPINGS as V35_CONDITIONING_BRIDGE_NODE_DISPLAY_NAME_MAPPINGS,
|
||||
)
|
||||
|
||||
NODE_CLASS_MAPPINGS.update(V35_CONDITIONING_BRIDGE_NODE_CLASS_MAPPINGS)
|
||||
NODE_DISPLAY_NAME_MAPPINGS.update(
|
||||
V35_CONDITIONING_BRIDGE_NODE_DISPLAY_NAME_MAPPINGS
|
||||
)
|
||||
|
||||
from .v3.latent_resize_nodes import (
|
||||
NODE_CLASS_MAPPINGS as V35_RESIZE_NODE_CLASS_MAPPINGS,
|
||||
NODE_DISPLAY_NAME_MAPPINGS as V35_RESIZE_NODE_DISPLAY_NAME_MAPPINGS,
|
||||
@@ -417,6 +427,7 @@ _primary_node_ids = {
|
||||
"H3ContinuumHiResFixV35",
|
||||
"H3ContinuumLatentResizeV35",
|
||||
"H3ContinuumSecondPassV35",
|
||||
"H3ContinuumConditioningBridgeV35",
|
||||
"H3ContinuumClipOverrides",
|
||||
"H3ContinuumResult",
|
||||
}
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
[project]
|
||||
name = "comfyui-h3-continuum"
|
||||
version = "3.5.0"
|
||||
version = "3.5.1"
|
||||
description = "Integrated N-chunk continuation for ComfyUI native MiniMax H3 video and audio"
|
||||
readme = "README.md"
|
||||
requires-python = ">=3.10"
|
||||
|
||||
@@ -6,7 +6,7 @@ import tomllib
|
||||
|
||||
|
||||
ROOT = Path(__file__).resolve().parents[1]
|
||||
EXPECTED_VERSION = "3.5.0"
|
||||
EXPECTED_VERSION = "3.5.1"
|
||||
|
||||
|
||||
def test_v35_release_metadata_is_consistent():
|
||||
|
||||
@@ -145,4 +145,4 @@ def test_v217_result_pack_expands_legacy_outputs():
|
||||
def test_v217_has_no_frontend_display_controller():
|
||||
assert not (ROOT / "web" / "h3_continuum_v2.js").exists()
|
||||
version_source = (ROOT / "version.py").read_text(encoding="utf-8")
|
||||
assert 'PACKAGE_VERSION = "3.5.0"' in version_source
|
||||
assert 'PACKAGE_VERSION = "3.5.1"' in version_source
|
||||
|
||||
@@ -277,6 +277,15 @@ class _VideoVAE:
|
||||
self.upscale_ratio = 16
|
||||
|
||||
|
||||
class _AudioVAE:
|
||||
def __init__(self):
|
||||
self.first_stage_model = torch.nn.Linear(2, 2)
|
||||
self.patcher = _Patcher(self.first_stage_model)
|
||||
self.vae_dtype = torch.float32
|
||||
self.audio_sample_rate = 32000
|
||||
self.latent_channels = 32
|
||||
|
||||
|
||||
def _sampling_contract(
|
||||
*, model=None, clip=None, video_vae=None, sampler=None, reroll_nonce=0,
|
||||
conditioning_mode="i2va", first_frame_hash="a" * 64,
|
||||
@@ -284,6 +293,8 @@ def _sampling_contract(
|
||||
upstream_graph_contract=None, upstream_graph_safe=None,
|
||||
upstream_graph_reasons=None,
|
||||
execution_semantics=None,
|
||||
reference_audio_contract=None,
|
||||
reference_audio_vae=None,
|
||||
):
|
||||
return build_sampling_contract(
|
||||
model=model or _Model(),
|
||||
@@ -314,9 +325,63 @@ def _sampling_contract(
|
||||
upstream_graph_safe=upstream_graph_safe,
|
||||
upstream_graph_reasons=upstream_graph_reasons,
|
||||
execution_semantics=execution_semantics,
|
||||
reference_audio_contract=reference_audio_contract,
|
||||
reference_audio_vae=reference_audio_vae,
|
||||
)
|
||||
|
||||
|
||||
def test_reference_audio_revision_separates_changes_and_restores_on_disconnect():
|
||||
model = _Model()
|
||||
clip = _Clip()
|
||||
sampler = _Sampler()
|
||||
audio_vae = _AudioVAE()
|
||||
common = {
|
||||
"model": model,
|
||||
"clip": clip,
|
||||
"sampler": sampler,
|
||||
"conditioning_mode": "t2va",
|
||||
"first_frame_hash": "",
|
||||
}
|
||||
disconnected, safe, reasons = _sampling_contract(
|
||||
**common,
|
||||
reference_audio_vae=audio_vae,
|
||||
)
|
||||
assert safe, reasons
|
||||
assert "reference_audio" not in disconnected["global"]
|
||||
assert "reference_audio_vae" not in disconnected["global"]
|
||||
|
||||
first_contract = {
|
||||
"reference_audio_contract_version": 1,
|
||||
"source_sha256": "a" * 64,
|
||||
"resolved_vae_sample_rate": 32000,
|
||||
}
|
||||
first, safe, reasons = _sampling_contract(
|
||||
**common,
|
||||
reference_audio_contract=first_contract,
|
||||
reference_audio_vae=audio_vae,
|
||||
)
|
||||
assert safe, reasons
|
||||
assert first["global"]["reference_audio"] == first_contract
|
||||
assert "reference_audio_vae" in first["global"]
|
||||
|
||||
changed_contract = dict(first_contract, source_sha256="b" * 64)
|
||||
changed, safe, reasons = _sampling_contract(
|
||||
**common,
|
||||
reference_audio_contract=changed_contract,
|
||||
reference_audio_vae=audio_vae,
|
||||
)
|
||||
assert safe, reasons
|
||||
restored, safe, reasons = _sampling_contract(
|
||||
**common,
|
||||
reference_audio_vae=audio_vae,
|
||||
)
|
||||
assert safe, reasons
|
||||
|
||||
assert revision_identity(disconnected) != revision_identity(first)
|
||||
assert revision_identity(first) != revision_identity(changed)
|
||||
assert revision_identity(restored) == revision_identity(disconnected)
|
||||
|
||||
|
||||
def test_terminal_seed_v2_revision_is_scoped_and_distinct():
|
||||
old_contract, old_safe, old_reasons = _sampling_contract(
|
||||
conditioning_mode="fl2va",
|
||||
|
||||
@@ -138,6 +138,14 @@ def test_v34_public_schema_replaces_reference_audio_with_driving_audio():
|
||||
schema = H3ContinuumSamplerV34.INPUT_TYPES()
|
||||
assert "driving_audio" in schema["optional"]
|
||||
assert "audio_vae" in schema["optional"]
|
||||
assert schema["optional"]["reference_video_1"][1]["display_name"] == (
|
||||
"Video Guide Frames"
|
||||
)
|
||||
assert schema["optional"]["driving_audio"][1]["display_name"] == "Driving Audio"
|
||||
assert schema["optional"]["audio_vae"][1]["display_name"] == "Driving Audio VAE"
|
||||
assert schema["required"]["video_reference_size"][1]["display_name"] == (
|
||||
"Video Guide Size"
|
||||
)
|
||||
assert "reference_audio_1" not in schema["optional"]
|
||||
assert "reference_audio_vae" not in schema["optional"]
|
||||
|
||||
|
||||
@@ -0,0 +1,159 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import shutil
|
||||
import subprocess
|
||||
from pathlib import Path
|
||||
|
||||
|
||||
ROOT = Path(__file__).resolve().parents[1]
|
||||
PROJECT_ID_JS = ROOT / "web" / "project_id.js"
|
||||
SEED_REUSE_JS = ROOT / "web" / "last_queued_seed.js"
|
||||
|
||||
|
||||
def test_v35_only_wires_last_queued_seed_reuse_into_prompt_capture():
|
||||
source = PROJECT_ID_JS.read_text(encoding="utf-8")
|
||||
|
||||
assert 'const V35_NODE_CLASS = "H3ContinuumSamplerV35";' in source
|
||||
assert "if (isV35)" in source
|
||||
assert "configureLastQueuedSeedReuse(node);" in source
|
||||
assert "if (node.comfyClass === V35_NODE_CLASS)" in source
|
||||
assert "captureLastQueuedSeed(node, apiNode?.inputs?.base_seed);" in source
|
||||
|
||||
|
||||
def test_last_queued_seed_state_is_session_only_and_uses_required_fields():
|
||||
source = SEED_REUSE_JS.read_text(encoding="utf-8")
|
||||
|
||||
for field in (
|
||||
"last_queued_seed",
|
||||
"auto_updated_seed",
|
||||
"previous_control_mode",
|
||||
"auto_update_pending",
|
||||
):
|
||||
assert field in source
|
||||
assert "localStorage" not in source
|
||||
assert "sessionStorage" not in source
|
||||
assert "widgets_values" not in source
|
||||
|
||||
|
||||
def test_last_queued_seed_behavior_with_real_javascript_module(tmp_path):
|
||||
node = shutil.which("node")
|
||||
assert node is not None, "Node.js is required for frontend behavior validation"
|
||||
|
||||
module_path = tmp_path / "last_queued_seed.mjs"
|
||||
module_path.write_text(SEED_REUSE_JS.read_text(encoding="utf-8"), encoding="utf-8")
|
||||
harness_path = tmp_path / "seed_reuse_harness.mjs"
|
||||
harness_path.write_text(
|
||||
r'''
|
||||
import assert from "node:assert/strict";
|
||||
import {
|
||||
captureLastQueuedSeed,
|
||||
configureLastQueuedSeedReuse,
|
||||
} from "./last_queued_seed.mjs";
|
||||
|
||||
function makeNode({ seed = 101, mode = "randomize", nextSeeds = [], runAfter = true } = {}) {
|
||||
const remaining = [...nextSeeds];
|
||||
const seedWidget = {
|
||||
name: "base_seed",
|
||||
value: seed,
|
||||
callback(value) {
|
||||
this.value = value;
|
||||
},
|
||||
};
|
||||
const controlWidget = {
|
||||
name: "control_after_generate",
|
||||
value: mode,
|
||||
callback(value) {
|
||||
this.value = value;
|
||||
},
|
||||
afterQueued() {
|
||||
if (runAfter && this.value === "randomize" && remaining.length) {
|
||||
const next = remaining.shift();
|
||||
seedWidget.value = next;
|
||||
seedWidget.callback(next);
|
||||
}
|
||||
},
|
||||
};
|
||||
seedWidget.linkedWidgets = [controlWidget];
|
||||
const node = { widgets: [seedWidget, controlWidget] };
|
||||
assert.equal(configureLastQueuedSeedReuse(node), true);
|
||||
return { node, seedWidget, controlWidget };
|
||||
}
|
||||
|
||||
function setSeed(seedWidget, value) {
|
||||
seedWidget.value = value;
|
||||
seedWidget.callback(value);
|
||||
}
|
||||
|
||||
function setMode(controlWidget, value) {
|
||||
controlWidget.value = value;
|
||||
controlWidget.callback(value);
|
||||
}
|
||||
|
||||
{
|
||||
const { node, seedWidget, controlWidget } = makeNode({ nextSeeds: [202] });
|
||||
assert.equal(captureLastQueuedSeed(node, 101), true);
|
||||
controlWidget.afterQueued();
|
||||
assert.equal(seedWidget.value, 202);
|
||||
setMode(controlWidget, "fixed");
|
||||
assert.equal(seedWidget.value, 101);
|
||||
}
|
||||
|
||||
{
|
||||
const { node, seedWidget, controlWidget } = makeNode({ nextSeeds: [202] });
|
||||
captureLastQueuedSeed(node, 101);
|
||||
controlWidget.afterQueued();
|
||||
setSeed(seedWidget, 303);
|
||||
setMode(controlWidget, "fixed");
|
||||
assert.equal(seedWidget.value, 303);
|
||||
}
|
||||
|
||||
{
|
||||
const { node, seedWidget, controlWidget } = makeNode({ nextSeeds: [202, 303] });
|
||||
captureLastQueuedSeed(node, 101);
|
||||
controlWidget.afterQueued();
|
||||
assert.equal(seedWidget.value, 202);
|
||||
captureLastQueuedSeed(node, 202);
|
||||
controlWidget.afterQueued();
|
||||
assert.equal(seedWidget.value, 303);
|
||||
setMode(controlWidget, "fixed");
|
||||
assert.equal(seedWidget.value, 202);
|
||||
}
|
||||
|
||||
{
|
||||
const { node, seedWidget, controlWidget } = makeNode({ runAfter: false });
|
||||
captureLastQueuedSeed(node, 101);
|
||||
controlWidget.afterQueued();
|
||||
setMode(controlWidget, "fixed");
|
||||
assert.equal(seedWidget.value, 101);
|
||||
}
|
||||
|
||||
{
|
||||
const { node, seedWidget, controlWidget } = makeNode({ mode: "fixed", nextSeeds: [202] });
|
||||
captureLastQueuedSeed(node, 101);
|
||||
controlWidget.afterQueued();
|
||||
assert.equal(seedWidget.value, 101);
|
||||
setSeed(seedWidget, 404);
|
||||
assert.equal(seedWidget.value, 404);
|
||||
}
|
||||
|
||||
{
|
||||
const { node, seedWidget, controlWidget } = makeNode({ nextSeeds: [202] });
|
||||
captureLastQueuedSeed(node, 101);
|
||||
controlWidget.afterQueued();
|
||||
assert.equal(seedWidget.value, 202);
|
||||
assert.equal(captureLastQueuedSeed(node, ["12", 0]), false);
|
||||
setMode(controlWidget, "fixed");
|
||||
assert.equal(seedWidget.value, 202);
|
||||
}
|
||||
''',
|
||||
encoding="utf-8",
|
||||
)
|
||||
|
||||
result = subprocess.run(
|
||||
[node, str(harness_path)],
|
||||
cwd=tmp_path,
|
||||
capture_output=True,
|
||||
text=True,
|
||||
check=False,
|
||||
)
|
||||
assert result.returncode == 0, result.stdout + result.stderr
|
||||
@@ -0,0 +1,154 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import inspect
|
||||
import json
|
||||
from pathlib import Path
|
||||
|
||||
import pytest
|
||||
import torch
|
||||
|
||||
from ComfyUI_H3_Continuum_Join.reference_audio import (
|
||||
ReferenceAudioError,
|
||||
prepare_reference_audio_source,
|
||||
)
|
||||
from ComfyUI_H3_Continuum_Join.run_storage import automatic_project_key
|
||||
from ComfyUI_H3_Continuum_Join.v3 import driving_nodes
|
||||
from ComfyUI_H3_Continuum_Join.v3.driving_nodes import (
|
||||
H3ContinuumSamplerV34,
|
||||
H3ContinuumSamplerV35,
|
||||
)
|
||||
from ComfyUI_H3_Continuum_Join.v3.nodes import H3ContinuumSamplerProduction
|
||||
|
||||
|
||||
ROOT = Path(__file__).resolve().parents[1]
|
||||
|
||||
|
||||
def test_v35_appends_reference_audio_sockets_without_changing_v34_schema():
|
||||
v34_optional = H3ContinuumSamplerV34.INPUT_TYPES()["optional"]
|
||||
v35_optional = H3ContinuumSamplerV35.INPUT_TYPES()["optional"]
|
||||
|
||||
assert "reference_audio_1" not in v34_optional
|
||||
assert "reference_audio_vae" not in v34_optional
|
||||
assert list(v35_optional)[:-2] == list(v34_optional)
|
||||
assert list(v35_optional)[-2:] == ["reference_audio_1", "reference_audio_vae"]
|
||||
assert v35_optional["reference_audio_1"][0] == "AUDIO"
|
||||
assert v35_optional["reference_audio_1"][1]["display_name"] == (
|
||||
"Reference Audio (Optional)"
|
||||
)
|
||||
assert v35_optional["reference_audio_vae"][0] == "VAE"
|
||||
assert v35_optional["reference_audio_vae"][1]["display_name"] == (
|
||||
"Reference Audio VAE (Optional)"
|
||||
)
|
||||
assert "Driving Audio" in v35_optional["reference_audio_1"][1]["tooltip"]
|
||||
|
||||
|
||||
def test_v34_internal_reference_audio_parameters_are_appended_and_forwarded(
|
||||
monkeypatch,
|
||||
):
|
||||
parameters = list(inspect.signature(H3ContinuumSamplerV34.run).parameters)
|
||||
assert parameters[-4:] == [
|
||||
"capture_refine_context",
|
||||
"reference_audio_1",
|
||||
"reference_audio_vae",
|
||||
"kwargs",
|
||||
]
|
||||
|
||||
captured = {}
|
||||
reference_audio = object()
|
||||
reference_audio_vae = object()
|
||||
|
||||
monkeypatch.setattr(
|
||||
driving_nodes,
|
||||
"prepare_driving_audio_source",
|
||||
lambda *_args, **_kwargs: None,
|
||||
)
|
||||
monkeypatch.setattr(
|
||||
"ComfyUI_H3_Continuum_Join.reference_video.prepare_reference_video_source",
|
||||
lambda *_args, **_kwargs: None,
|
||||
)
|
||||
|
||||
def production_run(_self, **kwargs):
|
||||
captured.update(kwargs)
|
||||
return [], [], {}, "status"
|
||||
|
||||
monkeypatch.setattr(H3ContinuumSamplerProduction, "run", production_run)
|
||||
outputs = H3ContinuumSamplerV34().run(
|
||||
reference_audio_1=reference_audio,
|
||||
reference_audio_vae=reference_audio_vae,
|
||||
chunks=1,
|
||||
chunk_seconds=5.0,
|
||||
width=640,
|
||||
height=640,
|
||||
)
|
||||
|
||||
assert captured["reference_audio_1"] is reference_audio
|
||||
assert captured["reference_audio_vae"] is reference_audio_vae
|
||||
assert outputs[-1] is None
|
||||
|
||||
|
||||
def test_v35_run_forwards_reference_audio_without_duplicate_preparation(monkeypatch):
|
||||
captured = {}
|
||||
reference_audio = object()
|
||||
reference_audio_vae = object()
|
||||
|
||||
def v34_run(_self, *args, **kwargs):
|
||||
captured.update(kwargs)
|
||||
return [], [], {}, "status", None, {"groups": ()}
|
||||
|
||||
monkeypatch.setattr(H3ContinuumSamplerV34, "run", v34_run)
|
||||
H3ContinuumSamplerV35().run(
|
||||
reference_audio_1=reference_audio,
|
||||
reference_audio_vae=reference_audio_vae,
|
||||
)
|
||||
|
||||
assert captured["reference_audio_1"] is reference_audio
|
||||
assert captured["reference_audio_vae"] is reference_audio_vae
|
||||
assert captured["capture_refine_context"] is True
|
||||
assert captured["memory_attribution"] is True
|
||||
|
||||
|
||||
def test_reference_audio_vae_is_ignored_without_audio_and_required_with_audio():
|
||||
vae = object()
|
||||
assert prepare_reference_audio_source(None, vae) is None
|
||||
audio = {
|
||||
"waveform": torch.zeros((1, 2, 32000), dtype=torch.float32),
|
||||
"sample_rate": 32000,
|
||||
}
|
||||
with pytest.raises(ReferenceAudioError, match="reference_audio_vae is required"):
|
||||
prepare_reference_audio_source(audio, None)
|
||||
|
||||
|
||||
def test_unused_reference_audio_vae_does_not_change_automatic_project_key():
|
||||
base = {
|
||||
"1": {"class_type": "H3ContinuumSamplerV35", "inputs": {}},
|
||||
"2": {"class_type": "VAELoader", "inputs": {}},
|
||||
}
|
||||
vae_only = {
|
||||
**base,
|
||||
"1": {
|
||||
"class_type": "H3ContinuumSamplerV35",
|
||||
"inputs": {"reference_audio_vae": ["2", 0]},
|
||||
},
|
||||
}
|
||||
assert automatic_project_key(base, "1") == automatic_project_key(vae_only, "1")
|
||||
|
||||
|
||||
def test_published_v35_template_keeps_existing_sampler_socket_routes():
|
||||
template = ROOT / "examples/workflows/MiniMax_H3_Continuum_V35.json"
|
||||
if not template.exists():
|
||||
pytest.skip("published workflow template is not installed in this runtime copy")
|
||||
workflow = json.loads(
|
||||
template.read_text(encoding="utf-8")
|
||||
)
|
||||
sampler = next(
|
||||
node for node in workflow["nodes"] if node["type"] == "H3ContinuumSamplerV35"
|
||||
)
|
||||
routes = {item["name"]: item.get("link") for item in sampler["inputs"]}
|
||||
assert routes["reference_image_1"] == 321
|
||||
assert routes["reference_image_2"] == 320
|
||||
assert routes["reference_image_3"] == 318
|
||||
assert routes["reference_video_1"] == 322
|
||||
assert routes["driving_audio"] == 294
|
||||
assert routes["audio_vae"] == 295
|
||||
assert "reference_audio_1" not in routes
|
||||
assert "reference_audio_vae" not in routes
|
||||
@@ -0,0 +1,165 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import shutil
|
||||
import subprocess
|
||||
from pathlib import Path
|
||||
|
||||
|
||||
ROOT = Path(__file__).resolve().parents[1]
|
||||
PROJECT_ID_JS = ROOT / "web" / "project_id.js"
|
||||
REFERENCE_AUDIO_UI_JS = ROOT / "web" / "reference_audio_ui.js"
|
||||
|
||||
|
||||
def test_v35_wires_reference_audio_visibility_after_node_setup():
|
||||
source = PROJECT_ID_JS.read_text(encoding="utf-8")
|
||||
|
||||
assert 'from "./reference_audio_ui.js";' in source
|
||||
assert "if (node.comfyClass === V35_NODE_CLASS)" in source
|
||||
assert "configureReferenceAudioInputs(node);" in source
|
||||
assert "setTimeout(configureDeferred, 0);" in source
|
||||
assert "node.__h3ContinuumLoadedGraphNode = true;" in source
|
||||
assert "node.__h3ContinuumAfterConfigureGraph = true;" in source
|
||||
|
||||
|
||||
def test_reference_audio_visibility_with_real_javascript_module(tmp_path):
|
||||
node = shutil.which("node")
|
||||
assert node is not None, "Node.js is required for frontend behavior validation"
|
||||
|
||||
module_path = tmp_path / "reference_audio_ui.mjs"
|
||||
module_path.write_text(REFERENCE_AUDIO_UI_JS.read_text(encoding="utf-8"), encoding="utf-8")
|
||||
harness_path = tmp_path / "reference_audio_ui_harness.mjs"
|
||||
harness_path.write_text(
|
||||
r'''
|
||||
import assert from "node:assert/strict";
|
||||
import { configureReferenceAudioInputs } from "./reference_audio_ui.mjs";
|
||||
|
||||
function makeNode({ referenceLink = null, vaeLink = null, includeReferenceInputs = true } = {}) {
|
||||
const widgets = [];
|
||||
const inputs = [
|
||||
{ name: "reference_video_1", type: "IMAGE", label: "Video Reference", link: null },
|
||||
{ name: "driving_audio", type: "AUDIO", link: null },
|
||||
{ name: "audio_vae", type: "VAE", link: null },
|
||||
];
|
||||
if (includeReferenceInputs) {
|
||||
inputs.push(
|
||||
{ name: "reference_audio_1", type: "AUDIO", label: "Reference Audio", shape: 7, link: referenceLink },
|
||||
{ name: "reference_audio_vae", type: "VAE", label: "Reference Audio VAE", shape: 7, link: vaeLink },
|
||||
);
|
||||
}
|
||||
inputs.push(
|
||||
{ name: "prompt_mode", type: "COMBO", link: null },
|
||||
{ name: "chunks", type: "INT", link: null },
|
||||
);
|
||||
let previousConnectionCalls = 0;
|
||||
const node = {
|
||||
inputs,
|
||||
widgets,
|
||||
size: [320, 600],
|
||||
addWidget(type, name, value, callback, options) {
|
||||
const widget = { type, name, value, callback, options };
|
||||
this.widgets.push(widget);
|
||||
return widget;
|
||||
},
|
||||
addInput(name, type, options = {}) {
|
||||
const input = { name, type, link: null, ...options };
|
||||
this.inputs.push(input);
|
||||
return input;
|
||||
},
|
||||
removeInput(index) {
|
||||
assert.ok(this.inputs[index].link === null || this.inputs[index].link === -1);
|
||||
this.inputs.splice(index, 1);
|
||||
},
|
||||
computeSize() {
|
||||
return [320, 400 + this.inputs.length * 10];
|
||||
},
|
||||
setSize(size) {
|
||||
this.size = size;
|
||||
},
|
||||
setDirtyCanvas() {},
|
||||
onConnectionsChange() {
|
||||
previousConnectionCalls += 1;
|
||||
},
|
||||
};
|
||||
return { node, previousConnectionCalls: () => previousConnectionCalls };
|
||||
}
|
||||
|
||||
function widget(node) {
|
||||
return node.widgets.find((item) => item.name === "Reference Audio Inputs");
|
||||
}
|
||||
|
||||
function input(node, name) {
|
||||
return node.inputs.find((item) => item.name === name);
|
||||
}
|
||||
|
||||
{
|
||||
const { node } = makeNode();
|
||||
assert.equal(configureReferenceAudioInputs(node), true);
|
||||
assert.equal(widget(node).value, "Hidden");
|
||||
assert.equal(widget(node).options.serialize, false);
|
||||
assert.equal(widget(node).serializeValue(), undefined);
|
||||
assert.equal(input(node, "reference_audio_1"), undefined);
|
||||
assert.equal(input(node, "reference_audio_vae"), undefined);
|
||||
assert.equal(input(node, "reference_video_1").label, "Video Guide Frames");
|
||||
assert.equal(input(node, "audio_vae").label, "Driving Audio VAE");
|
||||
const serialized = { widgets_values: node.widgets.map((item) => item.value) };
|
||||
node.onSerialize(serialized);
|
||||
assert.deepEqual(serialized.widgets_values, []);
|
||||
|
||||
widget(node).value = "Show";
|
||||
widget(node).callback("Show");
|
||||
assert.deepEqual(
|
||||
node.inputs.slice(3, 5).map((item) => [item.name, item.label]),
|
||||
[
|
||||
["reference_audio_1", "Reference Audio (Optional)"],
|
||||
["reference_audio_vae", "Reference Audio VAE (Optional)"],
|
||||
],
|
||||
);
|
||||
|
||||
input(node, "reference_audio_1").link = 42;
|
||||
widget(node).value = "Hidden";
|
||||
widget(node).callback("Hidden");
|
||||
assert.equal(widget(node).value, "Show");
|
||||
assert.equal(input(node, "reference_audio_1").link, 42);
|
||||
}
|
||||
|
||||
{
|
||||
const { node, previousConnectionCalls } = makeNode({ referenceLink: 7, vaeLink: 8 });
|
||||
assert.equal(configureReferenceAudioInputs(node), true);
|
||||
assert.equal(widget(node).value, "Show");
|
||||
assert.equal(input(node, "reference_audio_1").link, 7);
|
||||
assert.equal(input(node, "reference_audio_vae").link, 8);
|
||||
node.onConnectionsChange();
|
||||
await new Promise((resolve) => setTimeout(resolve, 1));
|
||||
assert.equal(previousConnectionCalls(), 1);
|
||||
assert.equal(widget(node).value, "Show");
|
||||
}
|
||||
|
||||
{
|
||||
const { node } = makeNode({ referenceLink: -1, vaeLink: -1 });
|
||||
assert.equal(configureReferenceAudioInputs(node), true);
|
||||
assert.equal(widget(node).value, "Hidden");
|
||||
assert.equal(input(node, "reference_audio_1"), undefined);
|
||||
assert.equal(input(node, "reference_audio_vae"), undefined);
|
||||
}
|
||||
|
||||
{
|
||||
const { node } = makeNode({ includeReferenceInputs: false });
|
||||
assert.equal(configureReferenceAudioInputs(node), true);
|
||||
assert.equal(widget(node).value, "Hidden");
|
||||
widget(node).value = "Show";
|
||||
widget(node).callback("Show");
|
||||
assert.equal(input(node, "reference_audio_1").type, "AUDIO");
|
||||
assert.equal(input(node, "reference_audio_vae").type, "VAE");
|
||||
}
|
||||
''',
|
||||
encoding="utf-8",
|
||||
)
|
||||
|
||||
result = subprocess.run(
|
||||
[node, str(harness_path)],
|
||||
cwd=tmp_path,
|
||||
capture_output=True,
|
||||
text=True,
|
||||
check=False,
|
||||
)
|
||||
assert result.returncode == 0, result.stdout + result.stderr
|
||||
@@ -0,0 +1,249 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import torch
|
||||
|
||||
from ComfyUI_H3_Continuum_Join.nodes import (
|
||||
NODE_CLASS_MAPPINGS,
|
||||
NODE_DISPLAY_NAME_MAPPINGS,
|
||||
)
|
||||
from ComfyUI_H3_Continuum_Join.v3 import conditioning_bridge_nodes
|
||||
from ComfyUI_H3_Continuum_Join.v3.conditioning_bridge_nodes import (
|
||||
H3ContinuumConditioningBridgeV35,
|
||||
)
|
||||
from ComfyUI_H3_Continuum_Join.v3.refine_context import (
|
||||
MAGIC as REFINE_CONTEXT_MAGIC,
|
||||
)
|
||||
from ComfyUI_H3_Continuum_Join.v3.second_pass import (
|
||||
prepare_physical_refine_groups,
|
||||
)
|
||||
|
||||
|
||||
def _group(
|
||||
group_id: int,
|
||||
*,
|
||||
logical_chunks: list[int],
|
||||
temporal: int,
|
||||
terminal: bool,
|
||||
) -> dict:
|
||||
return {
|
||||
"group_id": group_id,
|
||||
"logical_chunks": logical_chunks,
|
||||
"physical_prompt": f"physical prompt {group_id}",
|
||||
"prompt_policy": "paired_timeline_v1" if terminal else "single",
|
||||
"physical_frames": 260 if terminal else 124,
|
||||
"trim_prefix_frames": 22 if terminal else 0,
|
||||
"terminal_merged": terminal,
|
||||
"source_width": 640,
|
||||
"source_height": 640,
|
||||
"source_batch": 1,
|
||||
"latent_channels": 24,
|
||||
"source_latent_t": temporal,
|
||||
"source_latent_h": 40,
|
||||
"source_latent_w": 40,
|
||||
"source_audio_shape": [1, 8, temporal * 4],
|
||||
}
|
||||
|
||||
|
||||
def _fixture():
|
||||
groups = [
|
||||
_group(0, logical_chunks=[1], temporal=37, terminal=False),
|
||||
_group(1, logical_chunks=[2, 3], temporal=77, terminal=True),
|
||||
]
|
||||
plan = {
|
||||
"width": 640,
|
||||
"height": 640,
|
||||
"second_pass_contract": {
|
||||
"version": 1,
|
||||
"physical_groups": groups,
|
||||
},
|
||||
}
|
||||
videos = [
|
||||
{"samples": torch.zeros((1, 24, group["source_latent_t"], 48, 48))}
|
||||
for group in groups
|
||||
]
|
||||
context_groups = (
|
||||
{
|
||||
"group_id": 0,
|
||||
"logical_chunks": (1,),
|
||||
"physical_clip_index": 1,
|
||||
"context_frames": 0,
|
||||
},
|
||||
{
|
||||
"group_id": 1,
|
||||
"logical_chunks": (2, 3),
|
||||
"physical_clip_index": 2,
|
||||
"context_frames": 22,
|
||||
},
|
||||
)
|
||||
context = {
|
||||
"magic": REFINE_CONTEXT_MAGIC,
|
||||
"complete": True,
|
||||
"groups": context_groups,
|
||||
}
|
||||
return groups, plan, videos, context
|
||||
|
||||
|
||||
def test_conditioning_bridge_public_schema_and_registration():
|
||||
node_id = "H3ContinuumConditioningBridgeV35"
|
||||
node_class = NODE_CLASS_MAPPINGS[node_id]
|
||||
assert node_class is H3ContinuumConditioningBridgeV35
|
||||
assert NODE_DISPLAY_NAME_MAPPINGS[node_id] == (
|
||||
"H3 Continuum Conditioning Bridge V3.5"
|
||||
)
|
||||
assert node_class.CATEGORY == "MiniMax H3/Continuum/Advanced"
|
||||
assert node_class.DEPRECATED is False
|
||||
assert node_class.INPUT_IS_LIST is True
|
||||
assert node_class.OUTPUT_IS_LIST == (True, True, False, False)
|
||||
assert node_class.RETURN_TYPES == (
|
||||
"MODEL",
|
||||
"CONDITIONING",
|
||||
"H3_CONTINUUM_ASSEMBLY_PLAN",
|
||||
"STRING",
|
||||
)
|
||||
assert node_class.RETURN_NAMES == (
|
||||
"group_models",
|
||||
"conditioning",
|
||||
"updated_assembly_plan",
|
||||
"status",
|
||||
)
|
||||
schema = node_class.INPUT_TYPES()
|
||||
assert list(schema["required"]) == [
|
||||
"model",
|
||||
"clip",
|
||||
"video_latents",
|
||||
"assembly_plan",
|
||||
"refine_context",
|
||||
]
|
||||
assert list(schema["optional"]) == ["video_vae"]
|
||||
|
||||
|
||||
def test_prepare_keeps_one_complete_conditioning_per_physical_group():
|
||||
groups, plan, videos, context = _fixture()
|
||||
conditioning_objects = [
|
||||
[["group-0-entry-a", {"slot": 0}], ["group-0-entry-b", {"slot": 1}]],
|
||||
[["group-1-entry-a", {"slot": 0}], ["group-1-entry-b", {"slot": 1}]],
|
||||
]
|
||||
clone_calls = []
|
||||
|
||||
def validate_context(value, *, assembly_plan):
|
||||
assert value is context
|
||||
assert assembly_plan is plan
|
||||
return context
|
||||
|
||||
def adapt(group, **kwargs):
|
||||
assert kwargs["target_latent_h"] == 48
|
||||
assert kwargs["target_latent_w"] == 48
|
||||
return conditioning_objects[group["group_id"]], {"adapted": True}
|
||||
|
||||
def clone(model, **kwargs):
|
||||
clone_calls.append(kwargs)
|
||||
return f"model-{kwargs['chunk_index']}"
|
||||
|
||||
prepared = prepare_physical_refine_groups(
|
||||
model="base-model",
|
||||
clip="clip",
|
||||
video_latents=videos,
|
||||
assembly_plan=plan,
|
||||
refine_context=context,
|
||||
validate_refine_context_fn=validate_context,
|
||||
adapt_group_conditioning_fn=adapt,
|
||||
clone_model_fn=clone,
|
||||
)
|
||||
|
||||
assert prepared["physical_group_count"] == 2
|
||||
assert len(prepared["group_models"]) == len(prepared["conditioning"]) == 2
|
||||
assert prepared["group_models"] == ["model-1", "model-2"]
|
||||
assert prepared["conditioning"] == conditioning_objects
|
||||
assert prepared["conditioning"][0] is conditioning_objects[0]
|
||||
assert prepared["conditioning"][1] is conditioning_objects[1]
|
||||
assert [len(item) for item in prepared["conditioning"]] == [2, 2]
|
||||
assert [detail["group"]["logical_chunks"] for detail in prepared["details"]] == [
|
||||
[1],
|
||||
[2, 3],
|
||||
]
|
||||
assert [detail["context_frames"] for detail in prepared["details"]] == [0, 22]
|
||||
assert clone_calls == [
|
||||
{
|
||||
"strict": False,
|
||||
"debug": False,
|
||||
"chunk_index": 1,
|
||||
"context_frames": None,
|
||||
},
|
||||
{
|
||||
"strict": False,
|
||||
"debug": False,
|
||||
"chunk_index": 2,
|
||||
"context_frames": 22,
|
||||
},
|
||||
]
|
||||
assert prepared["updated_assembly_plan"]["width"] == 768
|
||||
assert prepared["updated_assembly_plan"]["height"] == 768
|
||||
assert plan["width"] == 640
|
||||
assert groups[1]["logical_chunks"] == [2, 3]
|
||||
|
||||
|
||||
def test_node_preserves_outer_physical_group_list_without_flattening(monkeypatch):
|
||||
_groups, plan, videos, context = _fixture()
|
||||
complete_conditioning = [
|
||||
[["first-entry", {"group": 0}], ["second-entry", {"group": 0}]],
|
||||
[["terminal-entry-a", {"group": 1}], ["terminal-entry-b", {"group": 1}]],
|
||||
]
|
||||
prepared = {
|
||||
"group_models": ["model-0", "model-1"],
|
||||
"conditioning": complete_conditioning,
|
||||
"updated_assembly_plan": {"width": 768, "height": 768},
|
||||
"physical_group_count": 2,
|
||||
"warnings": [],
|
||||
"details": [
|
||||
{
|
||||
"group_index": 0,
|
||||
"group": {"logical_chunks": [1], "prompt_policy": "single"},
|
||||
"conditioning_source": "refine_context",
|
||||
"physical_clip_index": 1,
|
||||
"context_frames": 0,
|
||||
},
|
||||
{
|
||||
"group_index": 1,
|
||||
"group": {
|
||||
"logical_chunks": [2, 3],
|
||||
"prompt_policy": "paired_timeline_v1",
|
||||
},
|
||||
"conditioning_source": "refine_context",
|
||||
"physical_clip_index": 2,
|
||||
"context_frames": 22,
|
||||
},
|
||||
],
|
||||
}
|
||||
captured = {}
|
||||
|
||||
def fake_prepare(**kwargs):
|
||||
captured.update(kwargs)
|
||||
return prepared
|
||||
|
||||
monkeypatch.setattr(
|
||||
conditioning_bridge_nodes,
|
||||
"prepare_physical_refine_groups",
|
||||
fake_prepare,
|
||||
)
|
||||
result = H3ContinuumConditioningBridgeV35().prepare(
|
||||
model=["base-model"],
|
||||
clip=["clip"],
|
||||
video_latents=videos,
|
||||
assembly_plan=[plan],
|
||||
refine_context=[context],
|
||||
video_vae=["vae"],
|
||||
)
|
||||
|
||||
assert captured["model"] == "base-model"
|
||||
assert captured["clip"] == "clip"
|
||||
assert captured["video_latents"] is videos
|
||||
assert captured["assembly_plan"] is plan
|
||||
assert captured["refine_context"] is context
|
||||
assert captured["video_vae"] == "vae"
|
||||
assert result[0] == ["model-0", "model-1"]
|
||||
assert result[1] is complete_conditioning
|
||||
assert len(result[1]) == 2
|
||||
assert [len(item) for item in result[1]] == [2, 2]
|
||||
assert result[2] is prepared["updated_assembly_plan"]
|
||||
assert "logical_chunks=[2, 3]" in result[3]
|
||||
assert "AV LATENT, Noise, and Audio Lock" in result[3]
|
||||
@@ -69,6 +69,7 @@ def _capture_sequence(
|
||||
monkeypatch,
|
||||
*,
|
||||
terminal: bool,
|
||||
reference_audio: bool = False,
|
||||
session=None,
|
||||
diagnostics=DIAGNOSTICS_BASIC,
|
||||
memory_attribution=False,
|
||||
@@ -101,6 +102,27 @@ def _capture_sequence(
|
||||
"clone_model_for_chunk",
|
||||
lambda model, **_kwargs: model,
|
||||
)
|
||||
reference_audio_source = None
|
||||
reference_audio_vae = None
|
||||
if reference_audio:
|
||||
from ComfyUI_H3_Continuum_Join import reference_audio as reference_audio_module
|
||||
|
||||
reference_audio_source = SimpleNamespace(
|
||||
combined_hash="reference-audio-hash",
|
||||
contract={
|
||||
"reference_audio_contract_version": 1,
|
||||
"source_sha256": "a" * 64,
|
||||
},
|
||||
)
|
||||
reference_audio_vae = object()
|
||||
reference_audio_assets = SimpleNamespace(
|
||||
audio_latent=torch.arange(64, dtype=torch.float32).reshape(1, 32, 2, 1)
|
||||
)
|
||||
monkeypatch.setattr(
|
||||
reference_audio_module,
|
||||
"encode_reference_audio",
|
||||
lambda _vae, _source: reference_audio_assets,
|
||||
)
|
||||
chunks = 3 if terminal else 2
|
||||
mode = PROMPT_MODE_LIST if terminal else PROMPT_MODE_FIXED
|
||||
script = "first\n---\nmiddle\n---\nlast" if terminal else "same prompt"
|
||||
@@ -133,6 +155,8 @@ def _capture_sequence(
|
||||
debug=False,
|
||||
session=session,
|
||||
latent_only=True,
|
||||
reference_audio_source=reference_audio_source,
|
||||
reference_audio_vae=reference_audio_vae,
|
||||
capture_refine_context=True,
|
||||
memory_attribution=memory_attribution,
|
||||
)
|
||||
@@ -275,6 +299,33 @@ def test_capture_records_terminal_pair_as_one_physical_group(monkeypatch):
|
||||
assert validate_refine_context(context, assembly_plan) is context
|
||||
|
||||
|
||||
def test_reference_audio_is_captured_in_every_normal_physical_group(monkeypatch):
|
||||
outputs = _capture_sequence(
|
||||
monkeypatch,
|
||||
terminal=False,
|
||||
reference_audio=True,
|
||||
)
|
||||
groups = outputs[4]["groups"]
|
||||
assert [group["logical_chunks"] for group in groups] == [(1,), (2,)]
|
||||
for group in groups:
|
||||
refs = group["conditioning"][0][1]["minimax_refs"]
|
||||
assert [ref["kind"] for ref in refs].count("audio") == 1
|
||||
|
||||
|
||||
def test_reference_audio_is_captured_in_terminal_physical_group(monkeypatch):
|
||||
outputs = _capture_sequence(
|
||||
monkeypatch,
|
||||
terminal=True,
|
||||
reference_audio=True,
|
||||
)
|
||||
groups = outputs[4]["groups"]
|
||||
assert [group["logical_chunks"] for group in groups] == [(1,), (2, 3)]
|
||||
assert groups[1]["prompt_policy"] == "paired_timeline_v1"
|
||||
for group in groups:
|
||||
refs = group["conditioning"][0][1]["minimax_refs"]
|
||||
assert [ref["kind"] for ref in refs].count("audio") == 1
|
||||
|
||||
|
||||
def test_reused_session_returns_incomplete_context_without_stopping(monkeypatch):
|
||||
first_outputs = _capture_sequence(monkeypatch, terminal=False)
|
||||
reused_outputs = _capture_sequence(
|
||||
|
||||
@@ -9,6 +9,7 @@ from ComfyUI_H3_Continuum_Join.nodes import (
|
||||
)
|
||||
from ComfyUI_H3_Continuum_Join.v3.hires_fix_nodes import (
|
||||
H3ContinuumHiResFixV35,
|
||||
align_h3_manual_canvas,
|
||||
resolve_h3_native_latent_target,
|
||||
)
|
||||
from ComfyUI_H3_Continuum_Join.v3.second_pass import SecondPassContractError
|
||||
@@ -173,6 +174,102 @@ def test_enabled_pixel_vae_roundtrip_then_reuses_second_pass_contract(monkeypatc
|
||||
assert second_pass["conditioning_upscale_method"] == "bilinear"
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
("latent_width", "latent_height", "expected_width", "expected_height"),
|
||||
(
|
||||
(36, 36, 704, 704),
|
||||
(64, 36, 1216, 704),
|
||||
),
|
||||
)
|
||||
def test_manual_scale_1_2_aligns_to_core_h3_canvas(
|
||||
latent_width,
|
||||
latent_height,
|
||||
expected_width,
|
||||
expected_height,
|
||||
):
|
||||
target = align_h3_manual_canvas(
|
||||
latent_width,
|
||||
latent_height,
|
||||
1.2,
|
||||
pixel_scale_width=16,
|
||||
pixel_scale_height=16,
|
||||
canvas_multiple=32,
|
||||
)
|
||||
|
||||
assert target == {
|
||||
"target_width": expected_width,
|
||||
"target_height": expected_height,
|
||||
"target_latent_width": expected_width // 16,
|
||||
"target_latent_height": expected_height // 16,
|
||||
}
|
||||
assert target["target_latent_width"] % 2 == 0
|
||||
assert target["target_latent_height"] % 2 == 0
|
||||
|
||||
|
||||
def test_manual_scale_1_2_passes_core_aligned_target_to_pixel_vae(monkeypatch):
|
||||
videos = [_video("first-pass", height=36, width=36)]
|
||||
resized = [_video("reencoded", height=44, width=44)]
|
||||
audios = [_audio("first-pass")]
|
||||
plan = _plan(width=576, height=576, latent_width=36, latent_height=36)
|
||||
calls = []
|
||||
|
||||
def fake_roundtrip(video_latents, assembly_plan, **kwargs):
|
||||
calls.append(("roundtrip", video_latents, assembly_plan, kwargs))
|
||||
return resized
|
||||
|
||||
def fake_second_pass(**kwargs):
|
||||
calls.append(("second_pass", kwargs))
|
||||
return (
|
||||
[_video("refined", height=44, width=44)],
|
||||
audios,
|
||||
{"width": 704, "height": 704},
|
||||
"sampled",
|
||||
)
|
||||
|
||||
monkeypatch.setattr(
|
||||
"ComfyUI_H3_Continuum_Join.v3.hires_fix_nodes.h3_core_native_canvas",
|
||||
lambda *_args, **_kwargs: (768, 768),
|
||||
)
|
||||
monkeypatch.setattr(
|
||||
"ComfyUI_H3_Continuum_Join.v3.hires_fix_nodes.resize_video_latents_via_vae",
|
||||
fake_roundtrip,
|
||||
)
|
||||
monkeypatch.setattr(
|
||||
"ComfyUI_H3_Continuum_Join.v3.hires_fix_nodes.run_second_pass_groups",
|
||||
fake_second_pass,
|
||||
)
|
||||
|
||||
result = H3ContinuumHiResFixV35().apply(
|
||||
["model"],
|
||||
["clip"],
|
||||
["sampler"],
|
||||
[torch.tensor([0.3, 0.0])],
|
||||
videos,
|
||||
audios,
|
||||
[plan],
|
||||
[True],
|
||||
["lanczos"],
|
||||
[1.2],
|
||||
[17],
|
||||
[{"context": True}],
|
||||
["video-vae"],
|
||||
)
|
||||
|
||||
assert calls[0] == (
|
||||
"roundtrip",
|
||||
videos,
|
||||
plan,
|
||||
{
|
||||
"video_vae": "video-vae",
|
||||
"target_width": 704,
|
||||
"target_height": 704,
|
||||
"upscale_method": "lanczos",
|
||||
},
|
||||
)
|
||||
assert calls[1][1]["video_latents"] is resized
|
||||
assert "target=704x704" in result[3]
|
||||
|
||||
|
||||
def test_native_auto_resizes_to_exact_core_target_then_samples(monkeypatch):
|
||||
videos = [_video("first-pass")]
|
||||
resized = [_video("native", height=6, width=6)]
|
||||
|
||||
@@ -73,6 +73,7 @@ def main() -> int:
|
||||
"H3ContinuumHiResFixV35",
|
||||
"H3ContinuumLatentResizeV35",
|
||||
"H3ContinuumSecondPassV35",
|
||||
"H3ContinuumConditioningBridgeV35",
|
||||
"H3ContinuumClipOverrides",
|
||||
"H3ContinuumResult",
|
||||
}
|
||||
|
||||
@@ -0,0 +1,135 @@
|
||||
"""V3.5 Advanced bridge from Continuum refine context to Core conditioning."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Any
|
||||
|
||||
from .second_pass import prepare_physical_refine_groups
|
||||
from .second_pass_nodes import _single_list_input
|
||||
|
||||
|
||||
class H3ContinuumConditioningBridgeV35:
|
||||
"""Publish paired physical-group MODEL and CONDITIONING values."""
|
||||
|
||||
DEPRECATED = False
|
||||
DESCRIPTION = (
|
||||
"Advanced interoperability bridge for Basic Guider and external samplers. "
|
||||
"It adapts the captured Continuum refine context to externally processed "
|
||||
"physical-group video latents, then returns one paired MODEL and complete "
|
||||
"CONDITIONING per physical group plus the target-geometry Assembly Plan. "
|
||||
"Nested AV LATENT construction, Audio LATENT, Noise, Audio Lock, and external "
|
||||
"sampling behavior remain the workflow's responsibility."
|
||||
)
|
||||
|
||||
@classmethod
|
||||
def INPUT_TYPES(cls):
|
||||
return {
|
||||
"required": {
|
||||
"model": ("MODEL",),
|
||||
"clip": ("CLIP",),
|
||||
"video_latents": ("LATENT",),
|
||||
"assembly_plan": ("H3_CONTINUUM_ASSEMBLY_PLAN",),
|
||||
"refine_context": ("H3_CONTINUUM_REFINE_CONTEXT",),
|
||||
},
|
||||
"optional": {
|
||||
"video_vae": (
|
||||
"VAE",
|
||||
{
|
||||
"tooltip": (
|
||||
"When available, First/Last keyframes are re-encoded at "
|
||||
"the target geometry. Otherwise the existing conditioning "
|
||||
"adapter uses its documented latent-resize fallback."
|
||||
)
|
||||
},
|
||||
),
|
||||
},
|
||||
}
|
||||
|
||||
INPUT_IS_LIST = True
|
||||
RETURN_TYPES = (
|
||||
"MODEL",
|
||||
"CONDITIONING",
|
||||
"H3_CONTINUUM_ASSEMBLY_PLAN",
|
||||
"STRING",
|
||||
)
|
||||
RETURN_NAMES = (
|
||||
"group_models",
|
||||
"conditioning",
|
||||
"updated_assembly_plan",
|
||||
"status",
|
||||
)
|
||||
OUTPUT_IS_LIST = (True, True, False, False)
|
||||
FUNCTION = "prepare"
|
||||
CATEGORY = "MiniMax H3/Continuum/Advanced"
|
||||
|
||||
def prepare(
|
||||
self,
|
||||
model,
|
||||
clip,
|
||||
video_latents,
|
||||
assembly_plan,
|
||||
refine_context,
|
||||
video_vae=None,
|
||||
):
|
||||
prepared = prepare_physical_refine_groups(
|
||||
model=_single_list_input("model", model),
|
||||
clip=_single_list_input("clip", clip),
|
||||
video_latents=video_latents,
|
||||
assembly_plan=_single_list_input("assembly_plan", assembly_plan),
|
||||
refine_context=_single_list_input("refine_context", refine_context),
|
||||
video_vae=(
|
||||
None
|
||||
if video_vae is None
|
||||
else _single_list_input("video_vae", video_vae)
|
||||
),
|
||||
)
|
||||
group_models = prepared["group_models"]
|
||||
conditioning = prepared["conditioning"]
|
||||
physical_group_count = int(prepared["physical_group_count"])
|
||||
if not len(group_models) == len(conditioning) == physical_group_count:
|
||||
raise ValueError(
|
||||
"Conditioning Bridge MODEL/CONDITIONING physical group counts differ"
|
||||
)
|
||||
|
||||
status_lines = [
|
||||
"H3 Continuum Conditioning Bridge V3.5",
|
||||
f"Physical groups: {physical_group_count}.",
|
||||
"Output contract: one paired MODEL and one complete CONDITIONING per "
|
||||
"physical group; CONDITIONING entries remain grouped.",
|
||||
"Scope: Advanced MODEL + CONDITIONING interoperability only; AV LATENT, "
|
||||
"Noise, and Audio Lock are controlled by the external workflow.",
|
||||
*prepared["warnings"],
|
||||
]
|
||||
for detail in prepared["details"]:
|
||||
group = detail["group"]
|
||||
status_lines.append(
|
||||
"group "
|
||||
f"{int(detail['group_index']) + 1}: "
|
||||
f"logical_chunks={group.get('logical_chunks')}, "
|
||||
f"prompt_policy={group.get('prompt_policy', 'unknown')}, "
|
||||
f"conditioning_source={detail['conditioning_source']}, "
|
||||
f"physical_clip_index={detail['physical_clip_index']}, "
|
||||
f"context_frames={detail['context_frames']}"
|
||||
)
|
||||
status_lines.append(
|
||||
"Target geometry: "
|
||||
f"{prepared['updated_assembly_plan']['width']}x"
|
||||
f"{prepared['updated_assembly_plan']['height']}."
|
||||
)
|
||||
return (
|
||||
group_models,
|
||||
conditioning,
|
||||
prepared["updated_assembly_plan"],
|
||||
"\n".join(status_lines),
|
||||
)
|
||||
|
||||
|
||||
NODE_CLASS_MAPPINGS = {
|
||||
"H3ContinuumConditioningBridgeV35": H3ContinuumConditioningBridgeV35,
|
||||
}
|
||||
|
||||
NODE_DISPLAY_NAME_MAPPINGS = {
|
||||
"H3ContinuumConditioningBridgeV35": (
|
||||
"H3 Continuum Conditioning Bridge V3.5"
|
||||
),
|
||||
}
|
||||
+42
-7
@@ -101,9 +101,9 @@ class H3ContinuumSamplerV34(H3ContinuumSamplerProduction):
|
||||
REFERENCE_VIDEO_SIZE_OPTIONS,
|
||||
{
|
||||
"default": REFERENCE_VIDEO_SIZE_EFFICIENT,
|
||||
"display_name": "Video Reference Size",
|
||||
"display_name": "Video Guide Size",
|
||||
"tooltip": (
|
||||
"Efficient limits Video Reference to about 0.4 MP; Balanced uses "
|
||||
"Efficient limits Video Guide Frames to about 0.4 MP; Balanced uses "
|
||||
"about 0.6 MP; Match Output uses the output pixel area. Source "
|
||||
"aspect ratio is preserved and smaller sources are not enlarged."
|
||||
),
|
||||
@@ -115,16 +115,20 @@ class H3ContinuumSamplerV34(H3ContinuumSamplerProduction):
|
||||
optional["reference_video_1"] = (
|
||||
"IMAGE",
|
||||
{
|
||||
"display_name": "Video Reference",
|
||||
"display_name": "Video Guide Frames",
|
||||
"tooltip": (
|
||||
"Optional persistent video reference. Connect an IMAGE frame batch; "
|
||||
"frames are interpreted at 24 fps and applied to every chunk."
|
||||
"Optional video guide. Connect the IMAGE frame batch from a video loader; "
|
||||
"source-video audio is not included. Frames are interpreted at 24 fps "
|
||||
"and applied to every chunk. Non-native frame counts are padded by "
|
||||
"repeating the final frame to the next H3 17k+5 count, up to the "
|
||||
"one-chunk limit."
|
||||
),
|
||||
},
|
||||
)
|
||||
optional["driving_audio"] = (
|
||||
"AUDIO",
|
||||
{
|
||||
"display_name": "Driving Audio",
|
||||
"tooltip": (
|
||||
"Optional original audio timeline. It is used as native H3 guide "
|
||||
"conditioning and selected unchanged for final output."
|
||||
@@ -134,6 +138,7 @@ class H3ContinuumSamplerV34(H3ContinuumSamplerProduction):
|
||||
optional["audio_vae"] = (
|
||||
"VAE",
|
||||
{
|
||||
"display_name": "Driving Audio VAE",
|
||||
"tooltip": (
|
||||
"Required only when Driving Audio is connected. Uses the same "
|
||||
"Audio VAE encode path as ComfyUI Core MiniMax H3 Add Guide."
|
||||
@@ -151,6 +156,8 @@ class H3ContinuumSamplerV34(H3ContinuumSamplerProduction):
|
||||
reference_video_1=None,
|
||||
video_reference_size=REFERENCE_VIDEO_SIZE_EFFICIENT,
|
||||
capture_refine_context=False,
|
||||
reference_audio_1=None,
|
||||
reference_audio_vae=None,
|
||||
**kwargs,
|
||||
):
|
||||
from ..reference_video import prepare_reference_video_source
|
||||
@@ -175,8 +182,8 @@ class H3ContinuumSamplerV34(H3ContinuumSamplerProduction):
|
||||
size_mode=str(video_reference_size),
|
||||
)
|
||||
outputs = super().run(
|
||||
reference_audio_1=None,
|
||||
reference_audio_vae=None,
|
||||
reference_audio_1=reference_audio_1,
|
||||
reference_audio_vae=reference_audio_vae,
|
||||
driving_audio_source=source,
|
||||
driving_audio_vae=audio_vae,
|
||||
reference_video_source=reference_video_source,
|
||||
@@ -217,6 +224,34 @@ class H3ContinuumSamplerV35(H3ContinuumSamplerV34):
|
||||
)
|
||||
OUTPUT_IS_LIST = (*H3ContinuumSamplerV34.OUTPUT_IS_LIST, False)
|
||||
|
||||
@classmethod
|
||||
def INPUT_TYPES(cls):
|
||||
schema = super().INPUT_TYPES()
|
||||
optional = dict(schema.get("optional", {}))
|
||||
optional["reference_audio_1"] = (
|
||||
"AUDIO",
|
||||
{
|
||||
"display_name": "Reference Audio (Optional)",
|
||||
"tooltip": (
|
||||
"Optional standalone audio reference for H3 conditioning. "
|
||||
"It is not the audio track of Video Guide Frames. Unlike Driving "
|
||||
"Audio, it does not replace the generated final audio."
|
||||
),
|
||||
},
|
||||
)
|
||||
optional["reference_audio_vae"] = (
|
||||
"VAE",
|
||||
{
|
||||
"display_name": "Reference Audio VAE (Optional)",
|
||||
"tooltip": (
|
||||
"Required only when Reference Audio is connected. It encodes the "
|
||||
"reference for H3 conditioning; generated audio remains the output."
|
||||
),
|
||||
},
|
||||
)
|
||||
schema["optional"] = optional
|
||||
return schema
|
||||
|
||||
def run(self, *args, **kwargs):
|
||||
kwargs.pop("capture_refine_context", None)
|
||||
kwargs.pop("memory_attribution", None)
|
||||
|
||||
+70
-8
@@ -67,6 +67,65 @@ def h3_core_native_canvas(
|
||||
return target_width, target_height
|
||||
|
||||
|
||||
def align_h3_manual_canvas(
|
||||
current_latent_width: int,
|
||||
current_latent_height: int,
|
||||
scale_by: float,
|
||||
*,
|
||||
pixel_scale_width: int,
|
||||
pixel_scale_height: int,
|
||||
canvas_multiple: int | None = None,
|
||||
) -> dict[str, int]:
|
||||
"""Scale and align a manual target to ComfyUI Core's H3 canvas grid."""
|
||||
|
||||
if canvas_multiple is None:
|
||||
from comfy_extras.nodes_minimax_h3 import CANVAS_MULTIPLE
|
||||
|
||||
canvas_multiple = int(CANVAS_MULTIPLE)
|
||||
current_latent_width = int(current_latent_width)
|
||||
current_latent_height = int(current_latent_height)
|
||||
pixel_scale_width = int(pixel_scale_width)
|
||||
pixel_scale_height = int(pixel_scale_height)
|
||||
canvas_multiple = int(canvas_multiple)
|
||||
scale_by = float(scale_by)
|
||||
if min(
|
||||
current_latent_width,
|
||||
current_latent_height,
|
||||
pixel_scale_width,
|
||||
pixel_scale_height,
|
||||
canvas_multiple,
|
||||
) < 1:
|
||||
raise SecondPassContractError("manual H3 canvas geometry is invalid")
|
||||
if (
|
||||
canvas_multiple % pixel_scale_width
|
||||
or canvas_multiple % pixel_scale_height
|
||||
):
|
||||
raise SecondPassContractError(
|
||||
"ComfyUI Core H3 canvas multiple is not aligned to the latent scale"
|
||||
)
|
||||
|
||||
def aligned_target(current_latent: int, pixel_scale: int) -> int:
|
||||
current_pixels = current_latent * pixel_scale
|
||||
scaled_pixels = current_pixels * scale_by
|
||||
nearest_core_canvas = max(
|
||||
canvas_multiple,
|
||||
round(scaled_pixels / canvas_multiple) * canvas_multiple,
|
||||
)
|
||||
preserved_core_canvas = (
|
||||
(current_pixels + canvas_multiple - 1) // canvas_multiple
|
||||
) * canvas_multiple
|
||||
return max(nearest_core_canvas, preserved_core_canvas)
|
||||
|
||||
target_width = aligned_target(current_latent_width, pixel_scale_width)
|
||||
target_height = aligned_target(current_latent_height, pixel_scale_height)
|
||||
return {
|
||||
"target_width": target_width,
|
||||
"target_height": target_height,
|
||||
"target_latent_width": target_width // pixel_scale_width,
|
||||
"target_latent_height": target_height // pixel_scale_height,
|
||||
}
|
||||
|
||||
|
||||
def resolve_h3_native_latent_target(
|
||||
video_latents: Sequence[Mapping[str, Any]],
|
||||
assembly_plan: Mapping[str, Any],
|
||||
@@ -393,14 +452,17 @@ class H3ContinuumHiResFixV35:
|
||||
resize_mode = "h3_native_canvas_auto"
|
||||
else:
|
||||
pixel_scale_width, pixel_scale_height = resolve_pixel_latent_scale(plan)
|
||||
target_latent_width = round(current_geometry[1] * scale)
|
||||
target_latent_height = round(current_geometry[0] * scale)
|
||||
if target_latent_width < 1 or target_latent_height < 1:
|
||||
raise SecondPassContractError(
|
||||
"scale_by produced a non-positive target geometry"
|
||||
)
|
||||
target_width = target_latent_width * pixel_scale_width
|
||||
target_height = target_latent_height * pixel_scale_height
|
||||
manual_target = align_h3_manual_canvas(
|
||||
current_geometry[1],
|
||||
current_geometry[0],
|
||||
scale,
|
||||
pixel_scale_width=pixel_scale_width,
|
||||
pixel_scale_height=pixel_scale_height,
|
||||
)
|
||||
target_latent_width = int(manual_target["target_latent_width"])
|
||||
target_latent_height = int(manual_target["target_latent_height"])
|
||||
target_width = int(manual_target["target_width"])
|
||||
target_height = int(manual_target["target_height"])
|
||||
resize_mode = "manual_scale_by"
|
||||
|
||||
if current_geometry == (target_latent_height, target_latent_width):
|
||||
|
||||
+162
-45
@@ -168,36 +168,35 @@ def update_second_pass_geometry(
|
||||
return updated
|
||||
|
||||
|
||||
def run_second_pass_groups(
|
||||
def prepare_physical_refine_groups(
|
||||
*,
|
||||
model: Any,
|
||||
clip: Any,
|
||||
sampler: Any,
|
||||
sigmas: torch.Tensor,
|
||||
video_latents: Sequence[Any],
|
||||
audio_latents: Sequence[Any],
|
||||
assembly_plan: Mapping[str, Any],
|
||||
refine_seed: int,
|
||||
refine_context: Any = None,
|
||||
video_vae: Any = None,
|
||||
conditioning_upscale_method: str = "bilinear",
|
||||
enable_preview: bool = True,
|
||||
encode_prompt_fn=None,
|
||||
latent_builder=None,
|
||||
sample_fn=None,
|
||||
stream_extractor=None,
|
||||
clone_model_fn=None,
|
||||
validate_refine_context_fn=None,
|
||||
adapt_group_conditioning_fn=None,
|
||||
) -> tuple[list[dict[str, Any]], list[Any], dict[str, Any], str]:
|
||||
"""Refine complete physical groups while preserving first-pass audio exactly."""
|
||||
group_consumer_fn=None,
|
||||
retain_group_outputs: bool = True,
|
||||
) -> dict[str, Any]:
|
||||
"""Prepare one MODEL and one complete CONDITIONING per physical group.
|
||||
|
||||
validation = validate_second_pass_inputs(video_latents, audio_latents, assembly_plan)
|
||||
groups = _contract_groups(assembly_plan)
|
||||
This is the shared, sampling-independent contract used by the built-in
|
||||
Second Pass and the public Advanced Conditioning Bridge. The returned
|
||||
``conditioning`` value is an outer physical-group list; every item inside
|
||||
it remains one complete ComfyUI CONDITIONING object.
|
||||
"""
|
||||
|
||||
groups, (target_h, target_w) = _validate_video_groups(
|
||||
video_latents,
|
||||
assembly_plan,
|
||||
)
|
||||
encode_prompt_fn = encode_prompt_fn or encode_prompt_conditioning
|
||||
latent_builder = latent_builder or latent_from_cpu
|
||||
sample_fn = sample_fn or sample_refine_chunk
|
||||
stream_extractor = stream_extractor or extract_av_streams
|
||||
clone_model_fn = clone_model_fn or clone_model_for_chunk
|
||||
validate_refine_context_fn = validate_refine_context_fn or validate_refine_context
|
||||
adapt_group_conditioning_fn = (
|
||||
@@ -205,9 +204,9 @@ def run_second_pass_groups(
|
||||
)
|
||||
|
||||
captured_groups: Sequence[Mapping[str, Any]] | None = None
|
||||
context_warnings: list[str] = []
|
||||
warnings: list[str] = []
|
||||
if refine_context is None:
|
||||
context_warnings.append(
|
||||
warnings.append(
|
||||
"WARNING: refine_context is not connected; using legacy prompt-only "
|
||||
"conditioning."
|
||||
)
|
||||
@@ -226,7 +225,7 @@ def run_second_pass_groups(
|
||||
raise SecondPassContractError(
|
||||
f"refine_context contract is invalid: {exc}"
|
||||
) from exc
|
||||
context_warnings.append(
|
||||
warnings.append(
|
||||
"WARNING: optional refine_context was not a typed Continuum context; "
|
||||
f"using legacy prompt-only conditioning ({exc})."
|
||||
)
|
||||
@@ -234,29 +233,15 @@ def run_second_pass_groups(
|
||||
if bool(validated_context.get("complete")):
|
||||
captured_groups = validated_context["groups"]
|
||||
else:
|
||||
context_warnings.append(
|
||||
warnings.append(
|
||||
"WARNING: refine_context capture is incomplete; using legacy "
|
||||
"prompt-only conditioning."
|
||||
)
|
||||
|
||||
refined_videos: list[dict[str, Any]] = []
|
||||
group_seeds: list[int] = []
|
||||
conditioning_sources: list[str] = []
|
||||
report_lines = [
|
||||
"H3 Continuum Second Pass V3.5",
|
||||
"Mode: context-aware physical-group refine when a complete First Pass "
|
||||
"refine_context is available.",
|
||||
f"Physical groups: {validation['physical_group_count']}.",
|
||||
"Sampling contract: video random noise/mask=1; audio zero noise/mask=0; "
|
||||
"workflow SIGMAS are applied directly by Core.",
|
||||
*context_warnings,
|
||||
]
|
||||
|
||||
for group_index, (video_latent, audio_latent, group) in enumerate(
|
||||
zip(video_latents, audio_latents, groups, strict=True)
|
||||
):
|
||||
video_samples = _latent_samples(video_latent, name=f"video_latents[{group_index}]")
|
||||
audio_samples = _latent_samples(audio_latent, name=f"audio_latents[{group_index}]")
|
||||
group_models: list[Any] = []
|
||||
group_conditioning: list[list[Any]] = []
|
||||
details: list[dict[str, Any]] = []
|
||||
for group_index, group in enumerate(groups):
|
||||
captured_group = (
|
||||
captured_groups[group_index] if captured_groups is not None else None
|
||||
)
|
||||
@@ -267,15 +252,15 @@ def run_second_pass_groups(
|
||||
try:
|
||||
conditioning, adaptation_stats = adapt_group_conditioning_fn(
|
||||
captured_group,
|
||||
target_latent_h=validation["target_latent_h"],
|
||||
target_latent_w=validation["target_latent_w"],
|
||||
target_latent_h=target_h,
|
||||
target_latent_w=target_w,
|
||||
video_vae=video_vae,
|
||||
upscale_method=str(conditioning_upscale_method),
|
||||
)
|
||||
conditioning_source = "refine_context"
|
||||
context_conditioning_available = True
|
||||
except RefineConditioningAdaptationError as exc:
|
||||
report_lines.append(
|
||||
warnings.append(
|
||||
f"WARNING: group {group_index + 1} refine_context target "
|
||||
f"adaptation was unavailable; using legacy prompt-only "
|
||||
f"conditioning ({exc})."
|
||||
@@ -296,6 +281,11 @@ def run_second_pass_groups(
|
||||
timeline_video_assets=None,
|
||||
)
|
||||
conditioning_source = "prompt_only_fallback"
|
||||
if not isinstance(conditioning, list):
|
||||
raise SecondPassContractError(
|
||||
f"physical group {group_index} conditioning is not a complete "
|
||||
"ComfyUI CONDITIONING object"
|
||||
)
|
||||
|
||||
logical_chunks = model_group.get("logical_chunks")
|
||||
if not isinstance(logical_chunks, Sequence) or not logical_chunks:
|
||||
@@ -324,6 +314,107 @@ def run_second_pass_groups(
|
||||
chunk_index=physical_clip_index,
|
||||
context_frames=context_frames if context_frames > 0 else None,
|
||||
)
|
||||
detail = {
|
||||
"group_index": group_index,
|
||||
"group": group,
|
||||
"conditioning_source": conditioning_source,
|
||||
"adaptation_stats": adaptation_stats,
|
||||
"physical_clip_index": physical_clip_index,
|
||||
"context_frames": context_frames,
|
||||
}
|
||||
if group_consumer_fn is not None:
|
||||
group_consumer_fn(
|
||||
group_index,
|
||||
video_latents[group_index],
|
||||
group,
|
||||
chunk_model,
|
||||
conditioning,
|
||||
detail,
|
||||
)
|
||||
if retain_group_outputs:
|
||||
group_models.append(chunk_model)
|
||||
# Append, never extend: CONDITIONING's internal entries belong together.
|
||||
group_conditioning.append(conditioning)
|
||||
details.append(detail)
|
||||
|
||||
physical_group_count = len(groups)
|
||||
if retain_group_outputs and not (
|
||||
len(group_models)
|
||||
== len(group_conditioning)
|
||||
== len(details)
|
||||
== physical_group_count
|
||||
):
|
||||
raise SecondPassContractError(
|
||||
"prepared MODEL/CONDITIONING physical group counts differ"
|
||||
)
|
||||
if not retain_group_outputs and group_consumer_fn is None:
|
||||
raise SecondPassContractError(
|
||||
"non-retained physical group preparation requires a consumer"
|
||||
)
|
||||
return {
|
||||
"group_models": group_models,
|
||||
"conditioning": group_conditioning,
|
||||
"updated_assembly_plan": update_second_pass_geometry(
|
||||
assembly_plan,
|
||||
video_latents,
|
||||
),
|
||||
"details": details,
|
||||
"warnings": warnings,
|
||||
"physical_group_count": physical_group_count,
|
||||
"target_latent_h": target_h,
|
||||
"target_latent_w": target_w,
|
||||
}
|
||||
|
||||
|
||||
def run_second_pass_groups(
|
||||
*,
|
||||
model: Any,
|
||||
clip: Any,
|
||||
sampler: Any,
|
||||
sigmas: torch.Tensor,
|
||||
video_latents: Sequence[Any],
|
||||
audio_latents: Sequence[Any],
|
||||
assembly_plan: Mapping[str, Any],
|
||||
refine_seed: int,
|
||||
refine_context: Any = None,
|
||||
video_vae: Any = None,
|
||||
conditioning_upscale_method: str = "bilinear",
|
||||
enable_preview: bool = True,
|
||||
encode_prompt_fn=None,
|
||||
latent_builder=None,
|
||||
sample_fn=None,
|
||||
stream_extractor=None,
|
||||
clone_model_fn=None,
|
||||
validate_refine_context_fn=None,
|
||||
adapt_group_conditioning_fn=None,
|
||||
) -> tuple[list[dict[str, Any]], list[Any], dict[str, Any], str]:
|
||||
"""Refine complete physical groups while preserving first-pass audio exactly."""
|
||||
|
||||
validation = validate_second_pass_inputs(video_latents, audio_latents, assembly_plan)
|
||||
groups = _contract_groups(assembly_plan)
|
||||
latent_builder = latent_builder or latent_from_cpu
|
||||
sample_fn = sample_fn or sample_refine_chunk
|
||||
stream_extractor = stream_extractor or extract_av_streams
|
||||
refined_videos: list[dict[str, Any]] = []
|
||||
group_seeds: list[int] = []
|
||||
conditioning_sources: list[str] = []
|
||||
group_report_lines: list[str] = []
|
||||
|
||||
def sample_prepared_group(
|
||||
group_index,
|
||||
video_latent,
|
||||
group,
|
||||
chunk_model,
|
||||
conditioning,
|
||||
detail,
|
||||
):
|
||||
audio_latent = audio_latents[group_index]
|
||||
video_samples = _latent_samples(video_latent, name=f"video_latents[{group_index}]")
|
||||
audio_samples = _latent_samples(audio_latent, name=f"audio_latents[{group_index}]")
|
||||
conditioning_source = str(detail["conditioning_source"])
|
||||
adaptation_stats = detail["adaptation_stats"]
|
||||
physical_clip_index = int(detail["physical_clip_index"])
|
||||
context_frames = int(detail["context_frames"])
|
||||
physical_seed = derive_refine_seed(int(refine_seed), group_index)
|
||||
group_seeds.append(physical_seed)
|
||||
conditioning_sources.append(conditioning_source)
|
||||
@@ -349,7 +440,7 @@ def run_second_pass_groups(
|
||||
output_latent = dict(video_latent)
|
||||
output_latent["samples"] = refined_video
|
||||
refined_videos.append(output_latent)
|
||||
report_lines.append(
|
||||
group_report_lines.append(
|
||||
"group "
|
||||
f"{group_index + 1}: logical_chunks={group.get('logical_chunks')}, "
|
||||
f"prompt_policy={group.get('prompt_policy', 'unknown')}, "
|
||||
@@ -360,20 +451,46 @@ def run_second_pass_groups(
|
||||
"sampling_passes=1, temporary_audio_discarded=true"
|
||||
)
|
||||
if adaptation_stats is not None:
|
||||
report_lines.append(
|
||||
group_report_lines.append(
|
||||
"group "
|
||||
f"{group_index + 1} target conditioning: "
|
||||
f"keyframes_resized={int(adaptation_stats.get('keyframes_resized', 0))}, "
|
||||
f"keyframes_reencoded={int(adaptation_stats.get('keyframes_reencoded', 0))}, "
|
||||
f"context_refs_resized={int(adaptation_stats.get('context_refs_resized', 0))}"
|
||||
)
|
||||
report_lines.extend(
|
||||
group_report_lines.extend(
|
||||
f"WARNING: {warning}"
|
||||
for warning in adaptation_stats.get("warnings", ())
|
||||
)
|
||||
|
||||
prepared = prepare_physical_refine_groups(
|
||||
model=model,
|
||||
clip=clip,
|
||||
video_latents=video_latents,
|
||||
assembly_plan=assembly_plan,
|
||||
refine_context=refine_context,
|
||||
video_vae=video_vae,
|
||||
conditioning_upscale_method=conditioning_upscale_method,
|
||||
encode_prompt_fn=encode_prompt_fn,
|
||||
clone_model_fn=clone_model_fn,
|
||||
validate_refine_context_fn=validate_refine_context_fn,
|
||||
adapt_group_conditioning_fn=adapt_group_conditioning_fn,
|
||||
group_consumer_fn=sample_prepared_group,
|
||||
retain_group_outputs=False,
|
||||
)
|
||||
report_lines = [
|
||||
"H3 Continuum Second Pass V3.5",
|
||||
"Mode: context-aware physical-group refine when a complete First Pass "
|
||||
"refine_context is available.",
|
||||
f"Physical groups: {validation['physical_group_count']}.",
|
||||
"Sampling contract: video random noise/mask=1; audio zero noise/mask=0; "
|
||||
"workflow SIGMAS are applied directly by Core.",
|
||||
*prepared["warnings"],
|
||||
*group_report_lines,
|
||||
]
|
||||
|
||||
passthrough_audio = passthrough_audio_latents(audio_latents)
|
||||
updated_plan = update_second_pass_geometry(assembly_plan, refined_videos)
|
||||
updated_plan = prepared["updated_assembly_plan"]
|
||||
contract = updated_plan["second_pass_contract"]
|
||||
if conditioning_sources and all(
|
||||
source == "refine_context" for source in conditioning_sources
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
"""Package version and public schema identifiers."""
|
||||
|
||||
PACKAGE_VERSION = "3.5.0"
|
||||
PACKAGE_VERSION = "3.5.1"
|
||||
STATE_SCHEMA_VERSION = 1
|
||||
PLAN_SCHEMA_VERSION = 1
|
||||
PUBLIC_API_VERSION = 3
|
||||
|
||||
@@ -0,0 +1,137 @@
|
||||
const CONFIGURATION = Symbol("h3ContinuumLastQueuedSeedConfiguration");
|
||||
|
||||
function normalizeControlMode(value) {
|
||||
if (value === true) return "randomize";
|
||||
if (value === false) return "fixed";
|
||||
return String(value ?? "").trim().toLowerCase();
|
||||
}
|
||||
|
||||
function sameSeed(left, right) {
|
||||
if (left == null || right == null) return false;
|
||||
return String(left) === String(right);
|
||||
}
|
||||
|
||||
function clearAutomaticUpdate(state) {
|
||||
state.auto_updated_seed = undefined;
|
||||
state.auto_update_pending = false;
|
||||
}
|
||||
|
||||
function findSeedWidgets(node) {
|
||||
const seedWidget = node.widgets?.find((widget) => widget.name === "base_seed");
|
||||
const controlWidget = seedWidget?.linkedWidgets?.find(
|
||||
(widget) => widget.name === "control_after_generate",
|
||||
) ?? node.widgets?.find((widget) => widget.name === "control_after_generate");
|
||||
return { seedWidget, controlWidget };
|
||||
}
|
||||
|
||||
export function configureLastQueuedSeedReuse(node) {
|
||||
const { seedWidget, controlWidget } = findSeedWidgets(node);
|
||||
if (!seedWidget || !controlWidget) {
|
||||
return false;
|
||||
}
|
||||
|
||||
const existing = node[CONFIGURATION];
|
||||
if (existing?.seedWidget === seedWidget && existing?.controlWidget === controlWidget) {
|
||||
return true;
|
||||
}
|
||||
|
||||
const state = {
|
||||
last_queued_seed: undefined,
|
||||
auto_updated_seed: undefined,
|
||||
previous_control_mode: normalizeControlMode(controlWidget.value),
|
||||
auto_update_pending: false,
|
||||
};
|
||||
let applyingAutomaticUpdate = false;
|
||||
let restoringQueuedSeed = false;
|
||||
|
||||
const previousSeedCallback = seedWidget.callback;
|
||||
seedWidget.callback = function(value, ...args) {
|
||||
const result = previousSeedCallback?.call(this, value, ...args);
|
||||
if (
|
||||
!applyingAutomaticUpdate
|
||||
&& !restoringQueuedSeed
|
||||
&& state.auto_update_pending
|
||||
&& !sameSeed(value, state.auto_updated_seed)
|
||||
) {
|
||||
clearAutomaticUpdate(state);
|
||||
}
|
||||
return result;
|
||||
};
|
||||
|
||||
const previousControlCallback = controlWidget.callback;
|
||||
controlWidget.callback = function(value, ...args) {
|
||||
const priorMode = state.previous_control_mode;
|
||||
const result = previousControlCallback?.call(this, value, ...args);
|
||||
const nextMode = normalizeControlMode(value ?? controlWidget.value);
|
||||
|
||||
if (priorMode === "randomize" && nextMode === "fixed") {
|
||||
if (
|
||||
state.auto_update_pending
|
||||
&& sameSeed(seedWidget.value, state.auto_updated_seed)
|
||||
&& state.last_queued_seed != null
|
||||
) {
|
||||
restoringQueuedSeed = true;
|
||||
try {
|
||||
seedWidget.value = state.last_queued_seed;
|
||||
seedWidget.callback?.(state.last_queued_seed);
|
||||
} finally {
|
||||
restoringQueuedSeed = false;
|
||||
}
|
||||
}
|
||||
clearAutomaticUpdate(state);
|
||||
} else if (nextMode !== "randomize") {
|
||||
clearAutomaticUpdate(state);
|
||||
}
|
||||
|
||||
state.previous_control_mode = nextMode;
|
||||
return result;
|
||||
};
|
||||
|
||||
const previousAfterQueued = controlWidget.afterQueued;
|
||||
controlWidget.afterQueued = function(...args) {
|
||||
const before = seedWidget.value;
|
||||
applyingAutomaticUpdate = true;
|
||||
let result;
|
||||
try {
|
||||
result = previousAfterQueued?.apply(this, args);
|
||||
} finally {
|
||||
applyingAutomaticUpdate = false;
|
||||
}
|
||||
const after = seedWidget.value;
|
||||
const mode = normalizeControlMode(controlWidget.value);
|
||||
state.previous_control_mode = mode;
|
||||
|
||||
if (
|
||||
mode === "randomize"
|
||||
&& state.last_queued_seed != null
|
||||
&& sameSeed(before, state.last_queued_seed)
|
||||
&& !sameSeed(after, before)
|
||||
) {
|
||||
state.auto_updated_seed = after;
|
||||
state.auto_update_pending = true;
|
||||
}
|
||||
return result;
|
||||
};
|
||||
|
||||
node[CONFIGURATION] = { seedWidget, controlWidget, state };
|
||||
return true;
|
||||
}
|
||||
|
||||
export function captureLastQueuedSeed(node, queuedSeed) {
|
||||
if (!configureLastQueuedSeedReuse(node)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
const configuration = node[CONFIGURATION];
|
||||
const { controlWidget, state } = configuration;
|
||||
if (queuedSeed == null || Array.isArray(queuedSeed)) {
|
||||
state.last_queued_seed = undefined;
|
||||
state.previous_control_mode = normalizeControlMode(controlWidget.value);
|
||||
clearAutomaticUpdate(state);
|
||||
return false;
|
||||
}
|
||||
state.last_queued_seed = queuedSeed;
|
||||
state.previous_control_mode = normalizeControlMode(controlWidget.value);
|
||||
clearAutomaticUpdate(state);
|
||||
return true;
|
||||
}
|
||||
+27
-2
@@ -1,4 +1,9 @@
|
||||
import { app } from "../../scripts/app.js";
|
||||
import {
|
||||
captureLastQueuedSeed,
|
||||
configureLastQueuedSeedReuse,
|
||||
} from "./last_queued_seed.js";
|
||||
import { configureReferenceAudioInputs } from "./reference_audio_ui.js";
|
||||
|
||||
const PRODUCTION_NODE_CLASS = "H3ContinuumSamplerProduction";
|
||||
const TIMELINE_NODE_CLASS = "H3ContinuumSamplerTimelineVideo";
|
||||
@@ -238,6 +243,9 @@ function configureNode(node) {
|
||||
removeUnusedInput(node, PROMPT_OVERRIDES_INPUT);
|
||||
}
|
||||
applyRuntimeSettings(node);
|
||||
if (isV35) {
|
||||
configureLastQueuedSeedReuse(node);
|
||||
}
|
||||
hidePersistentWidget(findWidget(node, "diagnostics"));
|
||||
hidePersistentWidget(findWidget(node, "strict_compatibility"));
|
||||
hidePersistentWidget(findWidget(node, "debug"));
|
||||
@@ -251,8 +259,20 @@ function configureNode(node) {
|
||||
|
||||
function configureNodeAfterSetup(node) {
|
||||
configureNode(node);
|
||||
setTimeout(() => configureNode(node), 0);
|
||||
setTimeout(() => configureNode(node), 100);
|
||||
const configureDeferred = () => {
|
||||
configureNode(node);
|
||||
if (
|
||||
node.comfyClass === V35_NODE_CLASS
|
||||
&& (
|
||||
!node.__h3ContinuumLoadedGraphNode
|
||||
|| node.__h3ContinuumAfterConfigureGraph
|
||||
)
|
||||
) {
|
||||
configureReferenceAudioInputs(node);
|
||||
}
|
||||
};
|
||||
setTimeout(configureDeferred, 0);
|
||||
setTimeout(configureDeferred, 100);
|
||||
}
|
||||
|
||||
app.registerExtension({
|
||||
@@ -291,11 +311,13 @@ app.registerExtension({
|
||||
},
|
||||
|
||||
loadedGraphNode(node) {
|
||||
node.__h3ContinuumLoadedGraphNode = true;
|
||||
configureNodeAfterSetup(node);
|
||||
},
|
||||
|
||||
afterConfigureGraph() {
|
||||
for (const node of app.graph?._nodes || []) {
|
||||
node.__h3ContinuumAfterConfigureGraph = true;
|
||||
configureNodeAfterSetup(node);
|
||||
}
|
||||
},
|
||||
@@ -305,6 +327,9 @@ app.registerExtension({
|
||||
for (const node of app.graph?._nodes || []) {
|
||||
const projectWidget = configureNode(node);
|
||||
const apiNode = prompt.output?.[String(node.id)];
|
||||
if (node.comfyClass === V35_NODE_CLASS) {
|
||||
captureLastQueuedSeed(node, apiNode?.inputs?.base_seed);
|
||||
}
|
||||
if (apiNode?.inputs) {
|
||||
if (
|
||||
node.comfyClass === PRODUCTION_NODE_CLASS
|
||||
|
||||
@@ -0,0 +1,232 @@
|
||||
const REFERENCE_AUDIO_WIDGET = "Reference Audio Inputs";
|
||||
const REFERENCE_AUDIO_HIDDEN = "Hidden";
|
||||
const REFERENCE_AUDIO_SHOW = "Show";
|
||||
|
||||
const INPUT_DEFINITIONS = [
|
||||
{
|
||||
name: "reference_audio_1",
|
||||
type: "AUDIO",
|
||||
label: "Reference Audio (Optional)",
|
||||
shape: 7,
|
||||
},
|
||||
{
|
||||
name: "reference_audio_vae",
|
||||
type: "VAE",
|
||||
label: "Reference Audio VAE (Optional)",
|
||||
shape: 7,
|
||||
},
|
||||
];
|
||||
|
||||
const NORMALIZED_INPUT_LABELS = {
|
||||
reference_video_1: "Video Guide Frames",
|
||||
driving_audio: "Driving Audio",
|
||||
audio_vae: "Driving Audio VAE",
|
||||
reference_audio_1: "Reference Audio (Optional)",
|
||||
reference_audio_vae: "Reference Audio VAE (Optional)",
|
||||
};
|
||||
|
||||
function findInput(node, name) {
|
||||
return node.inputs?.find((input) => input.name === name);
|
||||
}
|
||||
|
||||
function findWidget(node) {
|
||||
return node.widgets?.find((widget) => widget.name === REFERENCE_AUDIO_WIDGET);
|
||||
}
|
||||
|
||||
function normalizeInputLabels(node) {
|
||||
for (const input of node.inputs || []) {
|
||||
const label = NORMALIZED_INPUT_LABELS[input.name];
|
||||
if (label) {
|
||||
input.label = label;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function inputHasLink(input) {
|
||||
return input?.link != null && input.link !== -1;
|
||||
}
|
||||
|
||||
function hasReferenceAudioLink(node) {
|
||||
return INPUT_DEFINITIONS.some(({ name }) => inputHasLink(findInput(node, name)));
|
||||
}
|
||||
|
||||
function rememberInputDefinitions(node) {
|
||||
node.__h3ContinuumReferenceAudioDefinitions ||= {};
|
||||
for (const definition of INPUT_DEFINITIONS) {
|
||||
const input = findInput(node, definition.name);
|
||||
if (!input || node.__h3ContinuumReferenceAudioDefinitions[definition.name]) {
|
||||
continue;
|
||||
}
|
||||
node.__h3ContinuumReferenceAudioDefinitions[definition.name] = {
|
||||
name: definition.name,
|
||||
type: input.type || definition.type,
|
||||
label: definition.label,
|
||||
shape: input.shape ?? definition.shape,
|
||||
index: node.inputs.indexOf(input),
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
function inputDefinition(node, name) {
|
||||
const remembered = node.__h3ContinuumReferenceAudioDefinitions?.[name];
|
||||
return remembered || INPUT_DEFINITIONS.find((definition) => definition.name === name);
|
||||
}
|
||||
|
||||
function resizeNode(node) {
|
||||
const computed = node.computeSize?.();
|
||||
if (computed && node.setSize) {
|
||||
const width = Math.max(Number(node.size?.[0]) || 0, Number(computed[0]) || 0);
|
||||
node.setSize([width, computed[1]]);
|
||||
}
|
||||
node.setDirtyCanvas?.(true, true);
|
||||
}
|
||||
|
||||
function showReferenceAudioInputs(node) {
|
||||
for (const expected of INPUT_DEFINITIONS) {
|
||||
if (findInput(node, expected.name)) {
|
||||
continue;
|
||||
}
|
||||
const definition = inputDefinition(node, expected.name);
|
||||
const input = node.addInput?.(definition.name, definition.type, {
|
||||
label: definition.label,
|
||||
shape: definition.shape,
|
||||
});
|
||||
const addedIndex = node.inputs?.indexOf(input) ?? -1;
|
||||
const rememberedIndex = Number(definition.index);
|
||||
const firstWidgetInput = node.inputs?.findIndex(
|
||||
(candidate) => candidate.name === "prompt_mode",
|
||||
) ?? -1;
|
||||
const requestedIndex = Number.isInteger(rememberedIndex)
|
||||
? rememberedIndex
|
||||
: (firstWidgetInput >= 0 ? firstWidgetInput : node.inputs.length - 1);
|
||||
const targetIndex = Math.min(
|
||||
Math.max(0, requestedIndex),
|
||||
Math.max(0, node.inputs.length - 1),
|
||||
);
|
||||
if (addedIndex >= 0 && addedIndex !== targetIndex) {
|
||||
node.inputs.splice(addedIndex, 1);
|
||||
node.inputs.splice(targetIndex, 0, input);
|
||||
}
|
||||
}
|
||||
normalizeInputLabels(node);
|
||||
return INPUT_DEFINITIONS.every(({ name }) => Boolean(findInput(node, name)));
|
||||
}
|
||||
|
||||
function hideReferenceAudioInputs(node) {
|
||||
if (hasReferenceAudioLink(node)) {
|
||||
return false;
|
||||
}
|
||||
const indices = INPUT_DEFINITIONS.map(({ name }) =>
|
||||
node.inputs?.findIndex((input) => input.name === name) ?? -1
|
||||
);
|
||||
for (const index of indices.filter((index) => index >= 0).sort((left, right) => right - left)) {
|
||||
node.removeInput?.(index);
|
||||
}
|
||||
return INPUT_DEFINITIONS.every(({ name }) => !findInput(node, name));
|
||||
}
|
||||
|
||||
function setReferenceAudioVisibility(node, widget, show) {
|
||||
rememberInputDefinitions(node);
|
||||
const applied = show
|
||||
? showReferenceAudioInputs(node)
|
||||
: hideReferenceAudioInputs(node);
|
||||
if (!applied) {
|
||||
showReferenceAudioInputs(node);
|
||||
widget.value = REFERENCE_AUDIO_SHOW;
|
||||
}
|
||||
resizeNode(node);
|
||||
return applied;
|
||||
}
|
||||
|
||||
function ensureVisibilityWidget(node) {
|
||||
let widget = findWidget(node);
|
||||
if (widget) {
|
||||
return widget;
|
||||
}
|
||||
if (!node.addWidget) {
|
||||
return null;
|
||||
}
|
||||
const initialValue = hasReferenceAudioLink(node)
|
||||
? REFERENCE_AUDIO_SHOW
|
||||
: REFERENCE_AUDIO_HIDDEN;
|
||||
widget = node.addWidget(
|
||||
"combo",
|
||||
REFERENCE_AUDIO_WIDGET,
|
||||
initialValue,
|
||||
(value) => {
|
||||
setReferenceAudioVisibility(
|
||||
node,
|
||||
widget,
|
||||
value === REFERENCE_AUDIO_SHOW,
|
||||
);
|
||||
},
|
||||
{ values: [REFERENCE_AUDIO_HIDDEN, REFERENCE_AUDIO_SHOW] },
|
||||
);
|
||||
widget.options ||= {};
|
||||
widget.options.serialize = false;
|
||||
widget.serializeValue = () => undefined;
|
||||
return widget;
|
||||
}
|
||||
|
||||
function attachWorkflowSerializationGuard(node, widget) {
|
||||
if (node.__h3ContinuumReferenceAudioSerializationGuard) {
|
||||
return;
|
||||
}
|
||||
const previous = node.onSerialize;
|
||||
node.onSerialize = function(info, ...args) {
|
||||
const result = previous?.call(this, info, ...args);
|
||||
const widgetIndex = node.widgets?.indexOf(widget) ?? -1;
|
||||
if (
|
||||
widgetIndex >= 0
|
||||
&& Array.isArray(info?.widgets_values)
|
||||
&& widgetIndex === node.widgets.length - 1
|
||||
&& info.widgets_values.length === node.widgets.length
|
||||
) {
|
||||
info.widgets_values.pop();
|
||||
}
|
||||
return result;
|
||||
};
|
||||
node.__h3ContinuumReferenceAudioSerializationGuard = true;
|
||||
}
|
||||
|
||||
function attachConnectionRefresh(node, widget) {
|
||||
if (node.__h3ContinuumReferenceAudioConnectionCallback) {
|
||||
return;
|
||||
}
|
||||
const previous = node.onConnectionsChange;
|
||||
node.onConnectionsChange = function(...args) {
|
||||
const result = previous?.apply(this, args);
|
||||
setTimeout(() => {
|
||||
normalizeInputLabels(node);
|
||||
if (hasReferenceAudioLink(node)) {
|
||||
widget.value = REFERENCE_AUDIO_SHOW;
|
||||
setReferenceAudioVisibility(node, widget, true);
|
||||
}
|
||||
}, 0);
|
||||
return result;
|
||||
};
|
||||
node.__h3ContinuumReferenceAudioConnectionCallback = true;
|
||||
}
|
||||
|
||||
export function configureReferenceAudioInputs(node) {
|
||||
if (!node) {
|
||||
return false;
|
||||
}
|
||||
normalizeInputLabels(node);
|
||||
rememberInputDefinitions(node);
|
||||
const widget = ensureVisibilityWidget(node);
|
||||
if (!widget) {
|
||||
return false;
|
||||
}
|
||||
attachWorkflowSerializationGuard(node, widget);
|
||||
if (hasReferenceAudioLink(node)) {
|
||||
widget.value = REFERENCE_AUDIO_SHOW;
|
||||
}
|
||||
setReferenceAudioVisibility(
|
||||
node,
|
||||
widget,
|
||||
widget.value === REFERENCE_AUDIO_SHOW,
|
||||
);
|
||||
attachConnectionRefresh(node, widget);
|
||||
return true;
|
||||
}
|
||||
Reference in New Issue
Block a user