AUTOMATIC1111 / stable-diffusion-webui

Stable Diffusion web UI
GNU Affero General Public License v3.0
142.6k stars 26.9k forks source link

[Bug]: txt2image, if use Hires.fix or Restore faces or Batch count>1, the end-of-generation image is not displayed #6524

Open wgku opened 1 year ago

wgku commented 1 year ago

Is there an existing issue for this?

What happened?

txt2image, if I use Hires.fix or Restore faces or Batch count>1, the end-of-generation image is not displayed, but if I don't use the above 3 options, the end-of-generation image is displayed normally. This will not be the case until the end of December 2022, it will be the case in the most recent modified version of the interface.

Steps to reproduce the problem

  1. Open url https://colab.research.google.com/github/dream80/TonyColab/blob/master/Stable_Diffusion_WebUI(NovelAILeaks).ipynb
  2. Edit Run WebUI command add: !pip install https://github.com/brian6091/xformers-wheels/releases/download/0.0.15.dev0%2B4c06c79/xformers-0.0.15.dev0+4c06c79.d20221205-cp38-cp38-linux_x86_64.whl modify: !COMMANDLINE_ARGS="--share --gradio-debug --xformers" REQS_FILE="requirements.txt" python launch.py
  3. Press run all
  4. When you see the following message like this: Running on local URL: http://127.0.0.1:7860/ Running on public URL: https://xxxxxxxxxxxxxx.gradio.live/ open the public url 5.Select the model, fill in the hints and negative hints, Sampling method just like Euler a DMP++2s a karra or other, Sampling steps 30,Width 512,Height 768, Batch size 2, CFG Scale 10 etc. These will not cause problems, but once used to Hires. fix or Restore faces or Batch count > 1, the end image is not displayed.

What should have happened?

Select the model, fill in the hints and negative hints, Sampling method just like Euler a DMP++2s a karra or other, Sampling steps 30,Width 512,Height 768, Batch size 2, CFG Scale 10 etc. These will not cause problems, but once used to Hires. fix or Restore faces or Batch count > 1, when the end image is not displayed.

Commit where the problem happens

I can't be sure, but it must have been after Dec 27, 2022

The problem is in the commit 76f256f

What platforms do you use to access UI ?

Other/Cloud

What browsers do you use to access the UI ?

Google Chrome, Microsoft Edge

Command Line Arguments

COMMANDLINE_ARGS="--share --gradio-debug --xformers"  REQS_FILE="requirements.txt" python launch.py

Additional information, context and logs

No response

zijiren233 commented 1 year ago

gradio has a 60s timeout Try using a local address

wgku commented 1 year ago

I have it running on Google Colab, a cloud service, and I can't use the local URL. In addition, when I adjust the Width to 640 and the Height to 960, the drawing time exceeds 1 minute, as long as I don't use Hires. fix or Restore faces or Batch count>1, the image can be displayed normally.

kajatak commented 1 year ago

gradio has a 60s timeout Try using a local address

This isn't the issue, as I'm having the same problem as OP using a Vast.ai instance (unable to reproduce locally though), but checking out something else semi-randomly, namely bd81a09eacf02dad095b98094ab936f276d0343f, everything works like it should over Gradio no matter how long I keep on using it.

wgku commented 1 year ago

bd81a09

Do you mean that reverting the changes made in bd81a09 on the latest version will solve this problem? Remove ”sd_config.model.params.finetune_keys = None“ from modules/sd_models.py line 299, and modify modules/sd_hijack_inpainting.py line 331 by removing the # ?

kajatak commented 1 year ago

I don't know what is causing the issue, I'm just saying that using e.g., that one does make it work as it should. There's likely some other point that works as well, I just picked that one at random to test it out and it works. If you want to use older one just use git checkout to change to it.

wgku commented 1 year ago

I don't know what is causing the issue, I'm just saying that using e.g., that one does make it work as it should. There's likely some other point that works as well, I just picked that one at random to test it out and it works. If you want to use older one just use git checkout to change to it.

I've checkout from 5ba04f9 to 3f401cd and the image keeps showing up fine, I'll keep trying until I find a version that doesn't.

JaviCru commented 1 year ago

It is exactly the same for me.

I've checkout from 5ba04f9 to 3f401cd and the image keeps showing up fine, I'll keep trying until I find a version that doesn't.

I have anticipated your research and I think I have found the commit where this problem appears: 76f256f The above commit 11d432d works correctly.

It seems to happen because of the version change in gradio (from 3.9 to 3.15.0), but I can't say more, I'm not a programmer.

I hope this is of some use.

Regards.

JaviCru commented 1 year ago

I have done some more research, and I confirm that it is a change in some version of gradio.

I've checkedout the last commit without the error (11d432d), and I've been updating the gradio version from 3.9 onwards (editing the requirements.txt and requirements_versions.txt files).

From gradio 3.10 onwards, I had to edit the modules/ui.py and scripts/prompts_from_file.py files to fix a bug (changing the type="bytes" argument to type="file").

Up to version 3.13.0, everything works fine. From version 3.13.1 onwards it no longer works. So everything points to some change between the two versions of gradio.

Regards.

wgku commented 1 year ago

I have done some more research, and I confirm that it is a change in some version of gradio.

I've checkedout the last commit without the error (11d432d), and I've been updating the gradio version from 3.9 onwards (editing the requirements.txt and requirements_versions.txt files).

From gradio 3.10 onwards, I had to edit the modules/ui.py and scripts/prompts_from_file.py files to fix a bug (changing the type="bytes" argument to type="file").

Up to version 3.13.0, everything works fine. From version 3.13.1 onwards it no longer works. So everything points to some change between the two versions of gradio.

Regards.

Yes, 11d432d was the last version that worked for me too, I hope the developers will lower the version of gradio and fix the problem as you say.The problem is in the commit 76f256f .

JaviCru commented 1 year ago

In commit c0ee148 gradio 3.9 compatibility has been configured. I have checkedout the most current commit as of today, and modifying the gradio version to 3.13.0 seems to work.

Regards.

aixiaodewugege commented 1 year ago

I meet the same problem after install some extensions, and I have checkeed the gradio, it is in the latest version. Do you know how to fix it?

wgku commented 1 year ago

I meet the same problem after install some extensions, and I have checkeed the gradio, it is in the latest version. Do you know how to fix it? in requirements.txt and requirements_versions.txt find gradio==3.16.2 change to gradio==3.13.0