Spaces:
Runtime error
Runtime error
File size: 1,238 Bytes
b2649ae 76a2568 b2649ae bd85979 1b121c9 b2649ae bd85979 b2649ae bd85979 76a2568 1b121c9 b2649ae 3990f68 b2649ae 3990f68 b2649ae |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 |
from asyncio import constants
import gradio as gr
import requests
import os
from base64 import b64decode
from PIL import Image
import io
def generate_image(text):
#dalle = gr.Interface.load("spaces/kuprel/min-dalle")
dalle = gr.Interface.load("spaces/Axolotlily/DalleMini")
print("calling interface",text)
img=dalle(text)
#img=dalle.fns[0].fn(seed,psi)
#header, encoded = img.split(",", 1)
#data = b64decode(encoded)
#image = Image.open(io.BytesIO(data))
return img
#gfpgan=gr.Interface.load("spaces/akhaliq/GFPGAN")
#img2=dalle(image)
#return img2
demo = gr.Blocks()
with demo:
gr.Markdown("<h1><center>StyleGan-Human + PIFu </center></h1>")
gr.Markdown(
"create an image with min-dalle then fix faces with grpgan"
)
with gr.Row():
b0 = gr.Button("generate image")
with gr.Row():
text=gr.Text(default="three pigs in a trenchcoat", label='Seed')
#outputImage = gr.Image(label="portrait",type="filepath", shape=(256,256))
output_image = gr.outputs.Image(type="filepath", label='Output')
b0.click(generate_image,inputs=[text],outputs=[output_image])
demo.launch(enable_queue=True, debug=True) |