Profakerr commited on
Commit
309bf38
·
verified ·
1 Parent(s): dffbf86

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +29 -36
app.py CHANGED
@@ -49,46 +49,49 @@ def generate_image(prompt, negative_prompt, num_inference_steps=50, guidance_sca
49
 
50
  return image
51
 
 
52
  # Create the Gradio interface
53
  with gr.Blocks() as demo:
54
- gr.Markdown("# ProFaker ImageGen")
55
 
56
  with gr.Row():
57
  with gr.Column():
58
  # Input components
59
  prompt = gr.Textbox(
60
  label="Prompt",
61
- placeholder="Enter your image description here...",
62
- value="a photo of an astronaut riding a horse on mars"
63
  )
64
  negative_prompt = gr.Textbox(
65
  label="Negative Prompt",
66
- placeholder="Enter what you don't want in photo",
 
67
  )
68
- steps_slider = gr.Slider(
69
- minimum=1,
70
- maximum=100,
71
- value=50,
72
- step=1,
73
- label="Number of Inference Steps"
74
- )
75
- guidance_slider = gr.Slider(
76
- minimum=1,
77
- maximum=20,
78
- value=7.5,
79
- step=0.5,
80
- label="Guidance Scale"
81
- )
82
- model = gr.Dropdown(
83
- choices=["Real6.0","Real5.1","Real5.0"],
84
- value="Real6.0",
85
- label="Model",
86
- )
87
- generate_button = gr.Button("Generate Image")
88
-
89
  with gr.Column():
90
  # Output component
91
  image_output = gr.Image(label="Generated Image")
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
92
 
93
  # Connect the interface to the generation function
94
  generate_button.click(
@@ -96,15 +99,5 @@ with gr.Blocks() as demo:
96
  inputs=[prompt, negative_prompt, steps_slider, guidance_slider, model],
97
  outputs=image_output
98
  )
99
-
100
- gr.Markdown("""
101
- ## Instructions
102
- 1. Enter your desired image description in the prompt field
103
- 2. Adjust the inference steps (higher = better quality but slower)
104
- 3. Adjust the guidance scale (higher = more prompt adherence)
105
- 4. Click 'Generate Image' and wait for the result
106
- """)
107
 
108
- # Launch the interface
109
- if __name__ == "__main__":
110
- demo.launch(share=True)
 
49
 
50
  return image
51
 
52
+ title = """<h1 align="center">ProFaker</h1>"""
53
  # Create the Gradio interface
54
  with gr.Blocks() as demo:
55
+ gr.HTML(title)
56
 
57
  with gr.Row():
58
  with gr.Column():
59
  # Input components
60
  prompt = gr.Textbox(
61
  label="Prompt",
62
+ info="Enter your image description here...",
63
+ lines=3
64
  )
65
  negative_prompt = gr.Textbox(
66
  label="Negative Prompt",
67
+ info="Enter what you don't want in Image...",
68
+ lines=3
69
  )
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
70
  with gr.Column():
71
  # Output component
72
  image_output = gr.Image(label="Generated Image")
73
+
74
+ with gr.Row():
75
+ steps_slider = gr.Slider(
76
+ minimum=1,
77
+ maximum=100,
78
+ value=50,
79
+ step=1,
80
+ label="Number of Inference Steps"
81
+ )
82
+ guidance_slider = gr.Slider(
83
+ minimum=1,
84
+ maximum=20,
85
+ value=7.5,
86
+ step=0.5,
87
+ label="Guidance Scale"
88
+ )
89
+ model = gr.Dropdown(
90
+ choices=["Real6.0","Real5.1","Real5.0"],
91
+ value="Real6.0",
92
+ label="Model",
93
+ )
94
+ generate_button = gr.Button("Generate Image")
95
 
96
  # Connect the interface to the generation function
97
  generate_button.click(
 
99
  inputs=[prompt, negative_prompt, steps_slider, guidance_slider, model],
100
  outputs=image_output
101
  )
 
 
 
 
 
 
 
 
102
 
103
+ demo.queue(max_size=10).launch(share=False)