diff --git a/docs/openapi.json b/docs/openapi.json index 9199149..f3c64c2 100755 --- a/docs/openapi.json +++ b/docs/openapi.json @@ -1 +1 @@ -{"openapi":"3.1.0","info":{"title":"FastAPI","version":"0.1.0"},"paths":{"/":{"get":{"summary":"Home","operationId":"home__get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/v1/generation/text-to-image":{"post":{"summary":"Text2Img Generation","operationId":"text2img_generation_v1_generation_text_to_image_post","parameters":[{"name":"accept","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Parameter to overvide 'Accept' header, 'image/png' for output bytes","title":"Accept"},"description":"Parameter to overvide 'Accept' header, 'image/png' for output bytes"},{"name":"accept","in":"header","required":false,"schema":{"type":"string","title":"Accept"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Text2ImgRequest"}}}},"responses":{"200":{"description":"PNG bytes if request's 'Accept' header is 'image/png', otherwise JSON","content":{"application/json":{"schema":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/GeneratedImageResult"}},{"$ref":"#/components/schemas/AsyncJobResponse"}],"title":"Response Text2Img Generation V1 Generation Text To Image Post"},"example":[{"base64":"...very long string...","seed":"1050625087","finish_reason":"SUCCESS"}]},"application/json async":{"example":{"job_id":1,"job_type":"Text to Image"}},"image/png":{"example":"PNG bytes, what did you expect?"}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/generation/image-upscale-vary":{"post":{"summary":"Img Upscale Or Vary","operationId":"img_upscale_or_vary_v1_generation_image_upscale_vary_post","parameters":[{"name":"accept","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Parameter to overvide 'Accept' header, 'image/png' for output bytes","title":"Accept"},"description":"Parameter to overvide 'Accept' header, 'image/png' for output bytes"},{"name":"accept","in":"header","required":false,"schema":{"type":"string","title":"Accept"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_img_upscale_or_vary_v1_generation_image_upscale_vary_post"}}}},"responses":{"200":{"description":"PNG bytes if request's 'Accept' header is 'image/png', otherwise JSON","content":{"application/json":{"schema":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/GeneratedImageResult"}},{"$ref":"#/components/schemas/AsyncJobResponse"}],"title":"Response Img Upscale Or Vary V1 Generation Image Upscale Vary Post"},"example":[{"base64":"...very long string...","seed":"1050625087","finish_reason":"SUCCESS"}]},"application/json async":{"example":{"job_id":1,"job_type":"Text to Image"}},"image/png":{"example":"PNG bytes, what did you expect?"}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v2/generation/image-upscale-vary":{"post":{"summary":"Img Upscale Or Vary V2","operationId":"img_upscale_or_vary_v2_v2_generation_image_upscale_vary_post","parameters":[{"name":"accept","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Parameter to overvide 'Accept' header, 'image/png' for output bytes","title":"Accept"},"description":"Parameter to overvide 'Accept' header, 'image/png' for output bytes"},{"name":"accept","in":"header","required":false,"schema":{"type":"string","title":"Accept"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ImgUpscaleOrVaryRequestJson"}}}},"responses":{"200":{"description":"PNG bytes if request's 'Accept' header is 'image/png', otherwise JSON","content":{"application/json":{"schema":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/GeneratedImageResult"}},{"$ref":"#/components/schemas/AsyncJobResponse"}],"title":"Response Img Upscale Or Vary V2 V2 Generation Image Upscale Vary Post"},"example":[{"base64":"...very long string...","seed":"1050625087","finish_reason":"SUCCESS"}]},"application/json async":{"example":{"job_id":1,"job_type":"Text to Image"}},"image/png":{"example":"PNG bytes, what did you expect?"}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/generation/image-inpait-outpaint":{"post":{"summary":"Img Inpaint Or Outpaint","operationId":"img_inpaint_or_outpaint_v1_generation_image_inpait_outpaint_post","parameters":[{"name":"accept","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Parameter to overvide 'Accept' header, 'image/png' for output bytes","title":"Accept"},"description":"Parameter to overvide 'Accept' header, 'image/png' for output bytes"},{"name":"accept","in":"header","required":false,"schema":{"type":"string","title":"Accept"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_img_inpaint_or_outpaint_v1_generation_image_inpait_outpaint_post"}}}},"responses":{"200":{"description":"PNG bytes if request's 'Accept' header is 'image/png', otherwise JSON","content":{"application/json":{"schema":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/GeneratedImageResult"}},{"$ref":"#/components/schemas/AsyncJobResponse"}],"title":"Response Img Inpaint Or Outpaint V1 Generation Image Inpait Outpaint Post"},"example":[{"base64":"...very long string...","seed":"1050625087","finish_reason":"SUCCESS"}]},"application/json async":{"example":{"job_id":1,"job_type":"Text to Image"}},"image/png":{"example":"PNG bytes, what did you expect?"}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v2/generation/image-inpait-outpaint":{"post":{"summary":"Img Inpaint Or Outpaint V2","operationId":"img_inpaint_or_outpaint_v2_v2_generation_image_inpait_outpaint_post","parameters":[{"name":"accept","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Parameter to overvide 'Accept' header, 'image/png' for output bytes","title":"Accept"},"description":"Parameter to overvide 'Accept' header, 'image/png' for output bytes"},{"name":"accept","in":"header","required":false,"schema":{"type":"string","title":"Accept"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ImgInpaintOrOutpaintRequestJson"}}}},"responses":{"200":{"description":"PNG bytes if request's 'Accept' header is 'image/png', otherwise JSON","content":{"application/json":{"schema":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/GeneratedImageResult"}},{"$ref":"#/components/schemas/AsyncJobResponse"}],"title":"Response Img Inpaint Or Outpaint V2 V2 Generation Image Inpait Outpaint Post"},"example":[{"base64":"...very long string...","seed":"1050625087","finish_reason":"SUCCESS"}]},"application/json async":{"example":{"job_id":1,"job_type":"Text to Image"}},"image/png":{"example":"PNG bytes, what did you expect?"}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/generation/image-prompt":{"post":{"summary":"Img Prompt","operationId":"img_prompt_v1_generation_image_prompt_post","parameters":[{"name":"accept","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Parameter to overvide 'Accept' header, 'image/png' for output bytes","title":"Accept"},"description":"Parameter to overvide 'Accept' header, 'image/png' for output bytes"},{"name":"accept","in":"header","required":false,"schema":{"type":"string","title":"Accept"}}],"requestBody":{"content":{"multipart/form-data":{"schema":{"allOf":[{"$ref":"#/components/schemas/Body_img_prompt_v1_generation_image_prompt_post"}],"title":"Body"}}}},"responses":{"200":{"description":"PNG bytes if request's 'Accept' header is 'image/png', otherwise JSON","content":{"application/json":{"schema":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/GeneratedImageResult"}},{"$ref":"#/components/schemas/AsyncJobResponse"}],"title":"Response Img Prompt V1 Generation Image Prompt Post"},"example":[{"base64":"...very long string...","seed":"1050625087","finish_reason":"SUCCESS"}]},"application/json async":{"example":{"job_id":1,"job_type":"Text to Image"}},"image/png":{"example":"PNG bytes, what did you expect?"}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v2/generation/image-prompt":{"post":{"summary":"Img Prompt","operationId":"img_prompt_v2_generation_image_prompt_post","parameters":[{"name":"accept","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Parameter to overvide 'Accept' header, 'image/png' for output bytes","title":"Accept"},"description":"Parameter to overvide 'Accept' header, 'image/png' for output bytes"},{"name":"accept","in":"header","required":false,"schema":{"type":"string","title":"Accept"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ImgPromptRequestJson"}}}},"responses":{"200":{"description":"PNG bytes if request's 'Accept' header is 'image/png', otherwise JSON","content":{"application/json":{"schema":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/GeneratedImageResult"}},{"$ref":"#/components/schemas/AsyncJobResponse"}],"title":"Response Img Prompt V2 Generation Image Prompt Post"},"example":[{"base64":"...very long string...","seed":"1050625087","finish_reason":"SUCCESS"}]},"application/json async":{"example":{"job_id":1,"job_type":"Text to Image"}},"image/png":{"example":"PNG bytes, what did you expect?"}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/generation/query-job":{"get":{"summary":"Query Job","description":"Query async generation job","operationId":"query_job_v1_generation_query_job_get","parameters":[{"name":"job_id","in":"query","required":true,"schema":{"type":"string","title":"Job Id"}},{"name":"require_step_preivew","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Require Step Preivew"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/generation/job-queue":{"get":{"summary":"Job Queue","description":"Query job queue info","operationId":"job_queue_v1_generation_job_queue_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobQueueInfo"}}}}}}},"/v1/generation/stop":{"post":{"summary":"Stop","description":"Job stoping","operationId":"stop_v1_generation_stop_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StopResponse"}}}}}}},"/v1/engines/all-models":{"get":{"summary":"All Models","description":"Get all filenames of base model and lora","operationId":"all_models_v1_engines_all_models_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AllModelNamesResponse"}}}}}}},"/v1/engines/refresh-models":{"post":{"summary":"Refresh Models","description":"Refresh local files and get all filenames of base model and lora","operationId":"refresh_models_v1_engines_refresh_models_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AllModelNamesResponse"}}}}}}},"/v1/engines/styles":{"get":{"summary":"All Styles","description":"Get all legal Fooocus styles","operationId":"all_styles_v1_engines_styles_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"type":"string"},"type":"array","title":"Response All Styles V1 Engines Styles Get"}}}}}}}},"components":{"schemas":{"AdvancedParams":{"properties":{"disable_preview":{"type":"boolean","title":"Disable Preview","description":"Disable preview during generation","default":false},"adm_scaler_positive":{"type":"number","maximum":3.0,"minimum":0.1,"title":"Adm Scaler Positive","description":"Positive ADM Guidance Scaler","default":1.5},"adm_scaler_negative":{"type":"number","maximum":3.0,"minimum":0.1,"title":"Adm Scaler Negative","description":"Negative ADM Guidance Scaler","default":0.8},"adm_scaler_end":{"type":"number","maximum":1.0,"minimum":0.0,"title":"Adm Scaler End","description":"ADM Guidance End At Step","default":0.3},"refiner_swap_method":{"type":"string","title":"Refiner Swap Method","description":"Refiner swap method","default":"joint"},"adaptive_cfg":{"type":"number","maximum":30.0,"minimum":1.0,"title":"Adaptive Cfg","description":"CFG Mimicking from TSNR","default":7.0},"sampler_name":{"type":"string","title":"Sampler Name","description":"Sampler","default":"dpmpp_2m_sde_gpu"},"scheduler_name":{"type":"string","title":"Scheduler Name","description":"Scheduler","default":"karras"},"overwrite_step":{"type":"integer","maximum":200.0,"minimum":-1.0,"title":"Overwrite Step","description":"Forced Overwrite of Sampling Step","default":-1},"overwrite_switch":{"type":"integer","maximum":200.0,"minimum":-1.0,"title":"Overwrite Switch","description":"Forced Overwrite of Refiner Switch Step","default":-1},"overwrite_width":{"type":"integer","maximum":2048.0,"minimum":-1.0,"title":"Overwrite Width","description":"Forced Overwrite of Generating Width","default":-1},"overwrite_height":{"type":"integer","maximum":2048.0,"minimum":-1.0,"title":"Overwrite Height","description":"Forced Overwrite of Generating Height","default":-1},"overwrite_vary_strength":{"type":"number","maximum":1.0,"minimum":-1.0,"title":"Overwrite Vary Strength","description":"Forced Overwrite of Denoising Strength of \"Vary\"","default":-1},"overwrite_upscale_strength":{"type":"number","maximum":1.0,"minimum":-1.0,"title":"Overwrite Upscale Strength","description":"Forced Overwrite of Denoising Strength of \"Upscale\"","default":-1},"mixing_image_prompt_and_vary_upscale":{"type":"boolean","title":"Mixing Image Prompt And Vary Upscale","description":"Mixing Image Prompt and Vary/Upscale","default":false},"mixing_image_prompt_and_inpaint":{"type":"boolean","title":"Mixing Image Prompt And Inpaint","description":"Mixing Image Prompt and Inpaint","default":false},"debugging_cn_preprocessor":{"type":"boolean","title":"Debugging Cn Preprocessor","description":"Debug Preprocessors","default":false},"skipping_cn_preprocessor":{"type":"boolean","title":"Skipping Cn Preprocessor","description":"Skip Preprocessors","default":false},"controlnet_softness":{"type":"number","maximum":1.0,"minimum":0.0,"title":"Controlnet Softness","description":"Softness of ControlNet","default":0.25},"canny_low_threshold":{"type":"integer","maximum":255.0,"minimum":1.0,"title":"Canny Low Threshold","description":"Canny Low Threshold","default":64},"canny_high_threshold":{"type":"integer","maximum":255.0,"minimum":1.0,"title":"Canny High Threshold","description":"Canny High Threshold","default":128},"freeu_enabled":{"type":"boolean","title":"Freeu Enabled","description":"FreeU enabled","default":false},"freeu_b1":{"type":"number","title":"Freeu B1","description":"FreeU B1","default":1.01},"freeu_b2":{"type":"number","title":"Freeu B2","description":"FreeU B2","default":1.02},"freeu_s1":{"type":"number","title":"Freeu S1","description":"FreeU B3","default":0.99},"freeu_s2":{"type":"number","title":"Freeu S2","description":"FreeU B4","default":0.95},"debugging_inpaint_preprocessor":{"type":"boolean","title":"Debugging Inpaint Preprocessor","description":"Debug Inpaint Preprocessing","default":false},"inpaint_disable_initial_latent":{"type":"boolean","title":"Inpaint Disable Initial Latent","description":"Disable initial latent in inpaint","default":false},"inpaint_engine":{"type":"string","title":"Inpaint Engine","description":"Inpaint Engine","default":"v1"},"inpaint_strength":{"type":"number","maximum":1.0,"minimum":0.0,"title":"Inpaint Strength","description":"Inpaint Denoising Strength","default":1.0},"inpaint_respective_field":{"type":"number","maximum":1.0,"minimum":0.0,"title":"Inpaint Respective Field","description":"Inpaint Respective Field","default":1.0}},"type":"object","title":"AdvancedParams"},"AllModelNamesResponse":{"properties":{"model_filenames":{"items":{"type":"string"},"type":"array","title":"Model Filenames","description":"All available model filenames"},"lora_filenames":{"items":{"type":"string"},"type":"array","title":"Lora Filenames","description":"All available lora filenames"}},"type":"object","required":["model_filenames","lora_filenames"],"title":"AllModelNamesResponse"},"AsyncJobResponse":{"properties":{"job_id":{"type":"string","title":"Job Id","description":"Job ID"},"job_type":{"allOf":[{"$ref":"#/components/schemas/TaskType"}],"description":"Job type"},"job_stage":{"allOf":[{"$ref":"#/components/schemas/AsyncJobStage"}],"description":"Job running stage"},"job_progress":{"type":"integer","title":"Job Progress","description":"Job running progress, 100 is for finished."},"job_status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Job Status","description":"Job running status in text"},"job_step_preview":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Job Step Preview","description":"Preview image of generation steps at current time, as base64 image"},"job_result":{"anyOf":[{"items":{"$ref":"#/components/schemas/GeneratedImageResult"},"type":"array"},{"type":"null"}],"title":"Job Result","description":"Job generation result"}},"type":"object","required":["job_id","job_type","job_stage","job_progress"],"title":"AsyncJobResponse"},"AsyncJobStage":{"type":"string","enum":["WAITING","RUNNING","SUCCESS","ERROR"],"title":"AsyncJobStage"},"Body_img_inpaint_or_outpaint_v1_generation_image_inpait_outpaint_post":{"properties":{"input_image":{"type":"string","format":"binary","title":"Input Image","description":"Init image for inpaint or outpaint"},"input_mask":{"type":"string","format":"binary","title":"Input Mask","description":"Inpaint or outpaint mask"},"inpaint_additional_prompt":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Inpaint Additional Prompt","description":"Describe what you want to inpaint"},"outpaint_selections":{"items":{"type":"string"},"type":"array","title":"Outpaint Selections","description":"Outpaint expansion selections, literal 'Left', 'Right', 'Top', 'Bottom' seperated by comma","default":[]},"outpaint_distance_left":{"type":"integer","title":"Outpaint Distance Left","description":"Set outpaint left distance, 0 for default","default":0},"outpaint_distance_right":{"type":"integer","title":"Outpaint Distance Right","description":"Set outpaint right distance, 0 for default","default":0},"outpaint_distance_top":{"type":"integer","title":"Outpaint Distance Top","description":"Set outpaint top distance, 0 for default","default":0},"outpaint_distance_bottom":{"type":"integer","title":"Outpaint Distance Bottom","description":"Set outpaint bottom distance, 0 for default","default":0},"prompt":{"type":"string","title":"Prompt","default":""},"negative_prompt":{"type":"string","title":"Negative Prompt","default":""},"style_selections":{"items":{"type":"string"},"type":"array","title":"Style Selections","description":"Fooocus style selections, seperated by comma","default":["Fooocus V2","Fooocus Enhance","Fooocus Sharp"]},"performance_selection":{"allOf":[{"$ref":"#/components/schemas/PerfomanceSelection"}],"default":"Speed"},"aspect_ratios_selection":{"type":"string","title":"Aspect Ratios Selection","default":"1152*896"},"image_number":{"type":"integer","maximum":32.0,"minimum":1.0,"title":"Image Number","description":"Image number","default":1},"image_seed":{"type":"integer","title":"Image Seed","description":"Seed to generate image, -1 for random","default":-1},"sharpness":{"type":"number","maximum":30.0,"minimum":0.0,"title":"Sharpness","default":2.0},"guidance_scale":{"type":"number","maximum":30.0,"minimum":1.0,"title":"Guidance Scale","default":4.0},"base_model_name":{"type":"string","title":"Base Model Name","default":"juggernautXL_version6Rundiffusion.safetensors"},"refiner_model_name":{"type":"string","title":"Refiner Model Name","default":"None"},"refiner_switch":{"type":"number","maximum":1.0,"minimum":0.1,"title":"Refiner Switch","description":"Refiner Switch At","default":0.5},"loras":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Loras","description":"Lora config in JSON. Format as [{\"model_name\": \"sd_xl_offset_example-lora_1.0.safetensors\", \"weight\": 0.5}]","default":"[{\"model_name\":\"sd_xl_offset_example-lora_1.0.safetensors\",\"weight\":0.1}]"},"advanced_params":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Advanced Params","description":"Advanced parameters in JSON"},"require_base64":{"type":"boolean","title":"Require Base64","description":"Return base64 data of generated image","default":false},"async_process":{"type":"boolean","title":"Async Process","description":"Set to true will run async and return job info for retrieve generataion result later","default":false}},"type":"object","required":["input_image"],"title":"Body_img_inpaint_or_outpaint_v1_generation_image_inpait_outpaint_post"},"Body_img_prompt_v1_generation_image_prompt_post":{"properties":{"cn_img1":{"type":"string","format":"binary","title":"Cn Img1","description":"Input image for image prompt"},"cn_stop1":{"anyOf":[{"type":"number","maximum":1.0,"minimum":0.0},{"type":"null"}],"title":"Cn Stop1","description":"Stop at for image prompt, None for default value"},"cn_weight1":{"anyOf":[{"type":"number","maximum":2.0,"minimum":0.0},{"type":"null"}],"title":"Cn Weight1","description":"Weight for image prompt, None for default value"},"cn_type1":{"allOf":[{"$ref":"#/components/schemas/ControlNetType"}],"description":"ControlNet type for image prompt","default":"ImagePrompt"},"cn_img2":{"type":"string","format":"binary","title":"Cn Img2","description":"Input image for image prompt"},"cn_stop2":{"anyOf":[{"type":"number","maximum":1.0,"minimum":0.0},{"type":"null"}],"title":"Cn Stop2","description":"Stop at for image prompt, None for default value"},"cn_weight2":{"anyOf":[{"type":"number","maximum":2.0,"minimum":0.0},{"type":"null"}],"title":"Cn Weight2","description":"Weight for image prompt, None for default value"},"cn_type2":{"allOf":[{"$ref":"#/components/schemas/ControlNetType"}],"description":"ControlNet type for image prompt","default":"ImagePrompt"},"cn_img3":{"type":"string","format":"binary","title":"Cn Img3","description":"Input image for image prompt"},"cn_stop3":{"anyOf":[{"type":"number","maximum":1.0,"minimum":0.0},{"type":"null"}],"title":"Cn Stop3","description":"Stop at for image prompt, None for default value"},"cn_weight3":{"anyOf":[{"type":"number","maximum":2.0,"minimum":0.0},{"type":"null"}],"title":"Cn Weight3","description":"Weight for image prompt, None for default value"},"cn_type3":{"allOf":[{"$ref":"#/components/schemas/ControlNetType"}],"description":"ControlNet type for image prompt","default":"ImagePrompt"},"cn_img4":{"type":"string","format":"binary","title":"Cn Img4","description":"Input image for image prompt"},"cn_stop4":{"anyOf":[{"type":"number","maximum":1.0,"minimum":0.0},{"type":"null"}],"title":"Cn Stop4","description":"Stop at for image prompt, None for default value"},"cn_weight4":{"anyOf":[{"type":"number","maximum":2.0,"minimum":0.0},{"type":"null"}],"title":"Cn Weight4","description":"Weight for image prompt, None for default value"},"cn_type4":{"allOf":[{"$ref":"#/components/schemas/ControlNetType"}],"description":"ControlNet type for image prompt","default":"ImagePrompt"},"prompt":{"type":"string","title":"Prompt","default":""},"negative_prompt":{"type":"string","title":"Negative Prompt","default":""},"style_selections":{"items":{"type":"string"},"type":"array","title":"Style Selections","description":"Fooocus style selections, seperated by comma","default":["Fooocus V2","Fooocus Enhance","Fooocus Sharp"]},"performance_selection":{"allOf":[{"$ref":"#/components/schemas/PerfomanceSelection"}],"default":"Speed"},"aspect_ratios_selection":{"type":"string","title":"Aspect Ratios Selection","default":"1152*896"},"image_number":{"type":"integer","maximum":32.0,"minimum":1.0,"title":"Image Number","description":"Image number","default":1},"image_seed":{"type":"integer","title":"Image Seed","description":"Seed to generate image, -1 for random","default":-1},"sharpness":{"type":"number","maximum":30.0,"minimum":0.0,"title":"Sharpness","default":2.0},"guidance_scale":{"type":"number","maximum":30.0,"minimum":1.0,"title":"Guidance Scale","default":4.0},"base_model_name":{"type":"string","title":"Base Model Name","default":"juggernautXL_version6Rundiffusion.safetensors"},"refiner_model_name":{"type":"string","title":"Refiner Model Name","default":"None"},"refiner_switch":{"type":"number","maximum":1.0,"minimum":0.1,"title":"Refiner Switch","description":"Refiner Switch At","default":0.5},"loras":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Loras","description":"Lora config in JSON. Format as [{\"model_name\": \"sd_xl_offset_example-lora_1.0.safetensors\", \"weight\": 0.5}]","default":"[{\"model_name\":\"sd_xl_offset_example-lora_1.0.safetensors\",\"weight\":0.1}]"},"advanced_params":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Advanced Params","description":"Advanced parameters in JSON"},"require_base64":{"type":"boolean","title":"Require Base64","description":"Return base64 data of generated image","default":false},"async_process":{"type":"boolean","title":"Async Process","description":"Set to true will run async and return job info for retrieve generataion result later","default":false}},"type":"object","title":"Body_img_prompt_v1_generation_image_prompt_post"},"Body_img_upscale_or_vary_v1_generation_image_upscale_vary_post":{"properties":{"input_image":{"type":"string","format":"binary","title":"Input Image","description":"Init image for upsacale or outpaint"},"uov_method":{"$ref":"#/components/schemas/UpscaleOrVaryMethod"},"upscale_value":{"anyOf":[{"type":"number","maximum":5.0,"minimum":1.0},{"type":"null"}],"title":"Upscale Value","description":"Upscale custom value, None for default value"},"prompt":{"type":"string","title":"Prompt","default":""},"negative_prompt":{"type":"string","title":"Negative Prompt","default":""},"style_selections":{"items":{"type":"string"},"type":"array","title":"Style Selections","description":"Fooocus style selections, seperated by comma","default":["Fooocus V2","Fooocus Enhance","Fooocus Sharp"]},"performance_selection":{"allOf":[{"$ref":"#/components/schemas/PerfomanceSelection"}],"default":"Speed"},"aspect_ratios_selection":{"type":"string","title":"Aspect Ratios Selection","default":"1152*896"},"image_number":{"type":"integer","maximum":32.0,"minimum":1.0,"title":"Image Number","description":"Image number","default":1},"image_seed":{"type":"integer","title":"Image Seed","description":"Seed to generate image, -1 for random","default":-1},"sharpness":{"type":"number","maximum":30.0,"minimum":0.0,"title":"Sharpness","default":2.0},"guidance_scale":{"type":"number","maximum":30.0,"minimum":1.0,"title":"Guidance Scale","default":4.0},"base_model_name":{"type":"string","title":"Base Model Name","default":"juggernautXL_version6Rundiffusion.safetensors"},"refiner_model_name":{"type":"string","title":"Refiner Model Name","default":"None"},"refiner_switch":{"type":"number","maximum":1.0,"minimum":0.1,"title":"Refiner Switch","description":"Refiner Switch At","default":0.5},"loras":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Loras","description":"Lora config in JSON. Format as [{\"model_name\": \"sd_xl_offset_example-lora_1.0.safetensors\", \"weight\": 0.5}]","default":"[{\"model_name\":\"sd_xl_offset_example-lora_1.0.safetensors\",\"weight\":0.1}]"},"advanced_params":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Advanced Params","description":"Advanced parameters in JSON"},"require_base64":{"type":"boolean","title":"Require Base64","description":"Return base64 data of generated image","default":false},"async_process":{"type":"boolean","title":"Async Process","description":"Set to true will run async and return job info for retrieve generataion result later","default":false}},"type":"object","required":["input_image","uov_method"],"title":"Body_img_upscale_or_vary_v1_generation_image_upscale_vary_post"},"ControlNetType":{"type":"string","enum":["ImagePrompt","FaceSwap","PyraCanny","CPDS"],"title":"ControlNetType"},"GeneratedImageResult":{"properties":{"base64":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Base64","description":"Image encoded in base64, or null if finishReasen is not 'SUCCESS', only return when request require base64"},"url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Url","description":"Image file static serve url, or null if finishReasen is not 'SUCCESS'"},"seed":{"type":"string","title":"Seed","description":"The seed associated with this image"},"finish_reason":{"$ref":"#/components/schemas/GenerationFinishReason"}},"type":"object","required":["base64","url","seed","finish_reason"],"title":"GeneratedImageResult"},"GenerationFinishReason":{"type":"string","enum":["SUCCESS","QUEUE_IS_FULL","USER_CANCEL","ERROR"],"title":"GenerationFinishReason"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"ImagePrompt":{"properties":{"cn_img":{"anyOf":[{"type":"string","format":"binary"},{"type":"null"}],"title":"Cn Img"},"cn_stop":{"anyOf":[{"type":"number","maximum":1.0,"minimum":0.0},{"type":"null"}],"title":"Cn Stop"},"cn_weight":{"anyOf":[{"type":"number","maximum":2.0,"minimum":0.0},{"type":"null"}],"title":"Cn Weight","description":"None for default value"},"cn_type":{"allOf":[{"$ref":"#/components/schemas/ControlNetType"}],"default":"ImagePrompt"}},"type":"object","title":"ImagePrompt"},"ImagePromptJson":{"properties":{"cn_img":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cn Img","description":"Input image for image prompt as base64"},"cn_stop":{"anyOf":[{"type":"number","maximum":1.0,"minimum":0.0},{"type":"null"}],"title":"Cn Stop","description":"Stop at for image prompt, None for default value"},"cn_weight":{"anyOf":[{"type":"number","maximum":2.0,"minimum":0.0},{"type":"null"}],"title":"Cn Weight","description":"Weight for image prompt, None for default value"},"cn_type":{"allOf":[{"$ref":"#/components/schemas/ControlNetType"}],"description":"ControlNet type for image prompt","default":"ImagePrompt"}},"type":"object","title":"ImagePromptJson"},"ImgInpaintOrOutpaintRequestJson":{"properties":{"prompt":{"type":"string","title":"Prompt","default":""},"negative_prompt":{"type":"string","title":"Negative Prompt","default":""},"style_selections":{"items":{"type":"string"},"type":"array","title":"Style Selections","default":["Fooocus V2","Fooocus Enhance","Fooocus Sharp"]},"performance_selection":{"allOf":[{"$ref":"#/components/schemas/PerfomanceSelection"}],"default":"Speed"},"aspect_ratios_selection":{"type":"string","title":"Aspect Ratios Selection","default":"1152*896"},"image_number":{"type":"integer","maximum":32.0,"minimum":1.0,"title":"Image Number","description":"Image number","default":1},"image_seed":{"type":"integer","title":"Image Seed","description":"Seed to generate image, -1 for random","default":-1},"sharpness":{"type":"number","maximum":30.0,"minimum":0.0,"title":"Sharpness","default":2.0},"guidance_scale":{"type":"number","maximum":30.0,"minimum":1.0,"title":"Guidance Scale","default":4.0},"base_model_name":{"type":"string","title":"Base Model Name","default":"juggernautXL_version6Rundiffusion.safetensors"},"refiner_model_name":{"type":"string","title":"Refiner Model Name","default":"None"},"refiner_switch":{"type":"number","maximum":1.0,"minimum":0.1,"title":"Refiner Switch","description":"Refiner Switch At","default":0.5},"loras":{"items":{"$ref":"#/components/schemas/Lora"},"type":"array","title":"Loras","default":[{"model_name":"sd_xl_offset_example-lora_1.0.safetensors","weight":0.1}]},"advanced_params":{"anyOf":[{"$ref":"#/components/schemas/AdvancedParams"},{"type":"null"}],"default":{"adaptive_cfg":7.0,"adm_scaler_end":0.3,"adm_scaler_negative":0.8,"adm_scaler_positive":1.5,"canny_high_threshold":128,"canny_low_threshold":64,"controlnet_softness":0.25,"debugging_cn_preprocessor":false,"debugging_inpaint_preprocessor":false,"disable_preview":false,"freeu_b1":1.01,"freeu_b2":1.02,"freeu_enabled":false,"freeu_s1":0.99,"freeu_s2":0.95,"inpaint_disable_initial_latent":false,"inpaint_engine":"v1","inpaint_respective_field":1.0,"inpaint_strength":1.0,"mixing_image_prompt_and_inpaint":false,"mixing_image_prompt_and_vary_upscale":false,"overwrite_height":-1,"overwrite_step":-1,"overwrite_switch":-1,"overwrite_upscale_strength":-1.0,"overwrite_vary_strength":-1.0,"overwrite_width":-1,"refiner_swap_method":"joint","sampler_name":"dpmpp_2m_sde_gpu","scheduler_name":"karras","skipping_cn_preprocessor":false}},"require_base64":{"type":"boolean","title":"Require Base64","description":"Return base64 data of generated image","default":false},"async_process":{"type":"boolean","title":"Async Process","description":"Set to true will run async and return job info for retrieve generataion result later","default":false},"input_image":{"type":"string","title":"Input Image","description":"Init image for inpaint or outpaint as base64"},"input_mask":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Input Mask","description":"Inpaint or outpaint mask as base64"},"inpaint_additional_prompt":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Inpaint Additional Prompt","description":"Describe what you want to inpaint"},"outpaint_selections":{"items":{"$ref":"#/components/schemas/OutpaintExpansion"},"type":"array","title":"Outpaint Selections","default":[]},"outpaint_distance_left":{"type":"integer","title":"Outpaint Distance Left"},"outpaint_distance_right":{"type":"integer","title":"Outpaint Distance Right"},"outpaint_distance_top":{"type":"integer","title":"Outpaint Distance Top"},"outpaint_distance_bottom":{"type":"integer","title":"Outpaint Distance Bottom"}},"type":"object","required":["input_image"],"title":"ImgInpaintOrOutpaintRequestJson"},"ImgPromptRequestJson":{"properties":{"prompt":{"type":"string","title":"Prompt","default":""},"negative_prompt":{"type":"string","title":"Negative Prompt","default":""},"style_selections":{"items":{"type":"string"},"type":"array","title":"Style Selections","default":["Fooocus V2","Fooocus Enhance","Fooocus Sharp"]},"performance_selection":{"allOf":[{"$ref":"#/components/schemas/PerfomanceSelection"}],"default":"Speed"},"aspect_ratios_selection":{"type":"string","title":"Aspect Ratios Selection","default":"1152*896"},"image_number":{"type":"integer","maximum":32.0,"minimum":1.0,"title":"Image Number","description":"Image number","default":1},"image_seed":{"type":"integer","title":"Image Seed","description":"Seed to generate image, -1 for random","default":-1},"sharpness":{"type":"number","maximum":30.0,"minimum":0.0,"title":"Sharpness","default":2.0},"guidance_scale":{"type":"number","maximum":30.0,"minimum":1.0,"title":"Guidance Scale","default":4.0},"base_model_name":{"type":"string","title":"Base Model Name","default":"juggernautXL_version6Rundiffusion.safetensors"},"refiner_model_name":{"type":"string","title":"Refiner Model Name","default":"None"},"refiner_switch":{"type":"number","maximum":1.0,"minimum":0.1,"title":"Refiner Switch","description":"Refiner Switch At","default":0.5},"loras":{"items":{"$ref":"#/components/schemas/Lora"},"type":"array","title":"Loras","default":[{"model_name":"sd_xl_offset_example-lora_1.0.safetensors","weight":0.1}]},"advanced_params":{"anyOf":[{"$ref":"#/components/schemas/AdvancedParams"},{"type":"null"}],"default":{"adaptive_cfg":7.0,"adm_scaler_end":0.3,"adm_scaler_negative":0.8,"adm_scaler_positive":1.5,"canny_high_threshold":128,"canny_low_threshold":64,"controlnet_softness":0.25,"debugging_cn_preprocessor":false,"debugging_inpaint_preprocessor":false,"disable_preview":false,"freeu_b1":1.01,"freeu_b2":1.02,"freeu_enabled":false,"freeu_s1":0.99,"freeu_s2":0.95,"inpaint_disable_initial_latent":false,"inpaint_engine":"v1","inpaint_respective_field":1.0,"inpaint_strength":1.0,"mixing_image_prompt_and_inpaint":false,"mixing_image_prompt_and_vary_upscale":false,"overwrite_height":-1,"overwrite_step":-1,"overwrite_switch":-1,"overwrite_upscale_strength":-1.0,"overwrite_vary_strength":-1.0,"overwrite_width":-1,"refiner_swap_method":"joint","sampler_name":"dpmpp_2m_sde_gpu","scheduler_name":"karras","skipping_cn_preprocessor":false}},"require_base64":{"type":"boolean","title":"Require Base64","description":"Return base64 data of generated image","default":false},"async_process":{"type":"boolean","title":"Async Process","description":"Set to true will run async and return job info for retrieve generataion result later","default":false},"image_prompts":{"items":{"anyOf":[{"$ref":"#/components/schemas/ImagePromptJson"},{"$ref":"#/components/schemas/ImagePrompt"}]},"type":"array","title":"Image Prompts"}},"type":"object","required":["image_prompts"],"title":"ImgPromptRequestJson"},"ImgUpscaleOrVaryRequestJson":{"properties":{"prompt":{"type":"string","title":"Prompt","default":""},"negative_prompt":{"type":"string","title":"Negative Prompt","default":""},"style_selections":{"items":{"type":"string"},"type":"array","title":"Style Selections","default":["Fooocus V2","Fooocus Enhance","Fooocus Sharp"]},"performance_selection":{"allOf":[{"$ref":"#/components/schemas/PerfomanceSelection"}],"default":"Speed"},"aspect_ratios_selection":{"type":"string","title":"Aspect Ratios Selection","default":"1152*896"},"image_number":{"type":"integer","maximum":32.0,"minimum":1.0,"title":"Image Number","description":"Image number","default":1},"image_seed":{"type":"integer","title":"Image Seed","description":"Seed to generate image, -1 for random","default":-1},"sharpness":{"type":"number","maximum":30.0,"minimum":0.0,"title":"Sharpness","default":2.0},"guidance_scale":{"type":"number","maximum":30.0,"minimum":1.0,"title":"Guidance Scale","default":4.0},"base_model_name":{"type":"string","title":"Base Model Name","default":"juggernautXL_version6Rundiffusion.safetensors"},"refiner_model_name":{"type":"string","title":"Refiner Model Name","default":"None"},"refiner_switch":{"type":"number","maximum":1.0,"minimum":0.1,"title":"Refiner Switch","description":"Refiner Switch At","default":0.5},"loras":{"items":{"$ref":"#/components/schemas/Lora"},"type":"array","title":"Loras","default":[{"model_name":"sd_xl_offset_example-lora_1.0.safetensors","weight":0.1}]},"advanced_params":{"anyOf":[{"$ref":"#/components/schemas/AdvancedParams"},{"type":"null"}],"default":{"adaptive_cfg":7.0,"adm_scaler_end":0.3,"adm_scaler_negative":0.8,"adm_scaler_positive":1.5,"canny_high_threshold":128,"canny_low_threshold":64,"controlnet_softness":0.25,"debugging_cn_preprocessor":false,"debugging_inpaint_preprocessor":false,"disable_preview":false,"freeu_b1":1.01,"freeu_b2":1.02,"freeu_enabled":false,"freeu_s1":0.99,"freeu_s2":0.95,"inpaint_disable_initial_latent":false,"inpaint_engine":"v1","inpaint_respective_field":1.0,"inpaint_strength":1.0,"mixing_image_prompt_and_inpaint":false,"mixing_image_prompt_and_vary_upscale":false,"overwrite_height":-1,"overwrite_step":-1,"overwrite_switch":-1,"overwrite_upscale_strength":-1.0,"overwrite_vary_strength":-1.0,"overwrite_width":-1,"refiner_swap_method":"joint","sampler_name":"dpmpp_2m_sde_gpu","scheduler_name":"karras","skipping_cn_preprocessor":false}},"require_base64":{"type":"boolean","title":"Require Base64","description":"Return base64 data of generated image","default":false},"async_process":{"type":"boolean","title":"Async Process","description":"Set to true will run async and return job info for retrieve generataion result later","default":false},"uov_method":{"allOf":[{"$ref":"#/components/schemas/UpscaleOrVaryMethod"}],"default":"Upscale (2x)"},"upscale_value":{"anyOf":[{"type":"number","maximum":5.0,"minimum":1.0},{"type":"null"}],"title":"Upscale Value","description":"Upscale custom value, None for default value"},"input_image":{"type":"string","title":"Input Image","description":"Init image for upsacale or outpaint as base64"}},"type":"object","required":["input_image"],"title":"ImgUpscaleOrVaryRequestJson"},"JobQueueInfo":{"properties":{"running_size":{"type":"integer","title":"Running Size","description":"The current running and waiting job count"},"finished_size":{"type":"integer","title":"Finished Size","description":"Finished job cound (after auto clean)"},"last_job_id":{"type":"string","title":"Last Job Id","description":"Last submit generation job id"}},"type":"object","required":["running_size","finished_size","last_job_id"],"title":"JobQueueInfo"},"Lora":{"properties":{"model_name":{"type":"string","title":"Model Name"},"weight":{"type":"number","maximum":2.0,"minimum":-2.0,"title":"Weight","default":0.5}},"type":"object","required":["model_name"],"title":"Lora"},"OutpaintExpansion":{"type":"string","enum":["Left","Right","Top","Bottom"],"title":"OutpaintExpansion"},"PerfomanceSelection":{"type":"string","enum":["Speed","Quality","Extreme Speed"],"title":"PerfomanceSelection"},"StopResponse":{"properties":{"msg":{"type":"string","title":"Msg"}},"type":"object","required":["msg"],"title":"StopResponse"},"TaskType":{"type":"string","enum":["Text to Image","Image Upscale or Variation","Image Inpaint or Outpaint","Image Prompt"],"title":"TaskType"},"Text2ImgRequest":{"properties":{"prompt":{"type":"string","title":"Prompt","default":""},"negative_prompt":{"type":"string","title":"Negative Prompt","default":""},"style_selections":{"items":{"type":"string"},"type":"array","title":"Style Selections","default":["Fooocus V2","Fooocus Enhance","Fooocus Sharp"]},"performance_selection":{"allOf":[{"$ref":"#/components/schemas/PerfomanceSelection"}],"default":"Speed"},"aspect_ratios_selection":{"type":"string","title":"Aspect Ratios Selection","default":"1152*896"},"image_number":{"type":"integer","maximum":32.0,"minimum":1.0,"title":"Image Number","description":"Image number","default":1},"image_seed":{"type":"integer","title":"Image Seed","description":"Seed to generate image, -1 for random","default":-1},"sharpness":{"type":"number","maximum":30.0,"minimum":0.0,"title":"Sharpness","default":2.0},"guidance_scale":{"type":"number","maximum":30.0,"minimum":1.0,"title":"Guidance Scale","default":4.0},"base_model_name":{"type":"string","title":"Base Model Name","default":"juggernautXL_version6Rundiffusion.safetensors"},"refiner_model_name":{"type":"string","title":"Refiner Model Name","default":"None"},"refiner_switch":{"type":"number","maximum":1.0,"minimum":0.1,"title":"Refiner Switch","description":"Refiner Switch At","default":0.5},"loras":{"items":{"$ref":"#/components/schemas/Lora"},"type":"array","title":"Loras","default":[{"model_name":"sd_xl_offset_example-lora_1.0.safetensors","weight":0.1}]},"advanced_params":{"anyOf":[{"$ref":"#/components/schemas/AdvancedParams"},{"type":"null"}],"default":{"adaptive_cfg":7.0,"adm_scaler_end":0.3,"adm_scaler_negative":0.8,"adm_scaler_positive":1.5,"canny_high_threshold":128,"canny_low_threshold":64,"controlnet_softness":0.25,"debugging_cn_preprocessor":false,"debugging_inpaint_preprocessor":false,"disable_preview":false,"freeu_b1":1.01,"freeu_b2":1.02,"freeu_enabled":false,"freeu_s1":0.99,"freeu_s2":0.95,"inpaint_disable_initial_latent":false,"inpaint_engine":"v1","inpaint_respective_field":1.0,"inpaint_strength":1.0,"mixing_image_prompt_and_inpaint":false,"mixing_image_prompt_and_vary_upscale":false,"overwrite_height":-1,"overwrite_step":-1,"overwrite_switch":-1,"overwrite_upscale_strength":-1.0,"overwrite_vary_strength":-1.0,"overwrite_width":-1,"refiner_swap_method":"joint","sampler_name":"dpmpp_2m_sde_gpu","scheduler_name":"karras","skipping_cn_preprocessor":false}},"require_base64":{"type":"boolean","title":"Require Base64","description":"Return base64 data of generated image","default":false},"async_process":{"type":"boolean","title":"Async Process","description":"Set to true will run async and return job info for retrieve generataion result later","default":false}},"type":"object","title":"Text2ImgRequest"},"UpscaleOrVaryMethod":{"type":"string","enum":["Vary (Subtle)","Vary (Strong)","Upscale (1.5x)","Upscale (2x)","Upscale (Fast 2x)","Upscale (Custom)"],"title":"UpscaleOrVaryMethod"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}}}} \ No newline at end of file +{"openapi":"3.1.0","info":{"title":"FastAPI","version":"0.1.0"},"paths":{"/":{"get":{"summary":"Home","operationId":"home__get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/v1/generation/text-to-image":{"post":{"summary":"Text2Img Generation","operationId":"text2img_generation_v1_generation_text_to_image_post","parameters":[{"name":"accept","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Parameter to overvide 'Accept' header, 'image/png' for output bytes","title":"Accept"},"description":"Parameter to overvide 'Accept' header, 'image/png' for output bytes"},{"name":"accept","in":"header","required":false,"schema":{"type":"string","title":"Accept"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Text2ImgRequest"}}}},"responses":{"200":{"description":"PNG bytes if request's 'Accept' header is 'image/png', otherwise JSON","content":{"application/json":{"schema":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/GeneratedImageResult"}},{"$ref":"#/components/schemas/AsyncJobResponse"}],"title":"Response Text2Img Generation V1 Generation Text To Image Post"},"example":[{"base64":"...very long string...","seed":"1050625087","finish_reason":"SUCCESS"}]},"application/json async":{"example":{"job_id":1,"job_type":"Text to Image"}},"image/png":{"example":"PNG bytes, what did you expect?"}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/generation/image-upscale-vary":{"post":{"summary":"Img Upscale Or Vary","operationId":"img_upscale_or_vary_v1_generation_image_upscale_vary_post","parameters":[{"name":"accept","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Parameter to overvide 'Accept' header, 'image/png' for output bytes","title":"Accept"},"description":"Parameter to overvide 'Accept' header, 'image/png' for output bytes"},{"name":"accept","in":"header","required":false,"schema":{"type":"string","title":"Accept"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_img_upscale_or_vary_v1_generation_image_upscale_vary_post"}}}},"responses":{"200":{"description":"PNG bytes if request's 'Accept' header is 'image/png', otherwise JSON","content":{"application/json":{"schema":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/GeneratedImageResult"}},{"$ref":"#/components/schemas/AsyncJobResponse"}],"title":"Response Img Upscale Or Vary V1 Generation Image Upscale Vary Post"},"example":[{"base64":"...very long string...","seed":"1050625087","finish_reason":"SUCCESS"}]},"application/json async":{"example":{"job_id":1,"job_type":"Text to Image"}},"image/png":{"example":"PNG bytes, what did you expect?"}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v2/generation/image-upscale-vary":{"post":{"summary":"Img Upscale Or Vary V2","operationId":"img_upscale_or_vary_v2_v2_generation_image_upscale_vary_post","parameters":[{"name":"accept","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Parameter to overvide 'Accept' header, 'image/png' for output bytes","title":"Accept"},"description":"Parameter to overvide 'Accept' header, 'image/png' for output bytes"},{"name":"accept","in":"header","required":false,"schema":{"type":"string","title":"Accept"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ImgUpscaleOrVaryRequestJson"}}}},"responses":{"200":{"description":"PNG bytes if request's 'Accept' header is 'image/png', otherwise JSON","content":{"application/json":{"schema":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/GeneratedImageResult"}},{"$ref":"#/components/schemas/AsyncJobResponse"}],"title":"Response Img Upscale Or Vary V2 V2 Generation Image Upscale Vary Post"},"example":[{"base64":"...very long string...","seed":"1050625087","finish_reason":"SUCCESS"}]},"application/json async":{"example":{"job_id":1,"job_type":"Text to Image"}},"image/png":{"example":"PNG bytes, what did you expect?"}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/generation/image-inpait-outpaint":{"post":{"summary":"Img Inpaint Or Outpaint","operationId":"img_inpaint_or_outpaint_v1_generation_image_inpait_outpaint_post","parameters":[{"name":"accept","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Parameter to overvide 'Accept' header, 'image/png' for output bytes","title":"Accept"},"description":"Parameter to overvide 'Accept' header, 'image/png' for output bytes"},{"name":"accept","in":"header","required":false,"schema":{"type":"string","title":"Accept"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_img_inpaint_or_outpaint_v1_generation_image_inpait_outpaint_post"}}}},"responses":{"200":{"description":"PNG bytes if request's 'Accept' header is 'image/png', otherwise JSON","content":{"application/json":{"schema":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/GeneratedImageResult"}},{"$ref":"#/components/schemas/AsyncJobResponse"}],"title":"Response Img Inpaint Or Outpaint V1 Generation Image Inpait Outpaint Post"},"example":[{"base64":"...very long string...","seed":"1050625087","finish_reason":"SUCCESS"}]},"application/json async":{"example":{"job_id":1,"job_type":"Text to Image"}},"image/png":{"example":"PNG bytes, what did you expect?"}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v2/generation/image-inpait-outpaint":{"post":{"summary":"Img Inpaint Or Outpaint V2","operationId":"img_inpaint_or_outpaint_v2_v2_generation_image_inpait_outpaint_post","parameters":[{"name":"accept","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Parameter to overvide 'Accept' header, 'image/png' for output bytes","title":"Accept"},"description":"Parameter to overvide 'Accept' header, 'image/png' for output bytes"},{"name":"accept","in":"header","required":false,"schema":{"type":"string","title":"Accept"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ImgInpaintOrOutpaintRequestJson"}}}},"responses":{"200":{"description":"PNG bytes if request's 'Accept' header is 'image/png', otherwise JSON","content":{"application/json":{"schema":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/GeneratedImageResult"}},{"$ref":"#/components/schemas/AsyncJobResponse"}],"title":"Response Img Inpaint Or Outpaint V2 V2 Generation Image Inpait Outpaint Post"},"example":[{"base64":"...very long string...","seed":"1050625087","finish_reason":"SUCCESS"}]},"application/json async":{"example":{"job_id":1,"job_type":"Text to Image"}},"image/png":{"example":"PNG bytes, what did you expect?"}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/generation/image-prompt":{"post":{"summary":"Img Prompt","operationId":"img_prompt_v1_generation_image_prompt_post","parameters":[{"name":"accept","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Parameter to overvide 'Accept' header, 'image/png' for output bytes","title":"Accept"},"description":"Parameter to overvide 'Accept' header, 'image/png' for output bytes"},{"name":"accept","in":"header","required":false,"schema":{"type":"string","title":"Accept"}}],"requestBody":{"content":{"multipart/form-data":{"schema":{"allOf":[{"$ref":"#/components/schemas/Body_img_prompt_v1_generation_image_prompt_post"}],"title":"Body"}}}},"responses":{"200":{"description":"PNG bytes if request's 'Accept' header is 'image/png', otherwise JSON","content":{"application/json":{"schema":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/GeneratedImageResult"}},{"$ref":"#/components/schemas/AsyncJobResponse"}],"title":"Response Img Prompt V1 Generation Image Prompt Post"},"example":[{"base64":"...very long string...","seed":"1050625087","finish_reason":"SUCCESS"}]},"application/json async":{"example":{"job_id":1,"job_type":"Text to Image"}},"image/png":{"example":"PNG bytes, what did you expect?"}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v2/generation/image-prompt":{"post":{"summary":"Img Prompt","operationId":"img_prompt_v2_generation_image_prompt_post","parameters":[{"name":"accept","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Parameter to overvide 'Accept' header, 'image/png' for output bytes","title":"Accept"},"description":"Parameter to overvide 'Accept' header, 'image/png' for output bytes"},{"name":"accept","in":"header","required":false,"schema":{"type":"string","title":"Accept"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ImgPromptRequestJson"}}}},"responses":{"200":{"description":"PNG bytes if request's 'Accept' header is 'image/png', otherwise JSON","content":{"application/json":{"schema":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/GeneratedImageResult"}},{"$ref":"#/components/schemas/AsyncJobResponse"}],"title":"Response Img Prompt V2 Generation Image Prompt Post"},"example":[{"base64":"...very long string...","seed":"1050625087","finish_reason":"SUCCESS"}]},"application/json async":{"example":{"job_id":1,"job_type":"Text to Image"}},"image/png":{"example":"PNG bytes, what did you expect?"}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/generation/query-job":{"get":{"summary":"Query Job","description":"Query async generation job","operationId":"query_job_v1_generation_query_job_get","parameters":[{"name":"job_id","in":"query","required":true,"schema":{"type":"string","title":"Job Id"}},{"name":"require_step_preivew","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Require Step Preivew"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsyncJobResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/generation/job-queue":{"get":{"summary":"Job Queue","description":"Query job queue info","operationId":"job_queue_v1_generation_job_queue_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobQueueInfo"}}}}}}},"/v1/generation/stop":{"post":{"summary":"Stop","description":"Job stoping","operationId":"stop_v1_generation_stop_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StopResponse"}}}}}}},"/v1/engines/all-models":{"get":{"summary":"All Models","description":"Get all filenames of base model and lora","operationId":"all_models_v1_engines_all_models_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AllModelNamesResponse"}}}}}}},"/v1/engines/refresh-models":{"post":{"summary":"Refresh Models","description":"Refresh local files and get all filenames of base model and lora","operationId":"refresh_models_v1_engines_refresh_models_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AllModelNamesResponse"}}}}}}},"/v1/engines/styles":{"get":{"summary":"All Styles","description":"Get all legal Fooocus styles","operationId":"all_styles_v1_engines_styles_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"type":"string"},"type":"array","title":"Response All Styles V1 Engines Styles Get"}}}}}}}},"components":{"schemas":{"AdvancedParams":{"properties":{"disable_preview":{"type":"boolean","title":"Disable Preview","description":"Disable preview during generation","default":false},"adm_scaler_positive":{"type":"number","maximum":3.0,"minimum":0.1,"title":"Adm Scaler Positive","description":"Positive ADM Guidance Scaler","default":1.5},"adm_scaler_negative":{"type":"number","maximum":3.0,"minimum":0.1,"title":"Adm Scaler Negative","description":"Negative ADM Guidance Scaler","default":0.8},"adm_scaler_end":{"type":"number","maximum":1.0,"minimum":0.0,"title":"Adm Scaler End","description":"ADM Guidance End At Step","default":0.3},"refiner_swap_method":{"type":"string","title":"Refiner Swap Method","description":"Refiner swap method","default":"joint"},"adaptive_cfg":{"type":"number","maximum":30.0,"minimum":1.0,"title":"Adaptive Cfg","description":"CFG Mimicking from TSNR","default":7.0},"sampler_name":{"type":"string","title":"Sampler Name","description":"Sampler","default":"dpmpp_2m_sde_gpu"},"scheduler_name":{"type":"string","title":"Scheduler Name","description":"Scheduler","default":"karras"},"overwrite_step":{"type":"integer","maximum":200.0,"minimum":-1.0,"title":"Overwrite Step","description":"Forced Overwrite of Sampling Step","default":-1},"overwrite_switch":{"type":"integer","maximum":200.0,"minimum":-1.0,"title":"Overwrite Switch","description":"Forced Overwrite of Refiner Switch Step","default":-1},"overwrite_width":{"type":"integer","maximum":2048.0,"minimum":-1.0,"title":"Overwrite Width","description":"Forced Overwrite of Generating Width","default":-1},"overwrite_height":{"type":"integer","maximum":2048.0,"minimum":-1.0,"title":"Overwrite Height","description":"Forced Overwrite of Generating Height","default":-1},"overwrite_vary_strength":{"type":"number","maximum":1.0,"minimum":-1.0,"title":"Overwrite Vary Strength","description":"Forced Overwrite of Denoising Strength of \"Vary\"","default":-1},"overwrite_upscale_strength":{"type":"number","maximum":1.0,"minimum":-1.0,"title":"Overwrite Upscale Strength","description":"Forced Overwrite of Denoising Strength of \"Upscale\"","default":-1},"mixing_image_prompt_and_vary_upscale":{"type":"boolean","title":"Mixing Image Prompt And Vary Upscale","description":"Mixing Image Prompt and Vary/Upscale","default":false},"mixing_image_prompt_and_inpaint":{"type":"boolean","title":"Mixing Image Prompt And Inpaint","description":"Mixing Image Prompt and Inpaint","default":false},"debugging_cn_preprocessor":{"type":"boolean","title":"Debugging Cn Preprocessor","description":"Debug Preprocessors","default":false},"skipping_cn_preprocessor":{"type":"boolean","title":"Skipping Cn Preprocessor","description":"Skip Preprocessors","default":false},"controlnet_softness":{"type":"number","maximum":1.0,"minimum":0.0,"title":"Controlnet Softness","description":"Softness of ControlNet","default":0.25},"canny_low_threshold":{"type":"integer","maximum":255.0,"minimum":1.0,"title":"Canny Low Threshold","description":"Canny Low Threshold","default":64},"canny_high_threshold":{"type":"integer","maximum":255.0,"minimum":1.0,"title":"Canny High Threshold","description":"Canny High Threshold","default":128},"freeu_enabled":{"type":"boolean","title":"Freeu Enabled","description":"FreeU enabled","default":false},"freeu_b1":{"type":"number","title":"Freeu B1","description":"FreeU B1","default":1.01},"freeu_b2":{"type":"number","title":"Freeu B2","description":"FreeU B2","default":1.02},"freeu_s1":{"type":"number","title":"Freeu S1","description":"FreeU B3","default":0.99},"freeu_s2":{"type":"number","title":"Freeu S2","description":"FreeU B4","default":0.95},"debugging_inpaint_preprocessor":{"type":"boolean","title":"Debugging Inpaint Preprocessor","description":"Debug Inpaint Preprocessing","default":false},"inpaint_disable_initial_latent":{"type":"boolean","title":"Inpaint Disable Initial Latent","description":"Disable initial latent in inpaint","default":false},"inpaint_engine":{"type":"string","title":"Inpaint Engine","description":"Inpaint Engine","default":"v1"},"inpaint_strength":{"type":"number","maximum":1.0,"minimum":0.0,"title":"Inpaint Strength","description":"Inpaint Denoising Strength","default":1.0},"inpaint_respective_field":{"type":"number","maximum":1.0,"minimum":0.0,"title":"Inpaint Respective Field","description":"Inpaint Respective Field","default":1.0}},"type":"object","title":"AdvancedParams"},"AllModelNamesResponse":{"properties":{"model_filenames":{"items":{"type":"string"},"type":"array","title":"Model Filenames","description":"All available model filenames"},"lora_filenames":{"items":{"type":"string"},"type":"array","title":"Lora Filenames","description":"All available lora filenames"}},"type":"object","required":["model_filenames","lora_filenames"],"title":"AllModelNamesResponse"},"AsyncJobResponse":{"properties":{"job_id":{"type":"string","title":"Job Id","description":"Job ID"},"job_type":{"allOf":[{"$ref":"#/components/schemas/TaskType"}],"description":"Job type"},"job_stage":{"allOf":[{"$ref":"#/components/schemas/AsyncJobStage"}],"description":"Job running stage"},"job_progress":{"type":"integer","title":"Job Progress","description":"Job running progress, 100 is for finished."},"job_status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Job Status","description":"Job running status in text"},"job_step_preview":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Job Step Preview","description":"Preview image of generation steps at current time, as base64 image"},"job_result":{"anyOf":[{"items":{"$ref":"#/components/schemas/GeneratedImageResult"},"type":"array"},{"type":"null"}],"title":"Job Result","description":"Job generation result"}},"type":"object","required":["job_id","job_type","job_stage","job_progress"],"title":"AsyncJobResponse"},"AsyncJobStage":{"type":"string","enum":["WAITING","RUNNING","SUCCESS","ERROR"],"title":"AsyncJobStage"},"Body_img_inpaint_or_outpaint_v1_generation_image_inpait_outpaint_post":{"properties":{"input_image":{"type":"string","format":"binary","title":"Input Image","description":"Init image for inpaint or outpaint"},"input_mask":{"type":"string","format":"binary","title":"Input Mask","description":"Inpaint or outpaint mask"},"inpaint_additional_prompt":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Inpaint Additional Prompt","description":"Describe what you want to inpaint"},"outpaint_selections":{"items":{"type":"string"},"type":"array","title":"Outpaint Selections","description":"Outpaint expansion selections, literal 'Left', 'Right', 'Top', 'Bottom' seperated by comma","default":[]},"outpaint_distance_left":{"type":"integer","title":"Outpaint Distance Left","description":"Set outpaint left distance, -1 for default","default":0},"outpaint_distance_right":{"type":"integer","title":"Outpaint Distance Right","description":"Set outpaint right distance, -1 for default","default":0},"outpaint_distance_top":{"type":"integer","title":"Outpaint Distance Top","description":"Set outpaint top distance, -1 for default","default":0},"outpaint_distance_bottom":{"type":"integer","title":"Outpaint Distance Bottom","description":"Set outpaint bottom distance, -1 for default","default":0},"prompt":{"type":"string","title":"Prompt","default":""},"negative_prompt":{"type":"string","title":"Negative Prompt","default":""},"style_selections":{"items":{"type":"string"},"type":"array","title":"Style Selections","description":"Fooocus style selections, seperated by comma","default":["Fooocus V2","Fooocus Enhance","Fooocus Sharp"]},"performance_selection":{"allOf":[{"$ref":"#/components/schemas/PerfomanceSelection"}],"default":"Speed"},"aspect_ratios_selection":{"type":"string","title":"Aspect Ratios Selection","default":"1152*896"},"image_number":{"type":"integer","maximum":32.0,"minimum":1.0,"title":"Image Number","description":"Image number","default":1},"image_seed":{"type":"integer","title":"Image Seed","description":"Seed to generate image, -1 for random","default":-1},"sharpness":{"type":"number","maximum":30.0,"minimum":0.0,"title":"Sharpness","default":2.0},"guidance_scale":{"type":"number","maximum":30.0,"minimum":1.0,"title":"Guidance Scale","default":4.0},"base_model_name":{"type":"string","title":"Base Model Name","default":"juggernautXL_version6Rundiffusion.safetensors"},"refiner_model_name":{"type":"string","title":"Refiner Model Name","default":"None"},"refiner_switch":{"type":"number","maximum":1.0,"minimum":0.1,"title":"Refiner Switch","description":"Refiner Switch At","default":0.5},"loras":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Loras","description":"Lora config in JSON. Format as [{\"model_name\": \"sd_xl_offset_example-lora_1.0.safetensors\", \"weight\": 0.5}]","default":"[{\"model_name\":\"sd_xl_offset_example-lora_1.0.safetensors\",\"weight\":0.1}]"},"advanced_params":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Advanced Params","description":"Advanced parameters in JSON"},"require_base64":{"type":"boolean","title":"Require Base64","description":"Return base64 data of generated image","default":false},"async_process":{"type":"boolean","title":"Async Process","description":"Set to true will run async and return job info for retrieve generataion result later","default":false}},"type":"object","required":["input_image"],"title":"Body_img_inpaint_or_outpaint_v1_generation_image_inpait_outpaint_post"},"Body_img_prompt_v1_generation_image_prompt_post":{"properties":{"cn_img1":{"type":"string","format":"binary","title":"Cn Img1","description":"Input image for image prompt"},"input_image":{"type":"string","format":"binary","title":"Input Image","description":"Init image for inpaint or outpaint"},"input_mask":{"type":"string","format":"binary","title":"Input Mask","description":"Inpaint or outpaint mask"},"inpaint_additional_prompt":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Inpaint Additional Prompt","description":"Describe what you want to inpaint"},"outpaint_selections":{"items":{"type":"string"},"type":"array","title":"Outpaint Selections","description":"Outpaint expansion selections, literal 'Left', 'Right', 'Top', 'Bottom' seperated by comma","default":[]},"outpaint_distance_left":{"type":"integer","title":"Outpaint Distance Left","description":"Set outpaint left distance, 0 for default","default":0},"outpaint_distance_right":{"type":"integer","title":"Outpaint Distance Right","description":"Set outpaint right distance, 0 for default","default":0},"outpaint_distance_top":{"type":"integer","title":"Outpaint Distance Top","description":"Set outpaint top distance, 0 for default","default":0},"outpaint_distance_bottom":{"type":"integer","title":"Outpaint Distance Bottom","description":"Set outpaint bottom distance, 0 for default","default":0},"cn_stop1":{"anyOf":[{"type":"number","maximum":1.0,"minimum":0.0},{"type":"null"}],"title":"Cn Stop1","description":"Stop at for image prompt, None for default value"},"cn_weight1":{"anyOf":[{"type":"number","maximum":2.0,"minimum":0.0},{"type":"null"}],"title":"Cn Weight1","description":"Weight for image prompt, None for default value"},"cn_type1":{"allOf":[{"$ref":"#/components/schemas/ControlNetType"}],"description":"ControlNet type for image prompt","default":"ImagePrompt"},"cn_img2":{"type":"string","format":"binary","title":"Cn Img2","description":"Input image for image prompt"},"cn_stop2":{"anyOf":[{"type":"number","maximum":1.0,"minimum":0.0},{"type":"null"}],"title":"Cn Stop2","description":"Stop at for image prompt, None for default value"},"cn_weight2":{"anyOf":[{"type":"number","maximum":2.0,"minimum":0.0},{"type":"null"}],"title":"Cn Weight2","description":"Weight for image prompt, None for default value"},"cn_type2":{"allOf":[{"$ref":"#/components/schemas/ControlNetType"}],"description":"ControlNet type for image prompt","default":"ImagePrompt"},"cn_img3":{"type":"string","format":"binary","title":"Cn Img3","description":"Input image for image prompt"},"cn_stop3":{"anyOf":[{"type":"number","maximum":1.0,"minimum":0.0},{"type":"null"}],"title":"Cn Stop3","description":"Stop at for image prompt, None for default value"},"cn_weight3":{"anyOf":[{"type":"number","maximum":2.0,"minimum":0.0},{"type":"null"}],"title":"Cn Weight3","description":"Weight for image prompt, None for default value"},"cn_type3":{"allOf":[{"$ref":"#/components/schemas/ControlNetType"}],"description":"ControlNet type for image prompt","default":"ImagePrompt"},"cn_img4":{"type":"string","format":"binary","title":"Cn Img4","description":"Input image for image prompt"},"cn_stop4":{"anyOf":[{"type":"number","maximum":1.0,"minimum":0.0},{"type":"null"}],"title":"Cn Stop4","description":"Stop at for image prompt, None for default value"},"cn_weight4":{"anyOf":[{"type":"number","maximum":2.0,"minimum":0.0},{"type":"null"}],"title":"Cn Weight4","description":"Weight for image prompt, None for default value"},"cn_type4":{"allOf":[{"$ref":"#/components/schemas/ControlNetType"}],"description":"ControlNet type for image prompt","default":"ImagePrompt"},"prompt":{"type":"string","title":"Prompt","default":""},"negative_prompt":{"type":"string","title":"Negative Prompt","default":""},"style_selections":{"items":{"type":"string"},"type":"array","title":"Style Selections","description":"Fooocus style selections, seperated by comma","default":["Fooocus V2","Fooocus Enhance","Fooocus Sharp"]},"performance_selection":{"allOf":[{"$ref":"#/components/schemas/PerfomanceSelection"}],"default":"Speed"},"aspect_ratios_selection":{"type":"string","title":"Aspect Ratios Selection","default":"1152*896"},"image_number":{"type":"integer","maximum":32.0,"minimum":1.0,"title":"Image Number","description":"Image number","default":1},"image_seed":{"type":"integer","title":"Image Seed","description":"Seed to generate image, -1 for random","default":-1},"sharpness":{"type":"number","maximum":30.0,"minimum":0.0,"title":"Sharpness","default":2.0},"guidance_scale":{"type":"number","maximum":30.0,"minimum":1.0,"title":"Guidance Scale","default":4.0},"base_model_name":{"type":"string","title":"Base Model Name","default":"juggernautXL_version6Rundiffusion.safetensors"},"refiner_model_name":{"type":"string","title":"Refiner Model Name","default":"None"},"refiner_switch":{"type":"number","maximum":1.0,"minimum":0.1,"title":"Refiner Switch","description":"Refiner Switch At","default":0.5},"loras":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Loras","description":"Lora config in JSON. Format as [{\"model_name\": \"sd_xl_offset_example-lora_1.0.safetensors\", \"weight\": 0.5}]","default":"[{\"model_name\":\"sd_xl_offset_example-lora_1.0.safetensors\",\"weight\":0.1}]"},"advanced_params":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Advanced Params","description":"Advanced parameters in JSON"},"require_base64":{"type":"boolean","title":"Require Base64","description":"Return base64 data of generated image","default":false},"async_process":{"type":"boolean","title":"Async Process","description":"Set to true will run async and return job info for retrieve generataion result later","default":false}},"type":"object","title":"Body_img_prompt_v1_generation_image_prompt_post"},"Body_img_upscale_or_vary_v1_generation_image_upscale_vary_post":{"properties":{"input_image":{"type":"string","format":"binary","title":"Input Image","description":"Init image for upsacale or outpaint"},"uov_method":{"$ref":"#/components/schemas/UpscaleOrVaryMethod"},"upscale_value":{"anyOf":[{"type":"number","maximum":5.0,"minimum":1.0},{"type":"null"}],"title":"Upscale Value","description":"Upscale custom value, None for default value"},"prompt":{"type":"string","title":"Prompt","default":""},"negative_prompt":{"type":"string","title":"Negative Prompt","default":""},"style_selections":{"items":{"type":"string"},"type":"array","title":"Style Selections","description":"Fooocus style selections, seperated by comma","default":["Fooocus V2","Fooocus Enhance","Fooocus Sharp"]},"performance_selection":{"allOf":[{"$ref":"#/components/schemas/PerfomanceSelection"}],"default":"Speed"},"aspect_ratios_selection":{"type":"string","title":"Aspect Ratios Selection","default":"1152*896"},"image_number":{"type":"integer","maximum":32.0,"minimum":1.0,"title":"Image Number","description":"Image number","default":1},"image_seed":{"type":"integer","title":"Image Seed","description":"Seed to generate image, -1 for random","default":-1},"sharpness":{"type":"number","maximum":30.0,"minimum":0.0,"title":"Sharpness","default":2.0},"guidance_scale":{"type":"number","maximum":30.0,"minimum":1.0,"title":"Guidance Scale","default":4.0},"base_model_name":{"type":"string","title":"Base Model Name","default":"juggernautXL_version6Rundiffusion.safetensors"},"refiner_model_name":{"type":"string","title":"Refiner Model Name","default":"None"},"refiner_switch":{"type":"number","maximum":1.0,"minimum":0.1,"title":"Refiner Switch","description":"Refiner Switch At","default":0.5},"loras":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Loras","description":"Lora config in JSON. Format as [{\"model_name\": \"sd_xl_offset_example-lora_1.0.safetensors\", \"weight\": 0.5}]","default":"[{\"model_name\":\"sd_xl_offset_example-lora_1.0.safetensors\",\"weight\":0.1}]"},"advanced_params":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Advanced Params","description":"Advanced parameters in JSON"},"require_base64":{"type":"boolean","title":"Require Base64","description":"Return base64 data of generated image","default":false},"async_process":{"type":"boolean","title":"Async Process","description":"Set to true will run async and return job info for retrieve generataion result later","default":false}},"type":"object","required":["input_image","uov_method"],"title":"Body_img_upscale_or_vary_v1_generation_image_upscale_vary_post"},"ControlNetType":{"type":"string","enum":["ImagePrompt","FaceSwap","PyraCanny","CPDS"],"title":"ControlNetType"},"GeneratedImageResult":{"properties":{"base64":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Base64","description":"Image encoded in base64, or null if finishReasen is not 'SUCCESS', only return when request require base64"},"url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Url","description":"Image file static serve url, or null if finishReasen is not 'SUCCESS'"},"seed":{"type":"string","title":"Seed","description":"The seed associated with this image"},"finish_reason":{"$ref":"#/components/schemas/GenerationFinishReason"}},"type":"object","required":["base64","url","seed","finish_reason"],"title":"GeneratedImageResult"},"GenerationFinishReason":{"type":"string","enum":["SUCCESS","QUEUE_IS_FULL","USER_CANCEL","ERROR"],"title":"GenerationFinishReason"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"ImagePrompt":{"properties":{"cn_img":{"anyOf":[{"type":"string","format":"binary"},{"type":"null"}],"title":"Cn Img"},"cn_stop":{"anyOf":[{"type":"number","maximum":1.0,"minimum":0.0},{"type":"null"}],"title":"Cn Stop"},"cn_weight":{"anyOf":[{"type":"number","maximum":2.0,"minimum":0.0},{"type":"null"}],"title":"Cn Weight","description":"None for default value"},"cn_type":{"allOf":[{"$ref":"#/components/schemas/ControlNetType"}],"default":"ImagePrompt"}},"type":"object","title":"ImagePrompt"},"ImagePromptJson":{"properties":{"cn_img":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cn Img","description":"Input image for image prompt as base64"},"cn_stop":{"anyOf":[{"type":"number","maximum":1.0,"minimum":0.0},{"type":"null"}],"title":"Cn Stop","description":"Stop at for image prompt, 0 for default value","default":0},"cn_weight":{"anyOf":[{"type":"number","maximum":2.0,"minimum":0.0},{"type":"null"}],"title":"Cn Weight","description":"Weight for image prompt, 0 for default value","default":0},"cn_type":{"allOf":[{"$ref":"#/components/schemas/ControlNetType"}],"description":"ControlNet type for image prompt","default":"ImagePrompt"}},"type":"object","title":"ImagePromptJson"},"ImgInpaintOrOutpaintRequestJson":{"properties":{"prompt":{"type":"string","title":"Prompt","default":""},"negative_prompt":{"type":"string","title":"Negative Prompt","default":""},"style_selections":{"items":{"type":"string"},"type":"array","title":"Style Selections","default":["Fooocus V2","Fooocus Enhance","Fooocus Sharp"]},"performance_selection":{"allOf":[{"$ref":"#/components/schemas/PerfomanceSelection"}],"default":"Speed"},"aspect_ratios_selection":{"type":"string","title":"Aspect Ratios Selection","default":"1152*896"},"image_number":{"type":"integer","maximum":32.0,"minimum":1.0,"title":"Image Number","description":"Image number","default":1},"image_seed":{"type":"integer","title":"Image Seed","description":"Seed to generate image, -1 for random","default":-1},"sharpness":{"type":"number","maximum":30.0,"minimum":0.0,"title":"Sharpness","default":2.0},"guidance_scale":{"type":"number","maximum":30.0,"minimum":1.0,"title":"Guidance Scale","default":4.0},"base_model_name":{"type":"string","title":"Base Model Name","default":"juggernautXL_version6Rundiffusion.safetensors"},"refiner_model_name":{"type":"string","title":"Refiner Model Name","default":"None"},"refiner_switch":{"type":"number","maximum":1.0,"minimum":0.1,"title":"Refiner Switch","description":"Refiner Switch At","default":0.5},"loras":{"items":{"$ref":"#/components/schemas/Lora"},"type":"array","title":"Loras","default":[{"model_name":"sd_xl_offset_example-lora_1.0.safetensors","weight":0.1}]},"advanced_params":{"anyOf":[{"$ref":"#/components/schemas/AdvancedParams"},{"type":"null"}],"default":{"adaptive_cfg":7.0,"adm_scaler_end":0.3,"adm_scaler_negative":0.8,"adm_scaler_positive":1.5,"canny_high_threshold":128,"canny_low_threshold":64,"controlnet_softness":0.25,"debugging_cn_preprocessor":false,"debugging_inpaint_preprocessor":false,"disable_preview":false,"freeu_b1":1.01,"freeu_b2":1.02,"freeu_enabled":false,"freeu_s1":0.99,"freeu_s2":0.95,"inpaint_disable_initial_latent":false,"inpaint_engine":"v1","inpaint_respective_field":1.0,"inpaint_strength":1.0,"mixing_image_prompt_and_inpaint":false,"mixing_image_prompt_and_vary_upscale":false,"overwrite_height":-1,"overwrite_step":-1,"overwrite_switch":-1,"overwrite_upscale_strength":-1.0,"overwrite_vary_strength":-1.0,"overwrite_width":-1,"refiner_swap_method":"joint","sampler_name":"dpmpp_2m_sde_gpu","scheduler_name":"karras","skipping_cn_preprocessor":false}},"require_base64":{"type":"boolean","title":"Require Base64","description":"Return base64 data of generated image","default":false},"async_process":{"type":"boolean","title":"Async Process","description":"Set to true will run async and return job info for retrieve generataion result later","default":false},"input_image":{"type":"string","title":"Input Image","description":"Init image for inpaint or outpaint as base64"},"input_mask":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Input Mask","description":"Inpaint or outpaint mask as base64","default":""},"inpaint_additional_prompt":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Inpaint Additional Prompt","description":"Describe what you want to inpaint","default":""},"outpaint_selections":{"items":{"$ref":"#/components/schemas/OutpaintExpansion"},"type":"array","title":"Outpaint Selections","default":[]},"outpaint_distance_left":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Outpaint Distance Left","description":"Set outpaint left distance","default":-1},"outpaint_distance_right":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Outpaint Distance Right","description":"Set outpaint right distance","default":-1},"outpaint_distance_top":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Outpaint Distance Top","description":"Set outpaint top distance","default":-1},"outpaint_distance_bottom":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Outpaint Distance Bottom","description":"Set outpaint bottom distance","default":-1}},"type":"object","required":["input_image"],"title":"ImgInpaintOrOutpaintRequestJson"},"ImgPromptRequestJson":{"properties":{"prompt":{"type":"string","title":"Prompt","default":""},"negative_prompt":{"type":"string","title":"Negative Prompt","default":""},"style_selections":{"items":{"type":"string"},"type":"array","title":"Style Selections","default":["Fooocus V2","Fooocus Enhance","Fooocus Sharp"]},"performance_selection":{"allOf":[{"$ref":"#/components/schemas/PerfomanceSelection"}],"default":"Speed"},"aspect_ratios_selection":{"type":"string","title":"Aspect Ratios Selection","default":"1152*896"},"image_number":{"type":"integer","maximum":32.0,"minimum":1.0,"title":"Image Number","description":"Image number","default":1},"image_seed":{"type":"integer","title":"Image Seed","description":"Seed to generate image, -1 for random","default":-1},"sharpness":{"type":"number","maximum":30.0,"minimum":0.0,"title":"Sharpness","default":2.0},"guidance_scale":{"type":"number","maximum":30.0,"minimum":1.0,"title":"Guidance Scale","default":4.0},"base_model_name":{"type":"string","title":"Base Model Name","default":"juggernautXL_version6Rundiffusion.safetensors"},"refiner_model_name":{"type":"string","title":"Refiner Model Name","default":"None"},"refiner_switch":{"type":"number","maximum":1.0,"minimum":0.1,"title":"Refiner Switch","description":"Refiner Switch At","default":0.5},"loras":{"items":{"$ref":"#/components/schemas/Lora"},"type":"array","title":"Loras","default":[{"model_name":"sd_xl_offset_example-lora_1.0.safetensors","weight":0.1}]},"advanced_params":{"anyOf":[{"$ref":"#/components/schemas/AdvancedParams"},{"type":"null"}],"default":{"adaptive_cfg":7.0,"adm_scaler_end":0.3,"adm_scaler_negative":0.8,"adm_scaler_positive":1.5,"canny_high_threshold":128,"canny_low_threshold":64,"controlnet_softness":0.25,"debugging_cn_preprocessor":false,"debugging_inpaint_preprocessor":false,"disable_preview":false,"freeu_b1":1.01,"freeu_b2":1.02,"freeu_enabled":false,"freeu_s1":0.99,"freeu_s2":0.95,"inpaint_disable_initial_latent":false,"inpaint_engine":"v1","inpaint_respective_field":1.0,"inpaint_strength":1.0,"mixing_image_prompt_and_inpaint":false,"mixing_image_prompt_and_vary_upscale":false,"overwrite_height":-1,"overwrite_step":-1,"overwrite_switch":-1,"overwrite_upscale_strength":-1.0,"overwrite_vary_strength":-1.0,"overwrite_width":-1,"refiner_swap_method":"joint","sampler_name":"dpmpp_2m_sde_gpu","scheduler_name":"karras","skipping_cn_preprocessor":false}},"require_base64":{"type":"boolean","title":"Require Base64","description":"Return base64 data of generated image","default":false},"async_process":{"type":"boolean","title":"Async Process","description":"Set to true will run async and return job info for retrieve generataion result later","default":false},"input_image":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Input Image","description":"Init image for inpaint or outpaint as base64"},"input_mask":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Input Mask","description":"Inpaint or outpaint mask as base64","default":""},"inpaint_additional_prompt":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Inpaint Additional Prompt","description":"Describe what you want to inpaint","default":""},"outpaint_selections":{"items":{"$ref":"#/components/schemas/OutpaintExpansion"},"type":"array","title":"Outpaint Selections","default":[]},"outpaint_distance_left":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Outpaint Distance Left","description":"Set outpaint left distance","default":-1},"outpaint_distance_right":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Outpaint Distance Right","description":"Set outpaint right distance","default":-1},"outpaint_distance_top":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Outpaint Distance Top","description":"Set outpaint top distance","default":-1},"outpaint_distance_bottom":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Outpaint Distance Bottom","description":"Set outpaint bottom distance","default":-1},"image_prompts":{"items":{"anyOf":[{"$ref":"#/components/schemas/ImagePromptJson"},{"$ref":"#/components/schemas/ImagePrompt"}]},"type":"array","title":"Image Prompts"}},"type":"object","required":["image_prompts"],"title":"ImgPromptRequestJson"},"ImgUpscaleOrVaryRequestJson":{"properties":{"prompt":{"type":"string","title":"Prompt","default":""},"negative_prompt":{"type":"string","title":"Negative Prompt","default":""},"style_selections":{"items":{"type":"string"},"type":"array","title":"Style Selections","default":["Fooocus V2","Fooocus Enhance","Fooocus Sharp"]},"performance_selection":{"allOf":[{"$ref":"#/components/schemas/PerfomanceSelection"}],"default":"Speed"},"aspect_ratios_selection":{"type":"string","title":"Aspect Ratios Selection","default":"1152*896"},"image_number":{"type":"integer","maximum":32.0,"minimum":1.0,"title":"Image Number","description":"Image number","default":1},"image_seed":{"type":"integer","title":"Image Seed","description":"Seed to generate image, -1 for random","default":-1},"sharpness":{"type":"number","maximum":30.0,"minimum":0.0,"title":"Sharpness","default":2.0},"guidance_scale":{"type":"number","maximum":30.0,"minimum":1.0,"title":"Guidance Scale","default":4.0},"base_model_name":{"type":"string","title":"Base Model Name","default":"juggernautXL_version6Rundiffusion.safetensors"},"refiner_model_name":{"type":"string","title":"Refiner Model Name","default":"None"},"refiner_switch":{"type":"number","maximum":1.0,"minimum":0.1,"title":"Refiner Switch","description":"Refiner Switch At","default":0.5},"loras":{"items":{"$ref":"#/components/schemas/Lora"},"type":"array","title":"Loras","default":[{"model_name":"sd_xl_offset_example-lora_1.0.safetensors","weight":0.1}]},"advanced_params":{"anyOf":[{"$ref":"#/components/schemas/AdvancedParams"},{"type":"null"}],"default":{"adaptive_cfg":7.0,"adm_scaler_end":0.3,"adm_scaler_negative":0.8,"adm_scaler_positive":1.5,"canny_high_threshold":128,"canny_low_threshold":64,"controlnet_softness":0.25,"debugging_cn_preprocessor":false,"debugging_inpaint_preprocessor":false,"disable_preview":false,"freeu_b1":1.01,"freeu_b2":1.02,"freeu_enabled":false,"freeu_s1":0.99,"freeu_s2":0.95,"inpaint_disable_initial_latent":false,"inpaint_engine":"v1","inpaint_respective_field":1.0,"inpaint_strength":1.0,"mixing_image_prompt_and_inpaint":false,"mixing_image_prompt_and_vary_upscale":false,"overwrite_height":-1,"overwrite_step":-1,"overwrite_switch":-1,"overwrite_upscale_strength":-1.0,"overwrite_vary_strength":-1.0,"overwrite_width":-1,"refiner_swap_method":"joint","sampler_name":"dpmpp_2m_sde_gpu","scheduler_name":"karras","skipping_cn_preprocessor":false}},"require_base64":{"type":"boolean","title":"Require Base64","description":"Return base64 data of generated image","default":false},"async_process":{"type":"boolean","title":"Async Process","description":"Set to true will run async and return job info for retrieve generataion result later","default":false},"uov_method":{"allOf":[{"$ref":"#/components/schemas/UpscaleOrVaryMethod"}],"default":"Upscale (2x)"},"upscale_value":{"anyOf":[{"type":"number","maximum":5.0,"minimum":1.0},{"type":"null"}],"title":"Upscale Value","description":"Upscale custom value, 1.0 for default value","default":1.0},"input_image":{"type":"string","title":"Input Image","description":"Init image for upsacale or outpaint as base64"}},"type":"object","required":["input_image"],"title":"ImgUpscaleOrVaryRequestJson"},"JobQueueInfo":{"properties":{"running_size":{"type":"integer","title":"Running Size","description":"The current running and waiting job count"},"finished_size":{"type":"integer","title":"Finished Size","description":"Finished job cound (after auto clean)"},"last_job_id":{"type":"string","title":"Last Job Id","description":"Last submit generation job id"}},"type":"object","required":["running_size","finished_size","last_job_id"],"title":"JobQueueInfo"},"Lora":{"properties":{"model_name":{"type":"string","title":"Model Name"},"weight":{"type":"number","maximum":2.0,"minimum":-2.0,"title":"Weight","default":0.5}},"type":"object","required":["model_name"],"title":"Lora"},"OutpaintExpansion":{"type":"string","enum":["Left","Right","Top","Bottom"],"title":"OutpaintExpansion"},"PerfomanceSelection":{"type":"string","enum":["Speed","Quality","Extreme Speed"],"title":"PerfomanceSelection"},"StopResponse":{"properties":{"msg":{"type":"string","title":"Msg"}},"type":"object","required":["msg"],"title":"StopResponse"},"TaskType":{"type":"string","enum":["Text to Image","Image Upscale or Variation","Image Inpaint or Outpaint","Image Prompt"],"title":"TaskType"},"Text2ImgRequest":{"properties":{"prompt":{"type":"string","title":"Prompt","default":""},"negative_prompt":{"type":"string","title":"Negative Prompt","default":""},"style_selections":{"items":{"type":"string"},"type":"array","title":"Style Selections","default":["Fooocus V2","Fooocus Enhance","Fooocus Sharp"]},"performance_selection":{"allOf":[{"$ref":"#/components/schemas/PerfomanceSelection"}],"default":"Speed"},"aspect_ratios_selection":{"type":"string","title":"Aspect Ratios Selection","default":"1152*896"},"image_number":{"type":"integer","maximum":32.0,"minimum":1.0,"title":"Image Number","description":"Image number","default":1},"image_seed":{"type":"integer","title":"Image Seed","description":"Seed to generate image, -1 for random","default":-1},"sharpness":{"type":"number","maximum":30.0,"minimum":0.0,"title":"Sharpness","default":2.0},"guidance_scale":{"type":"number","maximum":30.0,"minimum":1.0,"title":"Guidance Scale","default":4.0},"base_model_name":{"type":"string","title":"Base Model Name","default":"juggernautXL_version6Rundiffusion.safetensors"},"refiner_model_name":{"type":"string","title":"Refiner Model Name","default":"None"},"refiner_switch":{"type":"number","maximum":1.0,"minimum":0.1,"title":"Refiner Switch","description":"Refiner Switch At","default":0.5},"loras":{"items":{"$ref":"#/components/schemas/Lora"},"type":"array","title":"Loras","default":[{"model_name":"sd_xl_offset_example-lora_1.0.safetensors","weight":0.1}]},"advanced_params":{"anyOf":[{"$ref":"#/components/schemas/AdvancedParams"},{"type":"null"}],"default":{"adaptive_cfg":7.0,"adm_scaler_end":0.3,"adm_scaler_negative":0.8,"adm_scaler_positive":1.5,"canny_high_threshold":128,"canny_low_threshold":64,"controlnet_softness":0.25,"debugging_cn_preprocessor":false,"debugging_inpaint_preprocessor":false,"disable_preview":false,"freeu_b1":1.01,"freeu_b2":1.02,"freeu_enabled":false,"freeu_s1":0.99,"freeu_s2":0.95,"inpaint_disable_initial_latent":false,"inpaint_engine":"v1","inpaint_respective_field":1.0,"inpaint_strength":1.0,"mixing_image_prompt_and_inpaint":false,"mixing_image_prompt_and_vary_upscale":false,"overwrite_height":-1,"overwrite_step":-1,"overwrite_switch":-1,"overwrite_upscale_strength":-1.0,"overwrite_vary_strength":-1.0,"overwrite_width":-1,"refiner_swap_method":"joint","sampler_name":"dpmpp_2m_sde_gpu","scheduler_name":"karras","skipping_cn_preprocessor":false}},"require_base64":{"type":"boolean","title":"Require Base64","description":"Return base64 data of generated image","default":false},"async_process":{"type":"boolean","title":"Async Process","description":"Set to true will run async and return job info for retrieve generataion result later","default":false}},"type":"object","title":"Text2ImgRequest"},"UpscaleOrVaryMethod":{"type":"string","enum":["Vary (Subtle)","Vary (Strong)","Upscale (1.5x)","Upscale (2x)","Upscale (Fast 2x)","Upscale (Custom)"],"title":"UpscaleOrVaryMethod"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}}}} \ No newline at end of file diff --git a/examples/examples.py b/examples/examples.py index e59001c..53d9d0c 100644 --- a/examples/examples.py +++ b/examples/examples.py @@ -24,194 +24,18 @@ class Config(): cfg = Config() upscale_params = { - "prompt": "", - "negative_prompt": "", - "style_selections": [ - "Fooocus V2", - "Fooocus Enhance", - "Fooocus Sharp" - ], - "performance_selection": "Speed", - "aspect_ratios_selection": "1152*896", - "image_number": 1, - "image_seed": -1, - "sharpness": 2, - "guidance_scale": 4, - "base_model_name": "juggernautXL_version6Rundiffusion.safetensors", - "refiner_model_name": "None", - "refiner_switch": 0.5, - "loras": [ - { - "model_name": "sd_xl_offset_example-lora_1.0.safetensors", - "weight": 0.1 - } - ], - "advanced_params": { - "disable_preview": False, - "adm_scaler_positive": 1.5, - "adm_scaler_negative": 0.8, - "adm_scaler_end": 0.3, - "refiner_swap_method": "joint", - "adaptive_cfg": 7, - "sampler_name": "dpmpp_2m_sde_gpu", - "scheduler_name": "karras", - "overwrite_step": -1, - "overwrite_switch": -1, - "overwrite_width": -1, - "overwrite_height": -1, - "overwrite_vary_strength": -1, - "overwrite_upscale_strength": -1, - "mixing_image_prompt_and_vary_upscale": False, - "mixing_image_prompt_and_inpaint": False, - "debugging_cn_preprocessor": False, - "skipping_cn_preprocessor": False, - "controlnet_softness": 0.25, - "canny_low_threshold": 64, - "canny_high_threshold": 128, - "freeu_enabled": False, - "freeu_b1": 1.01, - "freeu_b2": 1.02, - "freeu_s1": 0.99, - "freeu_s2": 0.95, - "debugging_inpaint_preprocessor": False, - "inpaint_disable_initial_latent": False, - "inpaint_engine": inpaint_engine, - "inpaint_strength": 1, - "inpaint_respective_field": 1 - }, - "require_base64": False, - "async_process": False, "uov_method": "Upscale (Custom)", "upscale_value": 3, "input_image": "" } inpaint_params = { - "prompt": "", - "negative_prompt": "", - "style_selections": [ - "Fooocus V2", - "Fooocus Enhance", - "Fooocus Sharp" - ], - "performance_selection": "Speed", - "aspect_ratios_selection": "1152*896", - "image_number": 1, - "image_seed": -1, - "sharpness": 2, - "guidance_scale": 4, - "base_model_name": "juggernautXL_version6Rundiffusion.safetensors", - "refiner_model_name": "None", - "refiner_switch": 0.5, - "loras": [ - { - "model_name": "sd_xl_offset_example-lora_1.0.safetensors", - "weight": 0.1 - } - ], - "advanced_params": { - "disable_preview": False, - "adm_scaler_positive": 1.5, - "adm_scaler_negative": 0.8, - "adm_scaler_end": 0.3, - "refiner_swap_method": "joint", - "adaptive_cfg": 7, - "sampler_name": "dpmpp_2m_sde_gpu", - "scheduler_name": "karras", - "overwrite_step": -1, - "overwrite_switch": -1, - "overwrite_width": -1, - "overwrite_height": -1, - "overwrite_vary_strength": -1, - "overwrite_upscale_strength": -1, - "mixing_image_prompt_and_vary_upscale": False, - "mixing_image_prompt_and_inpaint": False, - "debugging_cn_preprocessor": False, - "skipping_cn_preprocessor": False, - "controlnet_softness": 0.25, - "canny_low_threshold": 64, - "canny_high_threshold": 128, - "freeu_enabled": False, - "freeu_b1": 1.01, - "freeu_b2": 1.02, - "freeu_s1": 0.99, - "freeu_s2": 0.95, - "debugging_inpaint_preprocessor": False, - "inpaint_disable_initial_latent": False, - "inpaint_engine": inpaint_engine, - "inpaint_strength": 1, - "inpaint_respective_field": 1 - }, - "require_base64": False, - "async_process": False, "input_image": "", "input_mask": None, "inpaint_additional_prompt": None, - "outpaint_selections": [], - "outpaint_distance_left": 0, - "outpaint_distance_right": 0, - "outpaint_distance_top": 0, - "outpaint_distance_bottom": 0, } img_prompt_params = { - "prompt": "", - "negative_prompt": "", - "style_selections": [ - "Fooocus V2", - "Fooocus Enhance", - "Fooocus Sharp" - ], - "performance_selection": "Speed", - "aspect_ratios_selection": "1152*896", - "image_number": 1, - "image_seed": -1, - "sharpness": 2, - "guidance_scale": 4, - "base_model_name": "juggernautXL_version6Rundiffusion.safetensors", - "refiner_model_name": "None", - "refiner_switch": 0.5, - "loras": [ - { - "model_name": "sd_xl_offset_example-lora_1.0.safetensors", - "weight": 0.1 - } - ], - "advanced_params": { - "disable_preview": False, - "adm_scaler_positive": 1.5, - "adm_scaler_negative": 0.8, - "adm_scaler_end": 0.3, - "refiner_swap_method": "joint", - "adaptive_cfg": 7, - "sampler_name": "dpmpp_2m_sde_gpu", - "scheduler_name": "karras", - "overwrite_step": -1, - "overwrite_switch": -1, - "overwrite_width": -1, - "overwrite_height": -1, - "overwrite_vary_strength": -1, - "overwrite_upscale_strength": -1, - "mixing_image_prompt_and_vary_upscale": False, - "mixing_image_prompt_and_inpaint": False, - "debugging_cn_preprocessor": False, - "skipping_cn_preprocessor": False, - "controlnet_softness": 0.25, - "canny_low_threshold": 64, - "canny_high_threshold": 128, - "freeu_enabled": False, - "freeu_b1": 1.01, - "freeu_b2": 1.02, - "freeu_s1": 0.99, - "freeu_s2": 0.95, - "debugging_inpaint_preprocessor": False, - "inpaint_disable_initial_latent": False, - "inpaint_engine": inpaint_engine, - "inpaint_strength": 1, - "inpaint_respective_field": 1 - }, - "require_base64": False, - "async_process": False, "image_prompts": [] } @@ -221,7 +45,7 @@ class Config(): imgs_base_path = os.path.join(os.path.dirname(__file__), 'imgs') -with open(os.path.join(imgs_base_path, "1485005453352708.jpeg"), "rb") as f: +with open(os.path.join(imgs_base_path, "bear.jpg"), "rb") as f: img1 = f.read() image_base64 = base64.b64encode(img1).decode('utf-8') f.close() @@ -268,7 +92,6 @@ def image_prompt(img_prompt: list, params: dict) -> dict: """ Image Prompt """ - params["prompt"] = "cat" params["image_prompts"] = img_prompt data = json.dumps(params) response = requests.post(url=f"{cfg.fooocus_host}{cfg.img_prompt}", @@ -277,6 +100,21 @@ def image_prompt(img_prompt: list, params: dict) -> dict: timeout=300) return response.json() +def image_prompt_with_inpaint(img_prompt: list, input_image: str, input_mask: str, params: dict) -> dict: + """ + Image Prompt + """ + params["image_prompts"] = img_prompt + params["input_image"] = input_image + params["input_mask"] = input_mask + params["outpaint_selections"] = ["Left", "Right"] + data = json.dumps(params) + response = requests.post(url=f"{cfg.fooocus_host}{cfg.img_prompt}", + data=data, + headers=headers, + timeout=300) + return response.json() + img_prompt = [ { @@ -284,13 +122,9 @@ def image_prompt(img_prompt: list, params: dict) -> dict: "cn_stop": 0.6, "cn_weight": 0.6, "cn_type": "ImagePrompt" - },{ - "cn_img": s_base64, - "cn_stop": 0.6, - "cn_weight": 0.6, - "cn_type": "ImagePrompt" } ] -print(upscale_vary(image=image_base64)) +# print(upscale_vary(image=image_base64)) # print(inpaint_outpaint(input_image=s_base64, input_mask=m_base64)) # print(image_prompt(img_prompt=img_prompt, params=img_prompt_params)) +print(image_prompt_with_inpaint(img_prompt=img_prompt, input_image=s_base64, input_mask=m_base64, params=img_prompt_params)) \ No newline at end of file diff --git a/examples/examples_v1.py b/examples/examples_v1.py index 5a4fa69..960a0fc 100644 --- a/examples/examples_v1.py +++ b/examples/examples_v1.py @@ -2,6 +2,7 @@ import requests import os import base64 +from examples.models import ControlNetEnum, ImagePromptParams, ImagePromptParamsJson, ImgInpaintOrOutpaintParams, ImgInpaintOrOutpaintParamsJson, ImgUpscaleOrVaryParams, ImgUpscaleOrVaryParamsJson, Text2ImgParams, UpscaleOrVaryMethod from models import * @@ -24,9 +25,9 @@ def txt2img(params: Text2ImgParams) -> dict: """ text to image """ - date = json.dumps(params.model_dump()) + data = json.dumps(params.model_dump()) response = requests.post(url=f"{cfg.fooocus_host}{cfg.text2img}", - data=date, + data=data, timeout=30) return response.json() @@ -111,7 +112,7 @@ def image_prompt_v2(params: ImagePromptParamsJson = ImagePromptParamsJson()) -> if __name__ == '__main__': imgs_base_path = os.path.join(os.path.dirname(__file__), 'imgs') - input_image = open(os.path.join(imgs_base_path,'1485005453352708.jpeg'), 'rb').read() + input_image = open(os.path.join(imgs_base_path,'bear.jpg'), 'rb').read() input_source = open(os.path.join(imgs_base_path,'s.jpg'), 'rb').read() input_mask = open(os.path.join(imgs_base_path,'m.png'), 'rb').read() diff --git a/examples/imgs/1485005453352708.jpeg b/examples/imgs/1485005453352708.jpeg deleted file mode 100644 index a123861..0000000 Binary files a/examples/imgs/1485005453352708.jpeg and /dev/null differ diff --git a/examples/imgs/bear.jpg b/examples/imgs/bear.jpg new file mode 100644 index 0000000..b9fa8b2 Binary files /dev/null and b/examples/imgs/bear.jpg differ diff --git a/fooocusapi/api.py b/fooocusapi/api.py index 49fc559..8b15a79 100644 --- a/fooocusapi/api.py +++ b/fooocusapi/api.py @@ -61,10 +61,10 @@ def call_worker(req: Text2ImgRequest, accept: str): task_type = TaskType.text_2_img if isinstance(req, ImgUpscaleOrVaryRequest) or isinstance(req, ImgUpscaleOrVaryRequestJson): task_type = TaskType.img_uov - elif isinstance(req, ImgInpaintOrOutpaintRequest) or isinstance(req, ImgInpaintOrOutpaintRequestJson): - task_type = TaskType.img_inpaint_outpaint elif isinstance(req, ImgPromptRequest) or isinstance(req, ImgPromptRequestJson): task_type = TaskType.img_prompt + elif isinstance(req, ImgInpaintOrOutpaintRequest) or isinstance(req, ImgInpaintOrOutpaintRequestJson): + task_type = TaskType.img_inpaint_outpaint params = req_to_params(req) queue_task = task_queue.add_task( @@ -217,6 +217,11 @@ def img_prompt(req: ImgPromptRequestJson, else: streaming_output = False + if req.input_image is not None: + req.input_image = base64_to_stream(req.input_image) + if req.input_mask is not None: + req.input_mask = base64_to_stream(req.input_mask) + default_image_promt = ImagePrompt(cn_img=None) image_prompts_files: List[ImagePrompt] = [] for img_prompt in req.image_prompts: diff --git a/fooocusapi/api_utils.py b/fooocusapi/api_utils.py index f2acfd0..2768d20 100644 --- a/fooocusapi/api_utils.py +++ b/fooocusapi/api_utils.py @@ -79,12 +79,16 @@ def req_to_params(req: Text2ImgRequest) -> ImageGenerationParams: image_prompts = [] if isinstance(req, ImgPromptRequest) or isinstance(req, ImgPromptRequestJson): + # Auto set mixing_image_prompt_and_inpaint to True + if len(req.image_prompts) > 0 and req.input_image is not None and req.advanced_params is not None: + req.advanced_params.mixing_image_prompt_and_inpaint = True + for img_prompt in req.image_prompts: if img_prompt.cn_img is not None: cn_img = read_input_image(img_prompt.cn_img) - if img_prompt.cn_stop is None: + if img_prompt.cn_stop is None or img_prompt.cn_stop == 0: img_prompt.cn_stop = flags.default_parameters[img_prompt.cn_type.value][0] - if img_prompt.cn_weight is None: + if img_prompt.cn_weight is None or img_prompt.cn_weight == 0: img_prompt.cn_weight = flags.default_parameters[img_prompt.cn_type.value][1] image_prompts.append( (cn_img, img_prompt.cn_stop, img_prompt.cn_weight, img_prompt.cn_type.value)) diff --git a/fooocusapi/img_utils.py b/fooocusapi/img_utils.py index 3543b2d..abf2e9c 100644 --- a/fooocusapi/img_utils.py +++ b/fooocusapi/img_utils.py @@ -35,7 +35,9 @@ def read_input_image(input_image: UploadFile) -> np.ndarray: image = np.array(pil_image) return image -def base64_to_stream(image: str) -> UploadFile: +def base64_to_stream(image: str) -> UploadFile | None: + if image == '': + return None if image.startswith('data:image'): image = image.split(sep=',', maxsplit=1)[1] image_bytes = base64.b64decode(image) diff --git a/fooocusapi/models.py b/fooocusapi/models.py index 316da77..dd1f0f3 100644 --- a/fooocusapi/models.py +++ b/fooocusapi/models.py @@ -4,16 +4,14 @@ from fastapi.params import File from fastapi.exceptions import RequestValidationError -from pydantic import BaseModel, ConfigDict, Field, TypeAdapter, ValidationError, parse_obj_as +from pydantic import BaseModel, ConfigDict, Field, TypeAdapter, ValidationError from pydantic_core import InitErrorDetails from typing import List from enum import Enum from fooocusapi.parameters import GenerationFinishReason, defualt_styles, default_base_model_name, default_refiner_model_name, default_refiner_switch, default_loras, default_cfg_scale, default_prompt_negative, default_aspect_ratio, default_sampler, default_scheduler -from fooocusapi.task_queue import QueueTask, TaskType - -from modules import flags +from fooocusapi.task_queue import TaskType class Lora(BaseModel): model_name: str @@ -196,10 +194,10 @@ def as_form(cls, input_image: UploadFile = Form(description="Init image for inpa outpaint_selections: List[str] = Form( [], description="Outpaint expansion selections, literal 'Left', 'Right', 'Top', 'Bottom' seperated by comma"), - outpaint_distance_left: int = Form(default=0, description="Set outpaint left distance, 0 for default"), - outpaint_distance_right: int = Form(default=0, description="Set outpaint right distance, 0 for default"), - outpaint_distance_top: int = Form(default=0, description="Set outpaint top distance, 0 for default"), - outpaint_distance_bottom: int = Form(default=0, description="Set outpaint bottom distance, 0 for default"), + outpaint_distance_left: int = Form(default=0, description="Set outpaint left distance, -1 for default"), + outpaint_distance_right: int = Form(default=0, description="Set outpaint right distance, -1 for default"), + outpaint_distance_top: int = Form(default=0, description="Set outpaint top distance, -1 for default"), + outpaint_distance_bottom: int = Form(default=0, description="Set outpaint bottom distance, -1 for default"), prompt: str = Form(''), negative_prompt: str = Form(default_prompt_negative), style_selections: List[str] = Form(defualt_styles, description="Fooocus style selections, seperated by comma"), @@ -258,7 +256,7 @@ def as_form(cls, input_image: UploadFile = Form(description="Init image for inpa errs = ve.errors() raise RequestValidationError(errors=[errs]) - return cls(input_image=input_image, input_mask=input_mask, inpaint_additional_prompt=inpaint_additional_prompt,outpaint_selections=outpaint_selections_arr, + return cls(input_image=input_image, input_mask=input_mask, inpaint_additional_prompt=inpaint_additional_prompt, outpaint_selections=outpaint_selections_arr, outpaint_distance_left=outpaint_distance_left, outpaint_distance_right=outpaint_distance_right, outpaint_distance_top=outpaint_distance_top, outpaint_distance_bottom=outpaint_distance_bottom, prompt=prompt, negative_prompt=negative_prompt, style_selections=style_selection_arr, performance_selection=performance_selection, aspect_ratios_selection=aspect_ratios_selection, @@ -267,11 +265,19 @@ def as_form(cls, input_image: UploadFile = Form(description="Init image for inpa loras=loras_model, advanced_params=advanced_params_obj, require_base64=require_base64, async_process=async_process) -class ImgPromptRequest(Text2ImgRequest): +class ImgPromptRequest(ImgInpaintOrOutpaintRequest): image_prompts: List[ImagePrompt] @classmethod - def as_form(cls, cn_img1: UploadFile = Form(File(None), description="Input image for image prompt"), + def as_form(cls, input_image: UploadFile = Form(Field(None), description="Init image for inpaint or outpaint"), + input_mask: UploadFile = Form(File(None), description="Inpaint or outpaint mask"), + inpaint_additional_prompt: str | None = Form(None, description="Describe what you want to inpaint"), + outpaint_selections: List[str] = Form([], description="Outpaint expansion selections, literal 'Left', 'Right', 'Top', 'Bottom' seperated by comma"), + outpaint_distance_left: int = Form(default=0, description="Set outpaint left distance, 0 for default"), + outpaint_distance_right: int = Form(default=0, description="Set outpaint right distance, 0 for default"), + outpaint_distance_top: int = Form(default=0, description="Set outpaint top distance, 0 for default"), + outpaint_distance_bottom: int = Form(default=0, description="Set outpaint bottom distance, 0 for default"), + cn_img1: UploadFile = Form(File(None), description="Input image for image prompt"), cn_stop1: float | None = Form( default=None, ge=0, le=1, description="Stop at for image prompt, None for default value"), cn_weight1: float | None = Form( @@ -321,6 +327,10 @@ def as_form(cls, cn_img1: UploadFile = Form(File(None), description="Input image require_base64: bool = Form(default=False, description="Return base64 data of generated image"), async_process: bool = Form(default=False, description="Set to true will run async and return job info for retrieve generataion result later"), ): + if isinstance(input_image, File): + input_image = None + if isinstance(input_mask, File): + input_mask = None if isinstance(cn_img1, File): cn_img1 = None if isinstance(cn_img2, File): @@ -330,6 +340,18 @@ def as_form(cls, cn_img1: UploadFile = Form(File(None), description="Input image if isinstance(cn_img4, File): cn_img4 = None + outpaint_selections_arr: List[OutpaintExpansion] = [] + for part in outpaint_selections: + if len(part) > 0: + for s in part.split(','): + try: + expansion = OutpaintExpansion(s) + outpaint_selections_arr.append(expansion) + except ValueError as ve: + err = InitErrorDetails(type='enum', loc=['outpaint_selections'], input=outpaint_selections, ctx={ + 'expected': "Literal 'Left', 'Right', 'Top', 'Bottom' seperated by comma"}) + raise RequestValidationError(errors=[err]) + image_prompts: List[ImagePrompt] = [] image_prompt_config = [(cn_img1, cn_stop1, cn_weight1, cn_type1), (cn_img2, cn_stop2, cn_weight2, cn_type2), (cn_img3, cn_stop3, cn_weight3, cn_type3), (cn_img4, cn_stop4, cn_weight4, cn_type4)] @@ -361,7 +383,9 @@ def as_form(cls, cn_img1: UploadFile = Form(File(None), description="Input image errs = ve.errors() raise RequestValidationError(errors=[errs]) - return cls(image_prompts=image_prompts, prompt=prompt, negative_prompt=negative_prompt, style_selections=style_selection_arr, + return cls(input_image=input_image, input_mask=input_mask, inpaint_additional_prompt=inpaint_additional_prompt, outpaint_selections=outpaint_selections_arr, + outpaint_distance_left=outpaint_distance_left, outpaint_distance_right=outpaint_distance_right, outpaint_distance_top=outpaint_distance_top, outpaint_distance_bottom=outpaint_distance_bottom, + image_prompts=image_prompts, prompt=prompt, negative_prompt=negative_prompt, style_selections=style_selection_arr, performance_selection=performance_selection, aspect_ratios_selection=aspect_ratios_selection, image_number=image_number, image_seed=image_seed, sharpness=sharpness, guidance_scale=guidance_scale, base_model_name=base_model_name, refiner_model_name=refiner_model_name, refiner_switch=refiner_switch, diff --git a/fooocusapi/models_v2.py b/fooocusapi/models_v2.py index e3ec1e1..2382485 100644 --- a/fooocusapi/models_v2.py +++ b/fooocusapi/models_v2.py @@ -3,27 +3,28 @@ class ImgUpscaleOrVaryRequestJson(Text2ImgRequest): uov_method: UpscaleOrVaryMethod = "Upscale (2x)" - upscale_value: float | None = Field(None, ge=1.0, le=5.0, description="Upscale custom value, None for default value") + upscale_value: float | None = Field(1.0, ge=1.0, le=5.0, description="Upscale custom value, 1.0 for default value") input_image: str = Field(description="Init image for upsacale or outpaint as base64") class ImgInpaintOrOutpaintRequestJson(Text2ImgRequest): input_image: str = Field(description="Init image for inpaint or outpaint as base64") - input_mask: str | None = Field(None, description="Inpaint or outpaint mask as base64") - inpaint_additional_prompt: str | None = Field(None, description="Describe what you want to inpaint") + input_mask: str | None = Field('', description="Inpaint or outpaint mask as base64") + inpaint_additional_prompt: str | None = Field('', description="Describe what you want to inpaint") outpaint_selections: List[OutpaintExpansion] = [] - outpaint_distance_left: int = Field(default=0, description="Set outpaint left distance"), - outpaint_distance_right: int = Field(default=0, description="Set outpaint right distance"), - outpaint_distance_top: int = Field(default=0, description="Set outpaint top distance"), - outpaint_distance_bottom: int = Field(default=0, description="Set outpaint bottom distance"), + outpaint_distance_left: int | None = Field(-1, description="Set outpaint left distance") + outpaint_distance_right: int | None = Field(-1, description="Set outpaint right distance") + outpaint_distance_top: int | None = Field(-1, description="Set outpaint top distance") + outpaint_distance_bottom: int | None = Field(-1, description="Set outpaint bottom distance") class ImagePromptJson(BaseModel): cn_img: str | None = Field(None, description="Input image for image prompt as base64") - cn_stop: float | None = Field(None, ge=0, le=1, description="Stop at for image prompt, None for default value") - cn_weight: float | None = Field(None, ge=0, le=2, description="Weight for image prompt, None for default value") + cn_stop: float | None = Field(0, ge=0, le=1, description="Stop at for image prompt, 0 for default value") + cn_weight: float | None = Field(0, ge=0, le=2, description="Weight for image prompt, 0 for default value") cn_type: ControlNetType = Field(default=ControlNetType.cn_ip, description="ControlNet type for image prompt") -class ImgPromptRequestJson(Text2ImgRequest): +class ImgPromptRequestJson(ImgInpaintOrOutpaintRequestJson): + input_image: str | None = Field(None, description="Init image for inpaint or outpaint as base64") image_prompts: List[ImagePromptJson | ImagePrompt] diff --git a/fooocusapi/parameters.py b/fooocusapi/parameters.py index 67e90e5..da66654 100644 --- a/fooocusapi/parameters.py +++ b/fooocusapi/parameters.py @@ -159,6 +159,10 @@ def __init__(self, prompt: str, inpaint_strength = 1.0 inpaint_respective_field = 0.618 + # Auto set mixing_image_prompt_and_inpaint to True + if len(self.image_prompts) > 0 and inpaint_input_image is not None: + mixing_image_prompt_and_inpaint = True + self.advanced_params = [ disable_preview, adm_scaler_positive, adm_scaler_negative, adm_scaler_end, adaptive_cfg, sampler_name, \ scheduler_name, generate_image_grid, overwrite_step, overwrite_switch, overwrite_width, overwrite_height, \ diff --git a/fooocusapi/worker.py b/fooocusapi/worker.py index e561440..f7564c9 100644 --- a/fooocusapi/worker.py +++ b/fooocusapi/worker.py @@ -121,7 +121,7 @@ def yield_result(_, imgs, tasks): refiner_switch = params.refiner_switch loras = params.loras input_image_checkbox = params.uov_input_image is not None or params.inpaint_input_image is not None or len(params.image_prompts) > 0 - current_tab = 'uov' if params.uov_method != flags.disabled else 'inpaint' if params.inpaint_input_image is not None else 'ip' if len(params.image_prompts) > 0 else None + current_tab = 'uov' if params.uov_method != flags.disabled else 'ip' if len(params.image_prompts) > 0 else 'inpaint' if params.inpaint_input_image is not None else None uov_method = params.uov_method upscale_value = params.upscale_value uov_input_image = params.uov_input_image @@ -470,7 +470,7 @@ def yield_result(_, imgs, tasks): print(f'Image upscaled.') f = 1.0 - if upscale_value is not None: + if upscale_value is not None and upscale_value > 1.0: f = upscale_value else: pattern = r"([0-9]+(?:\.[0-9]+)?)x"