File size: 727 Bytes
e547b24
be51f68
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
d0338ea
adb8560
be51f68
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
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()