ImagineAI-Real commited on
Commit
f9e46fa
·
1 Parent(s): 83bc640

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -8,7 +8,7 @@ api_url = "https://5cb20b40-572c-426f-9466-995256f9b6eb.id.repl.co/generate_imag
8
 
9
  def generate_image(prompt, seed=0, negative_prompt="", model="Dreamlike Diffusion", sampler="k_dpmpp_2s_a", steps=50):
10
  data = "?prompt="+ prompt + "&seed="+ str(seed) + "&negative_prompt=" + negative_prompt + "&model=" + model + "&sampler=" + sampler + "&steps=" + str(steps)
11
- response = requests.post(api_url+data, timeout=99999)
12
  if response.status_code == 200:
13
  img_base64 = response.json()["url"]
14
  img_bytes = base64.b64decode(img_base64)
@@ -81,4 +81,4 @@ interface = gr.Interface(generate_image, inputs, outputs, title="<a href='https:
81
  description="Enter a prompt, click Submit and wait a bit for your image.<br/>If taking too long, duplicate the space.<br/>Or use one of the others:<br><li><a href='https://huggingface.co/spaces/ImagineAI-Real/ImagineAI-Image-Generator'>ImagineAI-Image-Generator</a></li><li><a href='https://huggingface.co/spaces/ImagineAI-Real/ImagineAI-Image-Generator2'>ImagineAI-Image-Generator2</a></li><li><a href='https://huggingface.co/spaces/ImagineAI-Real/ImagineAI-Image-Generator3'>ImagineAI-Image-Generator3</a></li><br>Or <a href='https://ufile.io/vwyih7hj'>download our app</a>.",
82
  examples=[])
83
 
84
- interface.launch()
 
8
 
9
  def generate_image(prompt, seed=0, negative_prompt="", model="Dreamlike Diffusion", sampler="k_dpmpp_2s_a", steps=50):
10
  data = "?prompt="+ prompt + "&seed="+ str(seed) + "&negative_prompt=" + negative_prompt + "&model=" + model + "&sampler=" + sampler + "&steps=" + str(steps)
11
+ response = requests.post(api_url+data, timeout=200)
12
  if response.status_code == 200:
13
  img_base64 = response.json()["url"]
14
  img_bytes = base64.b64decode(img_base64)
 
81
  description="Enter a prompt, click Submit and wait a bit for your image.<br/>If taking too long, duplicate the space.<br/>Or use one of the others:<br><li><a href='https://huggingface.co/spaces/ImagineAI-Real/ImagineAI-Image-Generator'>ImagineAI-Image-Generator</a></li><li><a href='https://huggingface.co/spaces/ImagineAI-Real/ImagineAI-Image-Generator2'>ImagineAI-Image-Generator2</a></li><li><a href='https://huggingface.co/spaces/ImagineAI-Real/ImagineAI-Image-Generator3'>ImagineAI-Image-Generator3</a></li><br>Or <a href='https://ufile.io/vwyih7hj'>download our app</a>.",
82
  examples=[])
83
 
84
+ interface.launch()