Update app.py
Browse files
app.py
CHANGED
|
@@ -87,6 +87,7 @@ def main():
|
|
| 87 |
@torch.no_grad()
|
| 88 |
@spaces.GPU
|
| 89 |
def inference( prompt, negative_prompt, guidance_scale, ddim_steps, seed):
|
|
|
|
| 90 |
generator = torch.Generator(device=device).manual_seed(seed)
|
| 91 |
latents = torch.randn(
|
| 92 |
(1, unet.in_channels, 512 // 8, 512 // 8),
|
|
@@ -131,6 +132,7 @@ def main():
|
|
| 131 |
@torch.no_grad()
|
| 132 |
@spaces.GPU
|
| 133 |
def edit_inference(prompt, negative_prompt, guidance_scale, ddim_steps, seed, start_noise, a1, a2, a3, a4):
|
|
|
|
| 134 |
original_weights = network.proj.clone()
|
| 135 |
|
| 136 |
#pad to same number of PCs
|
|
|
|
| 87 |
@torch.no_grad()
|
| 88 |
@spaces.GPU
|
| 89 |
def inference( prompt, negative_prompt, guidance_scale, ddim_steps, seed):
|
| 90 |
+
nonlocal network
|
| 91 |
generator = torch.Generator(device=device).manual_seed(seed)
|
| 92 |
latents = torch.randn(
|
| 93 |
(1, unet.in_channels, 512 // 8, 512 // 8),
|
|
|
|
| 132 |
@torch.no_grad()
|
| 133 |
@spaces.GPU
|
| 134 |
def edit_inference(prompt, negative_prompt, guidance_scale, ddim_steps, seed, start_noise, a1, a2, a3, a4):
|
| 135 |
+
nonlocal network
|
| 136 |
original_weights = network.proj.clone()
|
| 137 |
|
| 138 |
#pad to same number of PCs
|