Skip to content

Commit

Permalink
Add support for negative LoRA strength
Browse files Browse the repository at this point in the history
  • Loading branch information
Danamir committed Dec 8, 2023
1 parent 27d070e commit 5c0d3b8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ai_diffusion/workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
from .util import client_logger as log


_pattern_lora = re.compile(r"\s*<lora:([^:<>]+)(?::([^:<>]*))?>\s*", re.IGNORECASE)
_pattern_lora = re.compile(r"\s*<lora:([^:<>]+)(?::(-?[^:<>]*))?>\s*", re.IGNORECASE)


class LoraException(Exception):
Expand Down Expand Up @@ -244,7 +244,7 @@ def _apply_strength(strength: float, steps: int, min_steps: int = 0) -> tuple[in
return steps, start_at_step


def load_model_with_lora(w: ComfyWorkflow, comfy: Client, style: Style, is_live=False, additional_loras: list[dict[str, str | float]] = ()):
def load_model_with_lora(w: ComfyWorkflow, comfy: Client, style: Style, is_live=False, additional_loras: list[dict[str, str | float]] | tuple = ()):
checkpoint = style.sd_checkpoint
if checkpoint not in comfy.checkpoints:
checkpoint = next(iter(comfy.checkpoints.keys()))
Expand Down

0 comments on commit 5c0d3b8

Please sign in to comment.