rnlduatm commited on
Commit
938619b
ยท
1 Parent(s): 76ee195

Update space

Browse files
Files changed (1) hide show
  1. model/animagine_xl.py +3 -1
model/animagine_xl.py CHANGED
@@ -10,12 +10,14 @@ def generate_animagine_xl(prompt: str):
10
  variant="fp16"
11
  )
12
  pipe.scheduler = EulerAncestralDiscreteScheduler.from_config(pipe.scheduler.config)
13
- pipe = pipe.to("cuda")
 
14
  image = pipe(prompt=prompt, width=1024, height=1024).images[0]
15
  image.save("output_animagine_xl.png")
16
  print("โœ… ์ €์žฅ ์™„๋ฃŒ: output_animagine_xl.png")
17
  return image
18
 
 
19
  if __name__ == "__main__":
20
  prompt = "๊ทธ๋…€๋ฅผ ๋ฐ”๋ผ๋ณด๋Š” ํ•œ ๋‚จ์ž์˜ ์•ผ๋ง"
21
  generate_animagine_xl(prompt)
 
10
  variant="fp16"
11
  )
12
  pipe.scheduler = EulerAncestralDiscreteScheduler.from_config(pipe.scheduler.config)
13
+ device = "cuda" if torch.cuda.is_available() else "cpu"
14
+ pipe = pipe.to(device)
15
  image = pipe(prompt=prompt, width=1024, height=1024).images[0]
16
  image.save("output_animagine_xl.png")
17
  print("โœ… ์ €์žฅ ์™„๋ฃŒ: output_animagine_xl.png")
18
  return image
19
 
20
+
21
  if __name__ == "__main__":
22
  prompt = "๊ทธ๋…€๋ฅผ ๋ฐ”๋ผ๋ณด๋Š” ํ•œ ๋‚จ์ž์˜ ์•ผ๋ง"
23
  generate_animagine_xl(prompt)