Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -67,12 +67,7 @@ latents = latents * scheduler.init_noise_sigma # Scaling (previous versions did
|
|
67 |
with autocast("cuda"): # will fallback to CPU if no CUDA; no autocast for MPS
|
68 |
for i, t in tqdm(enumerate(scheduler.timesteps), total=len(scheduler.timesteps)):
|
69 |
|
70 |
-
"""It's working, but that's quite a bit of code! Let's look at the components one by one.
|
71 |
|
72 |
-
## The Autoencoder (AE)
|
73 |
-
|
74 |
-
The AE can 'encode' an image into some sort of latent representation, and decode this back into an image. I've wrapped the code for this into a couple of functions here so we can see what this looks like in action:
|
75 |
-
"""
|
76 |
|
77 |
def pil_to_latent(input_im):
|
78 |
# Single image -> single latent in a batch (so size 1, 4, 64, 64)
|
|
|
67 |
with autocast("cuda"): # will fallback to CPU if no CUDA; no autocast for MPS
|
68 |
for i, t in tqdm(enumerate(scheduler.timesteps), total=len(scheduler.timesteps)):
|
69 |
|
|
|
70 |
|
|
|
|
|
|
|
|
|
71 |
|
72 |
def pil_to_latent(input_im):
|
73 |
# Single image -> single latent in a batch (so size 1, 4, 64, 64)
|