ValueError: Tensor lora_te_text_model_encoder_layers_0_mlp_fc1.alpha has no metadata - is this a Lora safetensor?

#1
by erank3 - opened

Hello !
Thanks so much for this great great work!

I am getting this error when I try to run inference:
ValueError: Tensor lora_te_text_model_encoder_layers_0_mlp_fc1.alpha has no metadata - is this a Lora safetensor?

I am running a normal inference flow using StableDiffusionPipeline:

os.makedirs(output_path, exist_ok=True)

model_id = "runwayml/stable-diffusion-v1-5"
lora_model = "models/lora/360/360Diffusion_v1.safetensors"

pipe = StableDiffusionPipeline.from_pretrained(model_id, torch_dtype=torch.float16).to(
    "cuda"
)

pipe.scheduler = EulerAncestralDiscreteScheduler.from_config(
    pipe.scheduler.config)

patch_pipe(
    pipe,
    lora_model,
    patch_text=True,
    patch_ti=True,
    patch_unet=True,
)

tune_lora_scale(pipe.unet, 1.00)
tune_lora_scale(pipe.text_encoder, 1.00)

generator = torch.Generator("cuda").manual_seed(seed)
image = pipe(prompt, num_inference_steps=steps, guidance_scale=scale,
             height=H, width=W, generator=generator).images[0]

can you provide some context about how to run the model using the pipeline?

Thanks!!

I have the same error with a different LoRa model, have you found a solution?

Hi @erank3 !
Were you able to use this lora model at the end?
Getting the same error
Thanks a lot!

Sign up or log in to comment