vilarin commited on
Commit
1d8c2bd
1 Parent(s): 9958140

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -8
app.py CHANGED
@@ -69,8 +69,6 @@ async def generate_image(
69
  num_inference_steps=steps,
70
  model=basemodel,
71
  )
72
- image1 = Image.open(image1)
73
- print(image1)
74
  image2 = await client.text_to_image(
75
  prompt=text,
76
  height=height,
@@ -79,9 +77,7 @@ async def generate_image(
79
  num_inference_steps=steps,
80
  model=model,
81
  )
82
- print(image2)
83
- image2 = Image.open(image2)
84
- return image1, image2, seed
85
 
86
  async def gen(
87
  prompt:str,
@@ -96,7 +92,7 @@ async def gen(
96
  ):
97
  model = enable_lora(lora_in, lora_add)
98
  image1, image2, seed = await generate_image(prompt,model,width,height,scales,steps,seed)
99
- return image1, image2, seed
100
 
101
 
102
 
@@ -133,8 +129,8 @@ with gr.Blocks(css=CSS, js=JS, theme="Nymbo/Nymbo_Theme") as demo:
133
  with gr.Row():
134
  with gr.Column(scale=4):
135
  with gr.Row():
136
- img1 = gr.Gallery(label='flux Generated Image', columns = 1, preview=True, height=600)
137
- img2 = gr.Gallery(label='LoRA Generated Image', columns = 1, preview=True, height=600)
138
  with gr.Row():
139
  prompt = gr.Textbox(label='Enter Your Prompt (Multi-Languages)', placeholder="Enter prompt...", scale=6)
140
  sendBtn = gr.Button(scale=1, variant='primary')
 
69
  num_inference_steps=steps,
70
  model=basemodel,
71
  )
 
 
72
  image2 = await client.text_to_image(
73
  prompt=text,
74
  height=height,
 
77
  num_inference_steps=steps,
78
  model=model,
79
  )
80
+ yield image1, image2, seed
 
 
81
 
82
  async def gen(
83
  prompt:str,
 
92
  ):
93
  model = enable_lora(lora_in, lora_add)
94
  image1, image2, seed = await generate_image(prompt,model,width,height,scales,steps,seed)
95
+ yield image1, image2, seed
96
 
97
 
98
 
 
129
  with gr.Row():
130
  with gr.Column(scale=4):
131
  with gr.Row():
132
+ img1 = gr.Image(type="PIL", label='flux Generated Image', height=600)
133
+ img2 = gr.Image(type="PIL", label='LoRA Generated Image', height=600)
134
  with gr.Row():
135
  prompt = gr.Textbox(label='Enter Your Prompt (Multi-Languages)', placeholder="Enter prompt...", scale=6)
136
  sendBtn = gr.Button(scale=1, variant='primary')