Skip to content

Enhance SCAIL-2 multi-reference support: 3 encoding modes, context windows, RoPE downsample patch#3

Open
user2318 wants to merge 2 commits into
kijai:scail2_devfrom
user2318:scail2_dev
Open

Enhance SCAIL-2 multi-reference support: 3 encoding modes, context windows, RoPE downsample patch#3
user2318 wants to merge 2 commits into
kijai:scail2_devfrom
user2318:scail2_dev

Conversation

@user2318

Copy link
Copy Markdown

Summary

Enhanced SCAIL-2 multi-reference support in nodes_scail.py with 3 reference encoding modes,
1+4n mask expansion, RoPE pose-only downsample patch, and SCAIL context window support.

Changes

WanSCAILToVideo — enhanced

  • 3 reference encoding modes: 1+4n batch (default, closer to training),
    per-frame (high fidelity), hybrid (balanced)
  • 1+4n mask expansion: masks are pixel-level expanded to match reference encoding
  • RoPE downsample patch: full-resolution RoPE → avg_pool2d downsample for pose branch only

WanSCAILContextWindows — new node

  • SCAIL-aware context window handler, correctly handles time-dimension alignment
    for ref_mask_28ch, driving_mask_28ch, pose_video_latent
  • Model forward patch slices conditioning at model entry to match windowed x

Compatibility

  • All existing node IDs preserved (WanSCAILToVideo, SCAIL2ColoredMask)
  • Backward compatible — existing workflows unaffected

Notes

  • RoPE downsample and forward slicing are implemented as monkey-patches
    to avoid modifying comfy/ldm/wan/model.py. Can be integrated directly
    into SCAILWanModel if preferred.

@user2318
user2318 requested a review from kijai as a code owner June 18, 2026 05:53
alexisrolland pushed a commit that referenced this pull request Jul 3, 2026
…4734)

* security: fix five vulnerabilities (GHSA-779p-m5rp-r4h4)

- CVE-2026-56670: force download of SVG/XML responses on /view to prevent stored XSS
- CVE-2026-56671: contain /experiment/models/preview reads within the model folder
- CVE-2026-56672: stop inline rendering of uploaded /userdata/{file} content
- CVE-2026-56673: prevent path traversal in get_annotated_filepath (LoadImage /prompt input)
- CVE-2026-56674: reject opaque/null Origin to close the CSRF middleware bypass

Adds regression tests under tests-unit/security_test/ covering all five.

* security: address review feedback on GHSA-779p fixes

- Fix Windows CI failure in test_get_annotated_filepath: compare against
  os.path.abspath(...) to match the intentional abspath normalization added
  by the traversal hardening (abspath prepends the drive letter on Windows).
- origin_check: narrow the bare `except:` in is_loopback() to ValueError so
  genuine interrupts aren't swallowed (review nit).
- origin_check: guard .port access in is_cross_origin_forbidden() so a
  malformed/out-of-range port (e.g. Origin: http://127.0.0.1:99999) fails
  closed with a 403 instead of surfacing an uncaught 500 in the middleware.
- server /view: escape backslash/quote in the Content-Disposition filename
  (RFC 6266 quoted-string) so a filename containing a double quote can't
  malform the response header.

* security: address CodeRabbit review feedback on GHSA-779p tests

- test #3: guard the symlink-escape test with a try/except skip so it no
  longer errors on Windows CI where os.symlink needs elevated privileges /
  Developer Mode (mirrors the guard in the sibling test #2).
- test Comfy-Org#5: refresh the stale module docstring to describe the actual /view
  gating (view_image closure calling folder_paths.is_dangerous_content_type,
  the normalising check) instead of the bypassable raw set-membership test.

* revert(security): drop CVE-2026-56674 Origin: null CSRF change

Per maintainer review, the reported CSRF is already mitigated by the pre-existing
Sec-Fetch-Site: cross-site check for current browsers, and the null-origin
rejection risked breaking legitimate sandboxed-iframe embeds. Restores
origin_only_middleware and is_loopback in server.py to their prior state
(the Sec-Fetch-Site check is retained) and removes utils/origin_check.py and its
regression test. The other four GHSA-779p fixes are unaffected.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant