Muhammad Saqib commited on
Commit
10460dc
1 Parent(s): 3bcde99

Update modules/app.py

Browse files
Files changed (1) hide show
  1. modules/app.py +15 -15
modules/app.py CHANGED
@@ -165,20 +165,20 @@ async def img2location(request: Request):
165
  @app.post("/pixart-sigma", dependencies=[Depends(verify_user_agent)])
166
  async def pixart_sigma(request: Request):
167
  request_json = await request.json()
168
- prompt = str(request_json.get("prompt")) if request_json.get("prompt") is not None else None
169
- negative_prompt = str(request_json.get("negative_prompt")) if request_json.get("negative_prompt") is not None else ""
170
- style = str(request_json.get("style")) if request_json.get("style") is not None else "(No style)"
171
- use_negative_prompt = bool(request_json.get("use_negative_prompt")) if request_json.get("use_negative_prompt") is not None else True
172
- num_imgs = float(request_json.get("num_imgs")) if request_json.get("num_imgs") is not None else 1
173
- seed = float(request_json.get("seed")) if request_json.get("seed") is not None else 0
174
- width = float(request_json.get("width")) if request_json.get("width") is not None else 1024
175
- height = float(request_json.get("height")) if request_json.get("height") is not None else 1024
176
- schedule = str(request_json.get("schedule")) if request_json.get("schedule") is not None else "DPM-Solver"
177
- dpms_guidance_scale = float(request_json.get("dpms_guidance_scale")) if request_json.get("dpms_guidance_scale") is not None else 4.5
178
- sas_guidance_scale = float(request_json.get("sas_guidance_scale")) if request_json.get("sas_guidance_scale") is not None else 3
179
- dpms_inference_steps = float(request_json.get("dpms_inference_steps")) if request_json.get("dpms_inference_steps") is not None else 14
180
- sas_inference_steps = float(request_json.get("sas_inference_steps")) if request_json.get("sas_inference_steps") is not None else 25
181
- randomize_seed = bool(request_json.get("randomize_seed")) if request_json.get("randomize_seed") is not None else True
182
 
183
  hash = generate_hash()
184
 
@@ -205,7 +205,7 @@ async def pixart_sigma(request: Request):
205
  sas_guidance_scale,
206
  dpms_inference_steps,
207
  sas_inference_steps,
208
- randomize_seed,
209
  ],
210
  'event_data': None,
211
  'fn_index': 3,
 
165
  @app.post("/pixart-sigma", dependencies=[Depends(verify_user_agent)])
166
  async def pixart_sigma(request: Request):
167
  request_json = await request.json()
168
+ prompt = request_json.get("prompt", None)
169
+ negative_prompt = request_json.get("negative_prompt", "")
170
+ style = request_json.get("style", "(No style)")
171
+ use_negative_prompt = request_json.get("use_negative_prompt", True)
172
+ num_imgs = request_json.get("num_imgs", 1)
173
+ seed = request_json.get("seed", 0)
174
+ width = request_json.get("width", 1024)
175
+ height = request_json.get("height", 1024)
176
+ schedule = request_json.get("schedule", "DPM-Solver")
177
+ dpms_guidance_scale = request_json.get("dpms_guidance_scale", 4.5)
178
+ sas_guidance_scale = request_json.get("sas_guidance_scale", 3)
179
+ dpms_inference_steps = request_json.get("dpms_inference_steps", 14)
180
+ sas_inference_steps = request_json.get("sas_inference_steps", 25)
181
+ randomize_seed = request_json.get("randomize_seed", True)
182
 
183
  hash = generate_hash()
184
 
 
205
  sas_guidance_scale,
206
  dpms_inference_steps,
207
  sas_inference_steps,
208
+ True,
209
  ],
210
  'event_data': None,
211
  'fn_index': 3,