Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

How were the VAE latent mean/std values obtained, and why are they used for latent scaling?

Open
#1,536 1 comment 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Documentation
Clarity
Needs clarification
Activity status
Quiet
Tech stack
python

Research direction

Start by tracing the Qwen-Image and Wan pipeline implementations where the channel-wise latent normalization is applied. Check the available VAE and training documentation or statistics-collection code to confirm how mean and standard deviation were obtained and why scaling is used; done means providing a clear, referenced explanation.

Written by the indexing model from the issue text.

Description

Hi DiffSynth-Studio team,

Thank you for open-sourcing this project.

I noticed that the Qwen-Image/Wan pipeline applies fixed channel-wise normalization to the VAE latent:

latents = (latents - mean) / std

Could you clarify:

How were these mean and std values calculated?
Were they computed by encoding the training data, taking the posterior mean for each sample, and then calculating channel-wise statistics over all samples and spatial-temporal positions?
Why is this scaling necessary?

My guess is that the raw latent channels have different means and variances, so this normalization makes their scales more balanced, better matches the scale of Gaussian noise, and prevents high-variance channels from dominating the flow-matching loss.

It would be very helpful if you could confirm this or share the statistics-collection method. Thanks!

Dominant language
Python
Stars
13.2k
Forks
1.3k
Avg merge
22h 15m
Merged PRs (30d)
31

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from modelscope/DiffSynth-Studio

All issues in modelscope/DiffSynth-Studio

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.