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

Batch File upload/ Folder upload. Bulk Enhance #3540

Open
wants to merge 26 commits into
base: main
Choose a base branch
from

Conversation

ChrisColeTech
Copy link

@ChrisColeTech ChrisColeTech commented Aug 18, 2024

Requires tkinter for the file/folder dialog

If you are using Python embedded, you will be missing TKINTER. This verison of Fooocus will automatically download and install TKINTER for you. If that fails, please download tkinter from Here and drag and drop it into your embedded_python folder.

New Features

  • Batch File Upload & Folder Upload:
    • Support for uploading multiple files at once or entire folders for batch processing.
  • Enhance on the fly:
    • Immediately enhances after generating the image, no more waiting!
  • Smaller Resolutions for Faster Generation:
    • Added support for 512x512 and 704x704 resolutions, fpr low VRAM users providing faster image generation.
  • Default Enhance Prompts:
    • Pre-defined enhancement prompts for various body parts such as 'face', 'eye', 'mouth', 'hair', 'hand', and 'body' to streamline the enhancement process.

📸 Preview

Uploading Images

  • Batch File Upload:
    • Select multiple files or an entire folder to upload images in bulk.
    • image

Enhancing Images

  • Immediate Enhancement:
    • Images are immediately enhanced after being generated, no more waiting!
    • image

Image Resolutions

  • Get faster processing, use less VRAM with smaller resolutions:
    • 512x512
    • 704x704
    • preview7

Pre-Selection Prompts

  • Use default enhancement prompts for various body parts to ensure high-quality results:
    • preview8

-Immediately enhance each image generated
-Added Bulk Enhance
-Added 2 smaller resolutions: 512x512 and 704x704 for faster image generation
-Added default enhance prompts for pre-selections  'face', 'eye', 'mouth', 'hair', 'hand', 'body'
-Added more error handling
remove unused imports


def on_input_change(input_path, file_explorer):
if os.path.isdir(input_path):

Check failure

Code scanning / CodeQL

Uncontrolled data used in path expression

This path depends on a [user-provided value](1).
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was resolved:
ChrisColeTech@9f535e8

Change to resolve GitHub Advanced Security check
@ChrisColeTech ChrisColeTech marked this pull request as draft August 18, 2024 15:15
-Rework stop/skip during bulk enhance to use "async_task.should_run" and -"async_task.should_skip" for more reliable stopping and skipping.
-Code cleanup
-Added more logging.
-Removed some emoji's
# Sanitize the input path
input_path = sanitize_path(input_path)

if os.path.isdir(input_path):

Check failure

Code scanning / CodeQL

Uncontrolled data used in path expression

This path depends on a [user-provided value](1).
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was resolved:
ChrisColeTech@b5e73ff

@builder-main
Copy link

Is tkinter installed within the embedded windows python ? It is missing for us.

remove unused flags
code cleanup
-To resolve github CodeQL warning
-more code cleanup
input_path = os.path.normpath(os.path.realpath(input_path))

if os.path.isdir(os.path.realpath(input_path)):
# Return an empty list if input_path is a directory

Check failure

Code scanning / CodeQL

Uncontrolled data used in path expression

This path depends on a [user-provided value](1).
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was resolved:
ChrisColeTech@b5e73ff

@ChrisColeTech
Copy link
Author

Is tkinter installed within the embedded windows python ? It is missing for us.

Is tkinter installed within the embedded windows python ? It is missing for us.

I got you..what version of python_embedded 3.10? 3.11? 3.12?

@ChrisColeTech
Copy link
Author

Is tkinter installed within the embedded windows python ? It is missing for us.

Please download tkinter from Here and drag and drop it into your embedded_python folder.

@ChrisColeTech ChrisColeTech marked this pull request as ready for review August 22, 2024 18:18

return _corsify_actual_response(jsonify(cache['data']))
except Exception as e:
return _corsify_actual_response(jsonify({'error': str(e)}))

Check warning

Code scanning / CodeQL

Information exposure through an exception

[Stack trace information](1) flows to this location and may be exposed to an external user.
@youniq-id
Copy link

I followed the exact steps but the Bulk Enhance option is not visible/available, I test the tkinter in the python embedder path and it pop up the little popup box as shown above.

I followed python 3.10 version tutorials but it won't work.

is there anyone to help me to fix this, please see the attached images 1-5 for better clarification.

Help 6
Help 5
Help 4
Help 3
help 2
help1

Thank you in advance you guys are doing great and it really means a lot. :)

@ChrisColeTech
Copy link
Author

I followed the exact steps but the Bulk Enhance option is not visible/available, I test the tkinter in the python embedder path and it pop up the little popup box as shown above.

I followed python 3.10 version tutorials but it won't work.

is there anyone to help me to fix this, please see the attached images 1-5 for better clarification.

Thank you in advance you guys are doing great and it really means a lot. :)

No problem, I really hope you enjoy 👍

These changes are not part of the official branch, so you must install them yourself.

Here are instructions to do that:

https://gist.github.com/ChrisColeTech/2df13aee74f7e8e515378cc861168f04

Let me know if you have questions.

@mashb1t mashb1t added the Size L large change, may depend on other changes, thoroughly test label Sep 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Size L large change, may depend on other changes, thoroughly test
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants