fix state end

Signed-off-by: vladmandic <mandic00@live.com>
This commit is contained in:
vladmandic
2026-03-14 12:46:43 +01:00
parent d432945a29
commit c86674047a
5 changed files with 11 additions and 13 deletions
+3 -3
View File
@@ -82,7 +82,7 @@ class APIProcess:
jobid = shared.state.begin('API-PRE', api=True)
processed = processor(image, local_config=req.params)
image = encode_pil_to_base64(processed)
shared.state.end(jobid)
shared.state.end(jobid, api=False)
return ResPreprocess(model=processor.processor_id, image=image)
def get_mask(self):
@@ -110,7 +110,7 @@ class APIProcess:
jobid = shared.state.begin('API-MASK', api=True)
with self.queue_lock:
processed = masking.run_mask(input_image=image, input_mask=mask, return_type=req.type)
shared.state.end(jobid)
shared.state.end(jobid, api=False)
if processed is None:
return JSONResponse(status_code=400, content={"error": "Mask is none"})
image = encode_pil_to_base64(processed)
@@ -134,7 +134,7 @@ class APIProcess:
classes.append(item.cls)
labels.append(item.label)
boxes.append(item.box)
shared.state.end(jobid)
shared.state.end(jobid, api=False)
return ResFace(classes=classes, labels=labels, scores=scores, boxes=boxes, images=images)
def post_prompt_enhance(self, req: models.ReqPromptEnhance):