fantaxy commited on
Commit
3e57a2d
·
verified ·
1 Parent(s): 5b02c3b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -1
app.py CHANGED
@@ -511,7 +511,15 @@ pipe = StableDiffusionXLPipeline.from_pretrained(
511
  variant="fp16"
512
  ).to(device)
513
 
514
-
 
 
 
 
 
 
 
 
515
 
516
  def generate_images(blog_post):
517
  images = []
 
511
  variant="fp16"
512
  ).to(device)
513
 
514
+ def generate_image(prompt):
515
+ # 한국어를 영어로 번역
516
+ translated = translator(prompt)[0]['translation_text']
517
+
518
+ # 이미지 생성
519
+ image = pipe(translated, num_inference_steps=30, guidance_scale=9).images[0]
520
+
521
+ # 이미지를 PIL Image 객체로 반환
522
+ return image
523
 
524
  def generate_images(blog_post):
525
  images = []