Akjava's picture
update
3b9712f
raw
history blame
677 Bytes
import numpy
import spaces
import gradio as gr
from PIL import Image
import upscale_image
import numpy as np
@spaces.GPU(duration=120)
def gradio_upscale(image):
pil_image = Image.fromarray(np.uint8(image)).convert('RGB')
return upscale_image.execute(pil_image)
if __name__ == "__main__":
# Gradio UIの設定
iface = gr.Interface(
fn=gradio_upscale,
inputs="image",
outputs="image",
title="Image Convert to 128x128 and Upscale to 512x512",
description="force convert to 128x128 image and upscale 512x512 with stable-diffusion-x4-upscaler",
)
# インターフェースを公開
iface.launch(share=True)