Update app.py
Browse files
app.py
CHANGED
@@ -5,7 +5,16 @@ from pathlib import Path
|
|
5 |
import time
|
6 |
import random
|
7 |
from PIL import Image
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8 |
|
|
|
9 |
models2 =[
|
10 |
"",
|
11 |
"Schisim/Clarity",
|
@@ -66,6 +75,14 @@ proc1=gr.Interface.load(f"models/{model_1}",live=False,preprocess=True, postproc
|
|
66 |
proc2=gr.Interface.load(f"models/{model_20}",live=False,preprocess=True, postprocess=False)
|
67 |
proc3=gr.Interface.load(f"models/{model_17}",live=False,preprocess=True, postprocess=False)
|
68 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
69 |
|
70 |
|
71 |
#from transformers import pipeline
|
@@ -102,6 +119,9 @@ with gr.Blocks() as demo:
|
|
102 |
btn2 = gr.Button(value="btn2")
|
103 |
btn3 = gr.Button(value="btn3")
|
104 |
btn4 = gr.Button(value="btn4")
|
|
|
|
|
|
|
105 |
|
106 |
def iimg(text):
|
107 |
return ("girl "+randStr()+" "+text)
|
@@ -111,8 +131,11 @@ with gr.Blocks() as demo:
|
|
111 |
btn2.click(proc1,inputs=english,outputs=img1)
|
112 |
btn3.click(proc2,inputs=english,outputs=img2)
|
113 |
btn4.click(proc3,inputs=english,outputs=img3)
|
|
|
|
|
|
|
114 |
examples = gr.Examples(examples=["I went to the supermarket yesterday.", "Helen is a good swimmer."],
|
115 |
inputs=[english])
|
116 |
|
117 |
print("\nabc01aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\n")
|
118 |
-
demo.launch()
|
|
|
5 |
import time
|
6 |
import random
|
7 |
from PIL import Image
|
8 |
+
"""
|
9 |
+
import os
|
10 |
+
import gradio as gr
|
11 |
+
|
12 |
+
API_KEY=os.environ.get('HUGGING_FACE_HUB_TOKEN', None)
|
13 |
+
|
14 |
+
article = "test"
|
15 |
+
|
16 |
|
17 |
+
"""
|
18 |
models2 =[
|
19 |
"",
|
20 |
"Schisim/Clarity",
|
|
|
75 |
proc2=gr.Interface.load(f"models/{model_20}",live=False,preprocess=True, postprocess=False)
|
76 |
proc3=gr.Interface.load(f"models/{model_17}",live=False,preprocess=True, postprocess=False)
|
77 |
|
78 |
+
ppComic=gr.Interface.load(
|
79 |
+
name="models/ogkalu/Comic-Diffusion",
|
80 |
+
title="""Comic Diffusion""",
|
81 |
+
description="""Demo for <a href="https://huggingface.co/ogkalu/Comic-Diffusion">Comic Diffusion</a> Stable Diffusion model.""",
|
82 |
+
article=article,
|
83 |
+
api_key=API_KEY,
|
84 |
+
)#.queue(concurrency_count=20).launch()
|
85 |
+
|
86 |
|
87 |
|
88 |
#from transformers import pipeline
|
|
|
119 |
btn2 = gr.Button(value="btn2")
|
120 |
btn3 = gr.Button(value="btn3")
|
121 |
btn4 = gr.Button(value="btn4")
|
122 |
+
with gr.Row():
|
123 |
+
img4=gr.Image()
|
124 |
+
btn5 = gr.Button(value="btn4")
|
125 |
|
126 |
def iimg(text):
|
127 |
return ("girl "+randStr()+" "+text)
|
|
|
131 |
btn2.click(proc1,inputs=english,outputs=img1)
|
132 |
btn3.click(proc2,inputs=english,outputs=img2)
|
133 |
btn4.click(proc3,inputs=english,outputs=img3)
|
134 |
+
btn5.click(ppComic,inputs=english,outputs=img4)
|
135 |
+
|
136 |
+
#ppComic
|
137 |
examples = gr.Examples(examples=["I went to the supermarket yesterday.", "Helen is a good swimmer."],
|
138 |
inputs=[english])
|
139 |
|
140 |
print("\nabc01aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\n")
|
141 |
+
demo.launch()
|