R
RunPod6d ago
Jacob

Bad requests

I have just the normal 3.6.0 sdxl docker running on my serverless but i just cannot get it to request correctly with a workflow. According to github which is literally the only place with any documentation it says a workflow can be passed but nothing I've tried works its just endless 400 bad request...
{
"input": {
"prompt": prompt,
"num_inference_steps": 50,
"width": 1024,
"height": 1024,
"guidance_scale": 15,
"high_noise_frac": 1.2
}
}
{
"input": {
"prompt": prompt,
"num_inference_steps": 50,
"width": 1024,
"height": 1024,
"guidance_scale": 15,
"high_noise_frac": 1.2
}
}
for some reason it will accept this but when I pass a workflow like this it just errors from the request.
{
"input": {
"workflow": {
"1": {
"inputs": {
"ckpt_name": "sd_xl_base_1.0.safetensors"
},
"class_type": "CheckpointLoaderSimple",
"_meta": {
"title": "Load Checkpoint"
}
},
"2": {
"inputs": {
"seed": 0,
"steps": 20,
"cfg": 8,
"sampler_name": "euler",
"scheduler": "normal",
"denoise": 1,
"model": [
"1",
0
],
"positive": [
"3",
0
],
"negative": [
"4",
0
],
"latent_image": [
"5",
0
]
},
"class_type": "KSampler",
"_meta": {
"title": "KSampler"
}
},
"3": {
"inputs": {
"text": "positive prompt here",
"clip": [
"1",
1
]
},
"class_type": "CLIPTextEncode",
"_meta": {
"title": "CLIP Text Encode (Prompt)"
}
},
"4": {
"inputs": {
"text": "negative prompt here",
"clip": [
"1",
1
]
},
"class_type": "CLIPTextEncode",
"_meta": {
"title": "CLIP Text Encode (Prompt)"
}
},
"5": {
"inputs": {
"width": 1024,
"height": 1024,
"batch_size": 1
},
"class_type": "EmptyLatentImage",
"_meta": {
"title": "Empty Latent Image"
}
},
"6": {
"inputs": {
"samples": [
"2",
0
],
"vae": [
"1",
2
]
},
"class_type": "VAEDecode",
"_meta": {
"title": "VAE Decode"
}
},
"7": {
"inputs": {
"filename_prefix": "ComfyUI",
"images": [
"6",
0
]
},
"class_type": "SaveImage",
"_meta": {
"title": "Save Image"
}
}
}
}
}
{
"input": {
"workflow": {
"1": {
"inputs": {
"ckpt_name": "sd_xl_base_1.0.safetensors"
},
"class_type": "CheckpointLoaderSimple",
"_meta": {
"title": "Load Checkpoint"
}
},
"2": {
"inputs": {
"seed": 0,
"steps": 20,
"cfg": 8,
"sampler_name": "euler",
"scheduler": "normal",
"denoise": 1,
"model": [
"1",
0
],
"positive": [
"3",
0
],
"negative": [
"4",
0
],
"latent_image": [
"5",
0
]
},
"class_type": "KSampler",
"_meta": {
"title": "KSampler"
}
},
"3": {
"inputs": {
"text": "positive prompt here",
"clip": [
"1",
1
]
},
"class_type": "CLIPTextEncode",
"_meta": {
"title": "CLIP Text Encode (Prompt)"
}
},
"4": {
"inputs": {
"text": "negative prompt here",
"clip": [
"1",
1
]
},
"class_type": "CLIPTextEncode",
"_meta": {
"title": "CLIP Text Encode (Prompt)"
}
},
"5": {
"inputs": {
"width": 1024,
"height": 1024,
"batch_size": 1
},
"class_type": "EmptyLatentImage",
"_meta": {
"title": "Empty Latent Image"
}
},
"6": {
"inputs": {
"samples": [
"2",
0
],
"vae": [
"1",
2
]
},
"class_type": "VAEDecode",
"_meta": {
"title": "VAE Decode"
}
},
"7": {
"inputs": {
"filename_prefix": "ComfyUI",
"images": [
"6",
0
]
},
"class_type": "SaveImage",
"_meta": {
"title": "Save Image"
}
}
}
}
}
38 Replies
Jacob
JacobOP6d ago
I'm sure its something I'm doing wrong but there's zero info on how to do it properly from what I've found
curl -X POST -H "Authorization: Bearer <api_key>" -H "Content-Type: application/json" -d '{"input":{"workflow":{"3":{"inputs":{"seed":1337,"steps":20,"cfg":8,"sampler_name":"euler","scheduler":"normal","denoise":1,"model":["4",0],"positive":["6",0],"negative":["7",0],"latent_image":["5",0]},"class_type":"KSampler"},"4":{"inputs":{"ckpt_name":"sd_xl_base_1.0.safetensors"},"class_type":"CheckpointLoaderSimple"},"5":{"inputs":{"width":512,"height":512,"batch_size":1},"class_type":"EmptyLatentImage"},"6":{"inputs":{"text":"beautiful scenery nature glass bottle landscape, purple galaxy bottle,","clip":["4",1]},"class_type":"CLIPTextEncode"},"7":{"inputs":{"text":"text, watermark","clip":["4",1]},"class_type":"CLIPTextEncode"},"8":{"inputs":{"samples":["3",0],"vae":["4",2]},"class_type":"VAEDecode"},"9":{"inputs":{"filename_prefix":"ComfyUI","images":["8",0]},"class_type":"SaveImage"}}}}' https://api.runpod.ai/v2/<endpoint_id>/runsync
curl -X POST -H "Authorization: Bearer <api_key>" -H "Content-Type: application/json" -d '{"input":{"workflow":{"3":{"inputs":{"seed":1337,"steps":20,"cfg":8,"sampler_name":"euler","scheduler":"normal","denoise":1,"model":["4",0],"positive":["6",0],"negative":["7",0],"latent_image":["5",0]},"class_type":"KSampler"},"4":{"inputs":{"ckpt_name":"sd_xl_base_1.0.safetensors"},"class_type":"CheckpointLoaderSimple"},"5":{"inputs":{"width":512,"height":512,"batch_size":1},"class_type":"EmptyLatentImage"},"6":{"inputs":{"text":"beautiful scenery nature glass bottle landscape, purple galaxy bottle,","clip":["4",1]},"class_type":"CLIPTextEncode"},"7":{"inputs":{"text":"text, watermark","clip":["4",1]},"class_type":"CLIPTextEncode"},"8":{"inputs":{"samples":["3",0],"vae":["4",2]},"class_type":"VAEDecode"},"9":{"inputs":{"filename_prefix":"ComfyUI","images":["8",0]},"class_type":"SaveImage"}}}}' https://api.runpod.ai/v2/<endpoint_id>/runsync
this example request according to the github works
Jason
Jason5d ago
soo.. you can get the "workflow" request from comfyui and you put it inside correctly without invalid json right may i know whats the error you are experiencing from that workflow input?, is it from the worker logs? or where?
Jacob
JacobOP5d ago
Yeah I tried importing a workflow but it just gives the 400 bad request error on runpod so it must not be formated correctly or something It's the logs from runpod I think the worker one
Jason
Jason5d ago
so when you sendthe request the response is 400 bad request? can you copy it here? oh i see it says json is valid tho how did you send your request too? (that one that failed)
Jacob
JacobOP5d ago
Ive been using a discord bot to send the requests like I said that first one works fine but workflows just error out
Jason
Jason5d ago
whats the code like? you mean the example from github (curl one) works but that json workflow that is prettied above isnt working right? whats the code you used to send the request, whats the error like oh btw bearer toke okay.
Jacob
JacobOP5d ago
yeah noticed
Jason
Jason5d ago
huh is that a comfyui worker or what?
Jacob
JacobOP5d ago
thats the worker log
Jason
Jason5d ago
doesn't looks like a normal one i found from the github
Jacob
JacobOP5d ago
i sent the workflow i posted earlier
Jason
Jason5d ago
oh... you're actually not running comfyui that is why... that workflow you formatted is for comfyui only not for other workers
Jacob
JacobOP5d ago
Am I not? I thought I was I just picked the quick deploy thing
Jason
Jason5d ago
which one?
INPUT_SCHEMA = {
'prompt': {
'type': str,
'required': False,
},
'negative_prompt': {
'type': str,
'required': False,
'default': None
},
'height': {
'type': int,
'required': False,
'default': 1024
},
'width': {
'type': int,
'required': False,
'default': 1024
},
'seed': {
'type': int,
'required': False,
'default': None
},
'scheduler': {
'type': str,
'required': False,
'default': 'DDIM'
},
'num_inference_steps': {
'type': int,
'required': False,
'default': 25
},
'refiner_inference_steps': {
'type': int,
'required': False,
'default': 50
},
'guidance_scale': {
'type': float,
'required': False,
'default': 7.5
},
'strength': {
'type': float,
'required': False,
'default': 0.3
},
'image_url': {
'type': str,
'required': False,
'default': None
},
'num_images': {
'type': int,
'required': False,
'default': 1,
'constraints': lambda img_count: 3 > img_count > 0
},
'high_noise_frac': {
'type': float,
'required': False,
'default': None
},
}
INPUT_SCHEMA = {
'prompt': {
'type': str,
'required': False,
},
'negative_prompt': {
'type': str,
'required': False,
'default': None
},
'height': {
'type': int,
'required': False,
'default': 1024
},
'width': {
'type': int,
'required': False,
'default': 1024
},
'seed': {
'type': int,
'required': False,
'default': None
},
'scheduler': {
'type': str,
'required': False,
'default': 'DDIM'
},
'num_inference_steps': {
'type': int,
'required': False,
'default': 25
},
'refiner_inference_steps': {
'type': int,
'required': False,
'default': 50
},
'guidance_scale': {
'type': float,
'required': False,
'default': 7.5
},
'strength': {
'type': float,
'required': False,
'default': 0.3
},
'image_url': {
'type': str,
'required': False,
'default': None
},
'num_images': {
'type': int,
'required': False,
'default': 1,
'constraints': lambda img_count: 3 > img_count > 0
},
'high_noise_frac': {
'type': float,
'required': False,
'default': None
},
}
Jacob
JacobOP5d ago
Is there a different workflow for sdxl?
Jason
Jason5d ago
thats the validation for sdxl worker which one from the runpod website, can you screenshot and showme? that you've deployed
Jacob
JacobOP5d ago
Actually I think I deleted that one the one I'm on now is the sdxl one I thought it was also on comfy ui
Jason
Jason5d ago
i see, i think it might uses hf pipelines, as you see from the logs its okay let me give you the link to comfyui
Jason
Jason5d ago
GitHub
GitHub - blib-la/runpod-worker-comfy: ComfyUI as a serverless API o...
ComfyUI as a serverless API on RunPod. Contribute to blib-la/runpod-worker-comfy development by creating an account on GitHub.
Jacob
JacobOP5d ago
I'll look into the sdxl requests, didn't see anything online so I was confused I might have to make a docker with that and just add the sdxl models I gues
Jason
Jason5d ago
GitHub
worker-sdxl/src at main · runpod-workers/worker-sdxl
RunPod worker for Stable Diffusion XL. Contribute to runpod-workers/worker-sdxl development by creating an account on GitHub.
Jason
Jason5d ago
sure, that works just follow the guides, and if you're stuck somewhere feel free to open a new one in #⚡|serverless
so that the thread is cleaner
Jacob
JacobOP5d ago
Thanks for replying though I appreciate it
Jason
Jason5d ago
Your welcome!
Jacob
JacobOP5d ago
I don't get this part though, the solution you gave will work but the docker even says comfyui for it so why would the requests be handled differently https://hub.docker.com/r/timpietruskyblibla/runpod-worker-comfy/tags "Run ComfyUI as a serverless API on RunPod." Don't see much info on the hf pipeline but I can just switch dockers I guess
Jason
Jason5d ago
You're using this?
Jacob
JacobOP5d ago
Yeah that's apparently the version according to runpod
Jason
Jason5d ago
I see, there might be an error with your request inside the worker then but when it wanted to return the error, it didn't succeed because runpod cannot parse the response from the worker That's what I thought
Jacob
JacobOP5d ago
that's a different endpoint but the workflow I tested on that also didn't work And it apparently has comfyui
Jason
Jason5d ago
Huh I'm getting confused here, can you make another thread instead for that one and one for the comfyui So it doesn't get mixed up
Jacob
JacobOP5d ago
I can but it's throwing the same error idk just confused
Jason
Jason5d ago
They all throw 400 bad request like this? Try modifying the docker image add a print statement before the return To print anything that is returned from the worker (inside the handler.py code)
Jacob
JacobOP5d ago
I think it might have just given me a weird docker when I hit quick deploy I'll try with a fresh version of the one you sent first
Jason
Jason5d ago
Hmm I dont think so But sure
Jacob
JacobOP5d ago
I think I got it working actually, I had a node incorrect I believe from what the log said. But that sdxl docker confused me because I thought it was comfyui like the other ones that's my fault Anyway I'll make a thread if I have problems have a good one
Jason
Jason5d ago
Oh a node incorrect meaning the comfyui should errors out? Ic okok

Did you find this page helpful?