haofanwang / Lora-for-Diffusers

The most easy-to-understand tutorial for using LoRA (Low-Rank Adaptation) within diffusers framework for AI Generation Researchers🔥
MIT License
739 stars 46 forks source link

Whenever I try to load the model, it returns an error #7

Open Catnip202X opened 1 year ago

Catnip202X commented 1 year ago

pipeline = StableDiffusionPipeline.from_pretrained(save_dir,torch_dtype=torch.float32) Traceback (most recent call last): File "", line 1, in NameError: name 'save_dir' is not defined

What should I do?

d1g1t commented 1 year ago

Did you define the variable save_dir?

Assuming you're running convert_lora_safetensor_to_diffusers.py, the model_id or save_dir in your case should be a hugging face repo of the base model or the path to a local copy of the diffuser

Catnip202X commented 1 year ago

ah ok, is there a more in depth guide that I can follow? thanks in advance

d1g1t commented 1 year ago

It's unclear which file you're trying to run/what you're trying to do.

If you're trying to load into your model, a lora safetensors file that uses Stable Diffusion 1.5 as the base, you can simply edit the convert_lora_safetensor_to_diffusers.py to replace onePieceWanoSagaStyle_v2Offset.safetensors with the path to your file