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 adpater id argument #478

Merged
merged 5 commits into from
Jan 19, 2024
Merged

fix adpater id argument #478

merged 5 commits into from
Jan 19, 2024

Conversation

doombeaker
Copy link
Contributor

@doombeaker doombeaker commented Dec 29, 2023

test on RTX 3090

onediff

6.94 it/s

 python examples/text_to_image_lcm_lora_sdxl.py --model_id /share_nfs/hf_models/stable-diffusion-xl-base-1.0 --adapter_id /share_nfs/hf_models/lcm-lora-sdxl --warmup 1 --steps 8 --seed 1 --prompt "Self-portrait oil painting, a beautiful cyborg with golden hair, 8k" --width 1024 --height 1024

image

pytorch

3.9 it/s

 python examples/text_to_image_lcm_lora_sdxl.py --model_id /share_nfs/hf_models/stable-diffusion-xl-base-1.0 --adapter_id /share_nfs/hf_models/lcm-lora-sdxl --warmup 1 --steps 8 --seed 1 --prompt "Self-portrait oil painting, a beautiful cyborg with golden hair, 8k" --width 1024 --height 1024 --disable

image

@@ -90,6 +90,9 @@ def parse_args():
else:
os.environ["ONEFLOW_MLIR_ENABLE_INFERENCE_OPTIMIZATION"] = "1"

pipe.load_lora_weights(args.adapter_id)
pipe.fuse_lora()
Copy link
Collaborator

Choose a reason for hiding this comment

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

需要判断版本

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Collaborator

Choose a reason for hiding this comment

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

像这样:

if hasattr(pipe, "fuse_lora"):

@doombeaker doombeaker merged commit ce566b7 into main Jan 19, 2024
5 checks passed
@doombeaker doombeaker deleted the fix_lcm_lora_adpater_id branch January 19, 2024 15:53
pipe.fuse_lora()
else:
print(f"pipe.fuse_lora doesn't exist, exit")
exit(1)
Copy link
Collaborator

Choose a reason for hiding this comment

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

发现这里不需要 exit,不 fuse_lora 也可以正常执行 @doombeaker

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