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

I always got noisy images! #103

Closed
109km opened this issue Oct 19, 2023 · 3 comments
Closed

I always got noisy images! #103

109km opened this issue Oct 19, 2023 · 3 comments
Labels
no bugs here Not a bug, but a workflow or environment issue

Comments

@109km
Copy link

109km commented Oct 19, 2023

I'm using MacOS M2 chip, when I'm working with other models, everything works fine.
And when using the motion model the output image is always noisy or got weird image.

What's wrong with the workflow? Or some other problems?

WX20231019-182810@2x

workflow.json

@Kosinkadink
Copy link
Owner

The batch size determines the total animation length, and in your workflow, that is set to 1. The amount of latents passed into AD at once has an effect on the actual output, and the sweetspot for AnimateDiff is around 16 frames at a time. Since you are passing only 1 latent into the KSampler, it only outputs 1 frame, and it is also very deep fried.

If you increase the amount of latents to ~16, you will get expected outputs. If you have a Context Options node attached, if your passed-in latents (in your workflow, that is determined by the batch_size on your Empty Latent Image node) exceed the context_length, then it will begin to use a sliding context window to sample context_length latents at a time to allow you to produce longer than sweetspot amount of frames at the sweetspot quality.

Once you increase your batch size as AD requires, you will almost certainly run into the pytorch bug that exists for M1 and M2 macs. The workaround is mentioned here: #48 (comment)

It is also recommended to use the --use-split-cross-attention startup argument on Mac to avoid other issues/crashes that could pop up.

Let me know if that helps!

@Kosinkadink
Copy link
Owner

Soon(ish), I'll make it easier to implement that workaround on Macs.

@Kosinkadink Kosinkadink added the no bugs here Not a bug, but a workflow or environment issue label Oct 19, 2023
@109km
Copy link
Author

109km commented Oct 19, 2023

It works!
Thank you so much!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
no bugs here Not a bug, but a workflow or environment issue
Projects
None yet
Development

No branches or pull requests

2 participants