yuanzhi-zhu / prolific_dreamer2d

Unofficial implementation of 2D ProlificDreamer
137 stars 6 forks source link

Classifer-free guidance #13

Closed QianyiWu closed 11 months ago

QianyiWu commented 11 months ago

Hi,

Thanks for your awesome implementation. I have one question regarding the CFG guidance. Dose this line should be

noise_pred = noise_pred_text + guidance_scale * (noise_pred_text - noise_pred_uncond)
yuanzhi-zhu commented 11 months ago

Hi, I just followed the practice in diffuser.

Indeed, the expression you provided is almost the equivalent but with a -1 cfg (you can plus and then subtract the unconditional term).

QianyiWu commented 11 months ago

Thanks for pointing out the diffuser implementation reference. It solved my concerns :)