Update app.py
Browse files
app.py
CHANGED
|
@@ -14,7 +14,6 @@ pipe = DiffusionPipeline.from_pretrained(
|
|
| 14 |
safety_checker=None,
|
| 15 |
use_auth_token=MY_SECRET_TOKEN,
|
| 16 |
revision="fp16",
|
| 17 |
-
torch_dtype=torch.float16,
|
| 18 |
custom_pipeline="imagic_stable_diffusion",
|
| 19 |
scheduler = DDIMScheduler(beta_start=0.00085, beta_end=0.012, beta_schedule="scaled_linear", clip_sample=False, set_alpha_to_one=False)
|
| 20 |
).to(device)
|
|
@@ -32,6 +31,8 @@ def infer(prompt, init_image):
|
|
| 32 |
num_inference_steps=50,
|
| 33 |
generator=generator)
|
| 34 |
|
|
|
|
|
|
|
| 35 |
res = pipe(alpha=1)
|
| 36 |
|
| 37 |
return res.images[0]
|
|
|
|
| 14 |
safety_checker=None,
|
| 15 |
use_auth_token=MY_SECRET_TOKEN,
|
| 16 |
revision="fp16",
|
|
|
|
| 17 |
custom_pipeline="imagic_stable_diffusion",
|
| 18 |
scheduler = DDIMScheduler(beta_start=0.00085, beta_end=0.012, beta_schedule="scaled_linear", clip_sample=False, set_alpha_to_one=False)
|
| 19 |
).to(device)
|
|
|
|
| 31 |
num_inference_steps=50,
|
| 32 |
generator=generator)
|
| 33 |
|
| 34 |
+
torch.cuda.empty_cache()
|
| 35 |
+
|
| 36 |
res = pipe(alpha=1)
|
| 37 |
|
| 38 |
return res.images[0]
|