Closed rubendax closed 6 days ago
Thank you for your contribution. However, I'm not sure if users want to save all the images.
That's fair. To be honest, when I first tried the Gradio demo, I did not see any way to download the generated image in the interface, which is why I added this. I see now that it is possible to download an image by clicking in the upper right corner of the generated image in the UI.
That being said, automatic image saving is fairly common in image generation apps, and it can be helpful in the case that the Gradio interface has an error, which can sometimes occur during a long generation. However, this is more of a personal preference than a necessary feature.
~I have now commented-out the automatic image saving in this branch, just in case you still want to incorporate the spelling/grammar edits.~
Thanks so much for your work on this incredible project. OmniGen is truly a paradigm shift in image generation.
Thank you rubendax, I'd been searching specifically for how to enable this ability and found it here.
I appreciate the ability to save to a folder of choice, downloading each time to the browser's default download folder was becoming cluttered. Although the PNG files are much larger, having this convenience is worth the option for me.
Also, since I didn't know how to use GitHub correctly to use the 'branch' I manually swapped app.py for this pull request to my installation. My guess is that's not the way to do it!
As a hobbyist, OmniGen is already a much-appreciated part of my toolkit; this is only my 2nd day of using it.
PS: In hindsight, I was too hasty. I see some functionality missing now. But by adding instead only the following lines it 'appears' all the functionality is back, possibly? Time wil tell!
`from datetime import datetime
img = output[0]
os.makedirs('outputs', exist_ok=True)
timestamp = datetime.now().strftime("%Y%m%d-%H%M%S") output_path = os.path.join('outputs', f'{timestamp}.png')
img.save(output_path)
return img`
@vootox You should clone my branch called demo-save_outputs. This has the auto-saving functionality enabled and is otherwise up-to-date with all the improvements from upstream VectorSpaceLab:main (at least as of today 2024-11-05).
git clone -b demo-save_outputs https://github.com/rubendax/OmniGen
I have added a checkbox to the UI to allow the user to toggle on or off saving all generated images as .png files to ./outputs
. In this branch, rubendax:main, this functionality is toggled off (unchecked) by default.
@vootox You should clone my branch called demo-save_outputs. This has the auto-saving functionality enabled and is otherwise up-to-date with all the improvements from upstream VectorSpaceLab:main (at least as of today 2024-11-05).
git clone -b demo-save_outputs https://github.com/rubendax/OmniGen
Thank you @rubendax, I have this installed and running, I like this a lot. Now, I'm wondering if there could be a script for batch processing images... just kidding, but it would be nice!
@rubendax, thanks for your code! I think it is reasonable to let the user choose whether to save all the images or not, and I will merge this PR into the main branch tomorrow.
Changes:
./outputs
as a.png
file. The filename will be a timestamp with the format:<year>_<month>_<day>-<hour>_<minute>_<second>.png
Tested these changes on a Linux machine with A6000 GPU.
EDIT 2024-11-05: