Skip to content

feat: Add downscaled IC-LoRA support to LTXVAddGuide (CORE-102)#13896

Merged
alexisrolland merged 7 commits into
Comfy-Org:masterfrom
drozbay:20260513a_ltx_iclora_input
May 16, 2026
Merged

feat: Add downscaled IC-LoRA support to LTXVAddGuide (CORE-102)#13896
alexisrolland merged 7 commits into
Comfy-Org:masterfrom
drozbay:20260513a_ltx_iclora_input

Conversation

@drozbay
Copy link
Copy Markdown
Contributor

@drozbay drozbay commented May 14, 2026

IC-LoRAs that need a non-default downscale factor have been usable in ComfyUI through Lightricks' LTXAddVideoICLoRAGuide custom node from ComfyUI-LTXVideo, which exposes latent_downscale_factor as a manual numeric input.

This proposed ComfyUI core version uses a new node (Get IC-LoRA Parameters) to tell the LTXVAddGuide how to process the guide latents, including performing the correct downscaling if necessary.

image

Under the hood, LoraLoader now exposes the LoRA's safetensors metadata on the model as an attachment under the key lora_metadata. The Get IC-LoRA Parameters node reads that attachment from the model and outputs an iclora_parameters object. LTXVAddGuide reads reference_downscale_factor from that iclora_parameters input. It falls back to factor 1 when nothing is connected or the metadata key is missing.

Workflow for testing:

droz_LTX23_canny_union_control_ic_lora_parameters_v3.json

Expected output:

ComfyUI_00113_.mp4

Input assets for test workflow:

CannyTest.mp4
FirstFrame_1 LastFrame_1

Previous version (Old and busted)

droz_LTX23_canny_union_control_v1.json

image

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 14, 2026

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 542027b2-9319-44a7-b263-35ff90090798

📥 Commits

Reviewing files that changed from the base of the PR and between b9585af and de569ac.

📒 Files selected for processing (1)
  • comfy_extras/nodes_lt.py
🚧 Files skipped from review as they are similar to previous changes (1)
  • comfy_extras/nodes_lt.py

📝 Walkthrough

Walkthrough

This PR adds LoRA metadata propagation through the LoRA loading and application pipeline. LoRA files are loaded with metadata and cached alongside weights. load_lora_for_models accepts optional lora_metadata and attaches it to model and clip patchers. LTXVAddGuide gains an optional ic_lora input, extracts a reference_downscale_factor from IC‑LoRA metadata, applies latent downscaling (with validation), optionally dilates and masks the guide latent, and passes guide_mask and latent_downscale_factor into keyframe conditioning for correct alignment.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and accurately describes the main change: adding downscaled IC-LoRA support to LTXVAddGuide, which is the primary objective reflected in all three modified files.
Description check ✅ Passed The description thoroughly explains the feature, including context about the previous manual approach, the new automated metadata-driven approach, implementation details, test workflow, and expected outputs related to the changeset.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@comfy/sd.py`:
- Around line 103-104: The code calls new_clip.set_attachments but new_clip is a
CLIP wrapper without that method; instead attach lora_metadata to the patcher.
Replace the set_attachments call on new_clip with using the CLIP patcher (e.g.,
patcher.set_attachments or patcher.attachments API) to store "lora_metadata" so
references to new_clip remain valid; update the logic around new_clip and the
patcher usage to set the attachment via the patcher rather than on new_clip.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 5c3664e2-ee0a-4e3e-a75d-3b811b87a568

📥 Commits

Reviewing files that changed from the base of the PR and between 1f28908 and cbebbd7.

📒 Files selected for processing (3)
  • comfy/sd.py
  • comfy_extras/nodes_lt.py
  • nodes.py

Comment thread comfy/sd.py Outdated
@drozbay drozbay changed the title feat: Add IC-LoRA support to native LTXVAddGuide via ic_lora model input (CORE-102) feat: Add downscaled IC-LoRA support to native LTXVAddGuide via ic_lora model input (CORE-102) May 14, 2026
@drozbay drozbay changed the title feat: Add downscaled IC-LoRA support to native LTXVAddGuide via ic_lora model input (CORE-102) feat: Add downscaled IC-LoRA support to LTXVAddGuide via ic_lora model input (CORE-102) May 14, 2026
@drozbay
Copy link
Copy Markdown
Contributor Author

drozbay commented May 14, 2026

image

drozbay added 4 commits May 15, 2026 14:14
Brings the IC-LoRA guide work up to date with upstream master. Resolved nodes_lt.py by keeping the ic_lora input and adopting master's strength max increase (1.0 to 10.0).
Supersedes the ic_lora model-input approach with the approved Get IC-LoRA Parameters node feeding an iclora_parameters socket on LTXVAddGuide. Resolved nodes_lt.py to the new design while keeping master's strength range and guide_mask VRAM clamp from 33ce449.
@drozbay drozbay changed the title feat: Add downscaled IC-LoRA support to LTXVAddGuide via ic_lora model input (CORE-102) feat: Add downscaled IC-LoRA support to LTXVAddGuide (CORE-102) May 16, 2026
@alexisrolland alexisrolland merged commit d3607a8 into Comfy-Org:master May 16, 2026
14 checks passed
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.

2 participants