Update app.py
Browse files
app.py
CHANGED
@@ -24,12 +24,12 @@ def generate_and_display_images(model_selection, scenery, style, height, width,
|
|
24 |
|
25 |
generated_images = []
|
26 |
if model_selection == "dreamlike-art/dreamlike-photoreal-2.0":
|
27 |
-
model = StableDiffusionPipeline.from_pretrained(model_selection, torch_dtype=torch.float16).to("
|
28 |
for _ in range(num_images):
|
29 |
image = model(prompt=prompt, num_inference_steps=n_steps, guidance_scale=guidance_scale, negative_prompt=negative_prompt, height=height, width=width).images[0]
|
30 |
generated_images.append(image)
|
31 |
else:
|
32 |
-
base = DiffusionPipeline.from_pretrained(model_selection, torch_dtype=torch.float16, use_auth_token=True).to("
|
33 |
for _ in range(num_images):
|
34 |
if "refiner" in model_selection:
|
35 |
image_latent = base(prompt=prompt, num_inference_steps=n_steps, denoising_end=high_noise_frac, output_type="latent").images
|
|
|
24 |
|
25 |
generated_images = []
|
26 |
if model_selection == "dreamlike-art/dreamlike-photoreal-2.0":
|
27 |
+
model = StableDiffusionPipeline.from_pretrained(model_selection, torch_dtype=torch.float16).to("cpu")
|
28 |
for _ in range(num_images):
|
29 |
image = model(prompt=prompt, num_inference_steps=n_steps, guidance_scale=guidance_scale, negative_prompt=negative_prompt, height=height, width=width).images[0]
|
30 |
generated_images.append(image)
|
31 |
else:
|
32 |
+
base = DiffusionPipeline.from_pretrained(model_selection, torch_dtype=torch.float16, use_auth_token=True).to("cpu")
|
33 |
for _ in range(num_images):
|
34 |
if "refiner" in model_selection:
|
35 |
image_latent = base(prompt=prompt, num_inference_steps=n_steps, denoising_end=high_noise_frac, output_type="latent").images
|