aqlanhadi commited on
Commit
7bde229
·
1 Parent(s): 1221969
Files changed (1) hide show
  1. app.py +0 -162
app.py CHANGED
@@ -143,168 +143,6 @@ generator = gr.Interface(
143
  outputs="image"
144
  )
145
 
146
- # with gr.Blocks() as blocks:
147
- # gr.Markdown(
148
- # """
149
- # # QR Code AI Art Generator
150
-
151
- # ## 💡 How to generate beautiful QR codes
152
-
153
- # We use the QR code image as the initial image **and** the control image, which allows you to generate
154
- # QR Codes that blend in **very naturally** with your provided prompt.
155
- # The strength parameter defines how much noise is added to your QR code and the noisy QR code is then guided towards both your prompt and the QR code image via Controlnet.
156
- # Use a high strength value between 0.8 and 0.95 and choose a conditioning scale between 0.6 and 2.0.
157
- # This mode arguably achieves the asthetically most appealing QR code images, but also requires more tuning of the controlnet conditioning scale and the strength value. If the generated image
158
- # looks way to much like the original QR code, make sure to gently increase the *strength* value and reduce the *conditioning* scale. Also check out the examples below.
159
-
160
- # model: https://huggingface.co/DionTimmer/controlnet_qrcode-control_v1p_sd15
161
-
162
- # <a href="https://huggingface.co/spaces/huggingface-projects/QR-code-AI-art-generator?duplicate=true" style="display: inline-block;margin-top: .5em;margin-right: .25em;" target="_blank">
163
- # <img style="margin-bottom: 0em;display: inline;margin-top: -.25em;" src="https://bit.ly/3gLdBN6" alt="Duplicate Space"></a> for no queue on your own hardware.</p>
164
- # """
165
- # )
166
-
167
- # with gr.Row():
168
- # with gr.Column():
169
- # qr_code_content = gr.Textbox(
170
- # label="QR Code Content",
171
- # info="QR Code Content or URL",
172
- # value="",
173
- # )
174
- # with gr.Accordion(label="QR Code Image (Optional)", open=False):
175
- # qr_code_image = gr.Image(
176
- # label="QR Code Image (Optional). Leave blank to automatically generate QR code",
177
- # type="pil",
178
- # )
179
-
180
- # prompt = gr.Textbox(
181
- # label="Prompt",
182
- # info="Prompt that guides the generation towards",
183
- # )
184
- # negative_prompt = gr.Textbox(
185
- # label="Negative Prompt",
186
- # value="ugly, disfigured, low quality, blurry, nsfw",
187
- # )
188
- # use_qr_code_as_init_image = gr.Checkbox(label="Use QR code as init image", value=True, interactive=False, info="Whether init image should be QR code. Unclick to pass init image or generate init image with Stable Diffusion 2.1")
189
-
190
- # with gr.Accordion(label="Init Images (Optional)", open=False, visible=False) as init_image_acc:
191
- # init_image = gr.Image(label="Init Image (Optional). Leave blank to generate image with SD 2.1", type="pil")
192
-
193
-
194
- # with gr.Accordion(
195
- # label="Params: The generated QR Code functionality is largely influenced by the parameters detailed below",
196
- # open=True,
197
- # ):
198
- # controlnet_conditioning_scale = gr.Slider(
199
- # minimum=0.0,
200
- # maximum=5.0,
201
- # step=0.01,
202
- # value=1.1,
203
- # label="Controlnet Conditioning Scale",
204
- # )
205
- # strength = gr.Slider(
206
- # minimum=0.0, maximum=1.0, step=0.01, value=0.9, label="Strength"
207
- # )
208
- # guidance_scale = gr.Slider(
209
- # minimum=0.0,
210
- # maximum=50.0,
211
- # step=0.25,
212
- # value=7.5,
213
- # label="Guidance Scale",
214
- # )
215
- # sampler = gr.Dropdown(choices=list(SAMPLER_MAP.keys()), value="DPM++ Karras SDE", label="Sampler")
216
- # seed = gr.Slider(
217
- # minimum=-1,
218
- # maximum=9999999999,
219
- # step=1,
220
- # value=2313123,
221
- # label="Seed",
222
- # randomize=True,
223
- # )
224
- # with gr.Row():
225
- # run_btn = gr.Button("Run")
226
- # with gr.Column():
227
- # result_image = gr.Image(label="Result Image")
228
- # run_btn.click(
229
- # inference,
230
- # inputs=[
231
- # qr_code_content,
232
- # prompt,
233
- # negative_prompt,
234
- # guidance_scale,
235
- # controlnet_conditioning_scale,
236
- # strength,
237
- # seed,
238
- # init_image,
239
- # qr_code_image,
240
- # use_qr_code_as_init_image,
241
- # sampler,
242
- # ],
243
- # outputs=[result_image],
244
- # )
245
-
246
- # gr.Examples(
247
- # examples=[
248
- # [
249
- # "https://huggingface.co/",
250
- # "A sky view of a colorful lakes and rivers flowing through the desert",
251
- # "ugly, disfigured, low quality, blurry, nsfw",
252
- # 7.5,
253
- # 1.3,
254
- # 0.9,
255
- # 5392011833,
256
- # None,
257
- # None,
258
- # True,
259
- # "DPM++ Karras SDE",
260
- # ],
261
- # [
262
- # "https://huggingface.co/",
263
- # "Bright sunshine coming through the cracks of a wet, cave wall of big rocks",
264
- # "ugly, disfigured, low quality, blurry, nsfw",
265
- # 7.5,
266
- # 1.11,
267
- # 0.9,
268
- # 2523992465,
269
- # None,
270
- # None,
271
- # True,
272
- # "DPM++ Karras SDE",
273
- # ],
274
- # [
275
- # "https://huggingface.co/",
276
- # "Sky view of highly aesthetic, ancient greek thermal baths in beautiful nature",
277
- # "ugly, disfigured, low quality, blurry, nsfw",
278
- # 7.5,
279
- # 1.5,
280
- # 0.9,
281
- # 2523992465,
282
- # None,
283
- # None,
284
- # True,
285
- # "DPM++ Karras SDE",
286
- # ],
287
- # ],
288
- # fn=inference,
289
- # inputs=[
290
- # qr_code_content,
291
- # prompt,
292
- # negative_prompt,
293
- # guidance_scale,
294
- # controlnet_conditioning_scale,
295
- # strength,
296
- # seed,
297
- # init_image,
298
- # qr_code_image,
299
- # use_qr_code_as_init_image,
300
- # sampler,
301
- # ],
302
- # outputs=[result_image],
303
- # cache_examples=True,
304
- # )
305
-
306
- # blocks.queue(concurrency_count=1, max_size=20)
307
- # blocks.launch(share=bool(os.environ.get("SHARE", False)))
308
  if __name__ == "__main__":
309
  generator.queue(concurrency_count=1, max_size=20)
310
  generator.launch()
 
143
  outputs="image"
144
  )
145
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
146
  if __name__ == "__main__":
147
  generator.queue(concurrency_count=1, max_size=20)
148
  generator.launch()