yerang commited on
Commit
57736d1
1 Parent(s): 2532f22

Update flux_dev.py

Browse files
Files changed (1) hide show
  1. flux_dev.py +11 -1
flux_dev.py CHANGED
@@ -44,7 +44,8 @@ def infer(prompt, seed=42, randomize_seed=False, width=1024, height=1024, guidan
44
  yield img, seed
45
 
46
 
47
- def create_flux_tab():
 
48
  examples = [
49
  "a tiny astronaut hatching from an egg on the moon",
50
  "a cat holding a sign that says hello world",
@@ -72,6 +73,9 @@ def create_flux_tab():
72
  run_button = gr.Button("Run", scale=0)
73
 
74
  result = gr.Image(label="Result", show_label=False)
 
 
 
75
 
76
  with gr.Accordion("Advanced Settings", open=False):
77
  seed = gr.Slider(
@@ -129,5 +133,11 @@ def create_flux_tab():
129
  inputs=[prompt, seed, randomize_seed, width, height, guidance_scale, num_inference_steps],
130
  outputs=[result, seed]
131
  )
 
 
 
 
 
 
132
 
133
  return flux_demo
 
44
  yield img, seed
45
 
46
 
47
+ #def create_flux_tab():
48
+ def create_flux_tab(image_input):
49
  examples = [
50
  "a tiny astronaut hatching from an egg on the moon",
51
  "a cat holding a sign that says hello world",
 
73
  run_button = gr.Button("Run", scale=0)
74
 
75
  result = gr.Image(label="Result", show_label=False)
76
+
77
+ with gr.Row():
78
+ use_in_text2lipsync_button = gr.Button("Use this image in [Txt2LipSync] Tab") # 새로운 버튼 추가
79
 
80
  with gr.Accordion("Advanced Settings", open=False):
81
  seed = gr.Slider(
 
133
  inputs=[prompt, seed, randomize_seed, width, height, guidance_scale, num_inference_steps],
134
  outputs=[result, seed]
135
  )
136
+ # 새로운 버튼 클릭 이벤트 정의
137
+ use_in_text2lipsync_button.click(
138
+ fn=lambda img: img, # 간단한 람다 함수를 사용하여 이미지를 그대로 전달
139
+ inputs=[result], # 생성된 이미지를 입력으로 사용
140
+ outputs=[image_input] # Text to LipSync 탭의 image_input을 업데이트
141
+ )
142
 
143
  return flux_demo