AUTOMATIC1111 / stable-diffusion-webui

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

[Bug]: assertion error when sending input image back and forth between img2img and inpainting #8872

Open Klace opened 1 year ago

Klace commented 1 year ago

Is there an existing issue for this?

What happened?

Reusing the same inpainting mask while sending the input image back and forth between inpainting and img2img via copy to buttons causes an assertion error

Steps to reproduce the problem

  1. Refresh the webui in the browser for a fresh start
  2. Go to img2img inpaint tab, upload an image, create a mask and generate
  3. Click the copy to img2img button under the INPUT image (not the output image)
  4. Generate an img2img
  5. Click the copy to inpaint button under the INPUT image (not the output image)
  6. Generate again using same mask as before
  7. Repeat 3,4,5,6 again

Results in: assert isinstance(x, dict) AssertionError

When updating the mask between steps the issue does not occur.

What should have happened?

Should reuse the same mask successfully.

Commit where the problem happens

a9fed7c364061ae6efb37f797b6b522cb3cf7aa2

What platforms do you use to access the UI ?

Linux

What browsers do you use to access the UI ?

Google Chrome

Command Line Arguments

None

List of extensions

Tested with no extensions installed

Console logs

Loading weights [6ce0161689] from /webui-vanilla/stable-diffusion-webui/models/Stable-diffusion/v1-5-pruned-emaonly.safetensors
Applying cross attention optimization (Doggettx).
Weights loaded in 20.5s (load weights from disk: 1.4s, apply weights to model: 18.0s, move model to device: 1.1s).
100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 16/16 [00:01<00:00, 14.07it/s]Total progress: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 16/16 [00:01<00:00, 13.51it/s]100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 16/16 [00:01<00:00, 15.97it/s]Total progress: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 16/16 [00:01<00:00, 14.71it/s]100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 16/16 [00:00<00:00, 16.31it/s]Total progress: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 16/16 [00:01<00:00, 14.98it/s]Traceback (most recent call last):████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 16/16 [00:01<00:00, 16.69it/s]  File "/webui-vanilla/stable-diffusion-webui/venv/lib/python3.8/site-packages/gradio/routes.py", line 337, in run_predict
    output = await app.get_blocks().process_api(
  File "/webui-vanilla/stable-diffusion-webui/venv/lib/python3.8/site-packages/gradio/blocks.py", line 1013, in process_api
    inputs = self.preprocess_data(fn_index, inputs, state)
  File "/webui-vanilla/stable-diffusion-webui/venv/lib/python3.8/site-packages/gradio/blocks.py", line 911, in preprocess_data
    processed_input.append(block.preprocess(inputs[i]))
  File "/webui-vanilla/stable-diffusion-webui/venv/lib/python3.8/site-packages/gradio/components.py", line 1488, in preprocess
    assert isinstance(x, dict)
AssertionError

Additional information

No response

MarkoS046 commented 1 year ago

@Klace Any luck so far? Same issue on MacBook Pro M2Ultra 13.2.1

rookiexjl commented 1 year ago

Total progress: 24it [00:20, 1.18it/s] Traceback (most recent call last):it/s] File "D:\work\workspace_pycharm\python_ai\stable-diffusion-webui\venv\lib\site-packages\gradio\routes.py", line 399, in run_predict output = await app.get_blocks().process_api( File "D:\work\workspace_pycharm\python_ai\stable-diffusion-webui\venv\lib\site-packages\gradio\blocks.py", line 1297, in process_api inputs = self.preprocess_data(fn_index, inputs, state) File "D:\work\workspace_pycharm\python_ai\stable-diffusion-webui\venv\lib\site-packages\gradio\blocks.py", line 1145, in preprocess_data processed_input.append(block.preprocess(inputs[i])) File "D:\work\workspace_pycharm\python_ai\stable-diffusion-webui\venv\lib\site-packages\gradio\components.py", line 1780, in preprocess assert isinstance(x, dict) AssertionError

haminhesam commented 1 year ago

Same Here, I'm trying to use infinite zoom in stable diffusion

Traceback (most recent call last): File "E:\stable-diffusion-webui-master\stable-diffusion-webui-master\venv\lib\site-packages\gradio\routes.py", line 408, in run_predict output = await app.get_blocks().process_api( File "E:\stable-diffusion-webui-master\stable-diffusion-webui-master\venv\lib\site-packages\gradio\blocks.py", line 1313, in process_api inputs = self.preprocess_data(fn_index, inputs, state) File "E:\stable-diffusion-webui-master\stable-diffusion-webui-master\venv\lib\site-packages\gradio\blocks.py", line 1163, in preprocess_data processed_input.append(block.preprocess(inputs[i])) File "E:\stable-diffusion-webui-master\stable-diffusion-webui-master\venv\lib\site-packages\gradio\components.py", line 1778, in preprocess assert isinstance(x, str) AssertionError

rookiexjl commented 1 year ago

什么事

Linjovi commented 1 year ago

same problem

rookiexjl commented 1 year ago

什么事

jieran233 commented 1 year ago

Same question. The steps to reproduce my problem are as follows:

  1. Go to img2img-->inpaint, upload image and draw mask
  2. Go to PNG info, upload image and click send to inpaint
  3. Return to img2img-->inpaint, click Generate

Platform: Windows10 Web browser: Mozilla Firefox, Chromium Command line args: --listen --xformers --upcast-sampling --no-half-vae Console log:

Traceback (most recent call last):
  File "C:\Users\jiera\stable-diffusion-webui\venv\lib\site-packages\gradio\routes.py", line 422, in run_predict
    output = await app.get_blocks().process_api(
  File "C:\Users\jiera\stable-diffusion-webui\venv\lib\site-packages\gradio\blocks.py", line 1321, in process_api
    inputs = self.preprocess_data(fn_index, inputs, state)
  File "C:\Users\jiera\stable-diffusion-webui\venv\lib\site-packages\gradio\blocks.py", line 1171, in preprocess_data
    processed_input.append(block.preprocess(inputs[i]))
  File "C:\Users\jiera\stable-diffusion-webui\venv\lib\site-packages\gradio\components.py", line 1822, in preprocess
    assert isinstance(x, dict)
AssertionError
soyatlas commented 1 year ago

Here is similar error. It happend later other error solved about comunication betwen server (a1111) and (Edge).

I had erased these files with bad configuration (config.json ui-config.json) and error follow.

I go to settings and any button has his name double, is repeat. Then I save and get this error. AssertionError: Bad value for setting auto_launch_browser: ['Disable', 'Disable']; expecting str

Some buttons with double name in it. imagen

imagen

imagen

And the log error

Error completing request Arguments: (True, 'png', 'SED=[seed] STP=[steps] CLP=[clip_skip] CFG=[cfg] SMPLR=[sampler] MDL=[model_name] batchnumber=[batch_number] [prompt_words]', True, True, 'png', True, True, False, '', -1, '', '#000000', '#999999', '#ffffff', True, False, False, False, False, False, False, 80, True, True, 4.0, 4000.0, 200.0, True, True, True, True, 'F:\imagina\a1111\tmp', True, True, 'F:\imagina\a1111\', 'outputs/txt2img-images', 'outputs/img2img-images', 'outputs/extras-images', 'F:\imagina\a1111\', 'outputs/txt2img-grids', 'outputs/img2img-grids', 'F:\imagina\a1111\SAVE', 'F:\imagina\a1111\INIT', True, True, True, '[date]', 8, 192, 8, ['R-ESRGAN 4x+', 'R-ESRGAN 4x+ Anime6B'], None, 100, False, 256, 8, 192, 8, False, 'CodeFormer', 0.5, False, 'Local', True, True, 8, True, True, True, True, False, True, True, True, '', False, False, False, True, '', ' ', 1, 500.0, False, False, False, 120.0, {}, 1, True, 0, 'Automatic', False, True, True, 20, 1, False, 'GPU', False, 'second pass', 0.0, 0.0, 2.5, 6.0, "VAE is a neural network that transforms a standard RGB\nimage into latent space representation and back. Latent space representation is what stable diffusion is working on during sampling\n(i.e. when the progress bar is between empty and full). For txt2img, VAE is used to create a resulting image after the sampling is finished.\nFor img2img, VAE is used to process user's input image before the sampling, and to create an image after sampling.", 0, 'Automatic', True, True, 'Full', 'Full', 1, 1, 0, False, False, '#ffffff', 720, '#ffffff', '#ffffff', '#ffffff', False, False, 'Automatic', 0, 0, 0, 0, False, True, True, False, False, False, False, False, False, False, False, False, False, 1, 24, 48, 1500.0, [], 0.5, True, True, True, '', True, 'When searched', 1, 0.0, 0.0, 1, True, ' ', '', False, True, 'None', 'None', 'Alias from file', True, False, [], 0, 'None', 'Default', True, '', True, False, True, True, True, True, False, 250.0, True, True, True, 0.1, 0.05, '.,\/!?%^;:{}=`~()', True, ['sd_model_checkpoint'], [], [], [], False, False, False, [], [], 2, False, True, True, False, True, True, ['Apply if any', 'Apply if any'], True, True, 'png', True, 10, 'Approx NN', False, 'Prompt', 1000.0, False, [], 0, 1, 'uniform', 0, 0, 0, 1, 'Automatic', 0.0, 0.0, 0.0, 0, False, False, 'bh1', 'time_uniform', 3, True, [], [], 5, {}, {}, {}, {}, 'Alt', 'Ctrl', 'F', 'S', 'R', 'O', True, True, False, ['Overlap']) {} Traceback (most recent call last): File "J:\stable-diffusion-webui\modules\call_queue.py", line 57, in f res = list(func(args, *kwargs)) File "J:\stable-diffusion-webui\modules\ui_settings.py", line 254, in fn=wrap_gradio_call(lambda args: self.run_settings(*args), extra_outputs=[gr.update()]), File "J:\stable-diffusion-webui\modules\ui_settings.py", line 71, in run_settings assert comp == self.dummy_component or opts.same_type(value, opts.data_labels[key].default), f"Bad value for setting {key}: {value}; expecting {type(opts.data_labels[key].default).name}" AssertionError: Bad value for setting infotext_styles: ['Apply if any', 'Apply if any']; expecting str


daszzzpg commented 8 months ago

Same here After some generations it fails

rookiexjl commented 8 months ago

什么事