fix(ui): hotfix V3.8 stale review actions and safe chunk-one restart

This commit is contained in:
ukr8b3g-cmyk
2026-09-08 13:58:04 +09:00
parent 5c10ac36ed
commit 636f263901
9 changed files with 269 additions and 20 deletions
+7
View File
@@ -1,5 +1,12 @@
# Changelog
## 3.8.0 — Review UI hotfix on main (2026-09-08)
- Withdraw stale Continue/Retry/Finish actions after local or connected generation inputs change. A stale queued Retry falls back to normal backend compatibility/reuse checks instead of targeting an incompatible saved review.
- Add the frontend-only `Start again from Chunk 1` action: use existing non-destructive branch controls, preserve saved Takes, and consume the restart selection once after Queue.
- Preserve explicit Regenerate From boundaries instead of resetting them when a Review action is clicked. Preserve normal continuation, completed review, history and serialized widget order.
- No sampling, audio, continuation transport, workflow or public Python schema change. The separate 15-second Review static/noise report remains unresolved. This main-branch hotfix is not a new Registry publication or release asset.
## 3.8.0
### Added
+5 -5
View File
@@ -3,7 +3,7 @@ dca65fb1393e67f59c6f81f9411e3e745eb8f1097e9a2adf7ffc6f4e3901ca9f __init__.py
4f6feeb2f63a9285b0e76fb2e2618058c7d7c279af1632e1a6ccabcc9ec9a45a .github/workflows/tests.yml
0a2f69d4cec89d440f5d5aa1ec68a7c9a741382d313f80dcddf96d13f70b3e68 .gitignore
e0d0093229dd4719e97e1ee2c0cf935f6692f323f97af49a6361fd9ffac8a3d2 AGENTS.md
2a1340ac613def60f0a2c1c7e382c87486b49b14ebc3c6ef34ae14af633295d2 CHANGELOG.md
2794b4f4831e5ec9a38b6cb3049736c16d800708057349e80e1a921c90d16a2e CHANGELOG.md
c1ed3a0342730450958fb62fd21854a876991f3a4aefb24e5383b0c73cd2312d compatibility.py
4d62508f900af9f93ec320afb900c27cc9a300d1e0c0a94714258498c5ede5fc conditioning.py
64967f4987e3ad9316f3a47f0dcf582eeff39ee0c3485f4184d3532d495534ae constants.py
@@ -87,7 +87,7 @@ b470819f16fc179654dc1600721a63f0a5a14e777f4c004d574b499da6886ba5 public_api.py
96f98d727b72d6aefd431061572e187c303365a3e5b4d20cbb2bcf030aa30112 pyproject.toml
94fdc2d545b2d4077a4d70229fd22ba3ccac21d49d1097d2873f76d04e9a3c7a pytest.ini
88aa955161d04d14ebd8d90d6cb6c6206097160a671eb4d1bfe9b3e76ebc6c13 README_JA.md
3fd54e93f0344a05bca9eb746cb8649666b8c4cb539c625379af937d1f14f04f README.md
8641e14015cd4a955f4d334e45c2af1920de1985cf11a70c0cff424289be0bdf README.md
44127adcfa30ee84bff9cd4b2d0c695355209550e76982d374122008728aa5bc reference_audio.py
5cb9bfd6810d3a93a637451980a4cc5c1436e5b84cfd1c7a111cd192e876351b reference_video.py
131bdfbb7a7173c9e7826859c0e648bfb69bd18bf20fa5528c0e18a63f888b26 reference.py
@@ -173,7 +173,7 @@ ee4dd8f6eb8114706b2625b4471b041a0ea66198f9f825c63e913c896ed87530 tests/test_v38
72a0e3cb334049b66dd36f52c826931067c242fa63557933fd667138b38d6e8d tests/test_v38_review_control.py
83301839f08d275f5648d7782b6d96795e14b1ce79d722e83e57190fe52fb4aa tests/test_v38_review_execution_cap.py
836b8264065886b929b098d26c3137e8e5f6fc1dbcfb91d53d0511be584b121e tests/test_v38_review_run_storage.py
d4b06d4732920a662da722717b805868d2a737f83a111bc62086decbf7408382 tests/test_v38_review_ui.py
02cad8b184ad056c4f50fa7e651f904d72e25ae60ea8ce53038a8859d99ec373 tests/test_v38_review_ui.py
75697036f361a9b8ea74f69b15e408670f686c8c0e8a6c1d48fe059cc837d12a tests/test_v38_selective_second_pass_node.py
8026a241301dfc4de518649305458a538ef17a0b1567b113877a2af377738528 tests/test_v38_temporal_window_refine.py
0dbe8a5f71c92f3523942343b40787104c8b96781461ba3ba82934a6bdbe5834 THIRD_PARTY_NOTICES.md
@@ -241,12 +241,12 @@ c2883272b05a9a9146b5c6cf614ddae8a3e6893cd910902023aae61360195289 web/easy_bypas
9db0aa94f634578a962d5db49e5c70356040a59df968e3a2e531b327a623081f web/easy_load_image.js
873efcbd15c2d9fa10c9d5fc51a796ad3a18c0c6acceecf499c4b956aa845c6c web/easy_load_video.js
0c68d13a1f8beb7431a32b471f8b0612c42fcc4bf72dd97611a025d158008662 web/easy_v38.js
7b318be7e0a6ffa7a0b924f149ee90c10e4ebfb731da2bc40297bad0ecf63269 web/project_id.js
14fd162ba18c7302c9f2bf49b62daf324ed0e1a349d1c42d064c67a28e2e5c38 web/project_id.js
be0b8d39e5343680ebea815c3a4fb6ce7a32e065f30e43e013040a40f702cef3 .comfyignore
1d2838cc47694609289ea15132872ad48e1b6c8274da4b7bf188dd3ebf066121 docs/V38_RELEASE_AND_MIGRATION.md
7a75ba760008ab0e58b164ebc628b5f1db7a8704e0bde5406d62ea0de2244f7b tests/test_v38_public_surface_cleanup.py
0cf8d49bcb71b30437dc893f6218dc4cfb1cd244b647e4fbc2861dea2271a33a web/reference_audio_ui.js
aeb8f7f7838ecb8b794567657d5e60668f11497317369b15209c6ee81e35493d REGISTRY_MANIFEST.sha256
445c2792a1f768aead69bcac334204d588a19072162421e4831d8df1f93af912 REGISTRY_MANIFEST.sha256
717577efdec5e61600504b77bc2a099ef022c4fe2333e936c3310c7182d8f2a0 docs/V38_OPEN_INTEGRATION_CONTRACT.md
623d528a02b6712cba28c374ba3ad979bc84e2ac5318640692589a04ba6ab15f tests/test_v38_open_integration_contract.py
0bc369ee428b8a5bc8e370a81fbab427262a1fdb7805a78c442c91698d65efba tools/__init__.py
+7
View File
@@ -1,5 +1,12 @@
# Project State
## Review UI hotfix — validated for user-authorized main publication (2026-09-08)
- User explicitly authorized a hotfix commit/push to existing origin/main for the confirmed Xarfai Review restart UI mismatch. Scope is frontend only: withdraw stale review actions after settings edits, preserve manual regeneration boundaries, add a non-destructive one-shot Start again from Chunk 1 button. Saved takes, sampler/transport/Audio/schema/workflow files and installed runtime remain unchanged.
- Browser-side edit detection only withdraws stale actions; it does not approve saved-prefix reuse. Existing Run Storage compatibility checks remain authoritative. The separate 15-second Review chunk2 static/noise report is unresolved and is explicitly excluded from the hotfix claim.
- Related pre-fix diagnostic evidence: D:/Codex/_test_results/ComfyUI-H3-Continuum/v38-xarfai-review-20260908/FINDINGS.md. New validation/publication evidence: D:/Codex/_test_results/ComfyUI-H3-Continuum/v38-review-hotfix-20260908. Initial source snapshots: nine verified one-file snapshots under before-review-hotfix-*. Final checks and publication result are recorded in WORKLOG and the task response.
- Final full guarded CPU suite1155/1155 PASS (46.62s), focused61 PASS, Registry105/105 and source declaration256/256 hashes match. All guarded processes exited CUDA-uninitialized, zero blocked initialization calls. Final additions cover delayed history response and queued-baseline isolation between Run Names. User authorized waiving the external review once due delayed delivery; the fixed H3情報チェック reply subsequently arrived with PASS / PUSH TO MAIN OK. Non-blocking review note: keep revision updated_utc tied to backend writes, not ordinary history reads. No GPU or Registry/tag/release-asset publication.
## Main publication preparation (2026-09-07)
- User explicitly approved commit/push to existing origin/main, then prioritized immediate README/file upload after announcing on Civitai and requested no further workflow tests. Publish the current Spectrum graph as MiniMax_H3_Continuum_V38.json and its matching ZIP, unchanged: JSON SHA e490c87e4995930f95c8fffc4c678111d7897e74003e1962b9b4a247ba43f4ac; ZIP SHA 83d28cc0cd549066962dc21ceae05d2b189fe22391b556887eab2cc1800e1e80. README, migration, package declarations and tests now describe one graph in two formats requiring Spectrum/rgthree/KJNodes/Easy Use. No separate Turbo graph and no prompt/media/title cleanup.
+7 -2
View File
@@ -2,6 +2,8 @@
**Download workflow: [JSON](examples/workflows/MiniMax_H3_Continuum_V38.json) | [ZIP](examples/workflows/MiniMax_H3_Continuum_V38.zip)** — [Latest release](https://github.com/ukr8b3g-cmyk/ComfyUI-H3-Continuum/releases/latest)
**Review UI hotfix on `main` — September 8, 2026:** Changed settings no longer offer a stale chunk Retry. Use **Start again from Chunk 1**, then Queue, to restart with the current settings while keeping saved Takes. The restart selection is consumed once so the next Queue can continue normally. Update with the `git pull` command below, restart ComfyUI, and reload the browser page (hard-refresh if the old UI remains). The workflow files and generation engine are unchanged. **The separate report of static/noise in the second 15-second Review chunk is still under investigation; this hotfix does not claim to fix it.**
<img width="1536" height="1024" alt="exec-55ad0463-8655-409c-b9a6-49d1315cdd78" src="https://github.com/user-attachments/assets/063bb16b-5c25-44f8-9304-031995502b26" />
@@ -205,7 +207,8 @@ When `Run = Review Each Chunk`, `Progress` is On, and a review unit is ready, th
| Button | What the next top-right ComfyUI `Run` does |
|---|---|
| `Use it and continue` | Accepts the current result, reuses it, and generates one next physical group |
| `Try this chunk again` | Keeps the earlier accepted prefix and creates another Take of the current review unit |
| `Try this chunk again` | Keeps the earlier accepted prefix and creates another Take of the current review unit |
| `Start again from Chunk 1` | Selects a fresh branch from Chunk 1 with current settings and automatic variation; press Queue afterward. Saved Takes are kept. The selection resets to Auto after Queue |
| `Use it and finish the rest` | Accepts the current result and generates every remaining group without further review pauses |
| `Back to Settings` | Shows the normal settings; does not queue, reset, or discard the review |
| `Return to Review` | Returns from settings to the pending review; does not undo edited values |
@@ -380,7 +383,9 @@ Use this when the **chunk currently being reviewed** is the one you want to repl
![Try this chunk again selected; the top-right Run button executes the retry](docs/images/v38-manual/live-retry-selected.png)
To replace an earlier chunk after moving past it, use [Render History](#7-choose-an-earlier-take-or-branch-from-it) or [Regenerate From](#8-regenerate-from-a-particular-chunk), not the current-chunk retry button.
To replace an earlier chunk after moving past it, use [Render History](#7-choose-an-earlier-take-or-branch-from-it) or [Regenerate From](#8-regenerate-from-a-particular-chunk), not the current-chunk retry button.
If you change the seed, prompt, references or other generation inputs after a review, the panel shows **Settings changed** and withdraws the old Continue/Retry/Finish actions. Queue the current settings for the backend to decide compatible reuse, or select **Start again from Chunk 1** and then Queue for an explicit restart. This is non-destructive: existing Takes remain in Render History. If you manually select `Regenerate From = Chunk N`, press Queue directly; Review buttons no longer discard that boundary.
#### 5. Keep the result and finish everything remaining
+3 -3
View File
@@ -1,7 +1,7 @@
dca65fb1393e67f59c6f81f9411e3e745eb8f1097e9a2adf7ffc6f4e3901ca9f __init__.py
be0b8d39e5343680ebea815c3a4fb6ce7a32e065f30e43e013040a40f702cef3 .comfyignore
3e7a1ec3380be2a222c8a3e9b8a6bb184d3a760478957f48186438f15235bdba branch_provenance.py
2a1340ac613def60f0a2c1c7e382c87486b49b14ebc3c6ef34ae14af633295d2 CHANGELOG.md
2794b4f4831e5ec9a38b6cb3049736c16d800708057349e80e1a921c90d16a2e CHANGELOG.md
c1ed3a0342730450958fb62fd21854a876991f3a4aefb24e5383b0c73cd2312d compatibility.py
4d62508f900af9f93ec320afb900c27cc9a300d1e0c0a94714258498c5ede5fc conditioning.py
64967f4987e3ad9316f3a47f0dcf582eeff39ee0c3485f4184d3532d495534ae constants.py
@@ -28,7 +28,7 @@ a4ce23167b83e8d72b86a802dfde4f4045828433c7c13aab799bd64831dc04a4 nodes.py
b470819f16fc179654dc1600721a63f0a5a14e777f4c004d574b499da6886ba5 public_api.py
96f98d727b72d6aefd431061572e187c303365a3e5b4d20cbb2bcf030aa30112 pyproject.toml
88aa955161d04d14ebd8d90d6cb6c6206097160a671eb4d1bfe9b3e76ebc6c13 README_JA.md
3fd54e93f0344a05bca9eb746cb8649666b8c4cb539c625379af937d1f14f04f README.md
8641e14015cd4a955f4d334e45c2af1920de1985cf11a70c0cff424289be0bdf README.md
44127adcfa30ee84bff9cd4b2d0c695355209550e76982d374122008728aa5bc reference_audio.py
5cb9bfd6810d3a93a637451980a4cc5c1436e5b84cfd1c7a111cd192e876351b reference_video.py
131bdfbb7a7173c9e7826859c0e648bfb69bd18bf20fa5528c0e18a63f888b26 reference.py
@@ -100,6 +100,6 @@ c2883272b05a9a9146b5c6cf614ddae8a3e6893cd910902023aae61360195289 web/easy_bypas
9db0aa94f634578a962d5db49e5c70356040a59df968e3a2e531b327a623081f web/easy_load_image.js
873efcbd15c2d9fa10c9d5fc51a796ad3a18c0c6acceecf499c4b956aa845c6c web/easy_load_video.js
0c68d13a1f8beb7431a32b471f8b0612c42fcc4bf72dd97611a025d158008662 web/easy_v38.js
7b318be7e0a6ffa7a0b924f149ee90c10e4ebfb731da2bc40297bad0ecf63269 web/project_id.js
14fd162ba18c7302c9f2bf49b62daf324ed0e1a349d1c42d064c67a28e2e5c38 web/project_id.js
0cf8d49bcb71b30437dc893f6218dc4cfb1cd244b647e4fbc2861dea2271a33a web/reference_audio_ui.js
83d28cc0cd549066962dc21ceae05d2b189fe22391b556887eab2cc1800e1e80 examples/workflows/MiniMax_H3_Continuum_V38.zip
+7
View File
@@ -1795,3 +1795,10 @@ D:\Codex\_snapshots\ComfyUI-H3-Continuum\pre-rollback-after-00038-fail-20260821_
- User approved the supplied Spectrum graph as generic V38 JSON plus matching ZIP; updated README links, package declarations, migration and regression expectations without touching either asset. Both README openings retain git clone/pull and point to LightX2V and the workflow downloads. Existing V3.8 source and manual images are included in this publication; unrelated node.zip is excluded, while the exact historical V3.7 ZIP is required by source regression tests.
- Verified per-file source snapshots. Added exact-byte Git attributes for manifest/ZIP reproducibility, not generation changes. Initial full guarded CPU run: 1,154 passed/1 failed; failure is optional SageAttention import probing CUDA in the real-Core CPU cache harness, stopped before initialization. Isolated that optional import in the test child only and reran focused checks; evidence focused.xml alongside the preserved failing full.xml. Production, installed runtime, user backend, GPU and supplied workflow bytes unchanged.
- User requested immediate upload and no further workflow tests. Complete only publication integrity checks and the explicitly authorized main commit/push; do not claim another full-suite PASS or Registry/GPU acceptance. Remote/main was equal to local HEAD before staging. Publication hash/result are returned to the user after push.
## 2026-09-08 — Review restart UI hotfix, user-authorized main publication
- Confirmed the UI keeps an old saved review after seed/prompt/reference edits, allowing an incompatible Retry. Dedicated CPU integration had already shown ordinary Queue correctly starts from chunk1 for changed inputs; 4x15s synthetic Full/Review sampling inputs matched. The rendering-static report is not solved by this change.
- Added browser-only generation-input snapshots (including connected inputs) to withdraw stale actions without granting backend reuse. Stale queued Review intent returns to normal Continue/Next compatibility checks. Added a transient, non-destructive Start again from Chunk 1 button using existing manual boundary/automatic nonce controls, consumed once after Queue. Preserved manual boundaries, saved takes, serialized widget order and all Python runtime contracts.
- Added real-JS lifecycle assertions for edits/undo, upstream prompt/media/bypass/reconnection, edits during generation, stale queue intent, direct manual regeneration, and one-shot restart. Focused frontend suite15 PASS after adapting extraction fixtures and simulating each completion's real queued settings. No GPU/model load/backend restart/workflow mutation/runtime deployment. Snapshots9 files verified. Final CPU checks, reviewer handoff and main push recorded in the task evidence folder and response.
- Final lifecycle hardening also preserves edits during a delayed initial history fetch and prevents a queued baseline from another Run Name being used. Focused61 PASS; full1155 PASS in46.62s; Registry105/source256 declared hashes PASS; all recorded CUDA exits false/blocked0. H3情報チェック returned PASS / PUSH TO MAIN OK after delayed delivery (user also explicitly permitted review waiver for this hotfix only). Reviewer noted updated_utc must remain a write-time revision signal; current history reads do not write it. Publication scope remains main source only, no new tag/Release/Registry assets; 15-second static/noise unresolved.
+77
View File
@@ -80,6 +80,7 @@ async function load(n,p) {project=p;await loadTakeHistory(n);n.__h3ContinuumIntu
}
for(const count of [1,2,3,4,5,6]){
w(n,"chunks").value=count;
prepareReviewQueueIntent(n,{}); // This completion belongs to the current settings.
const p=state("complete",{start:count,end:count,physical_group:count},`done-${count}`);
await load(n,p);
assert(visible(n,"Try this chunk again"),`retry complete ${count}`);
@@ -131,6 +132,82 @@ async function load(n,p) {project=p;await loadTakeHistory(n);n.__h3ContinuumIntu
w(reloaded,"generation_mode").value="Review Each Chunk";
w(reloaded,"run_storage").value="Off";reloaded.__h3ContinuumProductionUxRefresh();
assert(buttons.every(name=>!visible(reloaded,name)),"storage off does not expose review actions");
// Hotfix: stale saved review cannot offer/submit Retry after settings edits.
const edited=makeNode();w(edited,"chunks").value=4;
const originalProject=state("review_ready",{start:2,end:2,physical_group:2},"edit-base");
await load(edited,originalProject);
const oldSeed=w(edited,"base_seed").value;
w(edited,"Try this chunk again").callback();
w(edited,"Back to Settings").callback();
w(edited,"base_seed").value=999;w(edited,"base_seed").callback?.(999);
assert.match(reviewStatus(edited),/Settings changed/);
w(edited,"Return to Review").callback();
assert(buttons.every(name=>!visible(edited,name)),"stale review actions hidden");
assert(visible(edited,"Start again from Chunk 1")&&visible(edited,"Render History"));
await load(edited,originalProject);
assert.match(reviewStatus(edited),/Settings changed/,"history refresh must not bless edits");
const changedInputs={base_seed:999};prepareReviewQueueIntent(edited,changedInputs);
assert.equal(changedInputs.review_action,"Continue / Next");
assert.equal(changedInputs.base_seed,999);
assert.deepEqual(project,originalProject,"stored backend state is untouched");
w(edited,"base_seed").value=oldSeed;edited.__h3ContinuumProductionUxRefresh();
assert(visible(edited,"Try this chunk again"),"undo restores the original review eligibility");
// Manual boundaries are not silently erased by old action callbacks.
w(edited,"reroll_from_chunk").value="Chunk 1";
w(edited,"Try this chunk again").callback();
assert.equal(w(edited,"reroll_from_chunk").value,"Chunk 1");
const manualInputs={reroll_from_chunk:"Chunk 1"};prepareReviewQueueIntent(edited,manualInputs);
assert.equal(manualInputs.reroll_from_chunk,"Chunk 1");
assert.equal(manualInputs.review_action,"Continue / Next");
// Restart uses existing non-destructive branch controls, consumed once.
w(edited,"reroll_nonce").value=8;
w(edited,"Start again from Chunk 1").callback();
assert.equal(w(edited,"reroll_nonce").value,0);
assert.equal(w(edited,"take_action").value,"Automatic");
const restartInputs={reroll_from_chunk:w(edited,"reroll_from_chunk").value};
prepareReviewQueueIntent(edited,restartInputs);
w(edited,"review_action").afterQueued({isPartialExecution:false});
assert.equal(restartInputs.reroll_from_chunk,"Chunk 1","queued restart payload unchanged");
assert.equal(w(edited,"reroll_from_chunk").value,"Auto","next Queue can continue");
assert.equal(w(edited,"base_seed").value,oldSeed);
assert.equal(edited.serialize().widgets_values.length,makeNode().serialize().widgets_values.length);
// Linked prompts, media selection/bypass and reconnection are included.
const upstream={id:71,comfyClass:"LoadImage",mode:0,inputs:[],widgets:[{name:"image",value:"first.png"}]};
const graph={links:{9:{origin_id:71,origin_slot:0}},getNodeById:id=>id===71?upstream:null};
const linked=makeNode();linked.graph=graph;linked.inputs=[{name:"reference_image_1",link:9}];
await load(linked,state("review_ready",{start:1,end:1,physical_group:1},"linked"));
for(const mutation of [()=>upstream.widgets[0].value="second.png",()=>upstream.mode=4,()=>linked.inputs[0].link=null]){
mutation();linked.onDrawForeground();
assert.match(reviewStatus(linked),/Settings changed/);
assert(!visible(linked,"Try this chunk again"));
upstream.widgets[0].value="first.png";upstream.mode=0;linked.inputs[0].link=9;
linked.onDrawForeground();assert(visible(linked,"Try this chunk again"));
}
upstream.comfyClass="PrimitiveStringMultiline";upstream.widgets=[{name:"value",value:"old prompt"}];
await load(linked,state("review_ready",{start:1,end:1,physical_group:1},"prompt-base"));
upstream.widgets[0].value="new prompt";linked.onDrawForeground();
assert.match(reviewStatus(linked),/Settings changed/);
// Edits made while a queued run is working must remain dirty on completion.
const flight=makeNode();prepareReviewQueueIntent(flight,{});
w(flight,"base_seed").value=321;
await load(flight,state("review_ready",{start:1,end:1,physical_group:1},"flight"));
assert.match(reviewStatus(flight),/Settings changed/);
assert(!visible(flight,"Try this chunk again"));
// A slow first history response cannot bless settings changed during fetch.
const slow=makeNode();await load(slow,null);
const normalFetch=globalThis.fetch;let releaseFetch;
globalThis.fetch=()=>new Promise(resolve=>{releaseFetch=resolve;});
const pendingHistory=loadTakeHistory(slow);
w(slow,"base_seed").value=456;
releaseFetch({ok:true,status:200,json:async()=>state("review_ready",{start:1,end:1,physical_group:1},"slow")});
await pendingHistory;
assert.match(reviewStatus(slow),/Settings changed/);
globalThis.fetch=normalFetch;
// An old queued snapshot cannot become another Run Name's baseline.
const otherRun=makeNode();prepareReviewQueueIntent(otherRun,{});
w(otherRun,"run_name").value="different-run";w(otherRun,"base_seed").value=789;
await load(otherRun,state("review_ready",{start:1,end:1,physical_group:1},"other-run"));
assert(!reviewSettingsChanged(otherRun));
console.log("PASS: real frontend completed-review lifecycle");
})().catch(e=>{console.error(e);process.exitCode=1;});
'''
+7 -5
View File
@@ -278,6 +278,7 @@ const RUN_STORAGE_WIDGET = "run_storage";
const GENERATION_MODE_WIDGET = "generation_mode";
const REVIEW_ACTION_WIDGET = "review_action";
const GENERATION_MODE_FULL_RUN = "Full Run";
const REGENERATE_WIDGET = "reroll_from_chunk";
const GENERATION_MODE_REVIEW = "Review Each Chunk";
const REVIEW_ACTION_CONTINUE = "Continue / Next";
const REVIEW_ACTION_REGENERATE = "Regenerate Current";
@@ -652,6 +653,7 @@ const PRODUCTION_REGENERATE_WIDGET = "Try this chunk again";
const PRODUCTION_FINISH_WIDGET = "Use it and finish the rest";
const PRODUCTION_BACK_TO_SETTINGS_WIDGET = "Back to Settings";
const PRODUCTION_RETURN_TO_REVIEW_WIDGET = "Return to Review";
const PRODUCTION_RESTART_WIDGET = "Start again from Chunk 1";
const FACADE_READY_WIDGET = "Ready to Queue";
const FACADE_ADVANCED_WIDGET = "Advanced Settings";
const FACADE_REFERENCE_SIZE_WIDGET = "Reference Image Size";
@@ -679,7 +681,7 @@ function makeNode() {{
widgets: [
widget("unrelated", 73),
widget(RUN_STORAGE_WIDGET, "Off"),
widget(REGENERATE_WIDGET, "Chunk 2"),
widget(REGENERATE_WIDGET, "Auto"),
widget(REROLL_NONCE_WIDGET, 7),
widget(GENERATION_MODE_WIDGET, GENERATION_MODE_FULL_RUN),
widget(REVIEW_ACTION_WIDGET, REVIEW_ACTION_CONTINUE),
@@ -726,7 +728,7 @@ const continued = {{
plan: findWidget(node, PRODUCTION_STATUS_WIDGET).value,
}};
setExistingWidgetValue(findWidget(node, REGENERATE_WIDGET), "Chunk 2");
setExistingWidgetValue(findWidget(node, REGENERATE_WIDGET), "Auto");
findWidget(node, PRODUCTION_REGENERATE_WIDGET).callback();
const regenerateInputs = {{ unrelated: "preserved" }};
prepareReviewQueueIntent(node, regenerateInputs);
@@ -797,7 +799,7 @@ console.log(JSON.stringify({{
observed = json.loads(result.stdout)
assert observed["basic"] == {
"totalWidgets": 21,
"totalWidgets": 22,
"transientHidden": True,
"saved": observed["originalValues"],
}
@@ -848,8 +850,8 @@ console.log(JSON.stringify({{
assert len(observed["saved"]["widgets_values"]) == len(observed["originalValues"])
assert observed["reload"] == {
"values": observed["saved"]["widgets_values"],
"totalWidgets": 21,
"transientCount": 12,
"totalWidgets": 22,
"transientCount": 13,
}
+149 -5
View File
@@ -59,6 +59,7 @@ const PRODUCTION_REGENERATE_WIDGET = "Try this chunk again";
const PRODUCTION_FINISH_WIDGET = "Use it and finish the rest";
const PRODUCTION_BACK_TO_SETTINGS_WIDGET = "Back to Settings";
const PRODUCTION_RETURN_TO_REVIEW_WIDGET = "Return to Review";
const PRODUCTION_RESTART_WIDGET = "Start again from Chunk 1";
const TAKE_STATUS_WIDGET = "Render History / Takes";
const TAKE_TOGGLE_WIDGET = "Render History";
const TAKE_PREVIOUS_WIDGET = "Previous Take";
@@ -1318,6 +1319,69 @@ function canonicalStorageRevision(project) {
return revisions.find((item) => String(item?.revision_id || "") === revisionId) || null;
}
// Browser edit detection is advisory: it can withdraw stale actions, never
// approve a saved prefix. Run Storage still owns all compatibility/reuse checks.
function reviewSettingsSnapshot(node) {
const ignored = new Set([
PROJECT_WIDGET, LEGACY_RUN_NAME_WIDGET, RUN_STORAGE_WIDGET,
GENERATION_MODE_WIDGET, REVIEW_ACTION_WIDGET, REGENERATE_WIDGET,
REROLL_NONCE_WIDGET, TAKE_GROUP_WIDGET, TAKE_REVISION_WIDGET,
TAKE_ACTION_WIDGET, "control_after_generate", "diagnostics", "debug",
"strict_compatibility", "show_preview",
]);
const seen = new Set();
const visit = (current) => {
if (!current || seen.has(current)) return null;
seen.add(current);
const widgets = (current.widgets || []).filter((widget) => (
!widget[PRODUCTION_TRANSIENT_WIDGET] && !widget[FACADE_TRANSIENT_WIDGET]
&& widget.options?.serialize !== false && widget.type !== "button"
&& !(current === node && ignored.has(widget.name))
)).map((widget) => [widget.name, widget.value])
.sort((a, b) => String(a[0]).localeCompare(String(b[0])));
const graph = node.graph || (typeof app === "undefined" ? null : app.graph);
const inputs = (current.inputs || []).map((input) => {
const link = graph?.links?.[input.link];
return [input.name, input.link, link?.origin_slot,
visit(graph?.getNodeById?.(link?.origin_id))];
});
return [current.id, current.comfyClass || current.type, current.mode, widgets, inputs];
};
try { return JSON.stringify(visit(node)); } catch { return null; }
}
function reviewSettingsChanged(node) {
const baseline = node.__h3ContinuumReviewedSettings;
const current = reviewSettingsSnapshot(node);
return baseline != null && current != null && current !== baseline;
}
function rememberReviewSettings(node, requestedSettings) {
const revision = canonicalStorageRevision(node.__h3ContinuumTakeProject);
if (!revision || !["review_ready", "complete"].includes(revision.status)) return;
const key = JSON.stringify([takeRunName(node), revision.revision_id,
revision.status, revision.review_unit, revision.updated_utc]);
if (key === node.__h3ContinuumReviewedSettingsKey) return;
node.__h3ContinuumReviewedSettingsKey = key;
// Keep edits made during generation dirty against what was actually queued.
const queued = node.__h3ContinuumQueuedSettingsRun === takeRunName(node)
? node.__h3ContinuumQueuedSettings : null;
node.__h3ContinuumReviewedSettings = queued
?? requestedSettings ?? reviewSettingsSnapshot(node);
delete node.__h3ContinuumQueuedSettings;
delete node.__h3ContinuumQueuedSettingsRun;
}
function selectProductionRestart(node) {
clearTakeSelection(node);
setExistingWidgetValue(findWidget(node, REVIEW_ACTION_WIDGET), REVIEW_ACTION_CONTINUE);
setExistingWidgetValue(findWidget(node, REROLL_NONCE_WIDGET), 0);
setExistingWidgetValue(findWidget(node, REGENERATE_WIDGET), "Chunk 1");
delete node[REVIEW_UI_SELECTION];
node.__h3ContinuumRestartSelected = true;
node.__h3ContinuumProductionUxRefresh?.();
}
function reviewReady(node) {
const revision = canonicalStorageRevision(node.__h3ContinuumTakeProject);
// Completion ends continuation, not the user's ability to inspect/retry a Take.
@@ -1338,6 +1402,13 @@ function reviewStatus(node) {
if (node.__h3ContinuumTakeError) {
return `Review status unavailable: ${node.__h3ContinuumTakeError}`;
}
const from = findWidget(node, REGENERATE_WIDGET)?.value;
if (from && from !== "Auto" && from !== 0) {
return `Regenerate from ${from}\nPress Queue directly. Saved Takes are kept.`;
}
if (reviewSettingsChanged(node)) {
return "Settings changed — previous review is out of date\nQueue current settings, or start again from Chunk 1. Saved Takes are kept.";
}
const project = node.__h3ContinuumTakeProject;
if (!project) return "Queue the workflow to create the first chunk.";
const revision = canonicalStorageRevision(project);
@@ -1380,7 +1451,11 @@ function reviewStatus(node) {
}
function selectProductionReviewAction(node, action) {
setExistingWidgetValue(findWidget(node, REGENERATE_WIDGET), "Auto");
const from = findWidget(node, REGENERATE_WIDGET)?.value;
if (reviewSettingsChanged(node) || (from && from !== "Auto" && from !== 0)) {
node.__h3ContinuumProductionUxRefresh?.();
return;
}
setExistingWidgetValue(findWidget(node, RUN_STORAGE_WIDGET), "Save + Auto Resume");
setExistingWidgetValue(findWidget(node, GENERATION_MODE_WIDGET), GENERATION_MODE_REVIEW);
setReviewSeedControlFixed(node);
@@ -1655,6 +1730,7 @@ function clearTakeSelection(node) {
async function loadTakeHistory(node) {
const runName = takeRunName(node);
const requestedSettings = node.__h3ContinuumReadReviewSettings?.();
if (!runName || typeof globalThis.fetch !== "function") {
node.__h3ContinuumTakeProject = null;
delete node.__h3ContinuumTakeError;
@@ -1689,6 +1765,7 @@ async function loadTakeHistory(node) {
throw new Error("Branch Provenance v1 is unavailable");
}
node.__h3ContinuumTakeProject = project;
node.__h3ContinuumRememberReviewSettings?.(requestedSettings);
delete node.__h3ContinuumTakeError;
if (legacyV2) {
clearTakeSelection(node);
@@ -1730,9 +1807,10 @@ async function loadTakeHistory(node) {
}
}
function refreshV38TakeHistoryAfterExecution() {
function refreshV38TakeHistoryAfterExecution(event) {
for (const node of app.graph?._nodes || []) {
if (node.comfyClass !== V38_NODE_CLASS) continue;
if (event?.type !== "execution_success") delete node.__h3ContinuumQueuedSettings;
void loadTakeHistory(node);
setTimeout(() => void loadTakeHistory(node), 250);
}
@@ -1838,6 +1916,15 @@ function configureProductionReviewUx(node) {
"Return to the pending chunk review without changing any settings or Take state."
));
}
const restart = addTransientProductionWidget(
node, "button", PRODUCTION_RESTART_WIDGET, null,
() => selectProductionRestart(node),
);
if (restart) setWidgetTooltip(restart, (
"Select a new branch from Chunk 1 using the current settings and automatic "
+ "Take variation. Press Queue afterward. Saved Takes are not deleted; "
+ "the restart selection is consumed once after Queue."
));
const historyToggle = addTransientProductionWidget(
node,
"button",
@@ -1944,6 +2031,9 @@ function configureProductionReviewUx(node) {
}
const settingsOpen = ready && Boolean(node.__h3ContinuumReviewSettingsOpen);
const reviewOpen = ready && !settingsOpen;
const from = findWidget(node, REGENERATE_WIDGET)?.value;
const edited = reviewSettingsChanged(node);
const canReview = !edited && (!from || from === "Auto" || from === 0);
const takeCount = takeCatalog(node).length;
const actionNames = new Set([
PRODUCTION_STATUS_WIDGET,
@@ -1963,18 +2053,20 @@ function configureProductionReviewUx(node) {
if (widget.name === PRODUCTION_STATUS_WIDGET) {
setWidgetVisible(widget, reviewOpen);
} else if (widget.name === PRODUCTION_REGENERATE_WIDGET) {
setWidgetVisible(widget, reviewOpen && reviewHasUnit(node));
setWidgetVisible(widget, reviewOpen && canReview && reviewHasUnit(node));
} else if (
widget.name === PRODUCTION_CONTINUE_WIDGET
|| widget.name === PRODUCTION_FINISH_WIDGET
) {
setWidgetVisible(widget, reviewOpen && !complete);
setWidgetVisible(widget, reviewOpen && canReview && !complete);
} else if (actionNames.has(widget.name)) {
setWidgetVisible(widget, reviewOpen);
} else if (widget.name === PRODUCTION_BACK_TO_SETTINGS_WIDGET) {
setWidgetVisible(widget, reviewOpen);
} else if (widget.name === PRODUCTION_RETURN_TO_REVIEW_WIDGET) {
setWidgetVisible(widget, settingsOpen);
} else if (widget.name === PRODUCTION_RESTART_WIDGET) {
setWidgetVisible(widget, ready);
} else if (widget.name === TAKE_TOGGLE_WIDGET) {
setWidgetVisible(widget, reviewOpen && takeCount > 0);
} else if (historyNames.has(widget.name)) {
@@ -2044,6 +2136,7 @@ function configureProductionReviewUx(node) {
PRODUCTION_REGENERATE_WIDGET,
PRODUCTION_FINISH_WIDGET,
PRODUCTION_BACK_TO_SETTINGS_WIDGET,
PRODUCTION_RESTART_WIDGET,
TAKE_TOGGLE_WIDGET,
TAKE_STATUS_WIDGET,
TAKE_PREVIOUS_WIDGET,
@@ -2072,6 +2165,7 @@ function configureProductionReviewUx(node) {
readyIndex >= 0 ? readyIndex + 1 : settingsOrder.length,
0,
PRODUCTION_RETURN_TO_REVIEW_WIDGET,
PRODUCTION_RESTART_WIDGET,
);
moveNamedWidgetsToFront(node, settingsOrder);
} else if (Array.isArray(node.__h3ContinuumFacadeOrder)) {
@@ -2080,6 +2174,28 @@ function configureProductionReviewUx(node) {
node.setDirtyCanvas?.(true, true);
};
node.__h3ContinuumProductionUxRefresh = refresh;
node.__h3ContinuumReviewSettingsChanged = () => reviewSettingsChanged(node);
node.__h3ContinuumRememberReviewSettings = (requested) => rememberReviewSettings(node, requested);
node.__h3ContinuumReadReviewSettings = () => reviewSettingsSnapshot(node);
node.__h3ContinuumCaptureReviewSettings = () => {
node.__h3ContinuumQueuedSettings = reviewSettingsSnapshot(node);
node.__h3ContinuumQueuedSettingsRun = takeRunName(node);
};
// Upstream prompt/media edits also invalidate review, not just local widgets.
if (!node.__h3ContinuumReviewDrawWatch) {
const previous = node.onDrawForeground;
node.onDrawForeground = function(...args) {
const result = previous?.apply(this, args);
const changed = reviewSettingsChanged(this);
if (changed !== this.__h3ContinuumReviewDrawChanged) {
this.__h3ContinuumReviewDrawChanged = changed;
this.__h3ContinuumIntuitiveUxRefresh?.();
this.__h3ContinuumProductionUxRefresh?.();
}
return result;
};
node.__h3ContinuumReviewDrawWatch = true;
}
for (const [name, key] of (
[
[RUN_STORAGE_WIDGET, "__h3ContinuumProductionStorageRefresh"],
@@ -2095,6 +2211,11 @@ function configureProductionReviewUx(node) {
attachRefresh(findWidget(node, name), key, refresh);
}
attachTakeHistoryReload(node);
for (const widget of node.widgets || []) {
if (!widget[PRODUCTION_TRANSIENT_WIDGET] && !widget[FACADE_TRANSIENT_WIDGET]) {
attachRefresh(widget, "__h3ContinuumReviewEditRefresh", refresh);
}
}
refresh();
}
@@ -2391,15 +2512,29 @@ function prepareReviewQueueIntent(node, apiInputs) {
}
const generationMode = generationWidget.value;
const selectedAction = actionWidget.value;
const submittedAction = generationMode === GENERATION_MODE_FULL_RUN
const from = findWidget(node, REGENERATE_WIDGET)?.value;
const staleReview = node.__h3ContinuumReviewSettingsChanged?.() || false;
const manualRegenerate = from && from !== "Auto" && from !== 0;
const submittedAction = generationMode === GENERATION_MODE_FULL_RUN || staleReview || manualRegenerate
? REVIEW_ACTION_CONTINUE
: selectedAction;
if (staleReview || manualRegenerate) {
actionWidget.value = REVIEW_ACTION_CONTINUE;
delete node[REVIEW_UI_SELECTION];
}
apiInputs[GENERATION_MODE_WIDGET] = generationMode;
apiInputs[REVIEW_ACTION_WIDGET] = submittedAction;
const takeAction = findWidget(node, TAKE_ACTION_WIDGET)?.value || TAKE_ACTION_AUTOMATIC;
apiInputs[TAKE_GROUP_WIDGET] = Number(findWidget(node, TAKE_GROUP_WIDGET)?.value || 0);
apiInputs[TAKE_REVISION_WIDGET] = String(findWidget(node, TAKE_REVISION_WIDGET)?.value || "");
apiInputs[TAKE_ACTION_WIDGET] = takeAction;
node.__h3ContinuumCaptureReviewSettings?.();
if (node.__h3ContinuumRestartSelected && from === "Chunk 1") {
node.__h3ContinuumRestartQueued = true;
} else {
delete node.__h3ContinuumRestartSelected;
delete node.__h3ContinuumRestartQueued;
}
if (
generationMode === GENERATION_MODE_REVIEW
&& isOneShotReviewAction(submittedAction)
@@ -2462,6 +2597,15 @@ function configureReviewControls(node) {
const result = previous?.apply(this, args);
resetReviewActionAfterQueued(node);
resetTakeActionAfterQueued(node);
if (node.__h3ContinuumRestartQueued) {
delete node.__h3ContinuumRestartQueued;
delete node.__h3ContinuumRestartSelected;
const from = findWidget(node, REGENERATE_WIDGET);
if (from?.value === "Chunk 1") {
from.value = "Auto";
from.callback?.("Auto");
}
}
return result;
};
actionWidget.__h3ContinuumReviewAfterQueued = true;