Hello,
I've been trying to debug the text to image endpoint I'm not doing anything too complex just trying to use a couple of Control Net images. I've been using the dev tools inspector to look at the payload using the UI and as far as I can tell i'm matching everything and encoding my images properly etc, I still can't figure out what i'm doing wrong. Is there any way to see what params in the api schema are required? If anything it might be how I'm sending Control Net images. it seems to work when I remove all the Control Net related params.
When observing the payload in the browser, I see the numeric values as strings but I've tried sending them as integers/decimals and strings and still get a 400 error. I've also tried sending the control net images with the data URI prefix and only the encoded image strings with no success.
Here's some of my details:
Request URL: http://myswarmserver/API/GenerateText2Image
Request Headers:
{
'Connection': 'Keep-Alive',
'Content-Type': 'application/json',
'X-Session-ID': '35a6d8633c2b08bdd3f604b544476ef2270e0f8e',
'Keep-Alive': 'timeout=7200'
}
the payload (apologies for the param order):
{
"session_id": "35a6d8633c2b08bdd3f604b544476ef2270e0f8e",
"refinermethod": "PostApply",
"seed": -1,
"refinerupscalemethod": "pixel-lanczos",
"sampler": "euler",
"controlnetpreprocessor": "CannyEdgePreprocessor",
"controlnettwostrength": 0.75,
"height": 478,
"controlnettwopreprocessor": "CannyEdgePreprocessor",
"cfgscale": 1,
"automaticvae": true,
"controlnettwoimageinput": "data:image/png;base64,...",
"scheduler": "simple",
"refinerupscale": 3,
"controlnetstart": 0.2,
"controlnettwoend": 0.3,
"controlnetend": 0.8,
"model": "Flux/flux1-dev-fp8",
"controlnetimageinput": "data:image/png;base64,...",
"controlnetstrength": 0.62,
"controlnetmodel": "Flux/diffusion_pytorch_model-fp8",
"controlnettwomodel": "Flux/diffusion_pytorch_model-fp8",
"refinercontrolpercentage": 0.2,
"width": 815,
"refinervae": "Flux/ae",
"refinercfgscale": 1,
"refinermodel": "Flux/flux1-dev-fp8",
"extra_metadata": {
"controlnettwoimageinput_resolution": "815x478",
"controlnetimageinput_filename": "image_a.png",
"controlnetimageinput_resolution": "815x478",
"controlnettwoimageinput_filename": "image_b.png"
},
"prompt": "A photograph of a building\n",
"steps": 30,
"aspectratio": "Custom",
"controlnettwostart": 0
}
and just for completeness this very simple payload is working (uses strings for numeric values):
{
"session_id": "35a6d8633c2b08bdd3f604b544476ef2270e0f8e",
"prompt": "A photograph of a building\n",
"images": "1",
"model": "Flux/flux1-dev-fp8",
"cfgscale": "1",
"width": str(width),
"height": str(height)
}
Thanks in advance for any guidance or tips in debugging.