lllyasviel / Fooocus

Focus on prompting and generating
GNU General Public License v3.0
40.01k stars 5.53k forks source link

Upload multiple image for upscaling? #1236

Open tralala87 opened 9 months ago

tralala87 commented 9 months ago

Would it be possible to modify the code for gradio, so that more than 1 image could be uploaded for upscaling, so to automate upscaling a batch file, instead of uploading one by one?

tralala87 commented 8 months ago

Anybody? :)

mashb1t commented 8 months ago

Yes, this would be possible. Feel free to contribute and create a PR. You can use https://www.gradio.app/docs/file with file_count = 'multiple' and iterate over the list of files to create an upscaling AsyncJob for each.

tralala87 commented 8 months ago

I tried in various ways (files and zip), but the uploaded images or zip file are not recognized. Does Gradio even allow for uploading multiple images or a zip file?

mashb1t commented 8 months ago

Please also adjust the single image processing into a foreach loop logic for upscaling. This is currently not implemented, as, you guessed it, only single images are processed. You will have to trigger multiple upscale jobs though, one for each image.

A reference is the A1111 Extras tab, where exactly this has already been implemented (also in Gradio).

mashb1t commented 8 months ago

Please also see https://github.com/lllyasviel/Fooocus/issues/1664 where others are currently working on implementing a prompt queue.

mashb1t commented 8 months ago

Ideas from https://github.com/lllyasviel/Fooocus/issues/1853 by @drdancm:

  1. Since Fooocus makes so many of the operations so much easier than A1111, it would be great to have Fooocus have this autoscaling feature with a user set maximum pixel size for the longest side of an image.
  2. In addition, would it be possible to also have a batch mode allowing the user to browse for both an input and and output folder.
dkutz78 commented 6 months ago

I would also like an option to upscale multiple files. How can this be achieved? Can I edit the Gradio UI somehow?

mashb1t commented 5 months ago

@dkutz78 see https://github.com/lllyasviel/Fooocus/issues/1236#issuecomment-1872977886, not only UI changes are needed here.

dkutz78 commented 5 months ago

@dkutz78 see #1236 (comment), not only UI changes are needed here.

Thanks for the quick response. Since I have no coding experience I think it's above my pay grade(io) so to speak. but thanks anyway....