Teotonix commited on
Commit
0b15d1d
·
verified ·
1 Parent(s): 8806fa7

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +21 -4
app.py CHANGED
@@ -1,8 +1,25 @@
1
  import gradio as gr
 
2
 
3
- # En hızlı ve sorunsuz çalışan yükleme yöntemi
4
- demo = gr.load("models/stabilityai/sdxl-turbo")
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5
 
6
  if __name__ == "__main__":
7
- # Sitenin içine gömülebilmesi için (inline) ayarları
8
- demo.launch(show_api=False)
 
1
  import gradio as gr
2
+ from huggingface_hub import InferenceClient
3
 
4
+ # En hızlı ve en güncel SDXL Turbo modeli
5
+ client = InferenceClient("stabilityai/sdxl-turbo")
6
+
7
+ def generate(prompt):
8
+ # Modeli sorgula ve görseli al
9
+ image = client.text_to_image(prompt)
10
+ return image
11
+
12
+ # Arayüzü oluştur
13
+ with gr.Blocks(theme=gr.themes.Soft()) as demo:
14
+ gr.Markdown("# 🎨 Maind AI Image Studio")
15
+ with gr.Row():
16
+ with gr.Column():
17
+ input_text = gr.Textbox(label="Hayalindeki Görseli Tarif Et (İngilizce)", placeholder="Örn: A futuristic city at night, 4k...")
18
+ btn = gr.Button("Oluştur", variant="primary")
19
+ with gr.Column():
20
+ output_img = gr.Image(label="Sonuç")
21
+
22
+ btn.click(fn=generate, inputs=input_text, outputs=output_img)
23
 
24
  if __name__ == "__main__":
25
+ demo.launch()