Veda0718 commited on
Commit
ba6d6cf
1 Parent(s): cac47b5

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +33 -20
app.py CHANGED
@@ -62,7 +62,6 @@ MAX_IMAGE_SIZE = 1024
62
 
63
  def infer(prompt, negative_prompt, width, height, guidance_scale, style_name=None):
64
  seed = random.randint(0,4294967295)
65
- # guidance_scale = 7.5
66
 
67
  generator = torch.Generator().manual_seed(seed)
68
 
@@ -72,7 +71,6 @@ def infer(prompt, negative_prompt, width, height, guidance_scale, style_name=Non
72
  prompt = prompt,
73
  negative_prompt = negative_prompt,
74
  guidance_scale = guidance_scale,
75
- # num_inference_steps = num_inference_steps,
76
  width = width,
77
  height = height,
78
  generator = generator
@@ -84,21 +82,28 @@ examples = [
84
  "Astronaut in a jungle, cold color palette, muted colors, detailed, 8k",
85
  "An astronaut riding a green horse",
86
  "A delicious ceviche cheesecake slice",
 
 
87
  ]
88
 
89
  css="""
90
  #col-container {
91
- margin: 0 auto;
92
- max-width: 600px;
93
- padding-top: 20px;
94
- text-align: center;
95
- }
 
 
 
 
 
96
  .footer {
97
- margin-bottom: 45px;
98
- margin-top: 25px;
99
  text-align: center;
 
100
  }
101
- .footer>p {
102
  font-size: .8rem;
103
  display: inline-block;
104
  padding: 0 10px;
@@ -114,13 +119,20 @@ else:
114
  with gr.Blocks(css=css) as demo:
115
 
116
  with gr.Column(elem_id="col-container"):
117
- gr.Markdown(f"""
118
- # Welcome to Metamorph: Your Creative Gateway
119
- #### Transform your words into stunning visuals with our advanced AI-powered Text-to-Image generator
120
- Currently running on {power_device}
 
 
 
 
 
 
 
121
  """)
122
 
123
- with gr.Row():
124
 
125
  prompt = gr.Text(
126
  label="Prompt",
@@ -132,9 +144,9 @@ with gr.Blocks(css=css) as demo:
132
 
133
  run_button = gr.Button("Generate", scale=0)
134
 
135
- result = gr.Gallery(label="Results", show_label=False, format="png", show_share_button=False)
136
 
137
- with gr.Accordion("Advanced Settings", open=False):
138
 
139
  negative_prompt = gr.Textbox(
140
  label="Negative prompt",
@@ -177,15 +189,16 @@ with gr.Blocks(css=css) as demo:
177
  step=0.1,
178
  value=10,
179
  )
180
- gr.Examples(
181
  examples = examples,
182
  inputs = [prompt]
183
  )
184
 
185
- gr.HTML(
186
  """
187
  <div class="footer">
188
- <p>This application harnesses the cutting-edge Stable Diffusion XL (SDXL) model by <a href="https://huggingface.co/stabilityai" style="text-decoration: underline;" target="_blank">StabilityAI</a>, offering unparalleled text-to-image generation, while acknowledging potential biases and content considerations outlined in the model card.</p>
 
189
  </p>
190
  </div>
191
  """
 
62
 
63
  def infer(prompt, negative_prompt, width, height, guidance_scale, style_name=None):
64
  seed = random.randint(0,4294967295)
 
65
 
66
  generator = torch.Generator().manual_seed(seed)
67
 
 
71
  prompt = prompt,
72
  negative_prompt = negative_prompt,
73
  guidance_scale = guidance_scale,
 
74
  width = width,
75
  height = height,
76
  generator = generator
 
82
  "Astronaut in a jungle, cold color palette, muted colors, detailed, 8k",
83
  "An astronaut riding a green horse",
84
  "A delicious ceviche cheesecake slice",
85
+ "A serious capybara at work, wearing a suit",
86
+ 'a graffiti of a robot serving meals to people',
87
  ]
88
 
89
  css="""
90
  #col-container {
91
+ margin: 0 auto;
92
+ max-width: 600px;
93
+ padding-top: 20px;
94
+ text-align: center;
95
+ }
96
+ .header {
97
+ margin: 25px auto 10px auto;
98
+ text-align: center;
99
+ max-width: 600px;
100
+ }
101
  .footer {
102
+ margin: 25px auto 45px auto;
 
103
  text-align: center;
104
+ max-width: 600px;
105
  }
106
+ .footer>p {
107
  font-size: .8rem;
108
  display: inline-block;
109
  padding: 0 10px;
 
119
  with gr.Blocks(css=css) as demo:
120
 
121
  with gr.Column(elem_id="col-container"):
122
+ gr.HTML(
123
+ """
124
+ <div class="header">
125
+ <h1>Welcome to Metamorph: Your Creative Gateway</h1>
126
+ <h4>
127
+ Transform your words into stunning visuals with our advanced AI-powered Text-to-Image generator
128
+ </h4>
129
+ </div>
130
+ """)
131
+ gr.Markdown(f"""
132
+ Currently running on {power_device}.
133
  """)
134
 
135
+ with gr.Row():
136
 
137
  prompt = gr.Text(
138
  label="Prompt",
 
144
 
145
  run_button = gr.Button("Generate", scale=0)
146
 
147
+ result = gr.Gallery(label="Results", show_label=False, format="png", show_share_button=False)
148
 
149
+ with gr.Accordion("Advanced Settings", open=False):
150
 
151
  negative_prompt = gr.Textbox(
152
  label="Negative prompt",
 
189
  step=0.1,
190
  value=10,
191
  )
192
+ gr.Examples(
193
  examples = examples,
194
  inputs = [prompt]
195
  )
196
 
197
+ gr.HTML(
198
  """
199
  <div class="footer">
200
+ <p>
201
+ This application harnesses the cutting-edge Stable Diffusion XL (SDXL) model by <a href="https://huggingface.co/stabilityai" style="text-decoration: underline;" target="_blank">StabilityAI</a>, offering unparalleled text-to-image generation, while acknowledging potential biases and content considerations outlined in the model card.</p>
202
  </p>
203
  </div>
204
  """