{"openapi":"3.1.0","info":{"title":"CroCoDiLight v1 API","description":"固定流程：Qwen 默认 2MP/12步 → v1 结果1和 CroCo 直出结果2 → SAM 3.1 图5。全部落盘后完成。客户端接入说明见 /api-docs。","version":"1.1"},"paths":{"/":{"get":{"summary":"Index","operationId":"index__get","responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}}}}},"/api/health":{"get":{"tags":["服务"],"summary":"Health","operationId":"health_api_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HealthResponse"}}}}}}},"/api/lights":{"get":{"tags":["光效"],"summary":"Lights","operationId":"lights_api_lights_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LightsResponse"}}}}}}},"/api/jobs":{"post":{"tags":["任务"],"summary":"Create Job","operationId":"create_job_api_jobs_post","requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_create_job_api_jobs_post"}}},"required":true},"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/jobs/{job_id}":{"get":{"tags":["任务"],"summary":"Job Status","operationId":"job_status_api_jobs__job_id__get","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","title":"Job Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/jobs/{job_id}/final":{"post":{"tags":["任务"],"summary":"Generate Final","operationId":"generate_final_api_jobs__job_id__final_post","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","title":"Job Id"}}],"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["图片"],"summary":"Final Output","operationId":"final_output_api_jobs__job_id__final_get","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","title":"Job Id"}}],"responses":{"200":{"description":"Successful Response","content":{"image/png":{}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/jobs/{job_id}/quality":{"get":{"tags":["检测"],"summary":"Reference Quality","operationId":"reference_quality_api_jobs__job_id__quality_get","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","title":"Job Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/QualityResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/jobs/{job_id}/preview/{kind}":{"get":{"tags":["图片"],"summary":"Preview","operationId":"preview_api_jobs__job_id__preview__kind__get","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","title":"Job Id"}},{"name":"kind","in":"path","required":true,"schema":{"type":"string","title":"Kind"}}],"responses":{"200":{"description":"Successful Response","content":{"image/jpeg":{}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/jobs/{job_id}/image/{kind}":{"get":{"tags":["图片"],"summary":"Original Image","operationId":"original_image_api_jobs__job_id__image__kind__get","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","title":"Job Id"}},{"name":"kind","in":"path","required":true,"schema":{"type":"string","title":"Kind"}}],"responses":{"200":{"description":"Successful Response","content":{"image/png":{}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/jobs/{job_id}/output":{"get":{"tags":["图片"],"summary":"Output","operationId":"output_api_jobs__job_id__output_get","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","title":"Job Id"}}],"responses":{"200":{"description":"Successful Response","content":{"image/png":{}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/jobs/{job_id}/direct":{"get":{"tags":["图片"],"summary":"Direct Output","operationId":"direct_output_api_jobs__job_id__direct_get","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","title":"Job Id"}}],"responses":{"200":{"description":"Successful Response","content":{"image/png":{}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/jobs/{job_id}/final-mask":{"get":{"tags":["检测"],"summary":"Final Mask","operationId":"final_mask_api_jobs__job_id__final_mask_get","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","title":"Job Id"}}],"responses":{"200":{"description":"Successful Response","content":{"image/png":{}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/jobs/{job_id}/mask":{"get":{"tags":["检测"],"summary":"Person Mask","operationId":"person_mask_api_jobs__job_id__mask_get","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","title":"Job Id"}}],"responses":{"200":{"description":"Successful Response","content":{"image/png":{}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/jobs/{job_id}/crop/{kind}":{"get":{"tags":["图片"],"summary":"Crop","operationId":"crop_api_jobs__job_id__crop__kind__get","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","title":"Job Id"}},{"name":"kind","in":"path","required":true,"schema":{"type":"string","title":"Kind"}},{"name":"x","in":"query","required":false,"schema":{"type":"number","default":0.5,"title":"X"}},{"name":"y","in":"query","required":false,"schema":{"type":"number","default":0.5,"title":"Y"}},{"name":"size","in":"query","required":false,"schema":{"type":"integer","default":512,"title":"Size"}}],"responses":{"200":{"description":"Successful Response","content":{"image/jpeg":{}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/jobs/{job_id}/structure":{"get":{"tags":["检测"],"summary":"Structure","operationId":"structure_api_jobs__job_id__structure_get","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","title":"Job Id"}},{"name":"x","in":"query","required":false,"schema":{"type":"number","default":0.5,"title":"X"}},{"name":"y","in":"query","required":false,"schema":{"type":"number","default":0.5,"title":"Y"}},{"name":"size","in":"query","required":false,"schema":{"type":"integer","default":512,"title":"Size"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StructureResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/jobs/{job_id}/pattern":{"get":{"tags":["检测"],"summary":"Pattern","operationId":"pattern_api_jobs__job_id__pattern_get","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","title":"Job Id"}},{"name":"x","in":"query","required":false,"schema":{"type":"number","default":0.5,"title":"X"}},{"name":"y","in":"query","required":false,"schema":{"type":"number","default":0.5,"title":"Y"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PatternResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/jobs/{job_id}/lighting":{"get":{"tags":["检测"],"summary":"Lighting","operationId":"lighting_api_jobs__job_id__lighting_get","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","title":"Job Id"}},{"name":"x","in":"query","required":false,"schema":{"type":"number","default":0.5,"title":"X"}},{"name":"y","in":"query","required":false,"schema":{"type":"number","default":0.5,"title":"Y"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LightingResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}},"components":{"schemas":{"Body_create_job_api_jobs_post":{"properties":{"content":{"type":"string","contentMediaType":"application/octet-stream","title":"Content"},"reference":{"anyOf":[{"type":"string","contentMediaType":"application/octet-stream"},{"type":"null"}],"title":"Reference"},"light_preset":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Light Preset"},"light_prompt":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Light Prompt"},"light_steps":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Light Steps","default":12},"seed":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Seed"},"batch":{"type":"integer","title":"Batch","default":8},"amp":{"type":"string","title":"Amp","default":"bf16"},"light_strength":{"type":"number","title":"Light Strength","default":1.0},"detail_strength":{"type":"number","title":"Detail Strength","default":0.2},"face_safe":{"type":"boolean","title":"Face Safe","default":true},"contour_safe":{"type":"boolean","title":"Contour Safe","default":true}},"type":"object","required":["content"],"title":"Body_create_job_api_jobs_post"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"HealthResponse":{"properties":{"model_ready":{"type":"boolean","title":"Model Ready"},"fusion_loaded":{"type":"boolean","title":"Fusion Loaded"},"warmup_error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Warmup Error"},"v1_gpu_allocated_mb":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"V1 Gpu Allocated Mb"},"v1_gpu_reserved_mb":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"V1 Gpu Reserved Mb"},"v1_gpu_peak_mb":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"V1 Gpu Peak Mb"},"queued":{"type":"integer","title":"Queued"},"active":{"type":"integer","title":"Active"}},"type":"object","required":["model_ready","fusion_loaded","warmup_error","v1_gpu_allocated_mb","v1_gpu_reserved_mb","v1_gpu_peak_mb","queued","active"],"title":"HealthResponse"},"JobResponse":{"properties":{"job_id":{"type":"string","title":"Job Id"},"status":{"type":"string","enum":["queued","relighting","fusing","compositing","completed","failed"],"title":"Status"},"reference_size":{"anyOf":[{"items":{"type":"integer"},"type":"array"},{"type":"null"}],"title":"Reference Size"},"reference_ready":{"type":"boolean","title":"Reference Ready"},"content_size":{"items":{"type":"integer"},"type":"array","title":"Content Size"},"output_size":{"anyOf":[{"items":{"type":"integer"},"type":"array"},{"type":"null"}],"title":"Output Size"},"output_ready":{"type":"boolean","title":"Output Ready"},"pipeline_required":{"type":"boolean","title":"Pipeline Required"},"direct_ready":{"type":"boolean","title":"Direct Ready"},"final_ready":{"type":"boolean","title":"Final Ready"},"final_status":{"type":"string","enum":["not_started","queued","running","completed","failed"],"title":"Final Status"},"final_error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Final Error"},"final_elapsed_s":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Final Elapsed S"},"final_metrics":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Final Metrics"},"elapsed_s":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Elapsed S"},"model_cached":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Model Cached"},"content_features_cached":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Content Features Cached"},"source":{"type":"string","enum":["qwen","upload"],"title":"Source"},"batch":{"type":"integer","title":"Batch"},"amp":{"type":"string","title":"Amp"},"light_strength":{"type":"number","title":"Light Strength"},"detail_strength":{"type":"number","title":"Detail Strength"},"face_safe":{"type":"boolean","title":"Face Safe"},"contour_safe":{"type":"boolean","title":"Contour Safe"},"light_preset":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Light Preset"},"light_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Light Name"},"light_steps":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Light Steps"},"generated_seed":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Generated Seed"},"relight_elapsed_s":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Relight Elapsed S"},"fusion_elapsed_s":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Fusion Elapsed S"},"failed_stage":{"anyOf":[{"type":"string","enum":["relight","fusion","composite"]},{"type":"null"}],"title":"Failed Stage"},"runtime_target_s":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Runtime Target S"},"runtime_domain":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Runtime Domain"},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error"}},"type":"object","required":["job_id","status","reference_size","reference_ready","content_size","output_size","output_ready","pipeline_required","direct_ready","final_ready","final_status","final_error","final_elapsed_s","final_metrics","elapsed_s","model_cached","content_features_cached","source","batch","amp","light_strength","detail_strength","face_safe","contour_safe","light_preset","light_name","light_steps","generated_seed","relight_elapsed_s","fusion_elapsed_s","failed_stage","runtime_target_s","runtime_domain","error"],"title":"JobResponse","description":"Public response shared by job creation and polling."},"LightPresetResponse":{"properties":{"key":{"type":"string","title":"Key"},"name":{"type":"string","title":"Name"},"prompt":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Prompt"},"tier":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tier"},"via":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Via"},"note":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Note"}},"additionalProperties":true,"type":"object","required":["key","name"],"title":"LightPresetResponse"},"LightingResponse":{"properties":{"measured":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Measured"},"target":{"type":"number","title":"Target"},"reference_change":{"type":"number","title":"Reference Change"},"reference_change_target":{"type":"number","title":"Reference Change Target"},"domain":{"type":"string","title":"Domain"}},"type":"object","required":["measured","target","reference_change","reference_change_target","domain"],"title":"LightingResponse"},"LightsResponse":{"properties":{"lora_exists":{"type":"boolean","title":"Lora Exists"},"presets":{"items":{"$ref":"#/components/schemas/LightPresetResponse"},"type":"array","title":"Presets"},"lora":{"anyOf":[{"additionalProperties":{"type":"string"},"type":"object"},{"type":"null"}],"title":"Lora"}},"additionalProperties":true,"type":"object","required":["lora_exists","presets"],"title":"LightsResponse"},"PatternResponse":{"properties":{"target_present":{"type":"boolean","title":"Target Present"},"reference_contrast":{"type":"number","title":"Reference Contrast"},"reference_contrast_target":{"type":"number","title":"Reference Contrast Target"},"recovered":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Recovered"},"recovered_target":{"type":"number","title":"Recovered Target"},"correlation":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Correlation"},"correlation_target":{"type":"number","title":"Correlation Target"},"domain":{"type":"string","title":"Domain"}},"type":"object","required":["target_present","reference_contrast","reference_contrast_target","recovered","recovered_target","correlation","correlation_target","domain"],"title":"PatternResponse"},"QualityResponse":{"properties":{"face_count_b":{"type":"integer","title":"Face Count B"},"face_count_a":{"type":"integer","title":"Face Count A"},"matched_face_count":{"type":"integer","title":"Matched Face Count"},"landmark_shift":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Landmark Shift"},"face_box_shift":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Face Box Shift"},"face_overexposure_ratio":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Face Overexposure Ratio"},"global_overexposure_ratio":{"type":"number","title":"Global Overexposure Ratio"},"face_id_score":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Face Id Score"},"silhouette_shift":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Silhouette Shift"},"risk_level":{"type":"string","enum":["low","mid","high","unknown"],"title":"Risk Level"},"thresholds":{"additionalProperties":{"type":"number"},"type":"object","title":"Thresholds"},"domain":{"type":"string","title":"Domain"},"unavailable":{"items":{"type":"string"},"type":"array","title":"Unavailable"}},"type":"object","required":["face_count_b","face_count_a","matched_face_count","landmark_shift","face_box_shift","face_overexposure_ratio","global_overexposure_ratio","face_id_score","silhouette_shift","risk_level","thresholds","domain","unavailable"],"title":"QualityResponse"},"StructureResponse":{"properties":{"measured":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Measured"},"target":{"type":"number","title":"Target"},"domain":{"type":"string","title":"Domain"}},"type":"object","required":["measured","target","domain"],"title":"StructureResponse"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"},"input":{"title":"Input"},"ctx":{"type":"object","title":"Context"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}}}}