Skip to content

Preserve IC-LoRA metadata when composing multiple LoRAs #16834

Open

Description

@jaeone94

Problem

Composing multiple metadata-bearing LoRAs retains their patches but only retains the last nonempty lora_metadata attachment. If an IC-LoRA is followed by another LoRA with unrelated metadata, GetICLoRAParameters can no longer find the earlier reference_downscale_factor and falls back to 1.

This is a shared loader behavior, not specific to DynamicGroup: sequential existing LoraLoader nodes and the proposed native stack both call comfy.sd.load_lora_for_models.

Reproduction path

  1. Apply an IC-LoRA whose metadata contains a reference_downscale_factor greater than 1.
  2. Apply another LoRA with nonempty metadata that does not contain that parameter to the resulting model.
  3. Pass the final model to GetICLoRAParameters.

The shared loader clones the patched model and replaces its single lora_metadata attachment. GetICLoRAParameters reads that attachment, so the earlier IC-LoRA's parameter is no longer available even though its patches remain active. This report is based on the code path, not a full image-generation reproduction.

Follow-up scope

  • Define how metadata from multiple applied LoRAs is retained and how a consumer selects the intended LoRA's parameters. Do not assume blindly merging dictionaries is correct when multiple IC-LoRAs provide conflicting values.
  • Keep the single-LoRA behavior compatible and apply the chosen contract consistently to sequential loaders and native stacks. The shared helper also has a CLIP attachment path that should follow the chosen policy where applicable.
  • Add regressions for IC-LoRA followed by unrelated metadata, a later LoRA without metadata, and conflicting IC-LoRA parameters. Verify that patch composition remains unchanged.

Origin: ComfyUI #16309, feat: add native LoRA stack loader nodes, metadata review comment.

Relevant code: comfy/sd.py::load_lora_for_models, comfy/model_patcher.py::set_attachments, and comfy_extras/nodes_lt.py::GetICLoRAParameters.

Activity

  1. self-assigned this
    on Oct 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions