|
from huggingface_hub import InferenceClient |
|
import gradio as gr |
|
import os |
|
client = InferenceClient( |
|
provider="hf-inference", |
|
api_key=os.getenv("HF_API_KEY"), |
|
) |
|
def ghibli_art(user_input): |
|
image = client.text_to_image( |
|
user_input, |
|
model="nitrosocke/Ghibli-Diffusion", |
|
) |
|
return image |
|
|
|
demo = gr.Interface( |
|
fn=ghibli_art, |
|
inputs=gr.Textbox(placeholder="Enter a prompt for Ghibli-style art..."), |
|
outputs=gr.Image(), |
|
title=" Ghibli Art Generator", |
|
description="Generate beautiful Studio Ghibli-style images from text!" |
|
) |
|
|
|
demo.launch() |