import gradio as gr | |
# Modeli yükle | |
model = gr.load("models/radames/stable-diffusion-2-1-img2img") | |
def my_custom_function(image, prompt): | |
# Modeli doğrudan çağır | |
output = model(image=image, prompt=prompt) | |
# Burada output üzerinde ek işlemler yapabilirsiniz | |
# Örneğin, çıktıyı yeniden boyutlandırma, filtreleme vb. | |
return output | |
iface = gr.Interface( | |
fn=my_custom_function, | |
inputs=[gr.Image(type="pil"), gr.Textbox()], | |
outputs=gr.Image(type="pil"), | |
title="My Custom Stable Diffusion img2img Interface", | |
description="This is a custom interface for Stable Diffusion img2img model with additional processing." | |
) | |
iface.launch() | |