You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: project-5/index.html
+10-5Lines changed: 10 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -230,7 +230,7 @@ <h4>t = 750</h4>
230
230
<sectionid="part-1-3">
231
231
<h2>Part 1.3 – Implementing One Step Denoising</h2>
232
232
233
-
A much more effective method is to use a pretrained diffusion model. Using <code>stage_1.unet</code>, we can estimate the amount of noise in the noisy image. With the forward equation, we can solve for <code>x<sub>0</sub></code> (the original image) given the timestamp <code>t</code>:
233
+
A more effective method is to use a pretrained diffusion model. Using <code>stage_1.unet</code>, we can estimate the amount of noise in the noisy image. With the forward equation, we can solve for <code>x<sub>0</sub></code> (the original image) given the timestamp <code>t</code>:
Instead of using one step, we can obtain better results by iterativly denoising from step <code>t</code> until step 0. However, this means running the diffusion model 1000 times in the worst case, which is slow and costly.<br>
302
-
<br>
303
-
Fortunately, we can speed up the computation by first defining series of strided timestamps, starting at close to 1000 and ending at 0. For the examples below, we will use <code>strided_timestamps = [990, 960, ..., 30, 0]</code>. Then, we can use the formula
301
+
Instead of using one step, we can obtain better results by iterativly denoising from step <code>t</code> until step 0. However, this means running the diffusion model 1000 times in the worst case, which is slow and costly. Fortunately, we can speed up the computation by first defining series of strided timestamps, starting at close to 1000 and ending at 0. For the examples below, we will use <code>strided_timestamps = [990, 960, ..., 30, 0]</code>. Then, we can use the formula
304
302
305
303
<divclass="image-row">
306
304
<figure>
@@ -359,6 +357,10 @@ <h4>Every 5th loop of iterative denoising</h4>
To improve the quality of the images, we can compute both a noise estiamte conditioned on the text prompt, and the unconditional noise estimate, based on the null prompt <code>''</code>. Denoting the conditional noise estimate as ε<sub>c</sub> and the unconditional noise estimate as ε<sub>u</sub>, we let our noise estimate be ε = ε<sub>u</sub> + γ(ε<sub>c</sub> - ε<sub>u</sub>). Note that we have ε = ε<sub>u</sub> and ε = ε<sub>c</sub> for γ = 0 and γ = 1 respectively. However, when γ > 1, we can get much higher equality images for reasons still dicussed today. This technique is known as <strong>classifier-free guidance</strong>, and we can implement the noise estimate as follows:
Using γ = 7 and the conditional & unconditional prompts be <code>'a high quality photo'</code> and the null prompt, we the following sample images:
433
+
429
434
<divclass="subsection">
430
435
<h3>5 Images with Prompt "a high quality photo" (γ = 7)</h3>
0 commit comments