-
Notifications
You must be signed in to change notification settings - Fork 27k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug]: {'error': 'ValueError', 'detail': '', 'body': '', 'errors': 'height and width must be > 0'} #11425
Closed
1 task done
Labels
bug-report
Report of a bug, yet to be confirmed
Comments
same error |
same here |
4 tasks
same error |
AUTOMATIC1111
added a commit
that referenced
this issue
Jul 13, 2023
…xel-error fix: check fill size none zero when resize (fixes #11425)
same error |
Mapleshade20
added a commit
to Mapleshade20/stable-diffusion-webui
that referenced
this issue
Jul 25, 2023
* 🐛 Allow Script to have metaclass * update the description of --add-stop-rout * fix: adding elem_id for img2img resize to and resize by tabs * Add use_main_prompt parameter to use proper metadata for batch run grids or individual images * PNG info support at img2img batch * use ui params when retreiving png info fails Don't want to interrupt the process since batches can be huge. This makes more sense to me than using the previous images parameters * resolve linter * feat(extensions): add toggle all checkbox to Installed tab Small QoL addition. While there is the option to disable all extensions with the radio buttons at the top, that only acts as an added flag and doesn't really change the state of the extensions in the UI. An use case for this checkbox is to disable all extensions except for a few, which is important for debugging extensions. You could do that before, but you'd have to uncheck and recheck every extension one by one. * alternate fix for catch errors when retrieving extension index AUTOMATIC1111#11290 * send tensors to the correct device when loading from safetensors file with memmap disabled for AUTOMATIC1111#11260 * fix and rework AUTOMATIC1111#11113 * Add options to change colors in grid * add 'before_hr callback' script callback * fixing --subpath on newer gradio version * Revision * Fix lint * Move change colors options to Saving images/grids * add callback after_extra_networks_activate * Correctly remove end parenthesis with ctrl+up/down * rename --add-stop-route to --api-server-stop * sync default value of process_focal_crop_entropy_weight between ui and api * add stars * starts left * fix can't get current hash * add extensions Update Created dates with sorting * fix for AUTOMATIC1111#11534: canvas zoom and pan extension hijacking shortcut keys * Change default seed_resize to 0 * Hotfix: call processing close to cleanup API generation calls * fixing the copy/paste function, correct code * Fix launch script to be runnable from any directory * Update webui.sh * Add SD_WEBUI_LOG_LEVEL envvar * Add job argument to State.begin() * API: use finally: for state.end() * Add a status logger in modules.shared * Use read_info_from_image in postprocessing Avoids bad keys such as `exif` ending up in the "PNG info" passed forward * read_info_from_image: add `photoshop` to ignored * read_info_from_image: add type * read_info_from_image: don't mutate info in passed-in image * Handle cleanup in case there's an exception thrown * Use contextlib for closing the generation process * Check seed_resize_from <= 0 * made the blur function optional, added exclusion buttons * Allow gif for extra network previews * Fix throwing exception when trying to resize image with I;16 mode * Fix warning of 'has_mps' is deprecated from PyTorch * fix(api): convert to "RGB" if image mode is "RGBA" * Fix UnicodeEncodeError when writing to file CLIP Interrogator Batch Mode The code snippet print(interrogation_function(img), file=open(os.path.join(ii_output_dir, f"{left}.txt"), 'a')) raises a UnicodeEncodeError with the message "'charmap' codec can't encode character '\u016b' in position 129". This error occurs because the default encoding used by the open() function cannot handle certain Unicode characters. To fix this issue, the encoding parameter needs to be explicitly specified when opening the file. By using an appropriate encoding, such as 'utf-8', we can ensure that Unicode characters are properly encoded and written to the file. The updated code should be modified as follows: python Copy code print(interrogation_function(img), file=open(os.path.join(ii_output_dir, f"{left}.txt"), 'a', encoding='utf-8')) By making this change, the code will no longer raise the UnicodeEncodeError and will correctly handle Unicode characters during the file write operation. * Added a prompt for users using poor scaling Added a JavaScript file that detects browser scaling and prompts users when scale is not 100% * Add a link to an index-able/crawl-able wiki mirroring service of the wiki At the moment, the wiki is editable by GitHub users, so it is blocked from indexing. If you are searching for something related to this repo, Google and other search engines will not use the content for it. This link hack just sticks a link on the README so search engines may prioritize it. At the moment, 0 pages from GitHub are index and only 7 pages from my proxy service are. If you add this, the rest should get indexed. An indexable page looks like this: https://github-wiki-see.page/m/AUTOMATIC1111/stable-diffusion-webui/wiki/Command-Line-Arguments-and-Settings. It is not meant to be read, just indexed, and users are expected to click through to the GitHub copy. https://github-wiki-see.page/ has more information about the situation. I built the tool and I'm happy to answer any questions I can. Similar: https://github.com/MiSTer-devel/Main_MiSTer#main_mister-main-binary-and-wiki-repo:~:text=For%20the%20purposes%20of%20getting%20google%20to%20crawl%20the%20wiki%2C%20here%27s%20a%20link%20to%20the%20(not%20for%20humans)%20crawlable%20wiki * fix problem with extra network saving images as previews losing generation info add a description for save_image_with_geninfo * lint fix for AUTOMATIC1111#11492 * whitespace for AUTOMATIC1111#11477 * fix for AUTOMATIC1111#11478 * additional changes for merge conflict for AUTOMATIC1111#11337 * additional changes for merge conflict for AUTOMATIC1111#11337 * third time's the charm * small rework for img2img PNG info * for AUTOMATIC1111#10650: change key to alt+arrows, enable by default * use natural sort for shared.walk_files and shared.listfiles, as well as for dirs in extra networks * rework AUTOMATIC1111#10436 to use shared.walk_files * added torch.mps.empty_cache() to torch_gc() changed a bunch of places that use torch.cuda.empty_cache() to use torch_gc() instead * Fix typo: checkpoint_alisases * pin version for torch for Navi3 according to comment from AUTOMATIC1111#11228 * move github proxy to settings, System page. * fix for eslint * add option SWIN_torch_compile to accelerate SwinIR upscale using torch.compile() * Revert Pull Request AUTOMATIC1111#11244 Revert "Add github mirror for the download extension" This reverts commit 9ec2ba2. Revert "Update code style" This reverts commit de022c4. Revert "Update call method" This reverts commit e9bd18c. Revert "move github proxy to settings, System page." This reverts commit 4981c7d. * Use closing() with processing classes everywhere Follows up on AUTOMATIC1111#11569 * add cmd_args: --timeout-keep-alive * set timeout_keep_alive * Fix MPS cache cleanup Importing torch does not import torch.mps so the call failed. * Allow using alt in the prompt fields again * getting SD2.1 to run on SDXL repo * Save img2img batch with images.save_image() * fix: check fill size none zero when resize (fixes AUTOMATIC1111#11425) * Add correct logger name * Don't do MPS GC when there's a latent that could still be sampled * use submit blur for quick settings textbox * SDXL support * linter * fix importlib.machinery issue on github's autotests #yolo * mute unneeded SDXL imports for tests too * get attention optimizations to work * lint * fix CLIP doing the unneeded normalization revert SD2.1 back to use the original repo add SDXL's force_zero_embeddings to negative prompt * lora support * fix broken img2img * add XL support for live previews: approx and TAESD * repair --no-half for SDXL * mute SDXL imports in the place there SDXL is imported for the first time instead of launch.py * add support for SDXL loras with te1/te2 modules * thank you linter * handles model hash cache.json error * initial SDXL refiner support * linter * raise maximum Negative Guidance minimum sigma due to request in PR discussion * do not run workflow items twice for PRs from this repo update names * repair medvram and lowvram * edit names more * add more relevant fields to caching conds * add cheap VAE approximation coeffs for SDXL * add a message about unsupported samplers * restyle time taken/VRAM display * Added [none] filename token. * fix an issue in live previews that happens when you use SDXL with fp16 VAE * disable rich exception output in console for API by default, use WEBUI_RICH_EXCEPTIONS env var to enable * add padding and identification to generation log section (Failed to find Loras, Used embeddings, etc...) * add textual inversion hashes to infotext * cache git extension repo information * suppress printing TI embedding into console by default * remove "## " from changelog.md version * allow replacing extensions index with environment variable * Warns merge into master * user metadata system for custom networks * eslint * add lora user metadata editor dialog inspired by MrKuenning's mockup from AUTOMATIC1111#7458 * fix styles for dark people * Update shared.py * 404 when thumb file not found * allow refreshing single card after editing user metadata instead of all cards * speedup extra networks listing * fix bogus metadata for extra networks appearing out of cache fix description editing for checkpoint not immediately appearing on cards * add resolution calculation from buckets for lora user metadata page * nuke thumbs extra networks view mode (use settings tab to change width/height/scale to get thumbs) * minor restyling for extra networks * possible fix for FP16 VAE failing in img2img SDXL * fix cache loading wrong entries from old cache files * changelog for future 1.5.0 * lora extension rework to include other types of networks * linter * fix * IA3 support * Lokr support * XYZ always_discard_next_to_last_sigma Co-authored-by: Franck Mahon <franck.mahon@gmail.com> * reversible boolean_choice order * lowercase * support specifying te and unet weights separately update lora code support full module * some backwards compatibility linter * delay writing cache to prevent writing the same thing over and over * add alias to lyco network read networks from LyCORIS dir if it exists add credits * move generate button below the picture for mobile clients * hide cards for networks of incompatible stable diffusion version in Lora extra networks interface * skip installing packages with pip if theyare already installed record time it took to launch * Fix wrong key name in lokr module * use "is not None" for Tensor * Add support for `--upcast-sampling` with SD XL * remove duplicate * also make None a valid option for options API for AUTOMATIC1111#11854 * lint * add a bit more metadata info for the lora user metadata page * return sd_model_checkpoint to None * changelog for 1.5.0 * fix the issue with /sdapi/v1/options failing (this time for sure!) fix automated tests downloading CLIP model * linter fix * add backwards compatibility --lyco-dir-backcompat option, use that for LyCORIS directory instead of hardcoded value prevent running preload.py for disabled extensions * Make possible to install web ui without venv with --novenv flag When passing `--novenv` flag to webui.sh it can skip venv. Might be useful for installing in Docker since messing with venv in Docker might be a bit complicated. Example usage: `webui.sh --novenv` Hope this gets approved and pushed into future versions of Web UI * fix incorrect multiplier for Loras * Replace argument with env variable * improve var naming * missing p save_image before-highres-fix * bugfix: model name was added together with directory name to infotext and to [model_name] filename pattern * bugfix: model name was added together with directory name to infotext and to [model_name] filename pattern * automatically switch to 32-bit float VAE if the generated picture has NaNs. * Update sd_models_xl.py Fix width/height not getting fed into the conditioning * repair --medvram for SD2.x too after SDXL update --------- Co-authored-by: huchenlei <chenlei.hu@mail.utoronto.ca> Co-authored-by: w-e-w <40751091+w-e-w@users.noreply.github.com> Co-authored-by: George Gu <minggu@amazon.com> Co-authored-by: stablegeniusdiffuser <stablediffuser23@gmail.com> Co-authored-by: Ferdinand Weynschenk <flweynschenk@gmail.com> Co-authored-by: Martín (Netux) Rodríguez <send.email@netux.site> Co-authored-by: AUTOMATIC <16777216c@gmail.com> Co-authored-by: Beinsezii <39478211+Beinsezii@users.noreply.github.com> Co-authored-by: NoCrypt <57245077+NoCrypt@users.noreply.github.com> Co-authored-by: hako-mikan <122196982+hako-mikan@users.noreply.github.com> Co-authored-by: catalpaaa <caojingzifang@gmail.com> Co-authored-by: missionfloyd <missionfloyd@users.noreply.github.com> Co-authored-by: hunshcn <hunsh.cn@gmail.com> Co-authored-by: Akiba <akiba@anzu.link> Co-authored-by: gshawn3 <133769806+gshawn3@users.noreply.github.com> Co-authored-by: ramyma <ramy.mahmoudi@gmail.com> Co-authored-by: Danil Boldyrev <daswerq123@gmail.com> Co-authored-by: onyasumi <kugelblitz3@outlook.com> Co-authored-by: Frank Tao <48634762+onyasumi@users.noreply.github.com> Co-authored-by: Aarni Koskela <akx@iki.fi> Co-authored-by: semjon00 <semjon.00@gmail.com> Co-authored-by: Hao-Wu <haowu.wuhao@gmail.com> Co-authored-by: jovijovi <mageyul@hotmail.com> Co-authored-by: Neil Mahseth <neilmahaseth@gmail.com> Co-authored-by: gitama2023 <138025603+gitama2023@users.noreply.github.com> Co-authored-by: Nelson Chen <crazysim@gmail.com> Co-authored-by: SiYu Wu <wu.siyu@hotmail.com> Co-authored-by: wfjsw <wfjsw@users.noreply.github.com> Co-authored-by: TangJicheng <tangjch15@gmail.com> Co-authored-by: 王怀宗 <whz@meitu.com> Co-authored-by: Marcus Adams <rawlogic@gmail.com> Co-authored-by: Leon Feng <523684+leon0707@users.noreply.github.com> Co-authored-by: Franck Mahon <franck.mahon@gmail.com> Co-authored-by: Kohaku-Blueleaf <59680068+KohakuBlueleaf@users.noreply.github.com> Co-authored-by: brkirch <brkirch@users.noreply.github.com> Co-authored-by: Leon Feng <best.sum@gmail.com> Co-authored-by: kopyl <oleggggg1997@gmail.com> Co-authored-by: Janek Mann <janekm@gmail.com>
maybe X connection error |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Is there an existing issue for this?
What happened?
When I call the img2img API, sometimes this error is reported, but if I don't use graffiti without mask parameters, there is no problem
Steps to reproduce the problem
call img2img api with mak param
What should have happened?
`API error: POST: http://127.0.0.1:7161/sdapi/v1/img2img {'error': 'ValueError', 'detail': '', 'body': '', 'errors': 'height and width must be > 0'}
Traceback (most recent call last):
File "/root/miniconda3/envs/xl_env/lib/python3.10/site-packages/anyio/streams/memory.py", line 94, in receive
return self.receive_nowait()
File "/root/miniconda3/envs/xl_env/lib/python3.10/site-packages/anyio/streams/memory.py", line 89, in receive_nowait
raise WouldBlock
anyio.WouldBlock
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/root/miniconda3/envs/xl_env/lib/python3.10/site-packages/starlette/middleware/base.py", line 78, in call_next
message = await recv_stream.receive()
File "/root/miniconda3/envs/xl_env/lib/python3.10/site-packages/anyio/streams/memory.py", line 114, in receive
raise EndOfStream
anyio.EndOfStream
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/root/autodl-tmp/stable-diffusion-webui/modules/api/api.py", line 152, in exception_handling
return await call_next(request)
File "/root/miniconda3/envs/xl_env/lib/python3.10/site-packages/starlette/middleware/base.py", line 84, in call_next
raise app_exc
File "/root/miniconda3/envs/xl_env/lib/python3.10/site-packages/starlette/middleware/base.py", line 70, in coro
await self.app(scope, receive_or_disconnect, send_no_error)
File "/root/miniconda3/envs/xl_env/lib/python3.10/site-packages/starlette/middleware/base.py", line 108, in call
response = await self.dispatch_func(request, call_next)
File "/root/autodl-tmp/stable-diffusion-webui/modules/api/api.py", line 117, in log_and_time
res: Response = await call_next(req)
File "/root/miniconda3/envs/xl_env/lib/python3.10/site-packages/starlette/middleware/base.py", line 84, in call_next
raise app_exc
File "/root/miniconda3/envs/xl_env/lib/python3.10/site-packages/starlette/middleware/base.py", line 70, in coro
await self.app(scope, receive_or_disconnect, send_no_error)
File "/root/miniconda3/envs/xl_env/lib/python3.10/site-packages/starlette/middleware/cors.py", line 84, in call
await self.app(scope, receive, send)
File "/root/miniconda3/envs/xl_env/lib/python3.10/site-packages/starlette/middleware/gzip.py", line 24, in call
await responder(scope, receive, send)
File "/root/miniconda3/envs/xl_env/lib/python3.10/site-packages/starlette/middleware/gzip.py", line 44, in call
await self.app(scope, receive, self.send_with_gzip)
File "/root/miniconda3/envs/xl_env/lib/python3.10/site-packages/starlette/middleware/exceptions.py", line 79, in call
raise exc
File "/root/miniconda3/envs/xl_env/lib/python3.10/site-packages/starlette/middleware/exceptions.py", line 68, in call
await self.app(scope, receive, sender)
File "/root/miniconda3/envs/xl_env/lib/python3.10/site-packages/fastapi/middleware/asyncexitstack.py", line 21, in call
raise e
File "/root/miniconda3/envs/xl_env/lib/python3.10/site-packages/fastapi/middleware/asyncexitstack.py", line 18, in call
await self.app(scope, receive, send)
File "/root/miniconda3/envs/xl_env/lib/python3.10/site-packages/starlette/routing.py", line 718, in call
await route.handle(scope, receive, send)
File "/root/miniconda3/envs/xl_env/lib/python3.10/site-packages/starlette/routing.py", line 276, in handle
await self.app(scope, receive, send)
File "/root/miniconda3/envs/xl_env/lib/python3.10/site-packages/starlette/routing.py", line 66, in app
response = await func(request)
File "/root/miniconda3/envs/xl_env/lib/python3.10/site-packages/fastapi/routing.py", line 237, in app
raw_response = await run_endpoint_function(
File "/root/miniconda3/envs/xl_env/lib/python3.10/site-packages/fastapi/routing.py", line 165, in run_endpoint_function
return await run_in_threadpool(dependant.call, **values)
File "/root/miniconda3/envs/xl_env/lib/python3.10/site-packages/starlette/concurrency.py", line 41, in run_in_threadpool
return await anyio.to_thread.run_sync(func, *args)
File "/root/miniconda3/envs/xl_env/lib/python3.10/site-packages/anyio/to_thread.py", line 31, in run_sync
return await get_asynclib().run_sync_in_worker_thread(
File "/root/miniconda3/envs/xl_env/lib/python3.10/site-packages/anyio/_backends/_asyncio.py", line 937, in run_sync_in_worker_thread
return await future
File "/root/miniconda3/envs/xl_env/lib/python3.10/site-packages/anyio/_backends/_asyncio.py", line 867, in run
result = context.run(func, *args)
File "/root/autodl-tmp/stable-diffusion-webui/modules/api/api.py", line 392, in img2imgapi
processed = process_images(p)
File "/root/autodl-tmp/stable-diffusion-webui/modules/processing.py", line 610, in process_images
res = process_images_inner(p)
File "/root/autodl-tmp/stable-diffusion-webui/modules/processing.py", line 670, in process_images_inner
p.init(p.all_prompts, p.all_seeds, p.all_subseeds)
File "/root/autodl-tmp/stable-diffusion-webui/modules/processing.py", line 1161, in init
image_mask = images.resize_image(2, mask, self.width, self.height)
File "/root/autodl-tmp/stable-diffusion-webui/modules/images.py", line 305, in resize_image
res.paste(resized.resize((width, fill_height), box=(0, 0, width, 0)), box=(0, 0))
File "/root/miniconda3/envs/xl_env/lib/python3.10/site-packages/PIL/Image.py", line 2193, in resize
return self._new(self.im.resize(size, resample, box))
ValueError: height and width must be > 0`
Commit where the problem happens
master
What Python version are you running on ?
Python 3.10.x
What platforms do you use to access the UI ?
Linux
What device are you running WebUI on?
Other GPUs
What browsers do you use to access the UI ?
Google Chrome
Command Line Arguments
*
List of extensions
Console logs
Additional information
nothing
The text was updated successfully, but these errors were encountered: