apolinario commited on
Commit
de4241a
1 Parent(s): a836280

Styling fixes

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -26,6 +26,7 @@ dalle_real = get_rudalle_model('Malevich',fp16=True,device=device)
26
  dalle_emoji = get_rudalle_model('Emojich',fp16=True,device=device)
27
  vae, tokenizer = get_vae().to(device), get_tokenizer()
28
  translator = Translator()
 
29
  def np_gallery(array, ncols=3):
30
  nindex, height, width, intensity = array.shape
31
  nrows = nindex//ncols
@@ -75,8 +76,8 @@ def run(prompt, aspect_ratio, model):
75
 
76
  return(result_pil_images[0], None)
77
 
 
78
  image = gr.outputs.Image(type="pil", label="Your result")
79
- css = ".output-image{height: 260px !important}"
80
  iface = gr.Interface(fn=run, inputs=[
81
  gr.inputs.Textbox(label="Prompt (if not in Russian, it will be automatically translated to Russian)",default="an amusement park in mars"),
82
  #gr.inputs.Slider(label="Steps - more steps can increase quality but will take longer to generate",default=45,maximum=50,minimum=1,step=1),
@@ -90,6 +91,6 @@ iface = gr.Interface(fn=run, inputs=[
90
  outputs=[image,gr.outputs.Textbox(label="Error")],
91
  css=css,
92
  title="Generate images from text with ruDALLE",
93
- description="<div>By typing a prompt and pressing submit you generate images based on it. <a href='https://github.com/ai-forever/ru-dalle' target='_blank'>ruDALLE</a> is an open source text-to-image model, this Arbitrary Aspect Ratio implementation was created by <a href='https://github.com/shonenkov-AI' target='_blank'>Alex Shonenkov</a><br>This Spaces UI to the model was assembled by <a style='color: rgb(99, 102, 241);font-weight:bold' href='https://twitter.com/multimodalart' target='_blank'>@multimodalart</a>, keep up with the <a style='color: rgb(99, 102, 241);' href='https://multimodal.art/news'>latest multimodal ai art news here</a> and consider <a style='color: rgb(99, 102, 241);' href='https://www.patreon.com/multimodalart'>supporting us on Patreon</a></div>",
94
  article="<h4 style='font-size: 110%;margin-top:.5em'>Biases acknowledgment</h4><div>Despite how impressive being able to turn text into image is, beware to the fact that this model may output content that reinforces or exarcbates societal biases. According to the <a href='https://arxiv.org/abs/2112.10752' target='_blank'>Latent Diffusion paper</a>:<i> \"Deep learning modules tend to reproduce or exacerbate biases that are already present in the data\"</i>. The models are meant to be used for research purposes, such as this one.</div><h4 style='font-size: 110%;margin-top:1em'>Who owns the images produced by this demo?</h4><div>Definetly not me! Probably you do. I say probably because the Copyright discussion about AI generated art is ongoing. So <a href='https://www.theverge.com/2022/2/21/22944335/us-copyright-office-reject-ai-generated-art-recent-entrance-to-paradise' target='_blank'>it may be the case that everything produced here falls automatically into the public domain</a>. But in any case it is either yours or is in the public domain.</div>")
95
  iface.launch(enable_queue=True)
26
  dalle_emoji = get_rudalle_model('Emojich',fp16=True,device=device)
27
  vae, tokenizer = get_vae().to(device), get_tokenizer()
28
  translator = Translator()
29
+
30
  def np_gallery(array, ncols=3):
31
  nindex, height, width, intensity = array.shape
32
  nrows = nindex//ncols
76
 
77
  return(result_pil_images[0], None)
78
 
79
+ css = ".output-image{height: 400px !important}"
80
  image = gr.outputs.Image(type="pil", label="Your result")
 
81
  iface = gr.Interface(fn=run, inputs=[
82
  gr.inputs.Textbox(label="Prompt (if not in Russian, it will be automatically translated to Russian)",default="an amusement park in mars"),
83
  #gr.inputs.Slider(label="Steps - more steps can increase quality but will take longer to generate",default=45,maximum=50,minimum=1,step=1),
91
  outputs=[image,gr.outputs.Textbox(label="Error")],
92
  css=css,
93
  title="Generate images from text with ruDALLE",
94
+ description="<div>By typing a prompt and pressing submit you generate images based on it. <a href='https://github.com/ai-forever/ru-dalle' target='_blank'>ruDALLE</a> is an open source text-to-image model, this Arbitrary Aspect Ratio implementation was created by <a href='https://github.com/shonenkov-AI' target='_blank'>Alex Shonenkov</a><br>This Spaces UI to the model was assembled by <a style='color: rgb(99, 102, 241);font-weight:bold' href='https://twitter.com/multimodalart' target='_blank'>@multimodalart</a>, keep up with the <a style='color: rgb(99, 102, 241);' href='https://multimodal.art/news' target='_blank'>latest multimodal ai art news here</a> and consider <a style='color: rgb(99, 102, 241);' href='https://www.patreon.com/multimodalart' target='_blank'>supporting us on Patreon</a></div>",
95
  article="<h4 style='font-size: 110%;margin-top:.5em'>Biases acknowledgment</h4><div>Despite how impressive being able to turn text into image is, beware to the fact that this model may output content that reinforces or exarcbates societal biases. According to the <a href='https://arxiv.org/abs/2112.10752' target='_blank'>Latent Diffusion paper</a>:<i> \"Deep learning modules tend to reproduce or exacerbate biases that are already present in the data\"</i>. The models are meant to be used for research purposes, such as this one.</div><h4 style='font-size: 110%;margin-top:1em'>Who owns the images produced by this demo?</h4><div>Definetly not me! Probably you do. I say probably because the Copyright discussion about AI generated art is ongoing. So <a href='https://www.theverge.com/2022/2/21/22944335/us-copyright-office-reject-ai-generated-art-recent-entrance-to-paradise' target='_blank'>it may be the case that everything produced here falls automatically into the public domain</a>. But in any case it is either yours or is in the public domain.</div>")
96
  iface.launch(enable_queue=True)