Commit Graph

3215 Commits

Author SHA1 Message Date
AUTOMATIC1111 46c2b1e202
Merge pull request #11660 from neilmahaseth/patch-1
Fix UnicodeEncodeError when writing to file CLIP Interrogator Batch Mode
2023-07-08 13:10:03 +03:00
Neil Mahseth c258dd34a8
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.
2023-07-06 22:02:47 +05:30
jovijovi 259967b7c6 fix(api): convert to "RGB" if image mode is "RGBA" 2023-07-06 18:43:17 +08:00
Hao-Wu daf41a2734 Fix warning of 'has_mps' is deprecated from PyTorch 2023-07-06 15:37:10 +08:00
semjon00 fb661e089f Fix throwing exception when trying to resize image with I;16 mode 2023-07-05 15:39:04 +03:00
missionfloyd c602471b85
Allow gif for extra network previews 2023-07-05 03:19:26 -06:00
missionfloyd f731a728c6
Check seed_resize_from <= 0 2023-07-03 11:41:10 -06:00
ramyma c1c0492859 Use contextlib for closing the generation process 2023-07-03 20:17:47 +03:00
ramyma 3278887317 Handle cleanup in case there's an exception thrown 2023-07-03 20:02:30 +03:00
Aarni Koskela 5c6a33b3e1 read_info_from_image: don't mutate info in passed-in image 2023-07-03 13:10:42 +03:00
Aarni Koskela 96f0593c8f read_info_from_image: add type 2023-07-03 13:10:20 +03:00
Aarni Koskela b2c574891f read_info_from_image: add `photoshop` to ignored 2023-07-03 13:09:37 +03:00
Aarni Koskela 08f9b705cd Use read_info_from_image in postprocessing
Avoids bad keys such as `exif` ending up in the "PNG info" passed forward
2023-07-03 13:08:28 +03:00
Aarni Koskela 522a8b9f62 Add a status logger in modules.shared 2023-07-03 11:07:57 +03:00
Aarni Koskela e430344347 API: use finally: for state.end() 2023-07-03 11:03:41 +03:00
Aarni Koskela f44feb6a10 Add job argument to State.begin() 2023-07-03 11:03:41 +03:00
ramyma 74d001bc68 Hotfix: call processing close to cleanup API generation calls 2023-07-02 04:59:59 +03:00
missionfloyd 7f46f81dd7
Change default seed_resize to 0 2023-07-01 17:20:56 -06:00
w-e-w 2ccc832b33 add extensions Update Created dates with sorting 2023-06-29 22:46:59 +09:00
Akiba 0416a7bfba
fix can't get current hash 2023-06-29 18:46:52 +08:00
w-e-w d47324b898 add stars 2023-06-29 19:25:18 +09:00
hunshcn 0bc0e652a3 sync default value of process_focal_crop_entropy_weight between ui and api 2023-06-29 18:12:55 +08:00
w-e-w cc9c171978 rename --add-stop-route to --api-server-stop 2023-06-29 14:21:28 +09:00
w-e-w 9c2a7f1e8b add callback after_extra_networks_activate 2023-06-29 02:08:21 +09:00
NoCrypt f74fb50495 Move change colors options to Saving images/grids 2023-06-28 20:24:57 +07:00
NoCrypt d22eb8a17f Fix lint 2023-06-28 17:57:34 +07:00
NoCrypt 45ab7475d6 Revision 2023-06-28 17:55:58 +07:00
hako-mikan b0ec69b360
add 'before_hr callback' script callback 2023-06-28 18:37:08 +09:00
NoCrypt da14f6a663 Add options to change colors in grid 2023-06-28 10:16:44 +07:00
AUTOMATIC1111 fab73f2e7d
Merge pull request #11325 from stablegeniusdiffuser/dev-batch-grid-metadata
Add parameter to differentiate between batch run grids or ordinary images to write proper metadata
2023-06-27 14:23:39 +03:00
AUTOMATIC1111 1bf01b73f4
Merge pull request #11046 from akx/ded-code
Remove a bunch of unused/vestigial code
2023-06-27 11:25:55 +03:00
AUTOMATIC d06af4e517 fix and rework #11113 2023-06-27 09:26:18 +03:00
AUTOMATIC1111 0b97ae2832
Merge branch 'dev' into master 2023-06-27 09:23:15 +03:00
AUTOMATIC1111 3cd4fd51ef
Merge pull request #10823 from akx/model-loady
Upscaler model loading cleanup
2023-06-27 09:20:49 +03:00
AUTOMATIC1111 d4f9250c5a
Merge pull request #11201 from akx/ruff-upg
Upgrade Ruff to 0.0.272
2023-06-27 09:19:55 +03:00
AUTOMATIC 24129368f1 send tensors to the correct device when loading from safetensors file with memmap disabled for #11260 2023-06-27 09:19:04 +03:00
AUTOMATIC1111 14196548c5
Merge pull request #11260 from dhwz/dev
fix very slow loading speed of .safetensors files
2023-06-27 09:11:08 +03:00
AUTOMATIC1111 4147fd6b2f
Merge branch 'dev' into 10141-gradio-user-exif 2023-06-27 09:05:53 +03:00
AUTOMATIC1111 58a9a261c4
Merge branch 'dev' into meta_class 2023-06-27 09:02:38 +03:00
AUTOMATIC1111 2c43dd766d
Merge pull request #11226 from AUTOMATIC1111/git-clone-progress
show Git clone progress
2023-06-27 09:01:04 +03:00
AUTOMATIC 9bb1fcfad4 alternate fix for catch errors when retrieving extension index #11290 2023-06-27 08:59:35 +03:00
AUTOMATIC1111 fa31dd80f5
Merge pull request #11315 from guming3d/master
fix: adding elem_id for img2img resize to and resize by tabs
2023-06-27 08:53:10 +03:00
AUTOMATIC1111 2b247f3533
Merge pull request #11415 from netux/extensions-toggle-all
Add checkbox to check/uncheck all extensions in the Installed tab
2023-06-27 08:44:37 +03:00
AUTOMATIC1111 3e76ae5f50
Merge pull request #11146 from AUTOMATIC1111/api-quit-restart
api quit restart
2023-06-27 08:41:36 +03:00
AUTOMATIC1111 cd7c03e1f6
Merge pull request #11136 from arch-fan/typo
fixed typos
2023-06-27 06:40:43 +03:00
AUTOMATIC1111 a9e7a3db3e
Merge pull request #11199 from akx/makedirs
Use os.makedirs(..., exist_ok=True)
2023-06-27 06:39:51 +03:00
AUTOMATIC1111 820bbb5b7b
Merge pull request #11408 from wfjsw/patch-1
Strip whitespaces from URL and dirname prior to extension installation
2023-06-27 06:20:59 +03:00
AUTOMATIC 4bd490c28d add missing infotext entry for the pad cond/uncond option 2023-06-27 06:18:43 +03:00
Martín (Netux) Rodríguez dd268c48c9 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.
2023-06-25 00:48:46 -03:00
Jabasukuriputo Wang d5a5f2f29f
Strip whitespaces from URL and dirname prior to extension installation
This avoid some cryptic errors brought by accidental spaces around urls
2023-06-25 01:31:02 +08:00
Ferdinand Weynschenk c4c63dd5e4 resolve linter 2023-06-20 14:03:42 +02:00
Ferdinand Weynschenk 7ad48120d4 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
2023-06-20 13:50:02 +02:00
Ferdinand Weynschenk 928bd42da4 PNG info support at img2img batch 2023-06-20 13:33:36 +02:00
stablegeniusdiffuser 27e9e3f6fa Add use_main_prompt parameter to use proper metadata for batch run grids or individual images 2023-06-19 20:36:44 +02:00
George Gu d2ccdcdc97 fix: adding elem_id for img2img resize to and resize by tabs 2023-06-19 10:16:18 +08:00
w-e-w 2e1710d88e update the description of --add-stop-rout 2023-06-18 14:07:41 +09:00
huchenlei 373ff5a217 🐛 Allow Script to have metaclass 2023-06-16 15:17:17 -04:00
dhwz 41363e0d27 fix very slow loading speed of .safetensors files 2023-06-16 18:10:15 +02:00
XiaoMeng Mai e9bd18c57b Update call method 2023-06-16 00:09:54 +08:00
Jared Deckard f603275d84 Add an opt-in infotext user name setting 2023-06-15 11:00:20 -05:00
Jared Deckard 8f18e67243 Add a user pattern to the filename generator 2023-06-15 11:00:11 -05:00
XiaoMeng Mai de022c4c80 Update code style 2023-06-15 22:59:46 +08:00
XiaoMeng Mai 9ec2ba2d28 Add github mirror for the download extension 2023-06-15 22:43:09 +08:00
Jared Deckard d3c86e5178 Note the Gradio user in the Exif data 2023-06-14 17:15:52 -05:00
w-e-w 376f793bde git clone show progress 2023-06-15 04:23:52 +09:00
Jared Deckard fa9d2ac2ff Fix gradio special args in the call queue 2023-06-14 13:53:13 -05:00
w-e-w 6091c4e4aa terminate -> stop 2023-06-14 19:53:08 +09:00
w-e-w 49fb2a3376 response 501 if not a able to restart 2023-06-14 19:52:12 +09:00
w-e-w 5be6c026f5 rename routes 2023-06-14 18:51:47 +09:00
Aarni Koskela d807164776 textual_inversion/logging.py: clean up duplicate key from sets (and sort them) (Ruff B033) 2023-06-13 13:07:39 +03:00
Aarni Koskela bf67a5dcf4 Upscaler.load_model: don't return None, just use exceptions 2023-06-13 12:44:25 +03:00
Aarni Koskela e3a973a68d Add TODO comments to sus model loads 2023-06-13 12:38:29 +03:00
Aarni Koskela 0afbc0c235 Fix up `if "http" in ...:` to be more sensible startswiths 2023-06-13 12:38:29 +03:00
Aarni Koskela 89352a2f52 Move `load_file_from_url` to modelloader 2023-06-13 12:38:28 +03:00
Aarni Koskela 165ab44f03 Use os.makedirs(..., exist_ok=True) 2023-06-13 12:35:43 +03:00
w-e-w b9664ab615 move _stop route to api 2023-06-12 18:15:27 +09:00
Su Wei 7e2d39a2d1 update model checkpoint switch code 2023-06-12 15:22:49 +08:00
w-e-w 9142be0a0d quit restart 2023-06-10 23:36:34 +09:00
arch-fan 5576a72322 fixed typos 2023-06-09 19:59:27 +00:00
AUTOMATIC cfdd1b9418 linter 2023-06-09 22:47:27 +03:00
AUTOMATIC1111 d00139eea8
Merge pull request #11087 from AUTOMATIC1111/persistent_conds_cache
persistent conds cache
2023-06-09 22:32:49 +03:00
Splendide Imaginarius 1503af60b0 Split mask blur into X and Y components
Prequisite to fixing Outpainting MK2 mask blur bug.
2023-06-09 08:36:33 +00:00
Su Wei 8ca34ad6d8 add model exists status check to modeuls/api/api.py , /sdapi/v1/options [POST] 2023-06-09 13:14:20 +08:00
w-e-w 7f2214aa2b persistent conds cache
Update shared.py
2023-06-08 14:27:22 +09:00
AUTOMATIC1111 cf28aed1a7
Merge pull request #11058 from AUTOMATIC1111/api-wiki
link footer API to Wiki when API is not active
2023-06-07 07:49:59 +03:00
AUTOMATIC1111 806ea639e6
Merge pull request #11066 from aljungberg/patch-1
Fix upcast attention dtype error.
2023-06-07 07:48:52 +03:00
Alexander Ljungberg d9cc0910c8
Fix upcast attention dtype error.
Without this fix, enabling the "Upcast cross attention layer to float32" option while also using `--opt-sdp-attention` breaks generation with an error:

