Spaces:
Runtime error
Runtime error
import gradio as gr | |
from diffusers import StableDiffusionPipeline | |
import torch | |
# Load the Ghibli LoRA model | |
model_id = "openfree/flux-chatgpt-ghibli-lora" | |
pipe = StableDiffusionPipeline.from_pretrained(model_id, torch_dtype=torch.float16) | |
pipe.to("cpu") # Ensure you have GPU enabled | |
def convert_to_ghibli(image): | |
prompt = "A Ghibli-style anime scene, highly detailed, vibrant colors" | |
result = pipe(prompt, image=image).images[0] | |
return result | |
# Create Gradio UI | |
iface = gr.Interface( | |
fn=convert_to_ghibli, | |
inputs=gr.Image(type="pil"), | |
outputs="image", | |
title="Ghibli Image Converter", | |
description="Upload an image and convert it to a Studio Ghibli-style artwork using AI." | |
) | |
iface.launch() | |