Update app.py
Browse files
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 |
-
|
154 |
-
|
155 |
-
|
156 |
-
|
|
|
|
|
|
|
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})
|