kohya-ss / sd-webui-additional-networks

GNU Affero General Public License v3.0
1.77k stars 296 forks source link

A bug when using lora in text2img and img2img #211

Open star379814385 opened 1 year ago

star379814385 commented 1 year ago

First of all, thank you for your contribution. Here I propose a use case, which may be a bug, although this bug error can be avoided if one pays attention to the way it is used. When the lora enable option is checked in text2img and lora is loaded, the generated image is normal. After this, text2img is no longer run, and at this point img2img generates images that clearly have traces of the lora that was just run. If you check the lora enable option in img2img and load lora, the generated image is very poor. text2img and img2img are also the same in reverse.

The current solution without modifying the code is: Before changing the tab, do not enable the lora option and run the generation once at random.

nafisalawalidris commented 1 year ago

It seems that there is a bug related to the usage of lora in these functionalities where the generated images may retain traces of the previously loaded lora. To work around this issue without modifying the code, I suggest the following steps:

  1. Before switching to the other tab (either text2img or img2img), please ensure that the lora option is not enabled.

  2. Please run the generation once using random settings (e.g., different text or image inputs).

  3. Afterward, you can proceed with your desired task in the other tab (text2img or img2img) and enable the lora option if needed.

By performing a random generation without the lora option before switching tabs, you can avoid the traces of the previously loaded lora affecting the subsequent generations.

HakkaBats commented 1 year ago

Hey guys, I'm not sure if I'm having the problem you're talking about, but I'm using img2img to generate a series of images with the same Prompt, and as the number of times I generate them increases, the screen gets uglier and uglier.

image Like this.