Skip to content

Upload multiple image for upscaling? #1236

Open

Description

@tralala87

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?

Activity

  1. tralala87 commented on Dec 17, 2023

    @tralala87
    Author

    Anybody? :)

  2. mashb1t commented on Dec 29, 2023

    @mashb1t
    Collaborator

    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.

  3. added
    enhancement
    on Dec 29, 2023
  4. tralala87 commented on Dec 31, 2023

    @tralala87
    Author

    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?

  5. mashb1t commented on Dec 31, 2023

    @mashb1t
    Collaborator

    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).

  6. mashb1t commented on Dec 31, 2023

    @mashb1t
    Collaborator

    Please also see #1664 where others are currently working on implementing a prompt queue.

  7. mashb1t commented on Jan 10, 2024

    @mashb1t
    Collaborator

    Ideas from #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.
  8. dkutz78 commented on Mar 12, 2024

    @dkutz78

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

  9. mashb1t commented on Mar 12, 2024

    @mashb1t
    Collaborator

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

  10. dkutz78 commented on Mar 12, 2024

    @dkutz78

    @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....

  11. MMFJ commented on Jun 11, 2025

    @MMFJ

    I have added this feature but I am not experienced with making pull requests and interacting with the repo. If someone wants to add the changes and create a pull request, here is the updated webui.py. For those interested, just backup your existing file and use this one.
    https://gist.github.com/MMFJ/fab678c086761ac2906343337f6c5bb0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions