vladmandic / automatic

SD.Next: Advanced Implementation of Stable Diffusion and other Diffusion-based generative image models
https://github.com/vladmandic/automatic
GNU Affero General Public License v3.0
5.72k stars 425 forks source link

[Issue]: Send to txt2img broken: KeyError: 331 #397

Closed neurogen-dev closed 1 year ago

neurogen-dev commented 1 year ago

Issue Description

The problem does not always appear. When selecting an image in the Image Browser or via Process Image and then trying to send the information to txt2img, Gradio hangs and an error appears in the console:

Running on local URL:  http://127.0.0.1:7860

To create a public link, set `share=True` in `launch()`.
Initializing middleware
Startup time: 6.2s (scripts=1.3s ui=4.7s start=0.1s scripts app_started_callback=0.1s)
GENINFO award winning studio photo of beautiful girl, raw photo, (1girl:1.2), half body, detailed garden on the background, (ultra detailed:1.4), lots details, sharp focus, hdr, (detailed blue duochrome dress:1.2), make up, decorations, detailed face, nature skin texture, sexual smiling, bright colors, (saturated:1.2), vibrant colors
Negative prompt: deformed, bad anatomy, disfigured, poorly drawn face, mutation, mutated, extra limb, ugly, disgusting, poorly drawn hands, missing limb, floating limbs, disconnected limbs, malformed hands, blurry, ((((mutated hands and fingers)))), watermark, watermarked, censored, distorted hands, amputation, missing hands, obese, doubled face, double hands, asian, (2girl:1.4), asian
Steps: 40, Sampler: Euler a, CFG scale: 7, Seed: 177600654, Size: 512x904, Model hash: c074015431, Model: neurogen_art_v1fp16, Denoising strength: 0.35, Clip skip: 2, Token merging random: True, Hires upscale: 2, Hires steps: 50, Hires upscaler: 4x_UniversalUpscalerV2-Sharper_103000_G
Traceback (most recent call last):
  File "E:\SD\automatic\venv\lib\site-packages\gradio\routes.py", line 394, in run_predict
    output = await app.get_blocks().process_api(
  File "E:\SD\automatic\venv\lib\site-packages\gradio\blocks.py", line 1078, in process_api
    data = self.postprocess_data(fn_index, result["prediction"], state)
  File "E:\SD\automatic\venv\lib\site-packages\gradio\blocks.py", line 994, in postprocess_data
    block = self.blocks[output_id]
KeyError: 331
Traceback (most recent call last):
  File "E:\SD\automatic\venv\lib\site-packages\gradio\routes.py", line 394, in run_predict
    output = await app.get_blocks().process_api(
  File "E:\SD\automatic\venv\lib\site-packages\gradio\blocks.py", line 1078, in process_api
    data = self.postprocess_data(fn_index, result["prediction"], state)
  File "E:\SD\automatic\venv\lib\site-packages\gradio\blocks.py", line 994, in postprocess_data
    block = self.blocks[output_id]
KeyError: 331

Version Platform Description

Windows 11 python: 3.10.10  •  torch: 2.1.0.dev20230422+cu118  •  xformers: N/A  •  gradio: 3.23.0  •  commit: 4cb46d54  •  checkpoint: 43802795a4

jrameken commented 1 year ago

This has been happening to me as well. Though in my case I get a KeyError 373, but otherwise the error log is the same:

Traceback (most recent call last): File "F:\SD-AUTOVLAD\venv\lib\site-packages\gradio\routes.py", line 394, in run_predict output = await app.get_blocks().process_api( File "F:\SD-AUTOVLAD\venv\lib\site-packages\gradio\blocks.py", line 1078, in process_api data = self.postprocess_data(fn_index, result["prediction"], state) File "F:\SD-AUTOVLAD\venv\lib\site-packages\gradio\blocks.py", line 994, in postprocess_data block = self.blocks[output_id] KeyError: 373

vladmandic commented 1 year ago

see #224