KingNish commited on
Commit
b3c077f
·
verified ·
1 Parent(s): 34c1ae0

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -4
app.py CHANGED
@@ -148,12 +148,16 @@ def respond(message, history):
148
  yield output
149
  elif json_data["name"] == "image_generation":
150
  query = json_data["arguments"]["query"]
 
151
  gr.Info("Generating Image, Please wait 10 sec...")
152
  client = InferenceClient("stabilityai/stable-diffusion-3-medium-diffusers")
153
- seed = random.randint(0,999999)
154
- image = client.text_to_image(message_text, negative_prompt=f"{seed}", num_inference_steps=20 )
155
- yield gr.Image(image)
156
- gr.Info("We are going to mor upgrade image generator in next update")
 
 
 
157
  elif json_data["name"] == "image_qna":
158
  inputs = llava(message, history)
159
  streamer = TextIteratorStreamer(processor, skip_prompt=True, **{"skip_special_tokens": True})
 
148
  yield output
149
  elif json_data["name"] == "image_generation":
150
  query = json_data["arguments"]["query"]
151
+ number_of_image = json_data["arguments"]["number_of_image"]
152
  gr.Info("Generating Image, Please wait 10 sec...")
153
  client = InferenceClient("stabilityai/stable-diffusion-3-medium-diffusers")
154
+ generated_images = []
155
+ for i in range(5):
156
+ seed = random.randint(0,999999)
157
+ image = client.text_to_image(f"{query}{message_text}", negative_prompt=f"{seed}")
158
+ generated_images.append = gr.Image(image)
159
+ yield generated_images
160
+ gr.Info("We are going to more upgrade image generator in next update")
161
  elif json_data["name"] == "image_qna":
162
  inputs = llava(message, history)
163
  streamer = TextIteratorStreamer(processor, skip_prompt=True, **{"skip_special_tokens": True})