Skip to content

Commit 7c1b347

Browse files
Update README.md (huggingface#2653)
* Update README.md fix 2 bugs: (1) "previous_noisy_sample" should be in the FOR loop in line 87; (2) converting image to INT should be before "Image.fromarray" in line 91 * Apply suggestions from code review --------- Co-authored-by: Patrick von Platen <[email protected]>
1 parent a7cc468 commit 7c1b347

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

README.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -84,13 +84,12 @@ input = noise
8484
for t in scheduler.timesteps:
8585
with torch.no_grad():
8686
noisy_residual = model(input, t).sample
87-
88-
previous_noisy_sample = scheduler.step(noisy_residual, t, input).prev_sample
89-
input = previous_noisy_sample
87+
prev_noisy_sample = scheduler.step(noisy_residual, t, input).prev_sample
88+
input = prev_noisy_sample
9089

9190
image = (input / 2 + 0.5).clamp(0, 1)
9291
image = image.cpu().permute(0, 2, 3, 1).numpy()[0]
93-
image = Image.fromarray((image * 255)).round().astype("uint8")
92+
image = Image.fromarray((image * 255).round().astype("uint8"))
9493
image
9594
```
9695

0 commit comments

Comments
 (0)