Skip to content
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]: Will not write out webp files #5664

Closed
1 task done
brian000 opened this issue Dec 12, 2022 · 7 comments · Fixed by #5838
Closed
1 task done

[Bug]: Will not write out webp files #5664

brian000 opened this issue Dec 12, 2022 · 7 comments · Fixed by #5838
Labels
bug-report Report of a bug, yet to be confirmed

Comments

@brian000
Copy link

Is there an existing issue for this?

  • I have searched the existing issues and checked the recent builds/commits

What happened?

UI will no longer write WEBP images to disk. PNGs and JPGs write fine.

Steps to reproduce the problem

In config.json, set "samples_format": "webp",
Generate an image. It will generate, but will not be written to disk.

  File "C:\sd\modules\call_queue.py", line 45, in f
    res = list(func(*args, **kwargs))
  File "C:\sd\modules\call_queue.py", line 28, in f
    res = func(*args, **kwargs)
  File "C:\sd\modules\txt2img.py", line 51, in txt2img
    processed = process_images(p)
  File "C:\sd\modules\processing.py", line 464, in process_images
    res = process_images_inner(p)
  File "C:\sd\modules\processing.py", line 607, in process_images_inner
    images.save_image(image, p.outpath_samples, "", seeds[i], prompts[i], opts.samples_format, info=infotext(n, i), p=p)
  File "C:\sd\modules\images.py", line 536, in save_image
    _atomically_save_image(image, fullfn_without_extension, extension)
  File "C:\sd\modules\images.py", line 508, in _atomically_save_image
    image_format = Image.registered_extensions()[extension]
KeyError: '.webp'

What should have happened?

WEBP image should have been written to outputs/txt2images-images. When setting "samples_format": "png", the PNG is correctly written to disk at the end of generation.

Commit where the problem happens

685f963

What platforms do you use to access UI ?

Windows, MacOS

What browsers do you use to access the UI ?

Mozilla Firefox

Command Line Arguments

`--listen --xformers`

Additional information, context and logs

No response

@brian000 brian000 added the bug-report Report of a bug, yet to be confirmed label Dec 12, 2022
@Cyberes
Copy link
Contributor

Cyberes commented Dec 12, 2022

Not a bug, the WebUI doesn't have the ability to save in webp format. We welcome a PR though!

Pinging @ClashSAN for closure.

@brian000
Copy link
Author

Not a bug, the WebUI doesn't have the ability to save in webp format. We welcome a PR though!

It’s been writing webp for me for at least two weeks.

@WASasquatch
Copy link

WASasquatch commented Dec 12, 2022

Did you update something, it says webp isn't a valid extension in PIL.Image.registered_extensions(). So your PIL doesn't have the plugin for webp anymore, it looks like.

Probably because you have .webp instead of webp. It should be used as .save(destination, format="webp")

@ClashSAN
Copy link
Collaborator

is this issue related? #5603

@brian000
Copy link
Author

brian000 commented Dec 13, 2022

Probably because you have .webp instead of webp. It should be used as .save(destination, format="webp")

Nope. The config file just has webp without the dot. Just like if I were making jpg or png. I’ll check on the PIL version though.

Edit: Pillow==9.2.0

@maxixa
Copy link

maxixa commented Dec 13, 2022

now It is jpg also gives same error today s update

@aliencaocao
Copy link
Contributor

aliencaocao commented Dec 16, 2022

Definitely same issue as #5603
@ClashSAN I suggest we close this and keep the older issue open since it is duplicate, and move discussions to there

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug-report Report of a bug, yet to be confirmed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants