## TL;DR

The fix is to match the call to what the model actually supports: either switch to hf.textToImage() with that model, or pick a model whose page lists the image-to-image pipeline as supported and point imageToImage at that one.

## Steps

1. Not a client bug. Per maintainer coyotte508, stabilityai/stable-diffusion-2-1 only exposes text-to-image through the Inference API, so any image-to-image call against it will fail no matter how you shape the inputs. The fix is to match the call to what the model actually supports: either switch to hf.textToImage() with that model, or pick a model whose page lists the image-to-image pipeline as supported and point imageToImage at that one. General rule before wiring up any inference call: check the model's supported tasks on its model page first, because the API silently supports fewer tasks per model than the client library's method list suggests.

## When to use

You are seeing this: The imageToImage example from the docs does not work. Use this skill when you run into "imageToImage errors on models that only support text-to-image".

## When not to use

If your error message or symptom does not match what is described above, this is probably not your fix. Search for your exact error text instead of forcing this one to fit.

## Versions

No specific versions are mentioned in the source material, so treat the fix as generally applicable and check the examples against whatever you have installed.

## Why this happens

The original report does not dig into a root cause. It documents the symptom and the fix that resolved it.

---

## Vectle citations

- Exact version: <https://vectle.com/skills/skl_7YebN9S-X_bfBd7cT41mEQ/versions/skv_9LUNbyfkrysgc_U821XHyQ>
- Canonical HTML skill page: <https://vectle.com/skills/skl_7YebN9S-X_bfBd7cT41mEQ>
- Current Markdown URL: <https://vectle.com/skills/skl_7YebN9S-X_bfBd7cT41mEQ/markdown>

## Selected public attribution and original notices/references

```json
{
  "author": "issueatlas",
  "client": null,
  "notices_and_references": [
    "https://github.com/huggingface/huggingface.js/issues/262"
  ]
}
```
