Sygil-Dev / sygil-webui

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

[Bug]: ValueError: could not convert string to float: #702

Closed Theagainmen closed 1 year ago

Theagainmen commented 2 years ago

What happened?

First of all thanks for this great project!

I've noticed that whenever I use prompts longer than 1 line in the webui it starts generating, then after it's almost done generating I get the error:

ValueError: could not convert string to float: '8973786304bf4da7aeb8cf4d2e4f7e50'

I also always have this error in the img2img when I use masking. Here is the output (down below).

Version

0.0.1 (Default)

What browsers are you seeing the problem on?

Chrome

Where are you running the webui?

Windows

Custom settings

None

Relevant log output

Iteration: 1/4
100%|███████████████████████████████████████████████| 15/15 [00:34<00:00,  2.32s/it]
Exception processing job JobInfo(inputs=('Better Call Saul, Gta vice city, gta 5 cover art, borderlands style, celshading, symmetric highly detailed eyes, trending on artstation, by rhads, andreas rocha, rossdraws, makoto shinkai, laurie greasley, lois van baarle, ilya kuvshinov and greg rutkowski', 15, 'k_euler', [1, 2, 3, 4, 5], 'RealESRGAN_x4plus', 0, 4, 1, 9.5, '', 512, 512, None, 0, ''), func=<function txt2img at 0x000001B4CC757430>, session_key='"eefa49a985aa4a428aea5c4c25deb60f"', job_token=0, images=[], should_stop=<threading.Event object at 0x000001B502D7FBB0>, job_status="Error: [Errno 2] No such file or directory: 'outputs/txt2img-samples\\\\samples\\\\Better_Call_Saul,_Gta_vice_city,_gta_5_cover_art,_borderlands_style,_celshading,_symmetric_highly_detailed_eyes,_trending_on_artst\\\\00001-15_k_euler_1865612011_0.00.png'", finished=False, removed_output_idxs=[0]): [Errno 2] No such file or directory: 'outputs/txt2img-samples\\samples\\Better_Call_Saul,_Gta_vice_city,_gta_5_cover_art,_borderlands_style,_celshading,_symmetric_highly_detailed_eyes,_trending_on_artst\\00001-15_k_euler_1865612011_0.00.png'
Traceback (most recent call last):
  File "C:\Users\User\anaconda3\envs\ldm\lib\site-packages\gradio\routes.py", line 247, in run_predict
    output = await app.blocks.process_api(
  File "C:\Users\User\anaconda3\envs\ldm\lib\site-packages\gradio\blocks.py", line 645, in process_api
    output = self.postprocess_data(fn_index, predictions, state)
  File "C:\Users\User\anaconda3\envs\ldm\lib\site-packages\gradio\blocks.py", line 611, in postprocess_data
    block.postprocess(prediction_value)
  File "C:\Users\User\anaconda3\envs\ldm\lib\site-packages\gradio\components.py", line 673, in postprocess
    return self.round_to_precision(y, self.precision)
  File "C:\Users\User\anaconda3\envs\ldm\lib\site-packages\gradio\components.py", line 563, in round_to_precision
    return float(num)
ValueError: could not convert string to float: '8973786304bf4da7aeb8cf4d2e4f7e50'

Code of Conduct

Theagainmen commented 2 years ago

The issue also seems related to the "Save individual images" and "Upscale images using RealESRGAN" when they are enabled in the advanced options (either one of them).

0xech0 commented 2 years ago

have had same issue several times

webel commented 2 years ago

a way that I get around this issue is by changing the number of sampling steps... bizarre, I know

Theagainmen commented 2 years ago

a way that I get around this issue is by changing the number of sampling steps... bizarre, I know

Already tried this but it doesn't seem to work either, sometimes (very rarely) one will succeed but still most will fail.. How come no more users are reporting this issue? I can't find any other people experiencing this (other than this thread), while it's almost unusable for me now :o

jjisnow commented 2 years ago

Weirdly seems to do with an update to gfpgan's main repository. They updated utils.py in Revision 7272e458874cb9a3b1b68c38a7136b2b8dd71f69 which I think broke the model somehow. Reverting the changes seemed to help

Jason94 commented 2 years ago

I'm also getting this error most of the time. It's pretty unusable at this point, unfortunately. @jjisnow, how did you revert the changes? I tried downloading an old version of the model from the gfpgan releases, but am getting the same error.

TFWol commented 2 years ago

@Jason94 Replace the utils.py at stable-diffusion-webui\src\gfpgan\gfpgan\utils.py

with the one from before the change: https://raw.githubusercontent.com/TencentARC/GFPGAN/c7ccc098a7e3120eb666050e991ae111dcdadf34/gfpgan/utils.py

ymmv; I get mixed results

jjisnow commented 2 years ago

I use an IDE to do it, but I'm guessing:

  1. Go to gfpgan directory (cloned from GitHub)
  2. I think the command is: git checkout 3e27784
  3. You may want to git stash beforehand
TFWol commented 2 years ago

@jjisnow Do you have errors when turning on 'Fix faces using GFPGAN'? I seem to get the string to float error even when replacing the files from the mentioned repo

Although, I'm about to grab the latest version of sd-webui and see if things are still broken.

jjisnow commented 2 years ago

@jjisnow Do you have errors when turning on 'Fix faces using GFPGAN'? I seem to get the string to float error even when replacing the files from the mentioned repo

Although, I'm about to grab the latest version of sd-webui and see if things are still broken.

There's been quite a lot of development over the last week on sd-webui, so I would imagine the issues got fixed along the way in the latest version. I'm using the waifu-diffusion fork

TFWol commented 2 years ago

Awesome, thanks for the info. I might check out that fork once I'm done testing and tweaking things.

Wish I knew how to cherry pick between branches without screwing it all up and having to delete and start over.

jjisnow commented 2 years ago

Awesome, thanks for the info. I might check out that fork once I'm done testing and tweaking things.

Wish I knew how to cherry pick between branches without screwing it all up and having to delete and start over.

  1. git stash to store
  2. git checkout <the remote/branch or commit you'd like to explore>
  3. Fiddle/run with the code there.
  4. If you don't like it, git stash pop to recall the initial state of your code. Or even git checkout <initial branch> before the git stash pop

There's far more fancy ways of altering and returning to your code at https://git-scm.com/docs/git-stash

Also, there's https://learngitbranching.js.org/

TFWol commented 2 years ago

Thanks, I'll have to sit down and play around with git a bit more with this in mind.

TyraelWasTaken commented 2 years ago

I'm still experiencing this, is anybody else, if the prompt is short it works, however if it is long and gfpgan or realsrgan are on it breaks. I wonder if changing the length of the file name would work?

TFWol commented 2 years ago

I'm still experiencing this, is anybody else, if the prompt is short it works, however if it is long and gfpgan or realsrgan are on it breaks. I wonder if changing the length of the file name would work?

It's pretty much what @jjisnow had put out. In my case, I had to use v1.3.4 of GFPGAN repo to make faces work again.

I'm using VSCode, but the easiest way, if not familiar with git, would be to replace files in stable-diffusion-webui\src\gfpgan\ with the v1.3.4 ones.

I'm redoing the whole thing to verify (taking forever waiting for the process to finish)

TFWol commented 2 years ago

Nope, master gives other kinds of errors when doing that.

I'm able to get everything working by using this branch, installing all the things, and then replacing the GFPGAN with these files

TFWol commented 2 years ago

@jjisnow could you point a link to the branch you're using? I'm finally able to jump around branches more freely after following some of the tutorials you linked to for git, so I'd like to try another known working branch.

webel commented 1 year ago

I'm almost certain I saw a discussion or possibly an issue with more comments and thoughts than this issue 🤔 can't find it now thou.

Also - the UI sometimes gave me this back when in reality it was cuda that had run out of memory.

On Wed, 7 Sep 2022, 11:02 Theagainmen @.***> wrote:

a way that I get around this issue is by changing the number of sampling steps... bizarre, I know

Already tried this but it doesn't seem to work either, sometimes one will succeed but still most will fail.. How come no more users are reporting this issue? I can't find any other people experiencing this (other than this thread), while it's almost unusable for me now :o

— Reply to this email directly, view it on GitHub https://github.com/sd-webui/stable-diffusion-webui/issues/702#issuecomment-1239110999, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABANI4EOOADAJEBOSLFJ2WLV5BKVLANCNFSM6AAAAAAQFV4I2E . You are receiving this because you commented.Message ID: @.***>