MatteoScript commited on
Commit
32aa507
·
verified ·
1 Parent(s): c324e61

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +5 -3
main.py CHANGED
@@ -470,10 +470,12 @@ def generate_image(request: Request, input_data: InputImage):
470
  "8-Step",
471
  api_name="/generate_image"
472
  )
 
473
  else:
474
- client = Client("https://playgroundai-playground-v2-5.hf.space/--replicas/9kuov/")
 
475
  result = client.predict(
476
- input_data.input, # str in 'Prompt' Textbox component
477
  input_data.negativePrompt, # str in 'Negative prompt' Textbox component
478
  True, # bool in 'Use negative prompt' Checkbox component
479
  0, # float (numeric value between 0 and 2147483647) in 'Seed' Slider component
@@ -483,7 +485,7 @@ def generate_image(request: Request, input_data: InputImage):
483
  True, # bool in 'Randomize seed' Checkbox component
484
  api_name="/run"
485
  )
486
- image_url = result
487
  print(image_url)
488
  with open(image_url, 'rb') as img_file:
489
  img_binary = img_file.read()
 
470
  "8-Step",
471
  api_name="/generate_image"
472
  )
473
+ image_url = result
474
  else:
475
+ #client = Client("https://playgroundai-playground-v2-5.hf.space/--replicas/9kuov/")
476
+ client = Client("https://choimirai-playground-v2-5.hf.space/--replicas/bgsav/")
477
  result = client.predict(
478
+ input_data.input, # str in 'Prompt' Textbox component
479
  input_data.negativePrompt, # str in 'Negative prompt' Textbox component
480
  True, # bool in 'Use negative prompt' Checkbox component
481
  0, # float (numeric value between 0 and 2147483647) in 'Seed' Slider component
 
485
  True, # bool in 'Randomize seed' Checkbox component
486
  api_name="/run"
487
  )
488
+ image_url = result.image
489
  print(image_url)
490
  with open(image_url, 'rb') as img_file:
491
  img_binary = img_file.read()