Prime Cai commited on
Commit
fd5b7c3
·
1 Parent(s): a1ef85e

fix dynamic gpu

Browse files
Files changed (1) hide show
  1. app.py +8 -1
app.py CHANGED
@@ -38,7 +38,14 @@ pipe.load_lora_weights(
38
  pipe.to(device, dtype=dtype)
39
 
40
  @spaces.GPU
41
- def generate_image(image, text, gemini_prompt, guidance, i_guidance, t_guidance):
 
 
 
 
 
 
 
42
  w, h, min_size = image.size[0], image.size[1], min(image.size)
43
  image = image.crop(
44
  ((w - min_size) // 2, (h - min_size) // 2, (w + min_size) // 2, (h + min_size) // 2)
 
38
  pipe.to(device, dtype=dtype)
39
 
40
  @spaces.GPU
41
+ def generate_image(
42
+ image: Image.Image,
43
+ text: str,
44
+ gemini_prompt: bool = True,
45
+ guidance: float = 3.5,
46
+ i_guidance: float = 1.0,
47
+ t_guidance: float = 1.0
48
+ ):
49
  w, h, min_size = image.size[0], image.size[1], min(image.size)
50
  image = image.crop(
51
  ((w - min_size) // 2, (h - min_size) // 2, (w + min_size) // 2, (h + min_size) // 2)