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

Trying to Use Locon as Lora - Attribute Error String #46

Open
Icarushollow opened this issue Jun 2, 2023 · 1 comment
Open

Trying to Use Locon as Lora - Attribute Error String #46

Icarushollow opened this issue Jun 2, 2023 · 1 comment

Comments

@Icarushollow
Copy link

I'm getting this error every time I use a locon placed in the lora folder. I could be doing something wrong but the readme doesn't really say much about how to use the extension or anything about the installation. Just that you can use a locon as a lora after installing from the URL. I used your Lycoris extension instead and pretty sure the locon was applied then and I didn't get an error but something similar to what AddNet displays when you use lora's through it. Thanks for any response that may help me understand more. I've self-taught myself everything up til now but just couldn't figure this error out.

locon load lora method
activating extra network lora with arguments [<modules.extra_networks.ExtraNetworkParams object at 0x00000253FF23E560>]: AttributeError
Traceback (most recent call last):
File "C:\Users\Joe\stable-diffusion-webui\modules\extra_networks.py", line 75, in activate
extra_network.activate(p, extra_network_args)
File "C:\Users\Joe\stable-diffusion-webui\extensions-builtin\Lora\extra_networks_lora.py", line 23, in activate
lora.load_loras(names, multipliers)
File "C:\Users\Joe\stable-diffusion-webui\extensions-builtin\Lora\lora.py", line 170, in load_loras
lora = load_lora(name, lora_on_disk.filename)
File "C:\Users\Joe\stable-diffusion-webui\extensions\a1111-sd-webui-locon\scripts\main.py", line 371, in load_lora
lora.mtime = os.path.getmtime(lora_on_disk.filename)
AttributeError: 'str' object has no attribute 'filename'

@jolin102525
Copy link

I have solved this issue by referring to the solution in the link #40 , which is as follows:

1.Go to the directory \stable-diffusion-webui\extensions\a1111-sd-webui-locon\scripts.
2.Edit the main.py file.
3.Modify the following code:
line 371: lora.mtime = os.path.getmtime(lora_on_disk)
line 373: sd = sd_models.read_state_dict(lora_on_disk)

Hope this helps you solve the problem!

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

No branches or pull requests

2 participants