lalashechka commited on
Commit
c8e3ba8
1 Parent(s): 276cf1e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +19 -5
app.py CHANGED
@@ -45,11 +45,25 @@ def flip_text(prompt, negative_prompt, task, steps, sampler, cfg_scale, seed):
45
  url_sd6 = os.getenv("url_sd6")
46
  hf_token = os.getenv("hf_token")
47
  if task == "Playground v2":
48
- playground = str(os.getenv("playground"))
49
- client = Client(playground, hf_token=hf_token)
50
- result = client.predict(prompt, "", False, 220, 1024, 1024, 3, True, api_name="/run")
51
- return result[0][0]['image']
52
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
53
  if task == "OpenDalle v1.1":
54
  opendalle = str(os.getenv("opendalle"))
55
  client = Client(opendalle, hf_token=hf_token)
 
45
  url_sd6 = os.getenv("url_sd6")
46
  hf_token = os.getenv("hf_token")
47
  if task == "Playground v2":
48
+ #playground = str(os.getenv("playground"))
49
+ #client = Client(playground, hf_token=hf_token)
50
+ #result = client.predict(prompt, "", False, 220, 1024, 1024, 3, True, api_name="/run")
51
+ #return result[0][0]['image']
52
+ client = Client("multimodalart/stable-cascade")
53
+ result = client.predict(
54
+ "cat", # str in 'Prompt' Textbox component
55
+ "", # str in 'Negative prompt' Textbox component
56
+ 0, # float (numeric value between 0 and 2147483647) in 'Seed' Slider component
57
+ 1024, # float (numeric value between 1024 and 1536) in 'Width' Slider component
58
+ 1024, # float (numeric value between 1024 and 1536) in 'Height' Slider component
59
+ 20, # float (numeric value between 10 and 30) in 'Prior Inference Steps' Slider component
60
+ 4, # float (numeric value between 0 and 20) in 'Prior Guidance Scale' Slider component
61
+ 10, # float (numeric value between 4 and 12) in 'Decoder Inference Steps' Slider component
62
+ 0, # float (numeric value between 0 and 0) in 'Decoder Guidance Scale' Slider component
63
+ 1, # float (numeric value between 1 and 2) in 'Number of Images' Slider component
64
+ api_name="/run")
65
+ return result
66
+
67
  if task == "OpenDalle v1.1":
68
  opendalle = str(os.getenv("opendalle"))
69
  client = Client(opendalle, hf_token=hf_token)