fix: stabilize V3.9 and bump package to 3.9.1
Preserve Second Pass audio and scoped Review conditioning, strengthen Take compatibility, and align Review Driving Audio. Keep v5 history readable, document v6 restart requirements, and describe the fixes at the top of both READMEs. Remove workstation-specific paths and private operational records from public documentation.
This commit is contained in:
+1
-1
@@ -37,7 +37,7 @@ def review_queue_results():
|
||||
capture_output=True, text=True, encoding="utf-8", timeout=45,
|
||||
)
|
||||
records = json.loads(result.stdout)
|
||||
assert len(records) == 60, "The complete queue fixture must finish, including Workflow rehydration"
|
||||
assert len(records) == 62, "The complete queue fixture must finish, including Workflow rehydration and v5 history"
|
||||
failures = [item for item in records if not item["pass"]]
|
||||
assert result.returncode == 0 and not failures, result.stdout + result.stderr
|
||||
return {item["name"]: item for item in records}
|
||||
|
||||
+99
@@ -0,0 +1,99 @@
|
||||
{
|
||||
"active_revisions": {
|
||||
"1": "f0d03f641973fb1d89c2ca4a",
|
||||
"2": "d5b6382c7152f233ac608bfa"
|
||||
},
|
||||
"branch_provenance_version": 1,
|
||||
"canonical_chain": [
|
||||
"f0d03f641973fb1d89c2ca4a",
|
||||
"d5b6382c7152f233ac608bfa"
|
||||
],
|
||||
"canonical_head_revision_id": "d5b6382c7152f233ac608bfa",
|
||||
"canonical_storage_revision_id": "d8352287737286e5",
|
||||
"group_revisions": [
|
||||
{
|
||||
"branch_provenance_version": 1,
|
||||
"created_utc": "2026-10-03T15:37:36+00:00",
|
||||
"generation_contract_sha256": "f5a4b7ec0041d5f51731148aae29b228608c1904aa7b3d922764697dc97daf46",
|
||||
"group": {
|
||||
"end": 1,
|
||||
"physical_group": 1,
|
||||
"start": 1
|
||||
},
|
||||
"lineage_sha256": "2dbba4b61863fde2a8d74a75dae4b563e7b79484a2ff678d0cbd333e504cf158",
|
||||
"parent_revision_id": null,
|
||||
"records": [
|
||||
{
|
||||
"file_sha256": "26e771cffc57f171f4cc4c6859876350bdf717d1e8213fc005343006a34f002f",
|
||||
"file_size": 110080,
|
||||
"filename": "rev-d8352287737286e5-txn-9bb0a584b7344342b114bd31b175225c-chunk-0001.safetensors",
|
||||
"prompt_hash": "5dec1ecc3f0d6f846562049c0a4968da02cbbb43113feb87a95cfd6d6691be07",
|
||||
"seed": 17671095936967226055,
|
||||
"sequence_index": 0,
|
||||
"storage_revision_id": "d8352287737286e5"
|
||||
}
|
||||
],
|
||||
"revision_id": "f0d03f641973fb1d89c2ca4a",
|
||||
"revision_order": "2026-10-03T15:37:36+00:00|f0d03f641973fb1d89c2ca4a",
|
||||
"seed_identity": "d54e2bdb426c4a8217b8d7a5cf608093c8a53b6087982053d294f61e042cbf49",
|
||||
"storage_revision_id": "d8352287737286e5",
|
||||
"variation_nonce": 0
|
||||
},
|
||||
{
|
||||
"branch_provenance_version": 1,
|
||||
"created_utc": "2026-10-03T15:37:36+00:00",
|
||||
"generation_contract_sha256": "f5a4b7ec0041d5f51731148aae29b228608c1904aa7b3d922764697dc97daf46",
|
||||
"group": {
|
||||
"end": 2,
|
||||
"physical_group": 2,
|
||||
"start": 2
|
||||
},
|
||||
"lineage_sha256": "2dbba4b61863fde2a8d74a75dae4b563e7b79484a2ff678d0cbd333e504cf158",
|
||||
"parent_revision_id": "f0d03f641973fb1d89c2ca4a",
|
||||
"records": [
|
||||
{
|
||||
"file_sha256": "8b8ca1b0c802d024c6915d903747d8722bea25628369997ab008ff896462b96a",
|
||||
"file_size": 124928,
|
||||
"filename": "rev-d8352287737286e5-txn-008f52b93a88461481ead25f91627af0-chunk-0002.safetensors",
|
||||
"prompt_hash": "5dec1ecc3f0d6f846562049c0a4968da02cbbb43113feb87a95cfd6d6691be07",
|
||||
"seed": 2167717532453298830,
|
||||
"sequence_index": 1,
|
||||
"storage_revision_id": "d8352287737286e5"
|
||||
}
|
||||
],
|
||||
"revision_id": "d5b6382c7152f233ac608bfa",
|
||||
"revision_order": "2026-10-03T15:37:36+00:00|d5b6382c7152f233ac608bfa",
|
||||
"seed_identity": "ea9acc75bcb213362286781997985bc03df80bb8e3b3368ab02907a465286579",
|
||||
"storage_revision_id": "d8352287737286e5",
|
||||
"variation_nonce": 0
|
||||
}
|
||||
],
|
||||
"revisions": [
|
||||
{
|
||||
"active_chain": [
|
||||
"f0d03f641973fb1d89c2ca4a",
|
||||
"d5b6382c7152f233ac608bfa"
|
||||
],
|
||||
"branch_regenerate_from": 0,
|
||||
"contract_sha256": "f5a4b7ec0041d5f51731148aae29b228608c1904aa7b3d922764697dc97daf46",
|
||||
"effective_reroll_nonce": 0,
|
||||
"nonce_mode": "inactive",
|
||||
"reroll_from_chunk": 0,
|
||||
"resume_safe": true,
|
||||
"review_control_version": 1,
|
||||
"review_pause_reason": "review_each_chunk",
|
||||
"review_unit": {
|
||||
"end": 2,
|
||||
"physical_group": 2,
|
||||
"start": 2
|
||||
},
|
||||
"revision_id": "d8352287737286e5",
|
||||
"sampling_revision_id": "f5a4b7ec0041d5f5",
|
||||
"status": "review_ready",
|
||||
"updated_utc": "2026-10-03T15:37:37+00:00"
|
||||
}
|
||||
],
|
||||
"run_name": "run_00bb27779f215038a7eb1845979fdd7c",
|
||||
"run_storage_schema_version": 3,
|
||||
"updated_utc": "2026-10-03T15:37:37+00:00"
|
||||
}
|
||||
BIN
Binary file not shown.
BIN
Binary file not shown.
@@ -0,0 +1,726 @@
|
||||
{
|
||||
"branch_provenance": {
|
||||
"active_chain": [
|
||||
"f0d03f641973fb1d89c2ca4a",
|
||||
"d5b6382c7152f233ac608bfa"
|
||||
],
|
||||
"canonical_committed_utc": "2026-10-03T15:37:37+00:00",
|
||||
"canonical_sequence": 1,
|
||||
"version": 1
|
||||
},
|
||||
"branch_regenerate_from": 0,
|
||||
"chunks": [
|
||||
{
|
||||
"entry": {
|
||||
"clip_index": 1,
|
||||
"context_frames": 0,
|
||||
"motion_score": 0.0,
|
||||
"plan": {
|
||||
"clip_index": 1,
|
||||
"context_frames": 5,
|
||||
"continuation": false,
|
||||
"debug": false,
|
||||
"height": 64,
|
||||
"magic": "H3_CONTINUUM_PLAN",
|
||||
"net_frames": 124,
|
||||
"requested_extend_seconds": 5.0,
|
||||
"schema_version": 1,
|
||||
"state_capacity_frames": 39,
|
||||
"total_frames": 124,
|
||||
"trim_frames": 0,
|
||||
"width": 64
|
||||
},
|
||||
"prompt_hash": "5dec1ecc3f0d6f846562049c0a4968da02cbbb43113feb87a95cfd6d6691be07",
|
||||
"seed": 17671095936967226055,
|
||||
"sequence_index": 0
|
||||
},
|
||||
"file_sha256": "26e771cffc57f171f4cc4c6859876350bdf717d1e8213fc005343006a34f002f",
|
||||
"file_size": 110080,
|
||||
"filename": "rev-d8352287737286e5-txn-9bb0a584b7344342b114bd31b175225c-chunk-0001.safetensors",
|
||||
"sequence_index": 0,
|
||||
"storage_revision_id": "d8352287737286e5"
|
||||
},
|
||||
{
|
||||
"entry": {
|
||||
"clip_index": 2,
|
||||
"context_frames": 22,
|
||||
"motion_score": 0.0,
|
||||
"plan": {
|
||||
"clip_index": 2,
|
||||
"context_frames": 22,
|
||||
"continuation": true,
|
||||
"debug": false,
|
||||
"height": 64,
|
||||
"magic": "H3_CONTINUUM_PLAN",
|
||||
"net_frames": 119,
|
||||
"requested_extend_seconds": 5.0,
|
||||
"schema_version": 1,
|
||||
"state_capacity_frames": 39,
|
||||
"total_frames": 141,
|
||||
"trim_frames": 22,
|
||||
"width": 64
|
||||
},
|
||||
"prompt_hash": "5dec1ecc3f0d6f846562049c0a4968da02cbbb43113feb87a95cfd6d6691be07",
|
||||
"seed": 2167717532453298830,
|
||||
"sequence_index": 1
|
||||
},
|
||||
"file_sha256": "8b8ca1b0c802d024c6915d903747d8722bea25628369997ab008ff896462b96a",
|
||||
"file_size": 124928,
|
||||
"filename": "rev-d8352287737286e5-txn-008f52b93a88461481ead25f91627af0-chunk-0002.safetensors",
|
||||
"sequence_index": 1,
|
||||
"storage_revision_id": "d8352287737286e5"
|
||||
}
|
||||
],
|
||||
"contract": {
|
||||
"chunk_contract_hashes": [
|
||||
"a1d04437be62e79c3945c65d26bbc2cc8fdab89c661d78e8dd8da4673b9f1f15",
|
||||
"b90a1eab80aaefd1db1935d6aec14050332ccc6047a7045bf52728de4f527259",
|
||||
"ffdc4b800b697062ab3d2e27c9079dda7fcd2e4c2a7d83fc98fac7402ffaaf55",
|
||||
"b07b8643f7706d41ae6a0b0a74c1f6771d844502ef8b006f5cf71664a0ba26f4"
|
||||
],
|
||||
"chunk_contracts": [
|
||||
{
|
||||
"chunk_number": 1,
|
||||
"effective_reroll_nonce": 0,
|
||||
"global_hash": "3f2ddb7a42a25548a6ec9319f859ed1a75ae0a11933056953d722e2553af357d",
|
||||
"last_frame_hash": "",
|
||||
"physical_group_reference_sha256": "ac4a88fbfb79802981cae2f4ce7b3befcfc5b40fa14f1cd9d03852a2e7a4678f",
|
||||
"prompt_hash": "5dec1ecc3f0d6f846562049c0a4968da02cbbb43113feb87a95cfd6d6691be07",
|
||||
"reroll_boundary": 0
|
||||
},
|
||||
{
|
||||
"chunk_number": 2,
|
||||
"effective_reroll_nonce": 0,
|
||||
"global_hash": "3f2ddb7a42a25548a6ec9319f859ed1a75ae0a11933056953d722e2553af357d",
|
||||
"last_frame_hash": "",
|
||||
"physical_group_reference_sha256": "24824ce6a4f406415e52b1909270780063bece5f97fc3fdb2e844d40878afdbe",
|
||||
"prompt_hash": "5dec1ecc3f0d6f846562049c0a4968da02cbbb43113feb87a95cfd6d6691be07",
|
||||
"reroll_boundary": 0
|
||||
},
|
||||
{
|
||||
"chunk_number": 3,
|
||||
"effective_reroll_nonce": 0,
|
||||
"global_hash": "3f2ddb7a42a25548a6ec9319f859ed1a75ae0a11933056953d722e2553af357d",
|
||||
"last_frame_hash": "",
|
||||
"physical_group_reference_sha256": "b9fcc63b033a0cdf334e68dad74f77ac87ff5e1f8c3b346aa5879411856f62da",
|
||||
"prompt_hash": "5dec1ecc3f0d6f846562049c0a4968da02cbbb43113feb87a95cfd6d6691be07",
|
||||
"reroll_boundary": 0
|
||||
},
|
||||
{
|
||||
"chunk_number": 4,
|
||||
"effective_reroll_nonce": 0,
|
||||
"global_hash": "3f2ddb7a42a25548a6ec9319f859ed1a75ae0a11933056953d722e2553af357d",
|
||||
"last_frame_hash": "6bc13118765285cba097403c4b340bac0e550599fb27a1b415ffc88fc6237daa",
|
||||
"physical_group_reference_sha256": "b9fcc63b033a0cdf334e68dad74f77ac87ff5e1f8c3b346aa5879411856f62da",
|
||||
"prompt_hash": "5dec1ecc3f0d6f846562049c0a4968da02cbbb43113feb87a95cfd6d6691be07",
|
||||
"reroll_boundary": 0
|
||||
}
|
||||
],
|
||||
"chunk_count": 4,
|
||||
"effective_reroll_nonce": 0,
|
||||
"global": {
|
||||
"actual_prefix_steps": 2,
|
||||
"audio_continuity": true,
|
||||
"base_seed": 1234,
|
||||
"chunk_seconds": 5.0,
|
||||
"clip": {
|
||||
"graph_route": {
|
||||
"node": {
|
||||
"class_type": "CLIPLoader",
|
||||
"inputs": {
|
||||
"clip_name": "audit_minimax_h3.safetensors",
|
||||
"type": "minimax"
|
||||
},
|
||||
"node_id": "clip"
|
||||
},
|
||||
"output": 0
|
||||
},
|
||||
"runtime": {
|
||||
"conditioner": {
|
||||
"parameter_count": 4,
|
||||
"parameter_layout_sha256": "bfc7a2fa460fae4eb803fa7bedfa5a2cb8c3c793902b65c1e7796159b92d79bd",
|
||||
"tensor_count": 1,
|
||||
"type": "audit_providers.TinyModule",
|
||||
"weight_probe": [
|
||||
{
|
||||
"dtype": "torch.float32",
|
||||
"name": "proj.weight",
|
||||
"sample_sha256": "c3a6b1f08b0b05ac05390d6c257551ffd0cdcf40496f232b52df2498f915469e",
|
||||
"shape": [
|
||||
2,
|
||||
2
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"options": {
|
||||
"layer_idx": null,
|
||||
"tokenizer_options": {},
|
||||
"use_clip_schedule": false
|
||||
},
|
||||
"patcher": {
|
||||
"model_type": "audit_providers.TinyModule",
|
||||
"state": {
|
||||
"model_options": {
|
||||
"transformer_options": {}
|
||||
},
|
||||
"object_patches": {},
|
||||
"patches": {},
|
||||
"wrappers": {}
|
||||
},
|
||||
"type": "comfy.model_patcher.ModelPatcher"
|
||||
},
|
||||
"runtime_observation": {
|
||||
"options_complete": true,
|
||||
"patcher_complete": true
|
||||
},
|
||||
"tokenizer": {
|
||||
"bos_token_id": null,
|
||||
"core_type": "types.SimpleNamespace",
|
||||
"eos_token_id": null,
|
||||
"model_max_length": 1024,
|
||||
"model_wrapper_type": "types.SimpleNamespace",
|
||||
"name_or_path": "audit-type-only",
|
||||
"pad_token_id": null,
|
||||
"padding_side": null,
|
||||
"truncation_side": null,
|
||||
"vocab_size": 10,
|
||||
"wrapper_type": "types.SimpleNamespace"
|
||||
},
|
||||
"wrapper_type": "audit_providers.SyntheticClip"
|
||||
}
|
||||
},
|
||||
"conditioning_mode": "fl2va",
|
||||
"continuity": "Balanced - 22 frames",
|
||||
"continuum_interop_api": 1,
|
||||
"driving_audio": {
|
||||
"driving_audio_contract_version": 1,
|
||||
"preprocess_version": 1,
|
||||
"resampled_dtype": "torch.float32",
|
||||
"resampled_sha256": "7cca6be8869d599159077330aaf71972b0328bf8758cd99e6d52ba5bd3466b7a",
|
||||
"resampled_shape": [
|
||||
1,
|
||||
2,
|
||||
640000
|
||||
],
|
||||
"resolved_vae_sample_rate": 32000,
|
||||
"source_dtype": "torch.float32",
|
||||
"source_sample_rate": 32000,
|
||||
"source_sha256": "7cca6be8869d599159077330aaf71972b0328bf8758cd99e6d52ba5bd3466b7a",
|
||||
"source_shape": [
|
||||
1,
|
||||
2,
|
||||
640000
|
||||
]
|
||||
},
|
||||
"driving_audio_vae": {
|
||||
"graph_route": {
|
||||
"node": {
|
||||
"class_type": "VAELoader",
|
||||
"inputs": {
|
||||
"vae_name": "audit_audio_vae.safetensors"
|
||||
},
|
||||
"node_id": "audio_vae"
|
||||
},
|
||||
"output": 0
|
||||
},
|
||||
"runtime": {
|
||||
"audio_sample_rate": 32000,
|
||||
"first_stage": {
|
||||
"parameter_count": 4,
|
||||
"parameter_layout_sha256": "bfc7a2fa460fae4eb803fa7bedfa5a2cb8c3c793902b65c1e7796159b92d79bd",
|
||||
"tensor_count": 1,
|
||||
"type": "audit_providers.TinyModule",
|
||||
"weight_probe": [
|
||||
{
|
||||
"dtype": "torch.float32",
|
||||
"name": "proj.weight",
|
||||
"sample_sha256": "cfd5cd0554b977e5208296d4a63e8d2ec6f6cc9823321f2d242239432b7d472b",
|
||||
"shape": [
|
||||
2,
|
||||
2
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"latent_channels": 32,
|
||||
"patcher": {
|
||||
"model_type": "audit_providers.TinyModule",
|
||||
"state": {
|
||||
"model_options": {
|
||||
"transformer_options": {}
|
||||
},
|
||||
"object_patches": {},
|
||||
"patches": {},
|
||||
"wrappers": {}
|
||||
},
|
||||
"type": "comfy.model_patcher.ModelPatcher"
|
||||
},
|
||||
"runtime_observation": {
|
||||
"config_complete": true,
|
||||
"patcher_complete": true
|
||||
},
|
||||
"vae_dtype": "torch.float32",
|
||||
"wrapper_type": "audit_providers.SyntheticAudioVAE"
|
||||
}
|
||||
},
|
||||
"execution_semantics": {
|
||||
"continuation_transport": "masked_av_prefix_22_v1",
|
||||
"flf_execution": "terminal_merged_10s_seed_v2",
|
||||
"terminal_seed_policy": "physical_window_seed_v2"
|
||||
},
|
||||
"first_frame_hash": "ce95397885a93617f1e00a1e6c9a4b5a9c03411a8f2ef58762709df00b6e95d6",
|
||||
"height": 64,
|
||||
"model": {
|
||||
"graph_route": {
|
||||
"node": {
|
||||
"class_type": "UNETLoader",
|
||||
"inputs": {
|
||||
"unet_name": "audit_minimax_h3_fl2va.safetensors",
|
||||
"weight_dtype": "default"
|
||||
},
|
||||
"node_id": "model"
|
||||
},
|
||||
"output": 0
|
||||
},
|
||||
"runtime": {
|
||||
"base": "audit_core_payload.TinyCoreH3",
|
||||
"dtype": "torch.float32",
|
||||
"inner": "audit_providers.TinyModule",
|
||||
"legacy_fingerprint": "2acbeaa9b63a6cf12d7a1b88a1533c12cf5329df420822568eaea5a0bc59bcd4",
|
||||
"model_patcher": "comfy.model_patcher.ModelPatcher",
|
||||
"model_size": 16,
|
||||
"patches": {},
|
||||
"runtime_observation": {
|
||||
"patches_complete": true,
|
||||
"transformer_options_complete": true,
|
||||
"wrappers_complete": true
|
||||
},
|
||||
"transformer_options": {},
|
||||
"weight_probe": [
|
||||
{
|
||||
"dtype": "torch.float32",
|
||||
"name": "proj.weight",
|
||||
"sample_sha256": "f6bb1294da2f78cd935b01c7656280df5eaa0439e9d97bc03775825a41a508e4",
|
||||
"shape": [
|
||||
2,
|
||||
2
|
||||
]
|
||||
}
|
||||
],
|
||||
"wrappers": {}
|
||||
}
|
||||
},
|
||||
"reference_audio": {
|
||||
"combined_hash": "a55474f5b6c557a5eaf70e78a5341a49a39fd2b0cb717b5d08396645d6e2ded8",
|
||||
"count": 2,
|
||||
"items": [
|
||||
{
|
||||
"audio_index": 1,
|
||||
"reference_audio": {
|
||||
"combined_hash": "64a489714dfa65dc229ad059608cd6f488ba1b2d49e815fd71403bfd100f2452",
|
||||
"preprocess_version": 1,
|
||||
"reference_audio_contract_version": 1,
|
||||
"resampled_dtype": "torch.float32",
|
||||
"resampled_sha256": "7ad1bd40edaed4e0a4601dca856191e3002a8b09b8551ec74b81365faecf0548",
|
||||
"resampled_shape": [
|
||||
1,
|
||||
2,
|
||||
3200
|
||||
],
|
||||
"resolved_vae_sample_rate": 32000,
|
||||
"source_dtype": "torch.float32",
|
||||
"source_sample_rate": 32000,
|
||||
"source_sha256": "7ad1bd40edaed4e0a4601dca856191e3002a8b09b8551ec74b81365faecf0548",
|
||||
"source_shape": [
|
||||
1,
|
||||
2,
|
||||
3200
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"audio_index": 2,
|
||||
"reference_audio": {
|
||||
"combined_hash": "5b8b8a88f1a7b2adf9005a4e9c32625b493812bb37d33837ee4d99890adafe54",
|
||||
"preprocess_version": 1,
|
||||
"reference_audio_contract_version": 1,
|
||||
"resampled_dtype": "torch.float32",
|
||||
"resampled_sha256": "69ac770debe6804e3d5762f61896bc226f266f57b8398ea3bed3dc67fde92a8a",
|
||||
"resampled_shape": [
|
||||
1,
|
||||
2,
|
||||
3200
|
||||
],
|
||||
"resolved_vae_sample_rate": 32000,
|
||||
"source_dtype": "torch.float32",
|
||||
"source_sample_rate": 32000,
|
||||
"source_sha256": "69ac770debe6804e3d5762f61896bc226f266f57b8398ea3bed3dc67fde92a8a",
|
||||
"source_shape": [
|
||||
1,
|
||||
2,
|
||||
3200
|
||||
]
|
||||
}
|
||||
}
|
||||
],
|
||||
"reference_audio_bundle_contract_version": 1
|
||||
},
|
||||
"reference_audio_vae": {
|
||||
"graph_route": {
|
||||
"node": {
|
||||
"class_type": "H3ContinuumReferenceAudios",
|
||||
"inputs": {
|
||||
"reference_audio_vae": {
|
||||
"node": {
|
||||
"class_type": "VAELoader",
|
||||
"inputs": {
|
||||
"vae_name": "audit_audio_vae.safetensors"
|
||||
},
|
||||
"node_id": "audio_vae"
|
||||
},
|
||||
"output": 0
|
||||
}
|
||||
},
|
||||
"node_id": "audio_bundle"
|
||||
},
|
||||
"output": 0
|
||||
},
|
||||
"runtime": {
|
||||
"audio_sample_rate": 32000,
|
||||
"first_stage": {
|
||||
"parameter_count": 4,
|
||||
"parameter_layout_sha256": "bfc7a2fa460fae4eb803fa7bedfa5a2cb8c3c793902b65c1e7796159b92d79bd",
|
||||
"tensor_count": 1,
|
||||
"type": "audit_providers.TinyModule",
|
||||
"weight_probe": [
|
||||
{
|
||||
"dtype": "torch.float32",
|
||||
"name": "proj.weight",
|
||||
"sample_sha256": "cfd5cd0554b977e5208296d4a63e8d2ec6f6cc9823321f2d242239432b7d472b",
|
||||
"shape": [
|
||||
2,
|
||||
2
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"latent_channels": 32,
|
||||
"patcher": {
|
||||
"model_type": "audit_providers.TinyModule",
|
||||
"state": {
|
||||
"model_options": {
|
||||
"transformer_options": {}
|
||||
},
|
||||
"object_patches": {},
|
||||
"patches": {},
|
||||
"wrappers": {}
|
||||
},
|
||||
"type": "comfy.model_patcher.ModelPatcher"
|
||||
},
|
||||
"runtime_observation": {
|
||||
"config_complete": true,
|
||||
"patcher_complete": true
|
||||
},
|
||||
"vae_dtype": "torch.float32",
|
||||
"wrapper_type": "audit_providers.SyntheticAudioVAE"
|
||||
}
|
||||
},
|
||||
"reference_routing_contract_version": 1,
|
||||
"sampler": {
|
||||
"function": "torch._VariableFunctionsClass.add",
|
||||
"options": {
|
||||
"extra_options": {},
|
||||
"inpaint_options": {}
|
||||
},
|
||||
"type": "types.SimpleNamespace"
|
||||
},
|
||||
"sampling_contract_version": 5,
|
||||
"sigmas": {
|
||||
"dtype": "torch.float32",
|
||||
"exact_sha256": "be115d3ffbb025877d7320bd3b0b29cbe245f520f805091917a60169e7737659",
|
||||
"shape": [
|
||||
3
|
||||
]
|
||||
},
|
||||
"strict_compatibility": false,
|
||||
"upstream_graph": {
|
||||
"routes": {
|
||||
"audio_vae": {
|
||||
"node": {
|
||||
"class_type": "VAELoader",
|
||||
"inputs": {
|
||||
"vae_name": "audit_audio_vae.safetensors"
|
||||
},
|
||||
"node_id": "audio_vae"
|
||||
},
|
||||
"output": 0
|
||||
},
|
||||
"clip": {
|
||||
"node": {
|
||||
"class_type": "CLIPLoader",
|
||||
"inputs": {
|
||||
"clip_name": "audit_minimax_h3.safetensors",
|
||||
"type": "minimax"
|
||||
},
|
||||
"node_id": "clip"
|
||||
},
|
||||
"output": 0
|
||||
},
|
||||
"model": {
|
||||
"node": {
|
||||
"class_type": "UNETLoader",
|
||||
"inputs": {
|
||||
"unet_name": "audit_minimax_h3_fl2va.safetensors",
|
||||
"weight_dtype": "default"
|
||||
},
|
||||
"node_id": "model"
|
||||
},
|
||||
"output": 0
|
||||
},
|
||||
"reference_audio_vae": {
|
||||
"node": {
|
||||
"class_type": "H3ContinuumReferenceAudios",
|
||||
"inputs": {
|
||||
"reference_audio_vae": {
|
||||
"node": {
|
||||
"class_type": "VAELoader",
|
||||
"inputs": {
|
||||
"vae_name": "audit_audio_vae.safetensors"
|
||||
},
|
||||
"node_id": "audio_vae"
|
||||
},
|
||||
"output": 0
|
||||
}
|
||||
},
|
||||
"node_id": "audio_bundle"
|
||||
},
|
||||
"output": 0
|
||||
},
|
||||
"video_vae": {
|
||||
"node": {
|
||||
"class_type": "VAELoader",
|
||||
"inputs": {
|
||||
"vae_name": "audit_video_vae.safetensors"
|
||||
},
|
||||
"node_id": "video_vae"
|
||||
},
|
||||
"output": 0
|
||||
}
|
||||
},
|
||||
"sampler_class_type": "H3ContinuumSamplerV39",
|
||||
"sha256": "f7f6f31d4e90a07b040f2774b93ff2e405e0565f8443f3ff1fb5c546394f2ca3",
|
||||
"version": 3
|
||||
},
|
||||
"video_vae": {
|
||||
"graph_route": {
|
||||
"node": {
|
||||
"class_type": "VAELoader",
|
||||
"inputs": {
|
||||
"vae_name": "audit_video_vae.safetensors"
|
||||
},
|
||||
"node_id": "video_vae"
|
||||
},
|
||||
"output": 0
|
||||
},
|
||||
"runtime": {
|
||||
"chunked_io": false,
|
||||
"downscale_ratio": 16,
|
||||
"first_stage": {
|
||||
"parameter_count": 4,
|
||||
"parameter_layout_sha256": "bfc7a2fa460fae4eb803fa7bedfa5a2cb8c3c793902b65c1e7796159b92d79bd",
|
||||
"tensor_count": 1,
|
||||
"type": "audit_providers.TinyModule",
|
||||
"weight_probe": [
|
||||
{
|
||||
"dtype": "torch.float32",
|
||||
"name": "proj.weight",
|
||||
"sample_sha256": "24c60715698663563d76ecaf262778712879423eb057d12b74a037150009d619",
|
||||
"shape": [
|
||||
2,
|
||||
2
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"latent_channels": 24,
|
||||
"patcher": {
|
||||
"model_type": "audit_providers.TinyModule",
|
||||
"state": {
|
||||
"model_options": {
|
||||
"transformer_options": {}
|
||||
},
|
||||
"object_patches": {},
|
||||
"patches": {},
|
||||
"wrappers": {}
|
||||
},
|
||||
"type": "comfy.model_patcher.ModelPatcher"
|
||||
},
|
||||
"required": true,
|
||||
"runtime_observation": {
|
||||
"config_complete": true,
|
||||
"patcher_complete": true
|
||||
},
|
||||
"upscale_ratio": 16,
|
||||
"vae_dtype": "torch.float32",
|
||||
"wrapper_type": "audit_providers.SyntheticVideoVAE"
|
||||
}
|
||||
},
|
||||
"width": 64
|
||||
},
|
||||
"last_frame_hash": "6bc13118765285cba097403c4b340bac0e550599fb27a1b415ffc88fc6237daa",
|
||||
"nonce_lifecycle": {
|
||||
"effective_nonce": 0,
|
||||
"lineage_sha256": "2dbba4b61863fde2a8d74a75dae4b563e7b79484a2ff678d0cbd333e504cf158",
|
||||
"mode": "inactive",
|
||||
"request_sha256": "55c6f2d10dbe9abae01443bac060ba1d56d583d0f80e5f3cfc586cef54a65fcd",
|
||||
"requested_nonce": 0
|
||||
},
|
||||
"nonce_lineage_sha256": "2dbba4b61863fde2a8d74a75dae4b563e7b79484a2ff678d0cbd333e504cf158",
|
||||
"nonce_request_sha256": "55c6f2d10dbe9abae01443bac060ba1d56d583d0f80e5f3cfc586cef54a65fcd",
|
||||
"prompt_hashes": [
|
||||
"5dec1ecc3f0d6f846562049c0a4968da02cbbb43113feb87a95cfd6d6691be07",
|
||||
"5dec1ecc3f0d6f846562049c0a4968da02cbbb43113feb87a95cfd6d6691be07",
|
||||
"5dec1ecc3f0d6f846562049c0a4968da02cbbb43113feb87a95cfd6d6691be07",
|
||||
"5dec1ecc3f0d6f846562049c0a4968da02cbbb43113feb87a95cfd6d6691be07"
|
||||
],
|
||||
"prompt_mode": "Fixed — one prompt",
|
||||
"reference_group_contracts": [
|
||||
{
|
||||
"descriptor": {
|
||||
"effective_prompt_sha256": "4de5a7dfe7c4a22a4f42e26d525e5175d90a85fe6eaa1a093663f3e5bf8ad6b1",
|
||||
"first_anchor": "ce95397885a93617f1e00a1e6c9a4b5a9c03411a8f2ef58762709df00b6e95d6",
|
||||
"last_anchor": "6bc13118765285cba097403c4b340bac0e550599fb27a1b415ffc88fc6237daa",
|
||||
"logical_chunks": [
|
||||
1
|
||||
],
|
||||
"physical_group": 1,
|
||||
"picture_order": [
|
||||
"first_frame",
|
||||
"last_frame",
|
||||
"R1"
|
||||
],
|
||||
"picture_presentation_version": 1,
|
||||
"reference_preprocess_version": 1,
|
||||
"reference_size_mode": "Match Output",
|
||||
"references": [
|
||||
{
|
||||
"picture_number": 3,
|
||||
"prepared_sha256": "4e2f68facb219819b6b0ba6c2c48f37a64b02ae159aef772e2e5d1dea15a3e62",
|
||||
"source_slot_id": "R1"
|
||||
}
|
||||
],
|
||||
"terminal_atomic": false,
|
||||
"terminal_prompt_policy": null,
|
||||
"version": 1
|
||||
},
|
||||
"sha256": "ac4a88fbfb79802981cae2f4ce7b3befcfc5b40fa14f1cd9d03852a2e7a4678f"
|
||||
},
|
||||
{
|
||||
"descriptor": {
|
||||
"effective_prompt_sha256": "4de5a7dfe7c4a22a4f42e26d525e5175d90a85fe6eaa1a093663f3e5bf8ad6b1",
|
||||
"first_anchor": "ce95397885a93617f1e00a1e6c9a4b5a9c03411a8f2ef58762709df00b6e95d6",
|
||||
"last_anchor": "6bc13118765285cba097403c4b340bac0e550599fb27a1b415ffc88fc6237daa",
|
||||
"logical_chunks": [
|
||||
2
|
||||
],
|
||||
"physical_group": 2,
|
||||
"picture_order": [
|
||||
"first_frame",
|
||||
"last_frame",
|
||||
"R1"
|
||||
],
|
||||
"picture_presentation_version": 1,
|
||||
"reference_preprocess_version": 1,
|
||||
"reference_size_mode": "Match Output",
|
||||
"references": [
|
||||
{
|
||||
"picture_number": 3,
|
||||
"prepared_sha256": "4e2f68facb219819b6b0ba6c2c48f37a64b02ae159aef772e2e5d1dea15a3e62",
|
||||
"source_slot_id": "R1"
|
||||
}
|
||||
],
|
||||
"terminal_atomic": false,
|
||||
"terminal_prompt_policy": null,
|
||||
"version": 1
|
||||
},
|
||||
"sha256": "24824ce6a4f406415e52b1909270780063bece5f97fc3fdb2e844d40878afdbe"
|
||||
},
|
||||
{
|
||||
"descriptor": {
|
||||
"effective_prompt_sha256": "4de5a7dfe7c4a22a4f42e26d525e5175d90a85fe6eaa1a093663f3e5bf8ad6b1",
|
||||
"first_anchor": "ce95397885a93617f1e00a1e6c9a4b5a9c03411a8f2ef58762709df00b6e95d6",
|
||||
"last_anchor": "6bc13118765285cba097403c4b340bac0e550599fb27a1b415ffc88fc6237daa",
|
||||
"logical_chunks": [
|
||||
3,
|
||||
4
|
||||
],
|
||||
"physical_group": 3,
|
||||
"picture_order": [
|
||||
"first_frame",
|
||||
"last_frame",
|
||||
"R1"
|
||||
],
|
||||
"picture_presentation_version": 1,
|
||||
"reference_preprocess_version": 1,
|
||||
"reference_size_mode": "Match Output",
|
||||
"references": [
|
||||
{
|
||||
"picture_number": 3,
|
||||
"prepared_sha256": "4e2f68facb219819b6b0ba6c2c48f37a64b02ae159aef772e2e5d1dea15a3e62",
|
||||
"source_slot_id": "R1"
|
||||
}
|
||||
],
|
||||
"terminal_atomic": true,
|
||||
"terminal_prompt_policy": "shared_prompt_v1",
|
||||
"version": 1
|
||||
},
|
||||
"sha256": "b9fcc63b033a0cdf334e68dad74f77ac87ff5e1f8c3b346aa5879411856f62da"
|
||||
}
|
||||
],
|
||||
"reroll_from_chunk": 0
|
||||
},
|
||||
"contract_sha256": "f5a4b7ec0041d5f51731148aae29b228608c1904aa7b3d922764697dc97daf46",
|
||||
"created_utc": "2026-10-03T15:37:36+00:00",
|
||||
"effective_reroll_nonce": 0,
|
||||
"nonce_lifecycle": {
|
||||
"effective_nonce": 0,
|
||||
"lineage_sha256": "2dbba4b61863fde2a8d74a75dae4b563e7b79484a2ff678d0cbd333e504cf158",
|
||||
"mode": "inactive",
|
||||
"request_sha256": "55c6f2d10dbe9abae01443bac060ba1d56d583d0f80e5f3cfc586cef54a65fcd",
|
||||
"requested_nonce": 0
|
||||
},
|
||||
"reference_routing_audit": {
|
||||
"requested_routes": [
|
||||
[
|
||||
"R1"
|
||||
],
|
||||
[
|
||||
"R1"
|
||||
],
|
||||
[
|
||||
"R1"
|
||||
]
|
||||
],
|
||||
"routing_config_sha256": "a3b1b8850a2c72eaa4e7c6c4f2697bb8bd6194091b677e5267338236e298734e",
|
||||
"version": 1
|
||||
},
|
||||
"report_summary": "H3 Continuum V3 3.9.0\nConditioning mode: Hybrid FL2VA + Reference + Continuation.\nPrompt plan: Fixed — one prompt; 4 chunks; 1 unique prompt(s); 5.000s per chunk. Auto detected Fixed.\nPrompt Preflight: OK.\nDecode: external ComfyUI Core VAE nodes; full raw AV chunks retained.\naccelerator markers not detected (informational only); Continuum APPLY_MODEL wrapper installed\nExecution: conditioning precomputed; single call-local MODEL clone per chunk; no internal VAE decode.\nDriving Audio: absolute-time guide slices enabled; original audio is preserved for final output.\nReference Audio conditioning: 2 ordered item(s); persistent across all chunks.\nV3.9 Custom Reference routing: group-local conditioning and complete-group saved-prefix verification; the verified effective Plan is available after Queue.\nFLF execution: terminal merged 10s seed v2; the final two 5-second logical chunks share one physical sample and are split back into normal chunk entries.\nresuming after accepted chunk 1\nPhysical review execution: 1 new physical group(s) completed; 2/4 logical chunks available.\nSession e03555e8: 2 chunks, 243 retained frames, 1 reused, 64x64.\nOutput: 2 raw AV latent chunk(s); connect Core VAE Decode nodes, then H3 Continuum Assemble V3.\nDecode preview: Chunk 2\nReference Plan Inspector (last Queue, runtime verified)\nMode: custom; accepted chunks: 2\nConnected: R1\nGroup 1 [C1] reused — R1=<Picture 3>; contract=ac4a88fbfb79\nGroup 2 [C2] generated — R1=<Picture 3>; contract=24824ce6a4f4\nGroup 3 [C3,4] pending — configured R1\nRun Storage: run_00bb27779f215038a7eb1845979fdd7c / revision d8352287737286e5; 1 reused, 1 generated, 4 total; resume=2; nonce=0 (inactive).\nWarning: Review is incomplete. Second Pass refinement of a partial review sequence is not yet supported.",
|
||||
"resume_disabled_reasons": [],
|
||||
"resume_safe": true,
|
||||
"review_control_version": 1,
|
||||
"review_pause_reason": "review_each_chunk",
|
||||
"review_unit": {
|
||||
"end": 2,
|
||||
"physical_group": 2,
|
||||
"start": 2
|
||||
},
|
||||
"revision_id": "d8352287737286e5",
|
||||
"run_name": "run_00bb27779f215038a7eb1845979fdd7c",
|
||||
"run_storage_schema_version": 3,
|
||||
"sampling_contract_version": 5,
|
||||
"sampling_revision_id": "f5a4b7ec0041d5f5",
|
||||
"session_id": "e03555e805774b9eb22b7d2eae44268c",
|
||||
"status": "review_ready",
|
||||
"updated_utc": "2026-10-03T15:37:37+00:00"
|
||||
}
|
||||
@@ -11,6 +11,7 @@ function project(n=1,total=3,id='r1',run='fixture') {
|
||||
let parent=null;
|
||||
const groups=Array.from({length:n},(_,i)=>{
|
||||
const g={revision_id:`${id}-g${i+1}`,parent_revision_id:parent,lineage_sha256:'lineage',
|
||||
sampling_contract_version:6,generation_reusable:true,
|
||||
revision_order:String(i+1),take_number:1,group:{start:i+1,end:i+1,physical_group:i+1}};
|
||||
parent=g.revision_id;return g;
|
||||
});
|
||||
@@ -19,6 +20,7 @@ function project(n=1,total=3,id='r1',run='fixture') {
|
||||
canonical_chain:groups.map(g=>g.revision_id),
|
||||
active_revisions:Object.fromEntries(groups.map(g=>[String(g.group.physical_group),g.revision_id])),
|
||||
group_revisions:groups,revisions:[{revision_id:id,status:n===total?'complete':'review_ready',
|
||||
sampling_contract_version:6,generation_reusable:true,
|
||||
updated_utc:`2026-09-08T00:00:0${n}Z`,review_unit:{start:n,end:n,physical_group:n}}]};
|
||||
}
|
||||
function environment() {
|
||||
@@ -464,8 +466,8 @@ await test('mode policy and transient UI serialization remain stable',async e=>{
|
||||
});
|
||||
await test('history catalog preserves lineage eligibility and compact summary',async e=>{
|
||||
const n=e.makeNode();e.w(n,'generation_mode').value='Review Each Chunk';const p=project(3,3);
|
||||
p.group_revisions.push({revision_id:'old',lineage_sha256:'other',group:{start:1,end:1,physical_group:1}},
|
||||
{revision_id:'orphan',parent_revision_id:'missing',lineage_sha256:'lineage',group:{start:2,end:2,physical_group:2}});
|
||||
p.group_revisions.push({revision_id:'old',lineage_sha256:'other',sampling_contract_version:6,generation_reusable:true,group:{start:1,end:1,physical_group:1}},
|
||||
{revision_id:'orphan',parent_revision_id:'missing',lineage_sha256:'lineage',sampling_contract_version:6,generation_reusable:true,group:{start:2,end:2,physical_group:2}});
|
||||
await e.load(n,p);assert.equal(e.f.takeCatalog(n).length,3);
|
||||
e.w(n,'Render History').callback();const body=e.w(n,'Render History / Takes');
|
||||
assert(body.computeSize(400)[1]<=124);const drawn=[];
|
||||
@@ -675,5 +677,25 @@ await test('failed graph load releases hydration gate for subsequent manual node
|
||||
await n.__h3ContinuumConfigurePending?.promise;await n.__h3ContinuumHistoryRequest?.promise;await sleep();
|
||||
assert(e.visible(n,'Use it and continue'));
|
||||
});
|
||||
await test('Sampling v5 history stays visible and actions remain read-only',async e=>{
|
||||
const p=project(2);for(const item of [...p.group_revisions,...p.revisions]){
|
||||
item.sampling_contract_version=5;item.generation_reusable=false;
|
||||
}
|
||||
const n=e.makeNode();await e.load(n,p);
|
||||
assert.equal(e.f.takeCatalog(n).length,2);
|
||||
assert.match(e.f.reviewStatus(n),/read-only/);
|
||||
const before=[e.w(n,'take_action').value,e.w(n,'take_revision_id').value];
|
||||
e.f.selectTakeAction(n,'Use This Take');
|
||||
assert.deepEqual([e.w(n,'take_action').value,e.w(n,'take_revision_id').value],before);
|
||||
assert(!e.visible(n,'Use it and continue'));
|
||||
});
|
||||
await test('archived v5 lineage remains browsable after a v6 canonical run',async e=>{
|
||||
const old=project(2,'fixture',3,'old');for(const item of old.group_revisions){
|
||||
item.sampling_contract_version=5;item.generation_reusable=false;item.lineage_sha256='old-lineage';
|
||||
}
|
||||
const current=project(1);current.group_revisions.push(...old.group_revisions);
|
||||
const n=e.makeNode();await e.load(n,current);
|
||||
assert.equal(e.f.takeCatalog(n).length,3);
|
||||
});
|
||||
console.log(JSON.stringify(results,null,2));if(results.some(r=>!r.pass))process.exitCode=1;
|
||||
})();
|
||||
|
||||
@@ -25,7 +25,7 @@ def test_v3_reference_video_imports_the_shared_temporal_helper():
|
||||
def test_reference_bundle_fingerprint_ignores_unused_legacy_vae():
|
||||
graph = {
|
||||
"1": {"class_type": "H3ContinuumSamplerV38", "inputs": {
|
||||
"model": ["2", 0], "clip": ["3", 0],
|
||||
"model": ["2", 0], "clip": ["3", 0], "sampler": ["8", 0],
|
||||
"audio_references": ["4", 0], "reference_audio_vae": ["5", 0]}},
|
||||
"2": {"class_type": "UNETLoader", "inputs": {"unet_name": "model"}},
|
||||
"3": {"class_type": "CLIPLoader", "inputs": {"clip_name": "clip"}},
|
||||
@@ -34,6 +34,7 @@ def test_reference_bundle_fingerprint_ignores_unused_legacy_vae():
|
||||
"5": {"class_type": "VAELoader", "inputs": {"vae_name": "unused"}},
|
||||
"6": {"class_type": "VAELoader", "inputs": {"vae_name": "active"}},
|
||||
"7": {"class_type": "LoadAudio", "inputs": {"audio": "voice.wav"}},
|
||||
"8": {"class_type": "KSamplerSelect", "inputs": {"sampler_name": "euler"}},
|
||||
}
|
||||
|
||||
def contract(value):
|
||||
|
||||
@@ -6,7 +6,7 @@ import tomllib
|
||||
|
||||
|
||||
ROOT = Path(__file__).resolve().parents[1]
|
||||
EXPECTED_VERSION = "3.9.0"
|
||||
EXPECTED_VERSION = "3.9.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.9.0"' in version_source
|
||||
assert 'PACKAGE_VERSION = "3.9.1"' in version_source
|
||||
|
||||
@@ -990,10 +990,11 @@ def _prompt_graph(model_name="minimax_h3_fl2va.safetensors"):
|
||||
"class_type": "VAELoader",
|
||||
"inputs": {"vae_name": "minimax_h3_video_vae_fp16.safetensors"},
|
||||
},
|
||||
"42": {
|
||||
"class_type": "H3ContinuumSamplerProduction",
|
||||
"inputs": {"model": ["12", 0], "clip": ["20", 0], "video_vae": ["30", 0]},
|
||||
},
|
||||
"42": {
|
||||
"class_type": "H3ContinuumSamplerProduction",
|
||||
"inputs": {"model": ["12", 0], "clip": ["20", 0], "video_vae": ["30", 0], "sampler": ["40", 0]},
|
||||
},
|
||||
"40": {"class_type": "KSamplerSelect", "inputs": {"sampler_name": "euler"}},
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -261,11 +261,13 @@ def test_run_storage_graph_contract_fingerprints_helper_vae_and_sources():
|
||||
"inputs": {
|
||||
"model": ["model", 0],
|
||||
"clip": ["clip", 0],
|
||||
"sampler": ["ksampler", 0],
|
||||
"audio_references": ["refs", 0],
|
||||
},
|
||||
},
|
||||
"model": {"class_type": "UNETLoader", "inputs": {"name": "model.safetensors"}},
|
||||
"clip": {"class_type": "CLIPLoader", "inputs": {"name": "text.safetensors"}},
|
||||
"ksampler": {"class_type": "KSamplerSelect", "inputs": {"sampler_name": "euler"}},
|
||||
"refs": {
|
||||
"class_type": "H3ContinuumReferenceAudios",
|
||||
"inputs": {
|
||||
|
||||
@@ -424,12 +424,14 @@ setTimeout(async () => {{
|
||||
canonical_storage_revision_id: "storage-ready",
|
||||
revisions: [{{
|
||||
revision_id: "storage-ready", status: "review_ready",
|
||||
sampling_contract_version: 6, generation_reusable: true,
|
||||
review_unit: {{ start: 1, end: 1, physical_group: 1 }},
|
||||
}}],
|
||||
canonical_head_revision_id: "take-1",
|
||||
active_revisions: {{ "1": "take-1" }},
|
||||
group_revisions: [{{
|
||||
revision_id: "take-1", revision_order: "1",
|
||||
sampling_contract_version: 6, generation_reusable: true,
|
||||
group: {{ start: 1, end: 1, physical_group: 1 }},
|
||||
}}],
|
||||
}};
|
||||
|
||||
@@ -89,6 +89,7 @@ def _contract(
|
||||
) -> dict:
|
||||
global_contract = {
|
||||
"sampling_contract_version": SAMPLING_CONTRACT_VERSION,
|
||||
"runtime_signature_version": 1,
|
||||
"conditioning_mode": "t2va",
|
||||
"width": 96,
|
||||
"height": 64,
|
||||
@@ -435,6 +436,7 @@ def test_rr_r5_selected_foreign_take_requires_whole_compatible_prefix(tmp_path):
|
||||
"chunks": [],
|
||||
}
|
||||
controller._write_manifest()
|
||||
controller.resume_safe = True
|
||||
imported = controller._adopt_plan_prefix(controller._plan_import)
|
||||
assert len(imported) == 2
|
||||
assert all(record["storage_revision_id"] == controller.revision_id for record in imported)
|
||||
|
||||
@@ -0,0 +1,157 @@
|
||||
"""Real conditioning/Second Pass contracts for V3.9 output-scope projection."""
|
||||
from copy import deepcopy
|
||||
|
||||
import pytest
|
||||
import torch
|
||||
|
||||
from ComfyUI_H3_Continuum_Join.v3 import driving_nodes
|
||||
from ComfyUI_H3_Continuum_Join.v3 import refine_context as rc
|
||||
from ComfyUI_H3_Continuum_Join.v3.reference_storage_contract import canonical_sha256
|
||||
from ComfyUI_H3_Continuum_Join.v3.second_pass import run_second_pass_groups
|
||||
|
||||
|
||||
def fixture(chunks=((1,), (2,), (3,)), captured=2, selected=(0, 1)):
|
||||
groups, plans, routes = [], [], []
|
||||
for index, logical in enumerate(chunks):
|
||||
descriptor = {"physical_group": index + 1, "logical_chunks": list(logical),
|
||||
"references": [{"source_slot_id": "R1", "picture_number": 2}]}
|
||||
route = {"descriptor": descriptor, "sha256": canonical_sha256(descriptor)}
|
||||
if index < captured:
|
||||
groups.append(rc.make_refine_group(
|
||||
conditioning=[[torch.full((1, 1, 2), float(index + 1)), {
|
||||
"minimax_frame_count": 124,
|
||||
"minimax_keyframes": [{"audio_latent": torch.ones(1, 32, 2, 7)}],
|
||||
}]], group_id=index, logical_chunks=logical, physical_frames=124,
|
||||
prompt_policy="single", physical_prompt=f"prompt {index + 1}",
|
||||
source_video_shape=(1, 24, 37, 2, 3), physical_clip_index=logical[0],
|
||||
context_frames=0 if index == 0 else 22,
|
||||
reference_routing_group_contract=route,
|
||||
))
|
||||
plans.append({
|
||||
"group_id": index, "logical_chunks": list(logical), "physical_frames": 124,
|
||||
"physical_prompt": f"prompt {index + 1}", "prompt_policy": "single",
|
||||
"trim_prefix_frames": 0 if index == 0 else 22,
|
||||
"terminal_merged": len(logical) == 2, "source_width": 48, "source_height": 32,
|
||||
"source_batch": 1, "latent_channels": 24, "source_latent_t": 37,
|
||||
"source_latent_h": 2, "source_latent_w": 3, "source_audio_shape": [1, 8, 148],
|
||||
})
|
||||
routes.append({"physical_group": index + 1, "logical_chunks": list(logical),
|
||||
"status": "reused" if index < captured else "pending",
|
||||
"requested_slots": ["R1"], "warnings": [],
|
||||
**({"contract_sha256": route["sha256"], "descriptor": descriptor}
|
||||
if index < captured else {})})
|
||||
context = rc.make_refine_context(groups, source_width=48, source_height=32,
|
||||
conditioning_mode="t2va", complete=captured == len(chunks))
|
||||
plan = {"width": 48, "height": 32,
|
||||
"second_pass_contract": {"version": 1, "physical_groups": [
|
||||
{**plans[index], "group_id": position} for position, index in enumerate(selected)]},
|
||||
"reference_routing_v1": {"mode": "custom", "accepted_chunks": captured,
|
||||
"connected_slots": ["R1"], "groups": routes}}
|
||||
return context, plan
|
||||
|
||||
|
||||
@pytest.mark.parametrize("selected", [(0,), (0, 1), (1,)])
|
||||
def test_partial_views_are_complete_for_output_without_completing_sequence(selected):
|
||||
source, plan = fixture(selected=selected)
|
||||
view = rc.project_refine_context(source, plan)
|
||||
assert source["complete"] is view["complete"] is False
|
||||
assert rc.OUTPUT_SCOPE_KEY not in source
|
||||
assert view[rc.OUTPUT_SCOPE_KEY]["source_group_ids"] == selected
|
||||
assert rc.validate_refine_context(view, assembly_plan=plan) is view
|
||||
for local_index, source_index in enumerate(selected):
|
||||
assert view["groups"][local_index]["group_id"] == local_index
|
||||
assert view["groups"][local_index]["physical_clip_index"] == source_index + 1
|
||||
assert view["groups"][local_index]["conditioning"] is source["groups"][source_index]["conditioning"]
|
||||
|
||||
|
||||
def test_complete_full_output_is_exact_context_passthrough():
|
||||
context, plan = fixture(captured=3, selected=(0, 1, 2))
|
||||
assert rc.project_refine_context(context, plan) is context
|
||||
|
||||
|
||||
def test_terminal_pair_is_one_physical_scope():
|
||||
source, plan = fixture(chunks=((1,), (2, 3), (4,)), selected=(1,))
|
||||
view = rc.project_refine_context(source, plan)
|
||||
assert view["groups"][0]["logical_chunks"] == (2, 3)
|
||||
broken = deepcopy(plan)
|
||||
broken["second_pass_contract"]["physical_groups"][0]["logical_chunks"] = [2]
|
||||
assert rc.project_refine_context(source, broken) is source
|
||||
|
||||
|
||||
def test_missing_capture_keeps_optional_fallback():
|
||||
source, plan = fixture(captured=1)
|
||||
assert rc.project_refine_context(source, plan) is source
|
||||
|
||||
|
||||
@pytest.mark.parametrize("field,value", [
|
||||
("physical_frames", 125), ("physical_prompt", "different"),
|
||||
("trim_prefix_frames", 23), ("source_latent_t", 38), ("source_latent_w", 4),
|
||||
])
|
||||
def test_mismatched_partial_evidence_is_diagnostic_not_a_new_stop(field, value):
|
||||
source, plan = fixture(selected=(1,))
|
||||
plan["second_pass_contract"]["physical_groups"][0][field] = value
|
||||
result = rc.project_refine_context(source, plan)
|
||||
assert rc.OUTPUT_SCOPE_KEY not in result
|
||||
assert result["complete"] is False
|
||||
assert any("Output scope unavailable:" in note for note in result["notes"])
|
||||
|
||||
|
||||
@pytest.mark.parametrize("corruption", ["hash", "duplicate", "pending"])
|
||||
def test_reference_identity_cannot_be_guessed_by_local_group_index(corruption):
|
||||
source, plan = fixture(selected=(1,))
|
||||
routes = plan["reference_routing_v1"]["groups"]
|
||||
if corruption == "hash":
|
||||
routes[1]["contract_sha256"] = "0" * 64
|
||||
elif corruption == "duplicate":
|
||||
routes.append(deepcopy(routes[1]))
|
||||
else:
|
||||
routes[1].pop("descriptor")
|
||||
view = rc.project_refine_context(source, plan)
|
||||
assert rc.OUTPUT_SCOPE_KEY not in view
|
||||
|
||||
|
||||
def test_projected_context_is_still_revalidated_at_second_pass_boundary():
|
||||
source, plan = fixture(selected=(1,))
|
||||
view = rc.project_refine_context(source, plan)
|
||||
plan["second_pass_contract"]["physical_groups"][0]["physical_prompt"] = "changed"
|
||||
with pytest.raises(rc.RefineContextError, match="physical_prompt"):
|
||||
rc.validate_refine_context(view, assembly_plan=plan)
|
||||
|
||||
|
||||
def test_chunk_two_actual_second_pass_uses_its_conditions_and_preserves_audio():
|
||||
source, plan = fixture(selected=(1,))
|
||||
view = rc.project_refine_context(source, plan)
|
||||
video = {"samples": torch.zeros(1, 24, 37, 2, 3)}
|
||||
audio = {"samples": torch.ones(1, 8, 148)}
|
||||
calls = []
|
||||
def sample(**kwargs):
|
||||
calls.append(kwargs["conditioning"])
|
||||
return kwargs["latent"]
|
||||
_video, output_audio, updated, report = run_second_pass_groups(
|
||||
model=object(), clip=object(), sampler=object(), sigmas=torch.tensor([.2, 0.]),
|
||||
video_latents=[video], audio_latents=[audio], assembly_plan=plan,
|
||||
refine_seed=123, refine_context=view,
|
||||
encode_prompt_fn=lambda *args, **kwargs: pytest.fail("must not reencode prompt alone"),
|
||||
clone_model_fn=lambda model, **kwargs: model,
|
||||
latent_builder=lambda v, a: {"video": v, "audio": a},
|
||||
sample_fn=sample, stream_extractor=lambda latent: (latent["video"], latent["audio"]),
|
||||
)
|
||||
assert float(calls[0][0][0][0, 0, 0]) == 2.0
|
||||
assert output_audio[0] is audio
|
||||
assert updated["second_pass_contract"]["reference_inheritance"][0]["status"] == "verified"
|
||||
assert "conditioning_source=refine_context" in report
|
||||
assert "prompt_only_fallback" not in report
|
||||
assert source["groups"][1]["group_id"] == 1
|
||||
|
||||
|
||||
def test_v39_boundary_projects_only_its_runtime_output(monkeypatch):
|
||||
source, plan = fixture(selected=(1,))
|
||||
from ComfyUI_H3_Continuum_Join.v3.nodes import _PARTIAL_REVIEW_SECOND_PASS_WARNING
|
||||
old = (object(), object(), plan, _PARTIAL_REVIEW_SECOND_PASS_WARNING, object(), source)
|
||||
monkeypatch.setattr(driving_nodes.H3ContinuumSamplerV38, "run", lambda *args, **kwargs: old)
|
||||
result = driving_nodes.H3ContinuumSamplerV39().run(chunks=3)["result"]
|
||||
assert result[:3] == old[:3]
|
||||
assert result[4] is old[4]
|
||||
assert result[5][rc.OUTPUT_SCOPE_KEY]["source_group_ids"] == (1,)
|
||||
assert "output-scope conditioning verified" in result[3]
|
||||
assert old[3] == _PARTIAL_REVIEW_SECOND_PASS_WARNING
|
||||
@@ -0,0 +1,42 @@
|
||||
import pytest
|
||||
import torch
|
||||
from ComfyUI_H3_Continuum_Join.v3 import refine_context as rc
|
||||
|
||||
def group(keyframe):
|
||||
return rc.make_refine_group(
|
||||
group_id=0,logical_chunks=[1],physical_frames=124,prompt_policy='single',
|
||||
physical_prompt='prompt',source_video_shape=(1,24,37,2,3),
|
||||
physical_clip_index=1,context_frames=0,first_image=None,last_image=None,
|
||||
conditioning=[[torch.zeros(1,2,3),{'minimax_keyframes':[keyframe]}]],
|
||||
)
|
||||
|
||||
@pytest.mark.parametrize('resize',[False,True])
|
||||
@pytest.mark.parametrize('kind',['audio','video','mixed'])
|
||||
def test_modalities_preserve_audio_and_frozen_source(kind,resize):
|
||||
keyframe={'resolved_frame_index':0}
|
||||
if kind!='video': keyframe['audio_latent']=torch.arange(32*2*7).reshape(1,32,2,7).float()
|
||||
if kind!='audio': keyframe['latent']=torch.ones(1,24,1,2,3)
|
||||
source=group(keyframe)
|
||||
frozen=source['conditioning'][0][1]['minimax_keyframes'][0]
|
||||
before={k:v.clone() for k,v in frozen.items() if torch.is_tensor(v)}
|
||||
result,stats=rc.adapt_group_conditioning(source,4 if resize else 2,6 if resize else 3)
|
||||
actual=result[0][1]['minimax_keyframes'][0]
|
||||
assert actual is not frozen
|
||||
assert actual['resolved_frame_index']==0
|
||||
if kind!='video':
|
||||
assert actual['audio_latent'] is frozen['audio_latent']
|
||||
assert torch.equal(actual['audio_latent'],before['audio_latent'])
|
||||
if kind=='audio':
|
||||
assert 'latent' not in actual
|
||||
assert stats['keyframes_resized']==0
|
||||
else:
|
||||
assert actual['latent'].shape[-2:]==((4,6) if resize else (2,3))
|
||||
for k,v in before.items(): assert torch.equal(frozen[k],v)
|
||||
|
||||
@pytest.mark.parametrize('payload',[{}, {'latent':torch.zeros(1,2,3)},
|
||||
{'audio_latent':torch.zeros(1,2)},
|
||||
{'latent':torch.zeros(1,2,3),'audio_latent':torch.zeros(1,32,2,7)},
|
||||
{'latent':torch.zeros(1,24,1,2,3),'audio_latent':'broken'}])
|
||||
def test_invalid_payload_is_not_hidden_by_another_modality(payload):
|
||||
with pytest.raises(rc.RefineConditioningAdaptationError):
|
||||
rc.adapt_group_conditioning(group({'resolved_frame_index':0,**payload}),4,6)
|
||||
@@ -0,0 +1,225 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import copy
|
||||
import functools
|
||||
import hashlib
|
||||
import json
|
||||
from pathlib import Path
|
||||
import shutil
|
||||
from types import SimpleNamespace
|
||||
|
||||
import pytest
|
||||
|
||||
from ComfyUI_H3_Continuum_Join import run_storage as storage
|
||||
from ComfyUI_H3_Continuum_Join.graph_contract import build_upstream_graph_contract
|
||||
from ComfyUI_H3_Continuum_Join.v3.review_control import (
|
||||
GENERATION_MODE_REVIEW, REVIEW_ACTION_CONTINUE, REVIEW_ACTION_REGENERATE_CURRENT,
|
||||
ReviewControlError,
|
||||
)
|
||||
from . import test_v31_run_storage as signatures
|
||||
from . import test_v38_review_run_storage as review
|
||||
|
||||
|
||||
def closure(gain):
|
||||
def sample(x=None, **kwargs):
|
||||
return x * gain
|
||||
return sample
|
||||
|
||||
|
||||
@pytest.mark.parametrize("option", [
|
||||
"sampler_cfg_function", "sampler_pre_cfg_function", "sampler_post_cfg_function",
|
||||
"model_function_wrapper", "denoise_mask_function",
|
||||
])
|
||||
def test_model_hook_changes_are_observed(option):
|
||||
model = signatures._Model()
|
||||
model.model_options[option] = closure(1)
|
||||
before, safe = storage._model_signature(model, "base")
|
||||
model.model_options[option] = closure(2)
|
||||
after, after_safe = storage._model_signature(model, "base")
|
||||
assert safe and after_safe
|
||||
assert before != after
|
||||
|
||||
|
||||
def test_cfg1_and_internal_join_context():
|
||||
model = signatures._Model()
|
||||
before, safe = storage._model_signature(model, "base")
|
||||
model.model_options["disable_cfg1_optimization"] = True
|
||||
after, safe_after = storage._model_signature(model, "base")
|
||||
assert safe and safe_after and before != after
|
||||
model.model_options["transformer_options"] = {"h3_continuum_join_context": object()}
|
||||
join, safe_join = storage._model_signature(model, "base")
|
||||
model.model_options["transformer_options"] = {}
|
||||
clean, safe_clean = storage._model_signature(model, "base")
|
||||
assert safe_join and safe_clean and join == clean
|
||||
|
||||
|
||||
def test_sampler_closure_only_changes_identity_with_graph_unchanged():
|
||||
graph, graph_safe, _ = build_upstream_graph_contract(
|
||||
signatures._prompt_graph(), "42", require_video_vae=True,
|
||||
)
|
||||
model, clip, vae = signatures._Model(), signatures._Clip(), signatures._VideoVAE()
|
||||
sampler = SimpleNamespace(sampler_function=closure(1), extra_options={}, inpaint_options={})
|
||||
kwargs = dict(model=model, clip=clip, video_vae=vae, sampler=sampler,
|
||||
upstream_graph_contract=graph, upstream_graph_safe=graph_safe)
|
||||
before, safe, _ = signatures._sampling_contract(**kwargs)
|
||||
sampler.sampler_function = closure(2)
|
||||
after, after_safe, _ = signatures._sampling_contract(**kwargs)
|
||||
assert safe and after_safe
|
||||
assert before["global"]["upstream_graph"] == after["global"]["upstream_graph"]
|
||||
assert storage.revision_identity(before) != storage.revision_identity(after)
|
||||
same, same_safe, _ = signatures._sampling_contract(**kwargs)
|
||||
assert same_safe and same == after
|
||||
|
||||
|
||||
def test_sampler_graph_only_changes_identity():
|
||||
graph = signatures._prompt_graph()
|
||||
before, safe, _ = build_upstream_graph_contract(graph, "42", require_video_vae=True)
|
||||
graph["40"]["inputs"]["sampler_name"] = "heun"
|
||||
after, after_safe, _ = build_upstream_graph_contract(graph, "42", require_video_vae=True)
|
||||
assert safe and after_safe and before != after
|
||||
assert before["version"] == after["version"] == 4
|
||||
assert before["routes"]["model"] == after["routes"]["model"]
|
||||
|
||||
|
||||
def test_partial_and_bound_method_state_are_observed():
|
||||
class Bound:
|
||||
def __init__(self, gain):
|
||||
self.gain = gain
|
||||
def sample(self, value):
|
||||
return value * self.gain
|
||||
first, safe = storage._observe(functools.partial(Bound(1).sample, 2))
|
||||
second, safe_second = storage._observe(functools.partial(Bound(3).sample, 2))
|
||||
assert safe and safe_second and first != second
|
||||
|
||||
|
||||
@pytest.mark.parametrize("location", ["wrappers", "patches", "model_options"])
|
||||
def test_opaque_state_disables_reuse_without_preventing_contract(location):
|
||||
class Opaque:
|
||||
__slots__ = ("gain",)
|
||||
def __init__(self):
|
||||
self.gain = 1
|
||||
def __call__(self, *args):
|
||||
return self.gain
|
||||
model = signatures._Model()
|
||||
getattr(model, location)["external"] = Opaque()
|
||||
contract, safe, reasons = signatures._sampling_contract(model=model)
|
||||
assert contract["global"]["sampling_contract_version"] == 6
|
||||
assert not safe and reasons
|
||||
|
||||
|
||||
def test_empty_callable_attributes_are_not_complete():
|
||||
class Opaque:
|
||||
def __call__(self):
|
||||
return 1
|
||||
_, safe = storage._observe(Opaque())
|
||||
assert not safe
|
||||
|
||||
|
||||
def test_observation_bounds_preserve_ordinary_lora_keys_without_weight_traversal():
|
||||
_, keys_safe = storage._observe({f"weight.{index}" for index in range(500)})
|
||||
_, oversized_safe = storage._observe(list(range(4097)))
|
||||
module = signatures._Model().model.diffusion_model
|
||||
descriptor, module_safe = storage._observe(module)
|
||||
assert keys_safe and not oversized_safe and not module_safe
|
||||
assert descriptor["module_state_unobserved"]
|
||||
|
||||
|
||||
def test_signature_failure_is_diagnostic_not_a_generation_stop():
|
||||
model = signatures._Model()
|
||||
model.model_dtype = lambda: (_ for _ in ()).throw(RuntimeError("custom dtype"))
|
||||
contract, safe, reasons = signatures._sampling_contract(model=model)
|
||||
assert contract and not safe and reasons
|
||||
|
||||
|
||||
def test_core_euler_sampler_has_an_observable_runtime_signature():
|
||||
from comfy.samplers import sampler_object
|
||||
_, safe = storage._sampler_signature(sampler_object("euler"))
|
||||
assert safe
|
||||
|
||||
|
||||
def reader(tmp_path, contract):
|
||||
controller = review._controller(tmp_path, contract)
|
||||
controller.configure_review(generation_mode=GENERATION_MODE_REVIEW,
|
||||
review_action=REVIEW_ACTION_CONTINUE)
|
||||
return controller
|
||||
|
||||
|
||||
@pytest.mark.parametrize("entry_point", ["head", "review", "import", "compatible", "take"])
|
||||
def test_safe_false_never_adopts_a_prefix(tmp_path, entry_point):
|
||||
contract = review._contract(chunks=3)
|
||||
source = review._persist(tmp_path, contract, prefix=2, review_unit=(2, 2),
|
||||
updated_utc="2026-10-04T00:00:00+00:00")
|
||||
controller = reader(tmp_path, contract)
|
||||
original = (source._manifest_path().read_bytes(), (source.run_root / "project.json").read_bytes())
|
||||
if entry_point == "head":
|
||||
assert controller.find_latest_review_head(contract, resume_safe=False) is None
|
||||
elif entry_point == "review":
|
||||
assert not controller._load_validated_review_prefix(contract, resume_safe=False).entries
|
||||
elif entry_point == "import":
|
||||
assert controller._find_plan_import(contract, resume_safe=False) is None
|
||||
elif entry_point == "compatible":
|
||||
assert controller._compatible_plan_prefix(source.manifest, contract, resume_safe=False) == ([], [])
|
||||
else:
|
||||
controller.take_group = 2
|
||||
controller.take_revision_id = review._project(source)["canonical_head_revision_id"]
|
||||
with pytest.raises(storage.RunStorageError, match="unobservable"):
|
||||
controller._validated_take_selection(contract, resume_safe=False)
|
||||
assert original == (source._manifest_path().read_bytes(), (source.run_root / "project.json").read_bytes())
|
||||
|
||||
|
||||
def test_safe_false_retry_preserves_existing_take(tmp_path):
|
||||
contract = review._contract(chunks=3)
|
||||
source = review._persist(tmp_path, contract, prefix=2, review_unit=(2, 2),
|
||||
updated_utc="2026-10-04T00:00:00+00:00")
|
||||
controller = reader(tmp_path, contract)
|
||||
controller.review_action = REVIEW_ACTION_REGENERATE_CURRENT
|
||||
before = source._manifest_path().read_bytes()
|
||||
with pytest.raises(ReviewControlError, match="could not be matched"):
|
||||
controller._load_validated_review_prefix(contract, resume_safe=False)
|
||||
assert source._manifest_path().read_bytes() == before
|
||||
|
||||
|
||||
def test_identical_v6_review_and_take_still_reuse(tmp_path):
|
||||
contract = review._contract(chunks=3)
|
||||
source = review._persist(tmp_path, contract, prefix=2, review_unit=(2, 2),
|
||||
updated_utc="2026-10-04T00:00:00+00:00")
|
||||
controller = reader(tmp_path, contract)
|
||||
assert len(controller._load_validated_review_prefix(contract, resume_safe=True).entries) == 2
|
||||
controller.take_group = 2
|
||||
controller.take_revision_id = review._project(source)["canonical_head_revision_id"]
|
||||
assert len(controller._validated_take_selection(contract)["entries"]) == 2
|
||||
|
||||
|
||||
def fixture_hashes(root):
|
||||
return {str(file.relative_to(root)): hashlib.sha256(file.read_bytes()).hexdigest()
|
||||
for file in root.rglob("*") if file.is_file()}
|
||||
|
||||
|
||||
def test_actual_old_code_v5_fixture_readable_and_immutable(tmp_path):
|
||||
fixture = Path(__file__).parent / "fixtures" / "v39_sampling_v5"
|
||||
before = fixture_hashes(fixture)
|
||||
run = tmp_path / "run"
|
||||
shutil.copytree(fixture, run)
|
||||
controller = storage.RunStorageController("legacy-read")
|
||||
controller.run_root = run
|
||||
controller.revisions_root = run / "revisions"
|
||||
manifests, catalog, chains = controller._provenance_catalog()
|
||||
assert len(manifests) == 1 and len(catalog) == 2 and len(chains) == 1
|
||||
manifest = next(iter(manifests.values()))
|
||||
assert manifest["sampling_contract_version"] == 5
|
||||
assert manifest["contract"]["global"]["sampling_contract_version"] == 5
|
||||
storage._manifest_sampling_identity(manifest)
|
||||
head = controller._validated_review_head(manifest, for_reuse=False)
|
||||
assert head["validated_prefix_count"] == 2
|
||||
assert len(head["entries"]) == 2
|
||||
contract = review._contract(chunks=manifest["contract"]["chunk_count"])
|
||||
controller.prompts = [""] * contract["chunk_count"]
|
||||
assert controller.find_latest_review_head(contract) is None
|
||||
assert controller._compatible_plan_prefix(manifest, contract) == ([], [])
|
||||
assert controller._find_plan_import(contract) is None
|
||||
controller.take_group = 2
|
||||
controller.take_revision_id = head["manifest"]["branch_provenance"]["active_chain"][-1]
|
||||
with pytest.raises(storage.RunStorageError, match="read-only"):
|
||||
controller._validated_take_selection(contract, source_lineage=manifest["contract"]["nonce_lineage_sha256"])
|
||||
assert fixture_hashes(fixture) == before
|
||||
assert fixture_hashes(run) == before
|
||||
@@ -0,0 +1,178 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import copy
|
||||
import gc
|
||||
from types import SimpleNamespace
|
||||
|
||||
import pytest
|
||||
import torch
|
||||
|
||||
from ComfyUI_H3_Continuum_Join import driving_audio
|
||||
from ComfyUI_H3_Continuum_Join.v3 import driving_nodes
|
||||
from ComfyUI_H3_Continuum_Join.v3.nodes import _apply_review_decode_scope
|
||||
from ComfyUI_H3_Continuum_Join.v3.plan import (
|
||||
AssemblyPlanError, REVIEW_AUDIO_PROJECTION_KEY, make_review_audio_projection,
|
||||
prepare_physical_decode_entries, validate_assembly_plan,
|
||||
)
|
||||
from ComfyUI_H3_Continuum_Join.v3.second_pass import update_second_pass_geometry
|
||||
from ComfyUI_H3_Continuum_Join.v3.file_backed_buffer import get_file_backed_image_manager
|
||||
from . import test_v38_review_run_storage as review
|
||||
from . import test_p23_assembly_v35 as assembly
|
||||
|
||||
|
||||
def scope(*, chunk=2, finish=False):
|
||||
contract = review._contract(chunks=4)
|
||||
entries = [review._entry(position, contract) for position in range(3)]
|
||||
decoded, full_plan = prepare_physical_decode_entries(
|
||||
entries, chunk_seconds=5, preserve_final_frame=False, terminal_merged=False,
|
||||
)
|
||||
result = {"session": {"chunks": entries}, "report": "source"}
|
||||
outputs = ([{"samples": entry["video"]} for entry in decoded],
|
||||
[{"samples": entry["audio"]} for entry in decoded], full_plan, result)
|
||||
storage = SimpleNamespace(review_generation_mode="Review Each Chunk",
|
||||
review_execution=SimpleNamespace(finish_remaining=finish,
|
||||
next_review_unit_start=chunk, next_review_unit_end=chunk,
|
||||
partial_review=True, smart_regenerate=False))
|
||||
scoped = _apply_review_decode_scope(
|
||||
outputs, storage=storage, capture_refine_context=False, configured_chunks=4,
|
||||
chunk_seconds=5, first_frame=None, last_frame=None, timeline_video_source=None,
|
||||
)
|
||||
return scoped, outputs
|
||||
|
||||
|
||||
def finalize(plan, source, *, exact=False, backend="RAM", direct=False):
|
||||
images, generated = assembly._decoded(plan, sample_rate=32000)
|
||||
if not direct:
|
||||
plan = dict(plan, _h3_continuum_driving_audio_v1=source)
|
||||
return driving_nodes.H3ContinuumAssembleSeamV35().assemble(
|
||||
images, generated, plan, exact, "Off", "Off", backend, "Off",
|
||||
driving_audio=source if direct else None,
|
||||
)
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def buffer_root(tmp_path, monkeypatch):
|
||||
original = driving_nodes.assemble_decoded_chunks_v35
|
||||
def assemble_at_test_root(**kwargs):
|
||||
return original(**kwargs, backing_root=tmp_path)
|
||||
monkeypatch.setattr(driving_nodes, "assemble_decoded_chunks_v35", assemble_at_test_root)
|
||||
yield tmp_path
|
||||
gc.collect()
|
||||
get_file_backed_image_manager(tmp_path).collect_ready()
|
||||
|
||||
|
||||
@pytest.mark.parametrize("rate", [32000, 44100, 48000])
|
||||
@pytest.mark.parametrize("channels", [1, 2])
|
||||
@pytest.mark.parametrize("exact", [False, True])
|
||||
@pytest.mark.parametrize("backend", ["RAM", "Disk-backed", "Auto"])
|
||||
def test_finalize_uses_natural_absolute_pcm_origin(rate, channels, exact, backend, buffer_root):
|
||||
scoped, original = scope()
|
||||
plan = scoped[2]
|
||||
unit = original[2]["chunks"][1]
|
||||
samples = round(20 * rate)
|
||||
waveform = torch.arange(samples, dtype=torch.float32).view(1, 1, -1).repeat(1, channels, 1)
|
||||
source = {"waveform": waveform, "sample_rate": rate}
|
||||
frozen = waveform.clone()
|
||||
start = round(unit["frame_start"] * rate / 24)
|
||||
stop = round(unit["frame_stop"] * rate / 24)
|
||||
assert unit["frame_start"] == 124 and unit["frame_stop"] == 243
|
||||
expected = waveform[..., start:stop]
|
||||
if exact:
|
||||
wanted = round(plan["target_frames"] * rate / 24)
|
||||
padding = max(0, wanted - expected.shape[-1])
|
||||
# The unchanged V3.9 Exact rule repeats the final available PCM sample.
|
||||
expected = torch.cat((expected[..., :wanted], expected[..., -1:].expand(1, channels, padding)), dim=-1)
|
||||
for direct in (False, True):
|
||||
images, audio, _ = finalize(plan, source, exact=exact, backend=backend, direct=direct)
|
||||
assert torch.equal(audio["waveform"], expected)
|
||||
assert audio["sample_rate"] == rate
|
||||
assert images.shape[0] == (120 if exact else 119)
|
||||
del images, audio
|
||||
assert torch.equal(waveform, frozen)
|
||||
assert scoped[3]["session"] is original[3]["session"]
|
||||
assert len(original[3]["session"]["chunks"]) == 3
|
||||
assert REVIEW_AUDIO_PROJECTION_KEY not in original[2]
|
||||
assert REVIEW_AUDIO_PROJECTION_KEY not in original[3]["session"]
|
||||
|
||||
|
||||
@pytest.mark.parametrize("length", [160000, 0])
|
||||
@pytest.mark.parametrize("exact", [False, True])
|
||||
def test_short_or_empty_review_audio_only_pads_when_required(length, exact, buffer_root):
|
||||
plan = scope()[0][2]
|
||||
waveform = torch.ones((1, 2, length), dtype=torch.float64)
|
||||
source = {"waveform": waveform, "sample_rate": 32000}
|
||||
images, output, report = finalize(plan, source, exact=exact)
|
||||
assert output["waveform"].dtype == waveform.dtype
|
||||
# Chunk 2 begins after these short sources. Use the selected output's real size.
|
||||
assert output["waveform"].shape == (1, 2, round(images.shape[0] * 32000 / 24))
|
||||
assert not torch.count_nonzero(output["waveform"])
|
||||
assert "Empty Review interval" in report
|
||||
assert torch.equal(source["waveform"], waveform)
|
||||
|
||||
|
||||
def test_partial_short_audio_is_not_padded_with_exact_off(buffer_root):
|
||||
plan = scope()[0][2]
|
||||
start = round(124 * 32000 / 24)
|
||||
waveform = torch.arange(start + 1000, dtype=torch.float32).view(1, 1, -1)
|
||||
_, output, report = finalize(plan, {"waveform": waveform, "sample_rate": 32000})
|
||||
assert torch.equal(output["waveform"], waveform[..., start:])
|
||||
assert output["waveform"].shape[-1] == 1000
|
||||
assert "silence added" not in report
|
||||
|
||||
|
||||
def test_finalize_repeat_does_not_cut_the_pcm_twice(buffer_root):
|
||||
plan = scope()[0][2]
|
||||
source = {"waveform": torch.arange(640000, dtype=torch.float32).view(1, 1, -1), "sample_rate": 32000}
|
||||
plan["_h3_continuum_driving_audio_v1"] = source
|
||||
before = source["waveform"].clone()
|
||||
first = finalize(plan, source)
|
||||
second = finalize(plan, source)
|
||||
assert torch.equal(first[1]["waveform"], second[1]["waveform"])
|
||||
assert first[1]["waveform"][0, 0, 0] == round(124 * 32000 / 24)
|
||||
assert torch.equal(plan["_h3_continuum_driving_audio_v1"]["waveform"], before)
|
||||
|
||||
|
||||
def test_full_projection_keeps_source_pcm_unchanged(buffer_root):
|
||||
scoped, full = scope(finish=True)
|
||||
assert scoped is full
|
||||
assert REVIEW_AUDIO_PROJECTION_KEY not in full[2]
|
||||
source = {"waveform": torch.arange(640000, dtype=torch.float32).view(1, 1, -1), "sample_rate": 32000}
|
||||
_, output, _ = finalize(full[2], source, exact=False)
|
||||
assert torch.equal(output["waveform"], source["waveform"])
|
||||
|
||||
|
||||
def test_terminal_physical_group_cannot_be_split():
|
||||
plan = assembly._plan("long_terminal_3x5")
|
||||
projection = make_review_audio_projection(plan, start_chunk=2, end_chunk=3)
|
||||
group = plan["decode_groups"][1]
|
||||
assert (projection["source_start_frame"], projection["source_stop_frame"]) == (group["frame_start"], group["frame_stop"])
|
||||
with pytest.raises(AssemblyPlanError, match="split"):
|
||||
make_review_audio_projection(plan, start_chunk=3, end_chunk=3)
|
||||
|
||||
|
||||
@pytest.mark.parametrize("field,value", [
|
||||
("version", 2), ("coordinate_space", "local"), ("fps", 30),
|
||||
("start_chunk", 1), ("source_start_frame", -1), ("source_stop_frame", 242),
|
||||
("source_stop_frame", 124),
|
||||
])
|
||||
def test_broken_metadata_has_no_first_audio_fallback(field, value):
|
||||
plan = scope()[0][2]
|
||||
plan[REVIEW_AUDIO_PROJECTION_KEY][field] = value
|
||||
with pytest.raises(AssemblyPlanError, match="Review audio projection"):
|
||||
driving_audio.slice_review_source_audio({"waveform": torch.ones(1, 1, 200), "sample_rate": 32000}, plan)
|
||||
|
||||
|
||||
def test_second_pass_geometry_copy_preserves_projection_and_source():
|
||||
scoped, _ = scope()
|
||||
plan = scoped[2]
|
||||
source = {"waveform": torch.arange(100, dtype=torch.float32).view(1, 1, -1), "sample_rate": 32000}
|
||||
plan["_h3_continuum_driving_audio_v1"] = source
|
||||
before = copy.deepcopy(plan[REVIEW_AUDIO_PROJECTION_KEY])
|
||||
group = plan["second_pass_contract"]["physical_groups"][0]
|
||||
shape = (group["source_batch"], group["latent_channels"], group["source_latent_t"],
|
||||
group["source_latent_h"] * 2, group["source_latent_w"] * 2)
|
||||
updated = update_second_pass_geometry(plan, [{"samples": torch.zeros(shape)}])
|
||||
assert updated[REVIEW_AUDIO_PROJECTION_KEY] == before
|
||||
assert torch.equal(updated["_h3_continuum_driving_audio_v1"]["waveform"], source["waveform"])
|
||||
assert plan[REVIEW_AUDIO_PROJECTION_KEY] == before
|
||||
validate_assembly_plan(updated)
|
||||
@@ -0,0 +1,139 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import builtins
|
||||
from types import SimpleNamespace
|
||||
|
||||
import pytest
|
||||
import torch
|
||||
|
||||
from ComfyUI_H3_Continuum_Join import audio_compat, reference, reference_audio, driving_audio
|
||||
from ComfyUI_H3_Continuum_Join.v3.ref_encode_cache import clear_ref_encode_cache
|
||||
from . import test_v38_ref_encode_cache as cache_cases
|
||||
|
||||
|
||||
def test_equal_rate_returns_original_without_importing_a_resampler(monkeypatch):
|
||||
monkeypatch.setattr(audio_compat.importlib, "import_module", lambda *args: pytest.fail("unneeded import"))
|
||||
waveform = torch.arange(200, dtype=torch.float32)
|
||||
assert audio_compat.resample_audio(waveform, 32000, 32000) is waveform
|
||||
|
||||
|
||||
@pytest.mark.parametrize("rate", [16000, 22050, 32000, 44100, 48000, 96000])
|
||||
@pytest.mark.parametrize("channels", [1, 2])
|
||||
def test_resample_is_exactly_core(rate, channels):
|
||||
from comfy.audio import resample
|
||||
waveform = torch.sin(torch.arange(rate // 10, dtype=torch.float32) * 0.0123).view(1, 1, -1).repeat(1, channels, 1)
|
||||
frozen = waveform.clone()
|
||||
expected = resample(waveform, rate, 32000)
|
||||
actual = audio_compat.resample_audio(waveform, rate, 32000)
|
||||
assert actual.shape == expected.shape
|
||||
assert actual.dtype == expected.dtype
|
||||
assert torch.equal(actual, expected)
|
||||
assert torch.equal(waveform, frozen)
|
||||
|
||||
|
||||
@pytest.mark.parametrize("absence", ["module", "api"])
|
||||
def test_older_core_uses_the_legacy_adapter_only_if_api_absent(monkeypatch, absence):
|
||||
calls = []
|
||||
def legacy(waveform, source_rate, target_rate):
|
||||
calls.append((source_rate, target_rate))
|
||||
return waveform + 1
|
||||
def modules(name):
|
||||
if name == "comfy.audio":
|
||||
if absence == "module":
|
||||
raise ModuleNotFoundError("old Core", name="comfy.audio")
|
||||
return SimpleNamespace()
|
||||
assert name == "torchaudio"
|
||||
return SimpleNamespace(functional=SimpleNamespace(resample=legacy))
|
||||
monkeypatch.setattr(audio_compat.importlib, "import_module", modules)
|
||||
waveform = torch.zeros(1, 1, 20)
|
||||
assert torch.equal(audio_compat.resample_audio(waveform, 44100, 32000), waveform + 1)
|
||||
assert calls == [(44100, 32000)]
|
||||
|
||||
|
||||
@pytest.mark.parametrize("failure", ["internal_dependency", "core_computation", "both_absent"])
|
||||
def test_errors_never_switch_silently_to_a_different_resampler(monkeypatch, failure):
|
||||
calls = []
|
||||
def core(*args):
|
||||
raise ValueError("Core computation failed")
|
||||
def modules(name):
|
||||
calls.append(name)
|
||||
if name == "comfy.audio":
|
||||
if failure == "internal_dependency":
|
||||
raise ModuleNotFoundError("broken scipy", name="scipy.signal")
|
||||
if failure == "core_computation":
|
||||
return SimpleNamespace(resample=core)
|
||||
raise ModuleNotFoundError("old Core", name="comfy.audio")
|
||||
raise ModuleNotFoundError("no legacy module", name="torchaudio")
|
||||
monkeypatch.setattr(audio_compat.importlib, "import_module", modules)
|
||||
with pytest.raises((ModuleNotFoundError, ValueError, RuntimeError), match={
|
||||
"internal_dependency": "broken scipy", "core_computation": "Core computation failed",
|
||||
"both_absent": "requires comfy.audio.resample",
|
||||
}[failure]):
|
||||
audio_compat.resample_audio(torch.zeros(1, 1, 20), 44100, 32000)
|
||||
if failure != "both_absent":
|
||||
assert calls == ["comfy.audio"]
|
||||
|
||||
|
||||
@pytest.mark.parametrize("rate", [32000, 44100, 48000])
|
||||
def test_reference_bundle_and_driving_do_not_require_torchaudio(rate, monkeypatch):
|
||||
original_import = builtins.__import__
|
||||
def no_torchaudio(name, *args, **kwargs):
|
||||
if name == "torchaudio" or name.startswith("torchaudio."):
|
||||
raise ModuleNotFoundError("Torchaudio deliberately absent", name="torchaudio")
|
||||
return original_import(name, *args, **kwargs)
|
||||
monkeypatch.setattr(builtins, "__import__", no_torchaudio)
|
||||
from comfy.audio import resample
|
||||
waveform = torch.sin(torch.arange(rate, dtype=torch.float32) / 10).view(1, 1, -1)
|
||||
source = {"waveform": waveform, "sample_rate": rate}
|
||||
vae = cache_cases.AudioVAE()
|
||||
reference_source = reference_audio.prepare_reference_audio_source(source, vae)
|
||||
bundle = reference_audio.H3ContinuumReferenceAudios().pack(source, None, None, vae)[0]
|
||||
assert bundle is not None
|
||||
assert reference_source.source_sample_rate == rate
|
||||
assert torch.equal(reference_source.waveform, resample(waveform, rate, 32000))
|
||||
driving = driving_audio.prepare_driving_audio_source(source, vae, target_frames=12, fps=24)
|
||||
effective = waveform[..., :round(rate / 2)]
|
||||
assert torch.equal(driving.source_audio["waveform"], effective)
|
||||
assert driving.source_audio["sample_rate"] == rate
|
||||
assert torch.equal(driving.resampled_waveform, resample(effective, rate, 32000))
|
||||
assert driving.contract["preprocess_version"] == 1
|
||||
same = reference_audio.prepare_reference_audio_source(source, vae)
|
||||
assert same.combined_hash == reference_source.combined_hash
|
||||
assert torch.equal(source["waveform"], waveform)
|
||||
|
||||
|
||||
@pytest.mark.parametrize("kind", ["image", "audio"])
|
||||
def test_direct_same_vae_weight_mutation_requires_clear_or_reload(kind):
|
||||
clear_ref_encode_cache()
|
||||
class WeightedImage(cache_cases.ImageVAE):
|
||||
def __init__(self):
|
||||
super().__init__()
|
||||
self.weight = torch.tensor(1.)
|
||||
def encode(self, image):
|
||||
return super().encode(image) + self.weight
|
||||
class WeightedAudio(cache_cases.AudioVAE):
|
||||
def __init__(self):
|
||||
super().__init__()
|
||||
self.weight = torch.tensor(1.)
|
||||
def encode(self, waveform):
|
||||
return super().encode(waveform) + self.weight
|
||||
vae = WeightedImage() if kind == "image" else WeightedAudio()
|
||||
source = cache_cases._image_assets("stability-r5-image") if kind == "image" else cache_cases._audio_source("stability-r5-audio")
|
||||
def encode(current):
|
||||
if kind == "image":
|
||||
return reference.encode_reference_latents_cached(current, source).latents[0]
|
||||
return reference_audio.encode_reference_audio_cached(current, source).audio_latent
|
||||
cold = encode(vae)
|
||||
same = encode(vae)
|
||||
assert vae.calls == 1 and torch.equal(cold, same)
|
||||
vae.weight.add_(1)
|
||||
stale = encode(vae)
|
||||
assert vae.calls == 1 and torch.equal(cold, stale)
|
||||
clear_ref_encode_cache()
|
||||
refreshed = encode(vae)
|
||||
assert vae.calls == 2 and torch.equal(refreshed, cold + 1)
|
||||
reloaded = type(vae)()
|
||||
reloaded.weight.fill_(3)
|
||||
assert torch.equal(encode(reloaded), cold + 2)
|
||||
assert reloaded.calls == 1
|
||||
clear_ref_encode_cache()
|
||||
Reference in New Issue
Block a user