ginipick commited on
Commit
5659cec
ยท
verified ยท
1 Parent(s): 614753e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +22 -3
app.py CHANGED
@@ -310,12 +310,31 @@ with gr.Blocks(
310
  gallery_html += "</div>"
311
  gr.HTML(gallery_html)
312
 
 
 
 
 
 
 
 
 
 
 
313
 
 
 
314
 
315
  # ์ด๋ฒคํŠธ ๋ฐ”์ธ๋”ฉ
316
  generate_btn.click(
317
- fn=generate_image,
318
- inputs=[height, width, steps, scales, prompt, seed], # ๋”•์…”๋„ˆ๋ฆฌ ๋Œ€์‹  ์ˆœ์„œ๋Œ€๋กœ ๋ฆฌ์ŠคํŠธ
 
 
 
 
 
 
 
319
  outputs=output
320
  )
321
 
@@ -326,4 +345,4 @@ with gr.Blocks(
326
  )
327
 
328
  if __name__ == "__main__":
329
- demo.launch(allowed_paths=[PERSISTENT_DIR])
 
310
  gallery_html += "</div>"
311
  gr.HTML(gallery_html)
312
 
313
+ # ์ด๋ฒคํŠธ ํ•ธ๋“ค๋Ÿฌ ๋ถ€๋ถ„๋งŒ ์ˆ˜์ •
314
+ def generate_image(h, w, s, sc, p, sd):
315
+ return process_and_save_image(
316
+ height=h,
317
+ width=w,
318
+ steps=s,
319
+ scales=sc,
320
+ prompt=p,
321
+ seed=sd
322
+ )
323
 
324
+ def update_random_seed():
325
+ return gr.update(value=get_random_seed())
326
 
327
  # ์ด๋ฒคํŠธ ๋ฐ”์ธ๋”ฉ
328
  generate_btn.click(
329
+ fn=process_and_save_image, # ์ง์ ‘ process_and_save_image ํ•จ์ˆ˜ ์‚ฌ์šฉ
330
+ inputs={
331
+ "height": height,
332
+ "width": width,
333
+ "steps": steps,
334
+ "scales": scales,
335
+ "prompt": prompt,
336
+ "seed": seed
337
+ },
338
  outputs=output
339
  )
340
 
 
345
  )
346
 
347
  if __name__ == "__main__":
348
+ demo.launch(allowed_paths=[PERSISTENT_DIR])