Agnes Image 2.1 I2I Config
Edit an image you already have, via a cloud API
- image
- request
Sometimes you don't want a brand-new image, you want to push an existing one somewhere - restyle it, change the subject, keep the composition. That's image-to-image, and AgnesImage21I2IConfig is the MediaHub node that packages that job for Agnes's Image 2.1 API. It's the sibling of AgnesImage21T2IConfig with exactly one extra input: an IMAGE tensor to use as the source.
Everything you feed this node gets turned into a MEDIAHUB_IMAGE_REQUEST and handed to MediaHubGenerateImage, which performs the actual paid API call and returns the resulting IMAGE. This node is pure description and packaging - nothing renders until the execution node runs.
How the image gets to the API
This is one place where the pack does real work on your machine. Your ComfyUI IMAGE tensor - shape [B, H, W, C], float values in 0–1 - gets clamped, converted to uint8, encoded as a JPEG at quality 95, and base64-wrapped into a data:image/jpeg;base64,... URL. That data URL is what travels to Agnes. It happens per-image in the batch, so a batch of inputs becomes a batch of base64 strings. The node then builds the request payload with your settings and hands it off.
The practical takeaway: big input batches mean big base64 payloads. If you're feeding a stack of 4K images, the request is chunky, and upload time is part of your generation latency. Keep the source reasonable and you'll be fine.
Inputs that matter
- prompt - what you want done to the source image.
- image - the source
IMAGE. This is the input that distinguishes I2I from T2I. - width / height - output dimensions, defaults 1024×768, range 64–4096 in steps of 8. This is the size the result comes back at, not necessarily the input's size.
- response_format -
urlorbase64.
One output: request (MEDIAHUB_IMAGE_REQUEST), wired into MediaHubGenerateImage.
Installing it
Same pack install as every Agnes node:
cd ComfyUI/custom_nodes
git clone https://github.com/vantang/ComfyUI-MediaHub.git
/path/to/ComfyUI/python -m pip install -r ComfyUI-MediaHub/requirements.txt
Restart ComfyUI; the node lives under MediaHub/Provider/Agnes/Image. Dependencies are requests, Pillow, and numpy - Pillow does the JPEG encoding, numpy/requests handle the conversion and download. No model files. You need an Agnes API key.
Where people get stuck
The usual suspects: forgetting to wire the config to MediaHubGenerateImage (config nodes generate nothing alone), and mixing up the key. Also worth knowing: the source image goes in as JPEG, so if your workflow depends on pixel-perfect input fidelity, the JPEG round-trip will cost you some. For most restyle and edit jobs it's irrelevant. If the API rejects the request, check raw_json from the execution node - the provider's error message names the field it didn't like.
Inputs (5)
| Name | Type | Default | Description |
|---|---|---|---|
| prompt | STRING | — | |
| width | INT | 102464–4096 | — |
| height | INT | 76864–4096 | — |
| response_format | COMBO | 2 options: url, base64 | |
| image | IMAGE | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| request | MEDIAHUB_IMAGE_REQUEST | — |