Spaces:
Sleeping
Sleeping
from gradio_client import Client | |
import numpy as np | |
import gradio as gr | |
def generate_img(prompt): | |
client = Client("ameerazam08/SDXS-GPU-Demo") | |
result = client.predict( | |
prompt=prompt, | |
api_name="/generate_image" | |
) | |
return result | |
from gradio_client import Client | |
def interrogate(img): | |
from gradio_client import Client | |
client = Client("https://pharmapsychotic-clip-interrogator.hf.space/") | |
result = client.predict( | |
img, # str (filepath or URL to image) | |
"ViT-L (best for Stable Diffusion 1.*)", # str (Option from: ['ViT-L (best for Stable Diffusion 1.*)']) | |
"best", # str in 'Mode' Radio component | |
fn_index=3 | |
) | |
print(result) | |
def rountrip(img): | |
prompt=interrogate(img) | |
return generate_img(prompt) | |
demo = gr.Interface(rountrip, gr.Image(),gr.Image()) | |
demo.launch() | |