Skip to content

IP-Adapter + Lora , lora_weight != 1.0 warning logs #6549

@Honey-666

Description

@Honey-666

hi
When I use lora + ip-adapter, lora_weight ! = 1.0 will print a lot of warning logs, can anyone tell me why?

os:

diffusers==0.26.0.dev0

this is my code:

import torch
from PIL import Image
from diffusers import StableDiffusionPipeline
from transformers import CLIPVisionModelWithProjection

model_path = 'C:\\work\\pythonProject\\aidazuo\\models\\Stable-diffusion\\stable-diffusion-v1-5'
ip_adapter_path = 'C:\\work\\pythonProject\\aidazuo\\models\\IP-Adapter'
ip_img_path = 'C:\\work\\pythonProject\\aidazuo\\jupyter-script\\test-img\\vermeer.png'
lora_path = 'C:\\work\\pythonProject\\aidazuo\\models\\Lora\\figma.safetensors'

image_encoder = CLIPVisionModelWithProjection.from_pretrained(ip_adapter_path,
                                                              subfolder='models/image_encoder',
                                                              torch_dtype=torch.float16).to('cuda')

pipe = StableDiffusionPipeline.from_pretrained(
    model_path,
    safety_checker=None,
    variant="fp16",
    torch_dtype=torch.float16,
    image_encoder=image_encoder).to("cuda")

pipe.load_ip_adapter(ip_adapter_path, subfolder="models", weight_name="ip-adapter-plus_sd15.bin")
pipe.set_ip_adapter_scale(0.6)

pipe.load_lora_weights(lora_path)

ip_adapter_img = Image.open(ip_img_path)

images = pipe(
    prompt='a beautiful girl',
    ip_adapter_image=ip_adapter_img,
    negative_prompt="",
    num_inference_steps=30,
    num_images_per_prompt=1,
    width=512,
    height=512,
    cross_attention_kwargs={"scale": 0.5}
).images

pipe.unload_lora_weights()
pipe.unload_ip_adapter()

for img in images:
    print(img)

test_result_img

Metadata

Metadata

Assignees

No one assigned

    Labels

    staleIssues that haven't received updates

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions