willsh1997 commited on
Commit
3a43f8c
·
verified ·
1 Parent(s): a2a24cc

add zerogpu spaces func

Browse files
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -3,6 +3,7 @@ import requests
3
  import torch
4
  from PIL import Image
5
  from io import BytesIO
 
6
 
7
  from diffusers import StableUnCLIPImg2ImgPipeline, UnCLIPImageVariationPipeline, ImagePipelineOutput
8
 
@@ -411,7 +412,7 @@ will_cand_tensors = torch.cat([chaosclicker_willtensor,
411
 
412
 
413
  ### FUNCTION FOR EXECUTION
414
-
415
  def generate_freak():
416
  will_randomised_input = random_candtensor(will_cand_tensors).unsqueeze(0)
417
  output = pipe(image_embeddings=will_randomised_input, num_images_per_prompt=1, decoder_num_inference_steps = 15, super_res_num_inference_steps = 4)
 
3
  import torch
4
  from PIL import Image
5
  from io import BytesIO
6
+ import spaces
7
 
8
  from diffusers import StableUnCLIPImg2ImgPipeline, UnCLIPImageVariationPipeline, ImagePipelineOutput
9
 
 
412
 
413
 
414
  ### FUNCTION FOR EXECUTION
415
+ @spaces.GPU
416
  def generate_freak():
417
  will_randomised_input = random_candtensor(will_cand_tensors).unsqueeze(0)
418
  output = pipe(image_embeddings=will_randomised_input, num_images_per_prompt=1, decoder_num_inference_steps = 15, super_res_num_inference_steps = 4)