TheVeshup commited on
Commit
68d034b
·
verified ·
1 Parent(s): bfb3c63

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +57 -11
app.py CHANGED
@@ -7,7 +7,7 @@ from diffusers import DiffusionPipeline
7
  import torch
8
 
9
  device = "cuda" if torch.cuda.is_available() else "cpu"
10
- model_repo_id = "black-forest-labs/FLUX.1-dev" # Replace to the model you would like to use
11
 
12
  if torch.cuda.is_available():
13
  torch_dtype = torch.float16
@@ -61,31 +61,77 @@ css = """
61
  #col-container {
62
  margin: 0 auto;
63
  max-width: 640px;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
64
  }
65
  """
66
 
67
  with gr.Blocks(css=css) as demo:
68
  with gr.Column(elem_id="col-container"):
69
- gr.Markdown(" # Text-to-Image Gradio Template")
70
 
71
  with gr.Row():
72
  prompt = gr.Text(
73
- label="Prompt",
74
  show_label=False,
75
  max_lines=1,
76
- placeholder="Enter your prompt",
77
  container=False,
78
  )
79
 
80
- run_button = gr.Button("Run", scale=0, variant="primary")
81
 
82
- result = gr.Image(label="Result", show_label=False)
83
 
84
  with gr.Accordion("Advanced Settings", open=False):
85
  negative_prompt = gr.Text(
86
- label="Negative prompt",
87
  max_lines=1,
88
- placeholder="Enter a negative prompt",
89
  visible=False,
90
  )
91
 
@@ -97,7 +143,7 @@ with gr.Blocks(css=css) as demo:
97
  value=0,
98
  )
99
 
100
- randomize_seed = gr.Checkbox(label="Randomize seed", value=True)
101
 
102
  with gr.Row():
103
  width = gr.Slider(
@@ -118,7 +164,7 @@ with gr.Blocks(css=css) as demo:
118
 
119
  with gr.Row():
120
  guidance_scale = gr.Slider(
121
- label="Guidance scale",
122
  minimum=0.0,
123
  maximum=10.0,
124
  step=0.1,
@@ -126,7 +172,7 @@ with gr.Blocks(css=css) as demo:
126
  )
127
 
128
  num_inference_steps = gr.Slider(
129
- label="Number of inference steps",
130
  minimum=1,
131
  maximum=50,
132
  step=1,
 
7
  import torch
8
 
9
  device = "cuda" if torch.cuda.is_available() else "cpu"
10
+ model_repo_id = "stabilityai/sdxl-turbo" # Replace to the model you would like to use
11
 
12
  if torch.cuda.is_available():
13
  torch_dtype = torch.float16
 
61
  #col-container {
62
  margin: 0 auto;
63
  max-width: 640px;
64
+ font-family: 'Arial', sans-serif;
65
+ color: #333;
66
+ background-color: #f7f7f7;
67
+ border-radius: 15px;
68
+ padding: 20px;
69
+ }
70
+
71
+ #header {
72
+ text-align: center;
73
+ color: #1f5f99;
74
+ }
75
+
76
+ #title {
77
+ font-size: 36px;
78
+ font-weight: bold;
79
+ margin-bottom: 10px;
80
+ }
81
+
82
+ #subtitle {
83
+ font-size: 18px;
84
+ color: #555;
85
+ margin-bottom: 30px;
86
+ }
87
+
88
+ .gradio-button {
89
+ background-color: #1f5f99;
90
+ color: white;
91
+ font-weight: bold;
92
+ border-radius: 8px;
93
+ }
94
+
95
+ .gradio-button:hover {
96
+ background-color: #155b89;
97
+ }
98
+
99
+ .gradio-slider {
100
+ width: 100%;
101
+ }
102
+
103
+ .gradio-checkbox label {
104
+ font-weight: normal;
105
+ }
106
+
107
+ .gradio-markdown {
108
+ font-size: 16px;
109
+ line-height: 1.6;
110
  }
111
  """
112
 
113
  with gr.Blocks(css=css) as demo:
114
  with gr.Column(elem_id="col-container"):
115
+ gr.Markdown("<div id='header'><h1 id='title'>Emmy: Veshup's Image Generation AI</h1><p id='subtitle'>Create stunning images with just a prompt. Powered by cutting-edge AI technology.</p></div>")
116
 
117
  with gr.Row():
118
  prompt = gr.Text(
119
+ label="Your Creative Prompt",
120
  show_label=False,
121
  max_lines=1,
122
+ placeholder="Enter your prompt here...",
123
  container=False,
124
  )
125
 
126
+ run_button = gr.Button("Generate Image", scale=0, variant="primary", elem_classes="gradio-button")
127
 
128
+ result = gr.Image(label="Generated Image", show_label=False)
129
 
130
  with gr.Accordion("Advanced Settings", open=False):
131
  negative_prompt = gr.Text(
132
+ label="Negative Prompt",
133
  max_lines=1,
134
+ placeholder="Enter a negative prompt if needed",
135
  visible=False,
136
  )
137
 
 
143
  value=0,
144
  )
145
 
146
+ randomize_seed = gr.Checkbox(label="Randomize Seed", value=True)
147
 
148
  with gr.Row():
149
  width = gr.Slider(
 
164
 
165
  with gr.Row():
166
  guidance_scale = gr.Slider(
167
+ label="Guidance Scale",
168
  minimum=0.0,
169
  maximum=10.0,
170
  step=0.1,
 
172
  )
173
 
174
  num_inference_steps = gr.Slider(
175
+ label="Number of Inference Steps",
176
  minimum=1,
177
  maximum=50,
178
  step=1,