jina-ai / discoart

🪩 Create Disco Diffusion artworks in one line
Other
3.84k stars 249 forks source link

Add option disable_progress_grid to user arguments #161

Open OverStruck opened 2 years ago

OverStruck commented 2 years ago

Currently diffusion progress is saved as an image sprite which is not very useful when running locally (not on a server or google collab) and when the save rate is high (i.e every frame) because it becomes hard to see how the image is looking as time goes on due to each snapshot getting smaller and smaller in the image sprite.

Visual Example of the image sprite (notice how small each snapshot is)

I propose adding an argument disable_progress_grid to settings.yml that will disable using plot_image_sprites and instead will just save the most recent snapshot using save_image_tensor_to_file with the file name {_nb}-progress.png

That way, at least on linux, we can just have {_nb}-progress.png open and we will see the updates properly at the right image resolution.

This pull requests implements this change.

hanxiao commented 2 years ago

you can just set save_rate, see docstring or cheatsheet().

save_rate=-1 means disable progress saving

latest step is already in {}-step-{}.png, no need to double save

OverStruck commented 2 years ago

Yes I see your point with the double save. The idea I had in mind was to run the program and just have a single file (progress.png) open on another screen that will always have the most updated snapshot. {}-step-{}.png works, but (and this is just me being picky an lazy) it requires manually changing to the next image to see the latest progress rather than simply glancing at the file on another screen or maximizing a window with {_nb}-progress.png and immediately seeing the latest.

Another drawback of relying on {}-step-{}.png images is that the user is forced to have a bunch of intermediate steps saved when it could be the case that the user just wants to see the progress without saving any intermediate steps to do so. In other words, rather than having hundreds of images, just have one that''s always updated with the latest progress. It saves space and makes things a bit more manageable.

I know there's the GIF option but that is disabled with save_rate=-1. Currently there's no way to have a GIF w/out saving any intermediate steps. And that's really the whole point I'm trying to make. Being able to track progress with a single file w/out saving all intermediate steps would be very welcomed.

This merge request doesn't really address that though, given that intermediate files are still being saved. :octocat: But it may be worth considering that small improvement to add some flexibility

It'd be ideal to decouple both functionalities: saving intermediate steps and having a single file to track progress, rather than requiring saving intermediate steps to track progress.

The proposal is being able to:

Hope I explain myself correctly :smiley_cat: What are your thoughts on this?