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

[LoRA] fix peft state dict parsing #10532

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

sayakpaul
Copy link
Member

What does this PR do?

Fixes #9542 (comment).

https://civitai.com/models/200251?modelVersionId=1081295 has both peft and non peft state dict inside it 🤷

Testing code:
from diffusers import FluxPipeline
import torch

pipeline = FluxPipeline.from_pretrained(
    "black-forest-labs/FLUX.1-dev", torch_dtype=torch.bfloat16
).to("cuda")
pipeline.load_lora_weights(
    "sayakpaul/different-lora-from-civitai", weight_name="sharp_detailed_foot.safetensors"
)

prompt = """
UHD, 4k, ultra detailed, cinematic, a photograph of <lora:sharp detailed image (foot focus) v1.1:0.9> sharp detailed image of a female person standing on a black mat with their bare feet in front of camera, perfect image, perfect body, perfect anatomy, sharp image, detailed image, cinematic style, high quality photography, sharp detailed image style, solo, barefoot, feet, toes, black background, toenails, close-up, foot focus, muscular, veins, soles, facing camera, feet in front of camera, polished nails, closeup, feet focus, epic, beautiful lighting, inpsiring
"""

_ = pipeline(prompt, num_inference_steps=20, generator=torch.manual_seed(2810038592))

@HuggingFaceDocBuilderDev

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

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