Spaces:
Paused
Paused
apolinario
commited on
Commit
•
34f173c
1
Parent(s):
3f7ab74
revert back to 2.9.4
Browse files
README.md
CHANGED
@@ -4,7 +4,7 @@ emoji: 👁
|
|
4 |
colorFrom: red
|
5 |
colorTo: blue
|
6 |
sdk: gradio
|
7 |
-
sdk_version: 2.
|
8 |
app_file: app.py
|
9 |
pinned: false
|
10 |
license: mit
|
|
|
4 |
colorFrom: red
|
5 |
colorTo: blue
|
6 |
sdk: gradio
|
7 |
+
sdk_version: 2.9.4
|
8 |
app_file: app.py
|
9 |
pinned: false
|
10 |
license: mit
|
app.py
CHANGED
@@ -76,7 +76,7 @@ perceptor = (
|
|
76 |
.requires_grad_(False)
|
77 |
.to(device)
|
78 |
)
|
79 |
-
def run_all(user_input, width, height, template, num_steps, flavor
|
80 |
import random
|
81 |
#if uploaded_file is not None:
|
82 |
#uploaded_folder = f"{DefaultPaths.root_path}/uploaded"
|
@@ -2326,17 +2326,17 @@ def run_all(user_input, width, height, template, num_steps, flavor, markdown):
|
|
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=[
|
@@ -2345,8 +2345,8 @@ iface = gr.Interface(
|
|
2345 |
gr.inputs.Slider(label="Height", default=256, minimum=32, step=32, maximum=512),
|
2346 |
gr.inputs.Dropdown(label="Style - Hyper Fast Results is fast but compromises a bit of the quality",choices=["Default","Balanced","Detailed","Consistent Creativity","Realistic","Smooth","Subtle MSE","Hyper Fast Results"],default="Hyper Fast Results"),
|
2347 |
gr.inputs.Slider(label="Steps - more steps can increase quality but will take longer to generate. All styles that are not Hyper Fast need at least 200 steps",default=50,maximum=300,minimum=1,step=1),
|
2348 |
-
gr.inputs.Dropdown(label="Flavor - pick a flavor for the style of the images
|
2349 |
-
markdown
|
2350 |
],
|
2351 |
outputs=image,
|
2352 |
title="Generate images from text with VQGAN+CLIP (Hypertron v2)",
|
|
|
76 |
.requires_grad_(False)
|
77 |
.to(device)
|
78 |
)
|
79 |
+
def run_all(user_input, width, height, template, num_steps, flavor):
|
80 |
import random
|
81 |
#if uploaded_file is not None:
|
82 |
#uploaded_folder = f"{DefaultPaths.root_path}/uploaded"
|
|
|
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=[
|
|
|
2345 |
gr.inputs.Slider(label="Height", default=256, minimum=32, step=32, maximum=512),
|
2346 |
gr.inputs.Dropdown(label="Style - Hyper Fast Results is fast but compromises a bit of the quality",choices=["Default","Balanced","Detailed","Consistent Creativity","Realistic","Smooth","Subtle MSE","Hyper Fast Results"],default="Hyper Fast Results"),
|
2347 |
gr.inputs.Slider(label="Steps - more steps can increase quality but will take longer to generate. All styles that are not Hyper Fast need at least 200 steps",default=50,maximum=300,minimum=1,step=1),
|
2348 |
+
gr.inputs.Dropdown(label="Flavor - pick a flavor for the style of the images",choices=["ginger", "cumin", "holywater", "zynth", "wyvern", "aaron", "moth", "juu"]),
|
2349 |
+
#markdown
|
2350 |
],
|
2351 |
outputs=image,
|
2352 |
title="Generate images from text with VQGAN+CLIP (Hypertron v2)",
|