continue-revolution / sd-webui-segment-anything

Segment Anything for Stable Diffusion WebUI
3.38k stars 204 forks source link

Today,after update sd-webui-segment-anything, when i use text2 img I got error from log,and can’t got the image #49

Closed 491331952 closed 1 year ago

491331952 commented 1 year ago

Is there an existing issue for this?

Have you updated WebUI and this extension to the newest version?

Do you understand that you should go to https://github.com/IDEA-Research/Grounded-Segment-Anything/issues if you cannot install GroundingDINO?

Do you know that you should use the newest ControlNet extension and enable external control if you want SAM extension to control ControlNet?

What happened?

Today,after update sd-webui-segment-anything, when i use text2 img I got error from log,and can’t got the image

Steps to reproduce the problem

  1. Go to ....
  2. Press ....
  3. ...

What should have happened?

Today,after update sd-webui-segment-anything, when i use text2 img I got error from log,and can’t got the image

Commit where the problem happens

webui: can't use to make image extension: after update

What browsers do you use to access the UI ?

Google Chrome

Command Line Arguments

nohup bash webui.sh >/home/ubuntu/stable-diffusion-webui/nohup.log 2>&1  &

Console logs

Traceback (most recent call last):
  File "/home/ubuntu/stable-diffusion-webui/venv/lib/python3.10/site-packages/gradio/routes.py", line 394, in run_predict
    output = await app.get_blocks().process_api(
  File "/home/ubuntu/stable-diffusion-webui/venv/lib/python3.10/site-packages/gradio/blocks.py", line 1073, in process_api
    inputs = self.preprocess_data(fn_index, inputs, state)
  File "/home/ubuntu/stable-diffusion-webui/venv/lib/python3.10/site-packages/gradio/blocks.py", line 962, in preprocess_data
    processed_input.append(block.preprocess(inputs[i]))
  File "/home/ubuntu/stable-diffusion-webui/venv/lib/python3.10/site-packages/gradio/components.py", line 1203, in preprocess
    return self.choices.index(x)
ValueError: '0' is not in list

Additional information

No response

491331952 commented 1 year ago

额。。。。能讲中文啊?憋了半天的洋文。 跟新了一下插件,并且也装了ControlNet,但是使用正常的 文生图功能出不来图, 后台有报错。卸载sd-webui-segment-anything 后回复正常。

491331952 commented 1 year ago

切换到 GroundingDINO 分支可以正常使用。 image image

continue-revolution commented 1 year ago

应该是gradio的bug,我之前碰到过,后来想了点办法给解决了,现在可能不知道是哪儿又出现了这个毛病。能不能麻烦你把你出现这个毛病的详细过程描述一下,最好把图片也发发,方便我复现。

zhongnannk commented 1 year ago

切换到 GroundingDINO 分支可以正常使用。 image image

同样的报错,辛苦了

continue-revolution commented 1 year ago

@491331952 @zhongnannk 你们得把你们的图片和操作过程说明一下我才能复现,不然我没办法帮你们debug

DevJake commented 1 year ago

I can confirm I am also having this issue.

The steps I took to produce it were:

  1. Install Segment Anything via the URL in the Extensions tab.
  2. Download the SAM models and place them into the appropriate directory.
  3. Enter the txt2img tab and type in a term. In my case, I just wrote cheese.
  4. Hit run.
  5. No image generates and in the console I receive the following error:
    Traceback (most recent call last):
    File "/home/[user]/stable-diffusion-webui/venv/lib/python3.10/site-packages/gradio/routes.py", line 394, in run_predict
    output = await app.get_blocks().process_api(
    File "/home/[user]/stable-diffusion-webui/venv/lib/python3.10/site-packages/gradio/blocks.py", line 1073, in process_api
    inputs = self.preprocess_data(fn_index, inputs, state)
    File "/home/[user]/stable-diffusion-webui/venv/lib/python3.10/site-packages/gradio/blocks.py", line 962, in preprocess_data
    processed_input.append(block.preprocess(inputs[i]))
    File "/home/[user]/stable-diffusion-webui/venv/lib/python3.10/site-packages/gradio/components.py", line 1203, in preprocess
    return self.choices.index(x)
    ValueError: '0' is not in list

This is the only information available. If there's a way to get more information - such as the exact dropdown or field that is erroneous - then let me know and I'll give it a go. Thanks!

continue-revolution commented 1 year ago

Thank you very much. It is much more helpful if you can provide information. Could I say that you actually did not use this extension, but only installed, but is unable to do ordinary txt2img without any extension enabled?

DevJake commented 1 year ago

Yes, I did not use the extension, simply having it installed causes this issue. I actually removed all of my extensions then added them back individually, confirming that simply the presence of this extension causes the issue. I have gone through all of the configuration menus and changed whatever I can to ensure everything has a default or updated value, with no success. So the extension is not able to do ordinary txt2img unless it is completely removed from the extensions directory.

continue-revolution commented 1 year ago

It seems that gradio is having some very wierd behavior. Is your webui and the extension the most up-to-date? Please update your webui and extension and re-try. If it does no help, I will do some urgent fix to bypass some gradio bugs.

continue-revolution commented 1 year ago

OK I know the problem. Did you install ControlNet? If no, the problem comes from this. I'll try to fix this problem.

continue-revolution commented 1 year ago

I have fixed the problem. Please re-try and let me know if it is working.

DevJake commented 1 year ago

Hey, yes, ControlNet is installed. I just git pulled your latest commit and it is now working as expected. Unless @491331952 continues to have issues after pulling the latest changes then I believe this issue to be solved. Thank you!

491331952 commented 1 year ago

@DevJake @continue-revolution I test it,the problem has been fixed!Thanks。 点赞点赞!

zhongnannk commented 1 year ago

controlnet+segment seems ok now,good job! thanks very much!

在 2023-04-19 03:02:38,"Chengsong Zhang" @.***> 写道:

I have fixed the problem. Please re-try and let me know if it is working.

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were mentioned.Message ID: @.***>