Extensions/ApoRepainter
ComfyUI Extension

ApoRepainter

Background removal (colour-to-alpha), object erase and exact-size crop tools for ComfyUI, with an in-node image editor.

By ApoloniArt·Created a day ago·Updated about 21 hours ago· 1
apoloniart/ApoRepainter
Nodes—
On cloudLocal install
Stars1
Updatedabout 21 hours ago
Readme
<h1 align="center">𝔸𝕡𝕠ℝ𝕖𝕡𝕒𝕚𝕟𝕥𝕖𝕣</h1> <p align="center"><b>Remove backgrounds, erase objects and crop to exact sizes: three image tools in one ComfyUI node with its own visual editor.</b></p> <p align="center"> <a href="https://github.com/comfyanonymous/ComfyUI"><img alt="ComfyUI extension" src="https://img.shields.io/badge/ComfyUI-Extension-5ea500?style=flat"></a> <a href="https://github.com/ApoloniArt/ApoRepainter/releases"><img alt="Version" src="https://img.shields.io/badge/dynamic/toml?url=https%3A%2F%2Fraw.githubusercontent.com%2Fapoloniart%2FApoRepainter%2Fmain%2Fpyproject.toml&query=%24.project.version&label=Version&color=ed7d31&style=flat"></a> <a href="https://github.com/ApoloniArt/ApoRepainter/blob/main/LICENSE"><img alt="License" src="https://img.shields.io/github/license/apoloniart/ApoRepainter?label=License&color=e0414a&style=flat&v=2"></a> <a href="https://github.com/ApoloniArt/ApoRepainter/blob/main/requirements.txt"><img alt="Dependencies" src="https://img.shields.io/badge/Dependencies-1-0075c2?style=flat"></a> <a href="https://github.com/ApoloniArt/ApoRepainter/commits"><img alt="Last update" src="https://img.shields.io/github/last-commit/apoloniart/ApoRepainter?label=Last%20Update&color=ed7d31&style=flat"></a> <a href="https://github.com/ApoloniArt/ApoRepainter/commits"><img alt="Activity" src="https://img.shields.io/github/commit-activity/m/apoloniart/ApoRepainter?label=Activity&color=d4b300&style=flat"></a> <a href="https://github.com/ApoloniArt/ApoRepainter/stargazers"><img alt="Stars" src="https://img.shields.io/github/stars/apoloniart/ApoRepainter?logo=github&color=555&style=flat&v=2"></a> <a href="https://discord.gg/XDExAUzuZp"><img alt="Discord" src="https://img.shields.io/badge/Discord-Join-5865F2?logo=discord&logoColor=white&style=flat"></a> <a href="https://github.com/ApoloniArt"><img alt="Follow on GitHub" src="https://img.shields.io/github/followers/ApoloniArt?label=Follow&logo=github&color=555&style=flat"></a> <a href="https://ko-fi.com/apoloniart"><img alt="Ko-fi" src="https://img.shields.io/badge/Ko--fi-Support-F16061?logo=ko-fi&logoColor=white&style=flat"></a> </p>

ApoRepainter

<h3 align="center">One node, three independent tools, one visual editor. Pick a tool, run it, and chain more nodes for more steps.</h3>

🧬<ins>Tools</ins>

| Tool | What it does | |---|---| | RemBG | Removes a flat colour background to true transparency (colour-to-alpha): clean edges, no halo, letter counters cleared. Auto-detects the colour or takes one you pick with the eyedropper. | | Erase | Click and erase: a circle removes a spot or object and rebuilds the area from its surroundings, with a smooth fill or a patch-copy texture fill, chosen automatically. | | Crop | Exact-size crop with each side moved inward or outward, an exact width x height with a 9-point anchor, or crop to content. |

Also: five presets per tool with starters, export and import; images, masks and transparency straight from Load Image; outputs for 4-channel and 3-channel nodes plus a plain-language info report; and every setting saved in the workflow.

💭<ins>Presets</ins>

Each tool has five named preset slots at the bottom of its settings. Click one to apply it, tune something, and Save it back under your own name. A small orange modified marker shows when you have changed a setting since applying a preset. Five starters per tool ship with the node, Reset to defaults and Restore starters are one click, and Export set / Import set keep as many sets as you like. Your own presets live in user_presets, which an update never touches. Full guide: docs/presets.md.

✍🏻<ins>Tool guides</ins>

See the docs folder: a page per tool, the visual editor, presets, images, masks and transparency, a generated reference of every widget, and Testing.

⚙️<ins>Installation</ins>

<h3 align="left">Option 1: Comfy Manager Install [recommended]</h3>

ApoRepainter has no extra requirements (torch, numpy and Pillow already ship with ComfyUI), so you can install it via Comfy Manager without any fear of breaking your Comfy. Search APO in Manager. After installation, rename the folder to ComfyUI-ApoRepainter.

<h3 align="left">Option 2: Manual Install [git clone]</h3>
cd ComfyUI/custom_nodes
git clone https://github.com/ApoloniArt/ApoRepainter ComfyUI-ApoRepainter

No Git? On GitHub press Code > Download ZIP, unpack it, and put the folder into ComfyUI/custom_nodes/ named ComfyUI-ApoRepainter.

  1. Restart ComfyUI fully (close the console window too). The node appears as ApoRepainter in the Add Node menu.

Update: in Comfy Manager press Update, or for a manual install run git pull inside custom_nodes/ComfyUI-ApoRepainter, then restart. Your own presets are not part of the repository, so an update never touches them (see Presets).

🤔<ins>Check your Install</ins>

Double-click RUN_TESTS.bat in the ComfyUI-ApoRepainter folder. It prints one PASS / FAIL line per test (details in docs/testing.md).

🏃🏻‍♀️‍➡️<ins>Quick Start</ins>

  1. Add Load Image and ApoRepainter (Add Node > ApoRepainter), or just drop a picture onto the ApoRepainter node.
  2. Pick RemBG, Erase or Crop with the tabs along the top of the node. Try Photo on black or Banner / flat graphic from the Presets block.
  3. Add Preview Image (or Save Image) and run. Use the image output, or mask for the alpha.
  4. To combine steps, connect the image output to the image_in socket of a second ApoRepainter node set to another tool.

Transparent PNG from Load Image? Connect its IMAGE to image_in and its MASK to mask_in (see images, masks and transparency).

🫱🏻‍🫲🏻<ins>Attribution & Licenses</ins>

ApoRepainter is MIT licensed, see LICENSE. If you use it in a project, a mention of "ApoRepainter by ApoloniArt" is very much appreciated 🥰

See NOTICE for the full attribution request.

Bundled font: Bitcount Ink SIL Open Font License 1.1.


Development details and version updates can be found in CHANGELOG.md


<div align="center">

Developed by ApoloniArt ⚢🌈

Discord Ko-fi

</div>