Spaces:
Sleeping
Sleeping
add accelerate
Browse files
app.py
CHANGED
@@ -27,10 +27,10 @@ def display_example_image(url):
|
|
27 |
def generate_images_using_huggingface_diffusers(text):
|
28 |
# pipe = StableDiffusionPipeline.from_pretrained("sd-dreambooth-library/cat-toy", torch_dtype=torch.float16)
|
29 |
pipe = StableDiffusionPipeline.from_pretrained("CompVis/stable-diffusion-v1-4", torch_dtype=torch.float32)
|
30 |
-
# pipe = pipe.to("
|
31 |
pipe = pipe.to(accelerator.device)
|
32 |
prompt = text
|
33 |
-
image = pipe(prompt)
|
34 |
return image
|
35 |
|
36 |
# Placeholder function for generating images (replace this with your actual generative AI code)
|
|
|
27 |
def generate_images_using_huggingface_diffusers(text):
|
28 |
# pipe = StableDiffusionPipeline.from_pretrained("sd-dreambooth-library/cat-toy", torch_dtype=torch.float16)
|
29 |
pipe = StableDiffusionPipeline.from_pretrained("CompVis/stable-diffusion-v1-4", torch_dtype=torch.float32)
|
30 |
+
# pipe = pipe.to("cuda")
|
31 |
pipe = pipe.to(accelerator.device)
|
32 |
prompt = text
|
33 |
+
image = pipe(prompt,num_images_per_prompt=3)
|
34 |
return image
|
35 |
|
36 |
# Placeholder function for generating images (replace this with your actual generative AI code)
|