Fix WanVAE_.encode() to return both mu and log_var#574
Open
Mr-Neutr0n wants to merge 1 commit intoWan-Video:mainfrom
Open
Fix WanVAE_.encode() to return both mu and log_var#574Mr-Neutr0n wants to merge 1 commit intoWan-Video:mainfrom
Mr-Neutr0n wants to merge 1 commit intoWan-Video:mainfrom
Conversation
Author
|
bump on this — the encode() method was only returning mu and dropping log_var, which breaks anyone trying to use the VAE's full latent distribution. would appreciate a review |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
WanVAE_.encode()to return bothmuandlog_varas expected byforward()scaleparameter optional (defaults toNone) in bothencode()anddecode()methodsProblem
The
forward()method callsself.encode(x)expecting two return values (mu, log_var):However,
encode()was only returningmu, causing aValueError: not enough values to unpack.Additionally,
encode(x, scale)required thescaleparameter, butforward()didn't pass it.Changes
encode()to return(mu, log_var)tuplescaleparameter optional withscale=Nonedefaultscaleparameter optional indecode()as well for consistencyWanVAE.encode()wrapper to extract onlymuwith[0]indexRelated Issue
Fixes #556
Test Plan
forward()now works without passing scale (uses no scaling when scale=None)