2 Commits
Author SHA1 Message Date
EnragedAntelope 04d56deed2 v4.0.0: behind-subject occlusion, a schema that says what it means, and only-live controls
- Fix "Behind Subject" not occluding: blur the two halves separately and
  re-apply the silhouette after, add a traced cast shadow (shadow_strength,
  shadow_length), and give the background glow real radial falloff
- Replace use_colored_lights with lighting_mode, adding "Both"; three presets
  set a colour and a grading block, so 12 values in each were inert
- Rename use_gradient_mode to mask_shape, and collapse apply_3d_lighting plus
  light_direction into subject_interaction
- Remove show_debug_info: wiring debug_image is the whole gesture, tracked
  through a hidden debug_output_connected input so one run is enough
- Scale everything drawn on the debug view with the frame, and flip a light's
  label to the left of the marker when it would run off the right edge
- Show only the controls that are doing something; grey out what a preset
  owns and put the preset's value in the label
- Ship a working "Fix node (recreate)" and remove ComfyUI-Manager's broken one
- Remap pre-v4 saves by name in web/relight_migrate.js
- Make "Rim Light (Behind)" a neutral white rim instead of (200,255,200)
- Drop requirements.txt; numpy, Pillow, scipy and torch come with ComfyUI
- Add a frontend test suite driving the real web/*.js outside a browser, and
  a CI job for it
- Bump to 4.0.0
2026-09-04 14:50:33 -04:00
Claude 47c08afe60 v3.0.0: fix crashes, batch masks, and 8-bit precision loss; add tests
Audit-driven correctness pass over the whole node.

Crashes:
- Masks are resized and clamped to the image instead of raising a
  RuntimeError when resolutions differ (e.g. a mask made before an upscale).
- RGBA input is handled; alpha is split off before lighting and passed
  through untouched.

Correctness:
- Occlusion and compositing are computed per batch item. Every frame
  previously reused the first image's mask, silently wrong for video.
- The mask output is always the normalised (batch, height, width) mask. It
  returned black when both mask consumers were off, and echoed the input's
  rank otherwise.
- Colour correction runs in float32 on-device rather than round-tripping
  through uint8 PIL. Identity settings shifted pixels by 1/255 and the error
  compounded across lights and chained nodes; blending now works on deltas so
  a no-op correction is bit-exact.
- Mask blurring moved to a separable float convolution, removing banding and
  a device round-trip per light.
- effect_strength scales gamma, so 0.0 is a true no-op.
- remove_background is honoured when apply_3d_lighting is off.

Behaviour changes:
- remove_background defaults off; it silently confined all lighting to the
  subject whenever a mask was connected.
- preserve_positioning defaults off, so presets apply their own geometry.
- Preset gamma values corrected. Gamma follows the Photoshop/ImageMagick
  convention where >1 brightens, but presets paired dimmed outer zones with
  gamma above 1.0, undoing their own shading.

Packaging and docs:
- Secondary inputs marked advanced where ComfyUI supports it, feature-detected
  so older builds still load. Input order unchanged.
- Declares requires-comfyui >=0.3.48; missing comfy_api gives a readable error.
- Example workflow moved to example_workflows/.
- Test suite with a comfy_api stub, plus lint and test CI.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BoCXQ1LeDc9ArKMWVAiwyC
2026-07-24 21:16:49 +00:00