Sandpies commited on
Commit
2db886f
·
1 Parent(s): b2c1241

regen2k: remove Sharp curve handling and default to open_h3_regen2k_refiner_r256pp_bf16 at 0.25

Browse files
Files changed (2) hide show
  1. CHANGELOG.md +1 -1
  2. h3_ref_chain.py +4 -35
CHANGELOG.md CHANGED
@@ -5,7 +5,7 @@ pack — the published package excludes them.
5
 
6
  ## Unreleased
7
 
8
- - **Upsampler (`upsample_redraw=regen2k`):** delivery-only Open-H3-Regenerate-2K mode on the stitched pre-VAE hop latents (`upsample_redraw` = `recipe` / `regen2k`, `regen2k_cond` = `text_only` / `hop`, `regen2k_model` socket, `regen2k_seed` = 42). Runs the 3D latent upscaler, then 3 Euler steps at CFG 1 on `[0.909375, 6/7, 2/3, 0]` with the real hop audio latent pinned clean (`noise=film`, 102/17 f chunks). Wire `UNETLoader(minimax_h3_fl2va_pruned_int8_convrot)` -> `OpenH3Regen2KLoader` with default LoRA `open_h3_regenerate_2k_r256pp_bf16.safetensors` (3.77 GB; reference `open_h3_regenerate_2k_bf16.safetensors`, 8.80 GB, both in `models/loras`; ships as a LoRA, not a merged checkpoint, with no smaller or quantised variants), `lora_strength=0.25`, and `sharp_strength=0` (Sharp is refused: all 50 `curve_B` weights in the published file are zero, a no-op). Lower tile budgets shorten Regen2K chunks down to 68 frames full-frame before splitting into spatial tiles, and an OOM-lowered budget carries forward across chunks and logs the `upsample_tile_tokens` value to set for next run.
9
  - **Upsampler:** chunks join into one preallocated latent (no film copy per chunk; output unchanged); log shows OOM retries, join time and peak VRAM.
10
  - **hand_tie: every previs is rendered and checked before the first hop.** A previs that is not
11
  one take (any cut, anywhere: every hop is tied to the frames on both sides of it) stops the run
 
5
 
6
  ## Unreleased
7
 
8
+ - **Upsampler (`upsample_redraw=regen2k`):** delivery-only Open-H3-Regenerate-2K mode on the stitched pre-VAE hop latents (`upsample_redraw` = `recipe` / `regen2k`, `regen2k_cond` = `text_only` / `hop`, `regen2k_model` socket, `regen2k_seed` = 42). Runs the 3D latent upscaler, then 3 Euler steps at CFG 1 on `[0.909375, 6/7, 2/3, 0]` with the real hop audio latent pinned clean (`noise=film`, 102/17 f chunks). Wire `UNETLoader(minimax_h3_fl2va_pruned_int8_convrot)` -> `OpenH3Regen2KLoader` with default LoRA `open_h3_regen2k_refiner_r256pp_bf16.safetensors` (refiner-only, 3.77 GB; reference `open_h3_regenerate_2k_bf16.safetensors`, 8.80 GB, both in `models/loras`; ships as a LoRA, not a merged checkpoint, with no smaller or quantised variants) at `lora_strength=0.25`. Lower tile budgets shorten Regen2K chunks down to 68 frames full-frame before splitting into spatial tiles, and an OOM-lowered budget carries forward across chunks and logs the `upsample_tile_tokens` value to set for next run.
9
  - **Upsampler:** chunks join into one preallocated latent (no film copy per chunk; output unchanged); log shows OOM retries, join time and peak VRAM.
10
  - **hand_tie: every previs is rendered and checked before the first hop.** A previs that is not
11
  one take (any cut, anywhere: every hop is tied to the frames on both sides of it) stops the run
h3_ref_chain.py CHANGED
@@ -2883,42 +2883,13 @@ _BOOST_LOADERS = {}
2883
  # repaints skin texture, 0.075 smeared mid-distance faces, 0.1 textured least
2884
  # while still sharp. The side node keeps the recipe's 0.2.
2885
  UPSAMPLE_DENOISE = 0.2 # the original recipe (sigma 0.75, one step)
2886
- REGEN2K_DEFAULT_LORA = "open_h3_regenerate_2k_r256pp_bf16.safetensors"
2887
  REGEN2K_REFERENCE_LORA = "open_h3_regenerate_2k_bf16.safetensors"
2888
 
2889
  # hand_tie: render and gate every section's previs before the first hop (see run()).
2890
  _HT_PREVIS_FIRST = True
2891
 
2892
 
