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

Add better logging #156

Merged
merged 4 commits into from
Feb 18, 2023
Merged

Add better logging #156

merged 4 commits into from
Feb 18, 2023

Conversation

philgzl
Copy link
Contributor

@philgzl philgzl commented Jan 26, 2023

This PR implements better video progress logging. Currently only the progress of the current image generation is being logged. So it's hard to tell how far from completion the entire video generation is. Below is an example of how the logs look (could be different depending on how you set up logging in your script):

Fetching 12 files: 100%|██████████| 12/12 [00:00<00:00, 563.35it/s]
[20:31:11] [0/2] [0/13] Generating frames 0-3
100%|██████████| 50/50 [00:18<00:00,  2.71it/s]
[20:31:31] [0/2] [1/13] Generating frames 4-7
100%|██████████| 50/50 [00:13<00:00,  3.68it/s]
[20:31:45] [0/2] [2/13] Generating frames 8-11
100%|██████████| 50/50 [00:13<00:00,  3.67it/s]
...
[20:36:44] [1/2] [10/13] Generating frames 40-43
100%|██████████| 50/50 [00:13<00:00,  3.64it/s]
[20:36:59] [1/2] [11/13] Generating frames 44-47
100%|██████████| 50/50 [00:13<00:00,  3.64it/s]
[20:37:13] [1/2] [12/13] Generating frames 48-49
100%|██████████| 50/50 [00:07<00:00,  6.81it/s]

In this example I set up logging like this:

logging.basicConfig(
    level=logging.INFO,
    format='[%(asctime)s] %(message)s',
    datefmt='%H:%M:%S',
)

The new log messages are formatted as

[<walk_index>/<num_walks>] [<batch_index>/<num_batches>] Generating frame(s) <frame indexes>

where <walk_index> and <num_walks> refer to walks between two prompts.

@Atomic-Germ
Copy link
Contributor

This could address #116 and #147 nicely

@nateraw
Copy link
Owner

nateraw commented Jan 27, 2023

I was thinkin of ditching the underlying progress bar and making a new one, updating with info like this w/ one master progress bar...but this idea is much simpler. Nice!!!

Will take a look asap

@nateraw
Copy link
Owner

nateraw commented Feb 18, 2023

Sorry again for delay. will get to this as soon as I can. really really appreciate the contribution ❤️

@nateraw nateraw linked an issue Feb 18, 2023 that may be closed by this pull request
@nateraw
Copy link
Owner

nateraw commented Feb 18, 2023

Really great PR, thank you :) Just added a line to logger init so it will show by default when running this without setting up logging in your script itself.

Copy link
Owner

@nateraw nateraw left a comment

Choose a reason for hiding this comment

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

LGTM

stable_diffusion_videos/stable_diffusion_pipeline.py Outdated Show resolved Hide resolved
@nateraw nateraw merged commit 997dc6c into nateraw:main Feb 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

add frame number while running
3 participants