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

Fix TAESD preview to only decode first latent, instead of all #1863

Merged
merged 1 commit into from
Oct 29, 2023

Conversation

Kosinkadink
Copy link
Collaborator

@Kosinkadink Kosinkadink commented Oct 29, 2023

The TAESD preview returns the first latent anyway to be displayed, but the code before performed decoding on all latents and returned the first index. For single images that is fine, but 1) causes slowdowns when using batches greater than one, and 2) causes VRAM OOM when batch size is a fairly large number.

Changed code now passes only the first latent into the decoder, in the form [1, :, :, :] via slicing, and then stores result into x_sample as [channels, h, w] same as before. No more VRAM isssues with large batch sizes, and preview is faster for any batch size > 1.

@comfyanonymous comfyanonymous merged commit 41b07ff into comfyanonymous:master Oct 29, 2023
1 check passed
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.

2 participants