crowsonkb / v-diffusion-pytorch

v objective diffusion inference code for PyTorch.
MIT License
715 stars 108 forks source link

[Question] What's the meaning of these equations in sample and cfg_model_fn(from sample.py ) #23

Open zhangquanwei962 opened 1 year ago

zhangquanwei962 commented 1 year ago

Hello, thank you for your great work! I have a little puzzle in sample.py `# Get the model output (v, the predicted velocity) with torch.cuda.amp.autocast(): v = model(x, ts * steps[i], **extra_args).float()

    # Predict the noise and the denoised image
    pred = x * alphas[i] - v * sigmas[i]
    eps = x * sigmas[i] + v * alphas[i]`

what the meaning ? Where it comes?