2893
- def _check_regen2k_no_sharp(regen2k_model):
2894
- """Refuse a Regen2K model with Sharp curve patches or a widened adaln_t_table."""
2895
- if regen2k_model is None:
2896
- return
2897
- obj_patches = getattr(regen2k_model, "object_patches", None) or {}
2898
- for k, v in obj_patches.items():
2899
- if "adaln_proj" in k or "time_embedder" in k:
2900
- raise RuntimeError(
2901
- f"{TAG}: regen2k_model has Sharp curve patches ({k}); set "
2902
- "sharp_strength=0 on OpenH3Regen2KLoader (published curve_B is a no-op).")
2903
- if k == "diffusion_model.adaln_t_table" and hasattr(v, "shape") and int(v.shape[1]) != 8:
2904
- raise RuntimeError(
2905
- f"{TAG}: regen2k_model has widened adaln_t_table {tuple(v.shape)}; "
2906
- "set sharp_strength=0 on OpenH3Regen2KLoader.")
2907
- dm = None
2908
- if hasattr(regen2k_model, "get_model_object"):
2909
- try:
2910
- dm = regen2k_model.get_model_object("diffusion_model")
2911
- except Exception:
2912
- dm = None
2913
- if dm is None:
2914
- dm = getattr(getattr(regen2k_model, "model", None), "diffusion_model", None)
2915
- tab = getattr(dm, "adaln_t_table", None)
2916
- if tab is not None and hasattr(tab, "shape") and int(tab.shape[1]) != 8:
2917
- raise RuntimeError(
2918
- f"{TAG}: regen2k_model adaln_t_table has shape {tuple(tab.shape)}, "
2919
- "expected (1025, 8); set sharp_strength=0 on OpenH3Regen2KLoader.")
2920
-
2921
-
2922
  def _validate_upsample_redraw(upsample, upsample_redraw, regen2k_model,
2923
  upsample_dit=None, upsample_denoise=UPSAMPLE_DENOISE,
2924
  width=1344, height=768):
@@ -2936,8 +2907,7 @@ def _validate_upsample_redraw(upsample, upsample_redraw, regen2k_model,
2936
  raise RuntimeError(
2937
  f"{TAG}: upsample_redraw=regen2k requires regen2k_model wired "
2938
  f"(UNETLoader -> OpenH3Regen2KLoader with {REGEN2K_DEFAULT_LORA}, "
2939
- "lora_strength 0.25, sharp_strength 0).")
2940
- _check_regen2k_no_sharp(regen2k_model)
2941
  if upsample_dit is not None:
2942
  print(f"[{TAG}] upsample: regen2k_model wins over the wired upsample_dit",
2943
  flush=True)
@@ -3066,7 +3036,6 @@ def _run_regen2k_upsample(regen2k_model, sampler, vae, upsample_hops, megapixels
3066
  alloc=None, budget=_tu.TOKEN_BUDGET, settings=None,
3067
  regen2k_cond="text_only", regen2k_seed=42):
3068
  """Run the delivery-only Open-H3-Regenerate-2K stage over stitched pre-VAE hop latents."""
3069
- _check_regen2k_no_sharp(regen2k_model)
3070
  snap = _snapshot_model_state(regen2k_model)
3071
  work_model = (regen2k_model.clone() if hasattr(regen2k_model, "clone")
3072
  else regen2k_model)
@@ -4801,8 +4770,8 @@ class HandTieClips:
4801
  "regen2k_model": ("MODEL", {
4802
  "tooltip": ("Model for upsample_redraw=regen2k: wire UNETLoader "
4803
  "(minimax_h3_fl2va_pruned_int8_convrot) -> "
4804
- "OpenH3Regen2KLoader (open_h3_regenerate_2k_r256pp_bf16, "
4805
- "lora_strength 0.25, sharp_strength 0)."),
4806
  }),
4807
  # Not named seed: ComfyUI hangs a randomize control on any widget
4808
  # called seed.
 
2883
  # repaints skin texture, 0.075 smeared mid-distance faces, 0.1 textured least
2884
  # while still sharp. The side node keeps the recipe's 0.2.
2885
  UPSAMPLE_DENOISE = 0.2 # the original recipe (sigma 0.75, one step)
2886
+ REGEN2K_DEFAULT_LORA = "open_h3_regen2k_refiner_r256pp_bf16.safetensors"
2887
  REGEN2K_REFERENCE_LORA = "open_h3_regenerate_2k_bf16.safetensors"
2888
 
2889
  # hand_tie: render and gate every section's previs before the first hop (see run()).
2890
  _HT_PREVIS_FIRST = True
2891
 
2892
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2893
  def _validate_upsample_redraw(upsample, upsample_redraw, regen2k_model,
2894
  upsample_dit=None, upsample_denoise=UPSAMPLE_DENOISE,
2895
  width=1344, height=768):
 
2907
  raise RuntimeError(
2908
  f"{TAG}: upsample_redraw=regen2k requires regen2k_model wired "
2909
  f"(UNETLoader -> OpenH3Regen2KLoader with {REGEN2K_DEFAULT_LORA}, "
2910
+ "lora_strength 0.25).")
 
2911
  if upsample_dit is not None:
2912
  print(f"[{TAG}] upsample: regen2k_model wins over the wired upsample_dit",
2913
  flush=True)
 
3036
  alloc=None, budget=_tu.TOKEN_BUDGET, settings=None,
3037
  regen2k_cond="text_only", regen2k_seed=42):
3038
  """Run the delivery-only Open-H3-Regenerate-2K stage over stitched pre-VAE hop latents."""
 
3039
  snap = _snapshot_model_state(regen2k_model)
3040
  work_model = (regen2k_model.clone() if hasattr(regen2k_model, "clone")
3041
  else regen2k_model)
 
4770
  "regen2k_model": ("MODEL", {
4771
  "tooltip": ("Model for upsample_redraw=regen2k: wire UNETLoader "
4772
  "(minimax_h3_fl2va_pruned_int8_convrot) -> "
4773
+ "OpenH3Regen2KLoader (open_h3_regen2k_refiner_r256pp_bf16, "
4774
+ "lora_strength 0.25)."),
4775
  }),
4776
  # Not named seed: ComfyUI hangs a randomize control on any widget
4777
  # called seed.