ArtVentureX / sd-webui-agent-scheduler

627 stars 65 forks source link

"POST /task_completed HTTP/1.1" 422 Unprocessable Entity #229

Closed joseph16388 closed 6 months ago

joseph16388 commented 6 months ago

Use http://127.0.0.1:7860/sdapi/v1/img2img Previously successful, today's report: INFO: 127.0.0.1:6192- "POST/task_completed HTTP/1.1" 422 Unprocessable Entity

May I ask what error this is? The complete request is as follows: Result_json=requests. post (request_img2img_URL, data=json. dumps (novel_dict))

novel_dict:

prompt: (masterpiece:1.5),(high detailed:1.5),8K,best quality,1girl,solo,long_hair,looking_at_viewer,smile,bangs,black_hair,dress,cleavage,bare_shoulders,brown_eyes,jewelry,upper_body,earrings,parted_lips,indoors,necklace,nail_polish,bracelet,plant,black_nails,armlet, negative_prompt: mutated hands, (poorly drawn hands:1.331),nsfw,NSFW,(NSFW:2),legs apart, paintings, sketches, (worst quality:2), (low quality:2), (normal quality:2), lowres, normal quality, ((monochrome)), ((grayscale)), skin spots, acnes, skin blemishes, age spot, (outdoor:1.6), manboobs, backlight,(ugly:1.331), (duplicate:1.331), (morbid:1.21), (mutilated:1.21), (tranny:1.331),  blurry, (bad anatomy:1.21), (bad proportions:1.331), extra limbs, (disfigured:1.331), (more than 2 nipples:1.331), (missing arms:1.331), (extra legs:1.331), (fused fingers:1.61051), (too many fingers:1.61051), (unclear eyes:1.331), bad hands, missing fingers, extra digit, (futa:1.1), bad body, NG_DeepNegative_V1_75T, pubic hair, glans, refraction, diffusion, diffraction, nude, open mouth, teeth,(worst quality, low quality:1.4), bad anatomy, low quality lowres, low quality lowres low polygon 3D game, low quality lowres monochrome sketch rough graffiti, low quality lowres very ugly fat obesity scar, low quality lowres chibi, low quality lowres poorly drawn bad anatomy, low quality lowres graffiti unbecoming colorfully, low quality lowres incoherent background, low quality lowres long body, low quality lowres duplicate comparison, low quality lowres sketch retro_artstyle doujinshi, low quality lowres sketch, low quality lowres text font ui error missing digit blurry, low quality lowres JPEG artifacts signature hazy bleary, low quality lowres monochrome parody meme, low quality lowres historical picture, low quality lowres disfigured mutated malformed twisted human body, low quality lowres futanari tranny, low quality lowres tentacle skeleton,watermark, signature, fewer digits, figure, nude, topless, fat,lace,rabbit,big boobs,big breast,chinese text,korean text,text,jpeg,error,simplified chinese text,Subtitles,subtitles,subtitled sampler_name: DPM++ 2M Karras batch_size: 1 n_iter: 1 steps: 25 cfg_scale: 7 width: 512 height: 512 do_not_save_grid: true denoising_strength: 0.4 init_images: [more than 65536 characters] checkpoint: chilloutmix_NiPrunedFp32Fix vae: vae-ft-mse-840000-ema-pruned.safetensors callback_url: http://localhost:18883/task_completed result_dict_val:1 INFO: 127.0.0.1:6192 - "POST /task_completed HTTP/1.1" 422 Unprocessable Entity

sd side error message: ERROR:sd:[ArtVenture] Error while uploading result ERROR:sd:{"detail":[{"type":"list_type","loc":["body","files"],"msg":"Input should be a valid list","input":{"filename":"00001-157649837-(masterpiece_1.5),(high detailed_1.5),8K,best quality,1girl,long_hair,blush,smile,short_hair,black_hair,long_sleeves,1boy,dress,.png","file":{"_file":{},"_max_size":1048576,"_rolled":false,"_TemporaryFileArgs":{"mode":"w+b","buffering":-1,"suffix":null,"prefix":null,"encoding":null,"newline":null,"dir":null,"errors":null}},"size":409704,"headers":{"content-disposition":"form-data; name=\"files\"; filename=\"00001-157649837-(masterpiece_1.5),(high detailed_1.5),8K,best quality,1girl,long_hair,blush,smile,short_hair,black_hair,long_sleeves,1boy,dress,.png\"","content-type":"image/png"}},"url":"https://errors.pydantic.dev/2.6/v/list_type"}]}

I tested webhook site callback is ok:https://webhook.site/#!/view/4758da38-dfb7-4ea0-9e0a-6777f5939846/fa96307c-4d02-49f5-90ee-7205eddeaa45/1

But for my fastapi server is always return 422 Error,my fastapi server code is below(This code is also readme code): from fastapi import FastAPI, Form, File, UploadFile import uvicorn from typing import List, Optional, Annotated

app = FastAPI() @app.post("/task_completed") async def handle_task_completed( task_id: Annotated[str, Form()], status: Annotated[str, Form()], files: Optional[List[UploadFile]] = File(None), ): print(f"Received for task {task_id} with status {status}")

print(f"Received {len(files)} files for task {task_id} with status {status}")

uvicorn.run(app, host="0.0.0.0", port=18883)