Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix lora switch #1143

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions onediff_sd_webui_extensions/onediff_lora.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
import torch

import onediff_shared

from compile.utils import is_oneflow_backend

from onediff.infer_compiler import DeployableModule
Expand Down Expand Up @@ -36,8 +39,9 @@ def hijacked_activate(activate_func):

def activate(self, p, params_list):
activate_func(self, p, params_list)
if isinstance(p.sd_model.model.diffusion_model, DeployableModule):
onediff_sd_model: DeployableModule = p.sd_model.model.diffusion_model
sd_model = onediff_shared.current_unet_graph.graph_module
if isinstance(sd_model, DeployableModule):
onediff_sd_model: DeployableModule = sd_model
for name, sub_module in onediff_sd_model.named_modules():
if not isinstance(
sub_module,
Expand Down