Spaces:
Runtime error
Runtime error
susunghong
commited on
Commit
•
7540b2d
1
Parent(s):
37d3c52
Update app.py
Browse files
app.py
CHANGED
@@ -53,7 +53,7 @@ examples = [
|
|
53 |
model_id = "runwayml/stable-diffusion-v1-5"
|
54 |
|
55 |
def main():
|
56 |
-
pipe = StableDiffusionSAGPipeline.from_pretrained(model_id
|
57 |
|
58 |
def generate(
|
59 |
prompt: str,
|
@@ -68,7 +68,7 @@ def main():
|
|
68 |
generator = torch.manual_seed(seed)
|
69 |
ori_image = pipe(prompt, generator=generator, guidance_scale=cfg_scale, sag_scale=0.0).images[0]
|
70 |
generator = torch.manual_seed(seed)
|
71 |
-
sag_image = pipe(prompt, generator=generator, guidance_scale=cfg_scale, sag_scale=
|
72 |
return [ori_image, sag_image]
|
73 |
|
74 |
def reset():
|
|
|
53 |
model_id = "runwayml/stable-diffusion-v1-5"
|
54 |
|
55 |
def main():
|
56 |
+
pipe = StableDiffusionSAGPipeline.from_pretrained(model_id, torch_dtype=torch.float16).to('cuda')
|
57 |
|
58 |
def generate(
|
59 |
prompt: str,
|
|
|
68 |
generator = torch.manual_seed(seed)
|
69 |
ori_image = pipe(prompt, generator=generator, guidance_scale=cfg_scale, sag_scale=0.0).images[0]
|
70 |
generator = torch.manual_seed(seed)
|
71 |
+
sag_image = pipe(prompt, generator=generator, guidance_scale=cfg_scale, sag_scale=sag_scale).images[0]
|
72 |
return [ori_image, sag_image]
|
73 |
|
74 |
def reset():
|