cheald / sd-webui-loractl

An Automatic1111 extension for dynamically controlling the weights of LoRAs during image generation
MIT License
239 stars 10 forks source link

Get low quality images after hires fix. #3

Closed QR-0W closed 1 year ago

QR-0W commented 1 year ago

I've been using this plugin on SD WebUI which version is 1.5.1, python 3.10.8, torch 2.0.1+cu118, xformers 0.0.20 and gradio 3.32.0. Overall it produces some nice results when generating images.

But when it comes to hires.fix, it would corrupt the image. Here are some examples:

图片

图片

the two images above are pictures after hires.fix, and these pictures below are those without hires fix:

图片

We can see those images without hires.fix clearly don't have large color blocks and distorted lines like the images that went through Hires.fix

I'm not sure if the problem is due to the plugin, or due to my syntax (I'm using statements like _<lora:Japanese scene20230609163753-000018[Japanese scene]:0@0,0.35@0.6> when generating it), or if it's simply just due to the fact that between LoRA or is it simply due to a conflict between LoRA.

cheald commented 1 year ago

By default, your LoRA will apply during the hires pass with the same schedule as the low-res pass. That is, it'll start the hi-res pass at 0, then ramp to 0.35 by 60% of the way through the hires pass, and then remain there.

If you want to turn the LoRA off during the hires pass, add hr=0, like: <lora:Japanese scene_20230609163753-000018[Japanese scene]:0@0,0.35@0.6:hr=0>; this will use the LoRA during your low-res pass, then turn it off for the hi-res pass. Alternately, you can also set a constant strength for the LoRA in the hires pass, or you can set a custom schedule for it just like you can with the low-res pass. You may need to fiddle with the strength in the hires pass to get the desired results, depending on the LoRA you're using.

cheald commented 1 year ago

The hires pass weights weren't inheriting properly, and were getting stuck at 1 unless specified. That's been fixed. See #4