```
  File "/ext3/automatic1111/stable-diffusion-webui/modules/sd_hijack_optimizations.py", line 612, in sdp_attnblock_forward
    out = torch.nn.functional.scaled_dot_product_attention(q, k, v, dropout_p=0.0, is_causal=False)
RuntimeError: Expected query, key, and value to have the same dtype, but got query.dtype: float key.dtype: float and value.dtype: c10::Half instead.
```

The fix is to make sure to upcast the value tensor too.
2023-06-06 21:45:30 +01:00
w-e-w 96e446218c link footer API to Wiki when API is not active 2023-06-06 18:58:44 +09:00
AUTOMATIC1111 a009fe15fd
Merge pull request #11047 from AUTOMATIC1111/parse_generation_parameters_with_error
handles exception when parsing generation parameters from png info
2023-06-06 00:13:27 +03:00
w-e-w 851bf43520 print error and continue
print error and continue
2023-06-06 05:50:43 +09:00
Aarni Koskela ba70a220e3 Remove a bunch of unused/vestigial code
As found by Vulture and some eyes
2023-06-05 22:43:57 +03:00
AUTOMATIC1111 0895c2369c
Merge pull request #11037 from AUTOMATIC1111/restart-autolaunch
fix rework-disable-autolaunch for new restart method
2023-06-05 20:57:31 +03:00
w-e-w c2808f3040 SD_WEBUI_RESTARTING 2023-06-06 02:52:05 +09:00
AUTOMATIC1111 1dd8d571a4
Merge pull request #11043 from akx/restart-envvar
Restart: only do restart if running via the wrapper script
2023-06-05 20:06:40 +03:00
Aarni Koskela 46a5bd64ed Restart: only do restart if running via the wrapper script 2023-06-05 20:04:28 +03:00
w-e-w 1411a6e74b rework-disable-autolaunch 2023-06-06 01:09:30 +09:00
AUTOMATIC 18acc0b30d revert the message to how it was 2023-06-05 11:08:57 +03:00
AUTOMATIC1111 7a7a201d81
Merge pull request #10956 from akx/len
Simplify a bunch of `len(x) > 0`/`len(x) == 0` style expressions
2023-06-05 11:06:37 +03:00
ramyma 4faaf3e723 Add endpoint to get latent_upscale_modes for hires fix 2023-06-04 17:05:29 +03:00
AUTOMATIC fbf88343de prevent calculating cons for second pass of hires fix when they are the same as for the first pass 2023-06-04 16:29:02 +03:00