jn1xia commited on
Commit
790e413
·
verified ·
1 Parent(s): 154c710

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -26,9 +26,9 @@ def display_example_image(url):
26
  def generate_images_using_huggingface_diffusers(text):
27
  # pipe = StableDiffusionPipeline.from_pretrained("sd-dreambooth-library/cat-toy", torch_dtype=torch.float16)
28
  pipe = StableDiffusionPipeline.from_pretrained("CompVis/stable-diffusion-v1-4", torch_dtype=torch.float32)
29
- pipe = pipe.to("cpu")
30
  prompt = text
31
- image = pipe(prompt).images[0]
32
  return image
33
 
34
  # Placeholder function for generating images (replace this with your actual generative AI code)
 
26
  def generate_images_using_huggingface_diffusers(text):
27
  # pipe = StableDiffusionPipeline.from_pretrained("sd-dreambooth-library/cat-toy", torch_dtype=torch.float16)
28
  pipe = StableDiffusionPipeline.from_pretrained("CompVis/stable-diffusion-v1-4", torch_dtype=torch.float32)
29
+ pipe = pipe.to("cuda")
30
  prompt = text
31
+ image = pipe(prompt,num_images_per_prompt=3)
32
  return image
33
 
34
  # Placeholder function for generating images (replace this with your actual generative AI code)