0

I tried to build an API call to a Runpod instance of Stable Diffusion with Roop Extension. The Webui working correctly, now i build a serverless endpoint based on this worker. There i can inference correctly without roop. Now i try to build a call with roop arguments like in this example from roop's git site. Here is my relevant code:

image_file = "./example.png"
im = Image.open(image_file)

img_bytes = io.BytesIO()
im.save(img_bytes, format='PNG') 
img_base64 = base64.b64encode(img_bytes.getvalue()).decode('utf-8')

# roop arguments list
args=[
    img_base64, # image input
    True, # enable
    '0', # comma seperated face numbers
    '/sd/stable-diffusion-webui/models/roop/inswapper_128.onnx', # model
    'CodeFormer', # restore faces 
    1, # restore visibility
    True, # restore face, upscaler
    None, # upscaler
    1, # upscaler scale 
    1, # upscaler visibility
    False, # swap in source image
    True, # swap in generated image
]

# create payload
payload = json.dumps({
  "input": {
    "api_name": "txt2img",
    "prompt": prompt,
    "restore_faces": True,
    "negative_prompt": negPrompt,
    "seed": -1,
    "override_settings": {
        "sd_model_checkpoint": "dreamshaper_7.safetensors [ed989d673d]",
    },
    # "model" : "SDv1.5",
    "sampler_index": "DPM++ SDE Karras",
    "cfg_scale": 5,
    #"sampler_index": "DDIM",
    "sampling_method" : "euler a",
    "sampling_steps" : 20,
    "num_inference_steps": 30,
    "width" : 576,
    "height" : 960,
    "alwayson_scripts": {"roop": {"args":args}},
  }
})

After that i get a response: {'delayTime': 14042, 'error': 'HTTPException', 'executionTime': 1637, 'id': 'e6f166af-575c-4670-8850-64563e639762', 'status': 'FAILED'}

Why is the minimal example failing?

xdobx
  • 39
  • 5

0 Answers0