-
Notifications
You must be signed in to change notification settings - Fork 6.3k
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
Jpeg 100% quality save #1789
Comments
Saving could be achieved relatively easy by changing the two lines Fooocus/modules/private_logger.py Line 16 in 176faf6
Fooocus/modules/private_logger.py Line 25 in 176faf6
Temp images in the browser are png base64 encoded images directly from pytorch_to_numpy as far as i could see and there is no conversion happening. If you need the jpg/jpeg results only in your outputs folder, feel free to change private_logger.py accordingly. Enhancement: make this configurable. |
nice. Yes configurability is important here, because when system update files, we loose that custom modifications. |
tested my pr locally but did not see any unit tests. If this needs to save to the file to maintain state, I can update my PR. |
This would be a wonderful enhancement. |
actually a change for gradio is a good thing, as it can become super slow when running machine at home and accessing via mobile. Jpeg will help that too. |
The description of the method Image.save() says:
For 100% JPG qiality need add an additional parameter image_quality specifying the JPG compression ratio. For example for 100% JPG: |
* feature: added flag, config and ui update for image extension change #1789 * moved function to config module * moved image extension to webui via async worker. Passing as parameter to log and get_current_html_path functions per feedback * check flag before displaying image extension radio button * disabled if image log flag is passed in * fix: add missing image_extension parameter to log call * refactor: change label * feat: add webp to image_extensions supported image extemsions: see https://pillow.readthedocs.io/en/stable/handbook/image-file-formats.html * feat: use consistent file name in gradio returns and uses filepaths instead of numpy image by saving to temp dir uses double the temp dir file storage on disk as it saves to temp dir and gradio temp dir when displaying the image, but reuses logged output image * feat: delete temp images after yielding to gradio * feat: use args temp path if given * chore: code cleanup, remove redundant if statement * feat: always show image_extension element this is now possible due to image extension support in gradio via #1932 * refactor: rename image_extension to image_file_extension * feat: use optimized jpg parameters when saving the image quality=95 optimize=True progressive=True * refactor: rename image_file_extension to output_format * feat: add exif handling * refactor: code cleanup, remove items from metadata output --------- Co-authored-by: Manuel Schmid <[email protected]> Co-authored-by: Manuel Schmid <[email protected]> Co-authored-by: Manuel Schmid <[email protected]> Co-authored by: eddyizm <[email protected]>
…1863) * feature: added flag, config and ui update for image extension change #1789 * moved function to config module * moved image extension to webui via async worker. Passing as parameter to log and get_current_html_path functions per feedback * check flag before displaying image extension radio button * disabled if image log flag is passed in * fix: add missing image_extension parameter to log call * refactor: change label * feat: add webp to image_extensions supported image extemsions: see https://pillow.readthedocs.io/en/stable/handbook/image-file-formats.html * feat: use consistent file name in gradio returns and uses filepaths instead of numpy image by saving to temp dir uses double the temp dir file storage on disk as it saves to temp dir and gradio temp dir when displaying the image, but reuses logged output image * feat: delete temp images after yielding to gradio * feat: use args temp path if given * chore: code cleanup, remove redundant if statement * feat: always show image_extension element this is now possible due to image extension support in gradio via #1932 * refactor: rename image_extension to image_file_extension * feat: use optimized jpg parameters when saving the image quality=95 optimize=True progressive=True * refactor: rename image_file_extension to output_format * feat: add exif handling * refactor: code cleanup, remove items from metadata output --------- Co-authored-by: Manuel Schmid <[email protected]> Co-authored-by: Manuel Schmid <[email protected]> Co-authored-by: Manuel Schmid <[email protected]> Co-authored by: eddyizm <[email protected]>
Hey guys!
Should be nice to have an option to save image in JPEG 100% quality instead of png.
Thanks.
The text was updated successfully, but these errors were encountered: