FreeverseAI commited on
Commit
a85392b
·
verified ·
1 Parent(s): 140d545

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -26
app.py CHANGED
@@ -1,33 +1,13 @@
1
  import gradio as gr
2
- import torch
3
- from diffusers import AutoPipelineForText2Image
4
 
5
- # Model configuration
6
- MODEL_ID = "stabilityai/sd-turbo"
7
- DEVICE = "cpu"
8
-
9
- pipe = AutoPipelineForText2Image.from_pretrained(
10
- MODEL_ID,
11
- torch_dtype=torch.float32,
12
- )
13
- pipe.to(DEVICE)
14
-
15
- def generate_image(prompt: str):
16
- if not prompt.strip():
17
- return None
18
- result = pipe(
19
- prompt,
20
- num_inference_steps=4, # Fast rendering
21
- guidance_scale=0.0, # More realistic, less overexposed
22
- )
23
- return result.images[0]
24
 
25
  demo = gr.Interface(
26
- fn=generate_image,
27
- inputs=gr.Textbox(label="Enter your image prompt"),
28
- outputs=gr.Image(label="Generated Image"),
29
- title="Freeverse AI Studio 🎨",
30
- description="Generate ultra-realistic AI images using Stable Diffusion Turbo (Freeverse AI).",
31
  )
32
 
33
  if __name__ == "__main__":
 
1
  import gradio as gr
 
 
2
 
3
+ def test_fn(text):
4
+ return "Freeverse AI is working: " + text
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5
 
6
  demo = gr.Interface(
7
+ fn=test_fn,
8
+ inputs="text",
9
+ outputs="text",
10
+ title="Freeverse AI Test"
 
11
  )
12
 
13
  if __name__ == "__main__":