Spaces:
Running
on
T4
Running
on
T4
Update app.py
Browse files
app.py
CHANGED
@@ -73,7 +73,7 @@ def multimodal_understanding(image, question, seed, top_p, temperature):
|
|
73 |
def generate(
|
74 |
input_ids,
|
75 |
cfg_weight: float = 2.0,
|
76 |
-
num_inference_steps: int =
|
77 |
):
|
78 |
# we generate 5 images at a time, *2 for CFG
|
79 |
tokens = torch.stack([input_ids] * 10).cuda()
|
@@ -215,37 +215,37 @@ with gr.Blocks() as demo:
|
|
215 |
|
216 |
|
217 |
|
218 |
-
|
219 |
-
|
220 |
-
|
221 |
|
222 |
-
|
223 |
-
|
224 |
|
225 |
-
|
226 |
|
227 |
-
|
228 |
|
229 |
-
|
230 |
-
|
231 |
-
|
232 |
-
|
233 |
-
|
234 |
-
|
235 |
-
|
236 |
-
|
237 |
-
)
|
238 |
|
239 |
-
|
240 |
-
|
241 |
-
|
242 |
-
|
243 |
-
)
|
244 |
|
245 |
-
generation_button.click(
|
246 |
-
|
247 |
-
|
248 |
-
|
249 |
-
)
|
250 |
|
251 |
demo.launch(share=True, ssr_mode = False)
|
|
|
73 |
def generate(
|
74 |
input_ids,
|
75 |
cfg_weight: float = 2.0,
|
76 |
+
num_inference_steps: int = 10
|
77 |
):
|
78 |
# we generate 5 images at a time, *2 for CFG
|
79 |
tokens = torch.stack([input_ids] * 10).cuda()
|
|
|
215 |
|
216 |
|
217 |
|
218 |
+
# with gr.Row():
|
219 |
+
# cfg_weight_input = gr.Slider(minimum=1, maximum=10, value=2, step=0.5, label="CFG Weight")
|
220 |
+
# step_input = gr.Slider(minimum=1, maximum=50, value=30, step=1, label="Number of Inference Steps")
|
221 |
|
222 |
+
# prompt_input = gr.Textbox(label="Prompt")
|
223 |
+
# seed_input = gr.Number(label="Seed (Optional)", precision=0, value=12345)
|
224 |
|
225 |
+
# generation_button = gr.Button("Generate Images")
|
226 |
|
227 |
+
# image_output = gr.Gallery(label="Generated Images", columns=2, rows=2, height=300)
|
228 |
|
229 |
+
# examples_t2i = gr.Examples(
|
230 |
+
# label="Text to image generation examples.",
|
231 |
+
# examples=[
|
232 |
+
# "Master shifu racoon wearing drip attire as a street gangster.",
|
233 |
+
# "A cute and adorable baby fox with big brown eyes, autumn leaves in the background enchanting,immortal,fluffy, shiny mane,Petals,fairyism,unreal engine 5 and Octane Render,highly detailed, photorealistic, cinematic, natural colors.",
|
234 |
+
# "The image features an intricately designed eye set against a circular backdrop adorned with ornate swirl patterns that evoke both realism and surrealism. At the center of attention is a strikingly vivid blue iris surrounded by delicate veins radiating outward from the pupil to create depth and intensity. The eyelashes are long and dark, casting subtle shadows on the skin around them which appears smooth yet slightly textured as if aged or weathered over time.\n\nAbove the eye, there's a stone-like structure resembling part of classical architecture, adding layers of mystery and timeless elegance to the composition. This architectural element contrasts sharply but harmoniously with the organic curves surrounding it. Below the eye lies another decorative motif reminiscent of baroque artistry, further enhancing the overall sense of eternity encapsulated within each meticulously crafted detail. \n\nOverall, the atmosphere exudes a mysterious aura intertwined seamlessly with elements suggesting timelessness, achieved through the juxtaposition of realistic textures and surreal artistic flourishes. Each component\u2014from the intricate designs framing the eye to the ancient-looking stone piece above\u2014contributes uniquely towards creating a visually captivating tableau imbued with enigmatic allure.",
|
235 |
+
# ],
|
236 |
+
# inputs=prompt_input,
|
237 |
+
#)
|
238 |
|
239 |
+
# understanding_button.click(
|
240 |
+
# multimodal_understanding,
|
241 |
+
# inputs=[image_input, question_input, und_seed_input, top_p, temperature],
|
242 |
+
# outputs=understanding_output
|
243 |
+
#)
|
244 |
|
245 |
+
#generation_button.click(
|
246 |
+
# fn=generate_image,
|
247 |
+
# inputs=[prompt_input, seed_input, cfg_weight_input, step_input],
|
248 |
+
# outputs=image_output
|
249 |
+
#)
|
250 |
|
251 |
demo.launch(share=True, ssr_mode = False)
|