Lisandro's picture
volví al código de ayer
e76f467
raw
history blame
1.04 kB
import os
import gradio as gr
api_key = os.getenv('HF_API_KEY')
# with gr.Blocks() as demo:
# gr.load("fffiloni/sd-xl-custom-model", api_key=api_key, hf_token=api_key, src="spaces")
from gradio_client import Client
def predict(prompt):
client = Client("fffiloni/sd-xl-custom-model")
result = client.predict(
custom_model="lichorosario/dott_remastered_style_lora_sdxl",
api_name="/load_model"
)
client = Client("fffiloni/sd-xl-custom-model")
result = client.predict(
custom_model="lichorosario/dott_remastered_style_lora_sdxl",
weight_name="dott_style.safetensors",
prompt=prompt,
inf_steps=25,
guidance_scale=12,
width=1024,
height=512,
seed=-1,
lora_weight=1,
api_name="/infer"
)
return result
with gr.Blocks() as demo:
inputs = gr.Textbox(label="Prompt")
outputs = [gr.Image(label="Image"), gr.Textbox(label="Seed")]
greet_btn = gr.Button("Generate")
greet_btn.click(fn=predict, inputs=inputs, outputs=outputs, api_name="predict")
demo.launch()