Spaces:
Paused
Paused
apolinario
commited on
Commit
•
a0a0708
1
Parent(s):
3950160
Attempted add flavors image
Browse files
app.py
CHANGED
@@ -2326,27 +2326,27 @@ def run_all(user_input, num_steps, flavor, template, width, height):
|
|
2326 |
|
2327 |
##################### START GRADIO HERE ############################
|
2328 |
image = gr.outputs.Image(type="pil", label="Your result")
|
2329 |
-
|
2330 |
-
|
2331 |
-
|
2332 |
-
|
2333 |
-
|
2334 |
-
|
2335 |
-
|
2336 |
-
|
2337 |
-
|
2338 |
-
|
2339 |
-
|
2340 |
iface = gr.Interface(
|
2341 |
fn=run_all,
|
2342 |
inputs=[
|
2343 |
gr.inputs.Textbox(label="Prompt - try adding increments to your prompt such as 'oil on canvas', 'a painting', 'a book cover'",default="chalk pastel drawing of a dog wearing a funny hat"),
|
2344 |
gr.inputs.Slider(label="Steps - more steps can increase quality but will take longer to generate",default=50,maximum=250,minimum=1,step=1),
|
2345 |
gr.inputs.Dropdown(label="Flavor",choices=["ginger", "cumin", "holywater", "zynth", "wyvern", "aaron", "moth", "juu", "custom"]),
|
2346 |
-
|
2347 |
gr.inputs.Dropdown(label="Style",choices=["Default","Balanced","Detailed","Consistent Creativity","Realistic","Smooth","Subtle MSE","Hyper Fast Results"],default="Hyper Fast Results"),
|
2348 |
-
gr.inputs.
|
2349 |
-
gr.inputs.
|
2350 |
],
|
2351 |
outputs=image,
|
2352 |
title="Generate images from text with VQGAN+CLIP (Hypertron v2)",
|
|
|
2326 |
|
2327 |
##################### START GRADIO HERE ############################
|
2328 |
image = gr.outputs.Image(type="pil", label="Your result")
|
2329 |
+
def cvt_2_base64(file_name):
|
2330 |
+
with open(file_name , "rb") as image_file :
|
2331 |
+
data = base64.b64encode(image_file.read())
|
2332 |
+
return data.decode('utf-8')
|
2333 |
+
base64image = "data:image/jpg;base64,"+cvt_2_base64('flavors.jpg')
|
2334 |
+
markdown = gr.Markdown("<img src='"+base64image+"' />")
|
2335 |
+
def test(raw_input):
|
2336 |
+
pass
|
2337 |
+
setattr(markdown, "requires_permissions", False)
|
2338 |
+
setattr(markdown, "label", "Flavors")
|
2339 |
+
setattr(markdown, "preprocess", test)
|
2340 |
iface = gr.Interface(
|
2341 |
fn=run_all,
|
2342 |
inputs=[
|
2343 |
gr.inputs.Textbox(label="Prompt - try adding increments to your prompt such as 'oil on canvas', 'a painting', 'a book cover'",default="chalk pastel drawing of a dog wearing a funny hat"),
|
2344 |
gr.inputs.Slider(label="Steps - more steps can increase quality but will take longer to generate",default=50,maximum=250,minimum=1,step=1),
|
2345 |
gr.inputs.Dropdown(label="Flavor",choices=["ginger", "cumin", "holywater", "zynth", "wyvern", "aaron", "moth", "juu", "custom"]),
|
2346 |
+
markdown,
|
2347 |
gr.inputs.Dropdown(label="Style",choices=["Default","Balanced","Detailed","Consistent Creativity","Realistic","Smooth","Subtle MSE","Hyper Fast Results"],default="Hyper Fast Results"),
|
2348 |
+
gr.inputs.Slider(label="Width", default=256, minimum=32, step=32, maximum=512),
|
2349 |
+
gr.inputs.Slider(label="Height", default=256, minimum=32, step=32, maximum=512),
|
2350 |
],
|
2351 |
outputs=image,
|
2352 |
title="Generate images from text with VQGAN+CLIP (Hypertron v2)",
|