stable-dreamfusion icon indicating copy to clipboard operation
stable-dreamfusion copied to clipboard

Questions about the classifier-free guidance.

Open Sumching opened this issue 10 months ago • 0 comments

https://github.com/ashawkey/stable-dreamfusion/blob/main/guidance/sd_utils.py#L112

I am encountering confusion at line 112 in the sd_utils.py file. Based on my understanding, the CFG should be structured as follows: image

This structure corresponds to the following equation:

#Eq.1 pred_noise = pred_text + guidance_scale * (pred_text - pred_uncond) However, the code in the repository is written as:

#Eq.2 pred_noise = pred_uncond + guidance_scale * (pred_text - pred_uncond)

Additionally, regardless of which form of the equation I use, setting the guidance_scale to 0 results in no learning taking place. image

Sumching avatar Apr 24 '24 06:04 Sumching