Nodes Browser

ComfyDeploy: How comfyui-finegrain works in ComfyUI?

What is comfyui-finegrain?

ComfyUI custom nodes to interact with the Finegrain API.

How to install it in ComfyDeploy?

Head over to the machine page

  1. Click on the "Create a new machine" button
  2. Select the Edit build steps
  3. Add a new step -> Custom Node
  4. Search for comfyui-finegrain and select it
  5. Close the build step dialig and then click on the "Save" button to rebuild the machine

comfyui-finegrain

Finegrain API ComfyUI custom nodes.

Account creation (Prerequisite)

To use these custom nodes, you need Finegrain API credentials:

  1. Sign up for an account at https://editor.finegrain.ai/signup:

finegrain login

  1. Once installed (see below), update config.ini with your Finegrain API credentials:
[finegrain]
credentials = myemail@email.com:my_password
priority = low
timeout = 60

[!Note] credentials can either be email:password or an API key, which you can create in Account Settings > New API key

Installation

Installing the nodes is pretty straight forward, check out our Discord server if you need help.

Requirements

  1. Ensure you have Python 3.12 (or later) installed.

  2. Ensure you have Git installed.

  3. Ensure you have ComfyUI installed.

ComfyUI Manager installation (recommended)

  1. Ensure you have ComfyUI Manager installed.

  2. In ComfyUI, open the manager by clicking the Manager button in the top right corner.

  3. Click Custom Nodes Manager in the menu.

  4. Search for comfyui-finegrain in the search bar and click the Install button.

Alternatively, if you load one of the workflows below, you should be able to install the nodes directly by clicking the Install Missing Custom Nodes button in the Manager's menu.

Comfy Registry installation

The nodes are published at https://registry.comfy.org/publishers/finegrain/nodes/comfyui-finegrain.

  1. Ensure you have Comfy CLI installed.

  2. Install the custom nodes using Comfy CLI:

comfy node registry-install comfyui-finegrain

The above command should automatically install the nodes' requirements. If it somehow doesn't, you can manually install them with:

On Linux:

# ensure you activated the python virtual environment used by ComfyUI
pip install -r custom_nodes/comfyui-finegrain/requirements.txt

On Windows:

.\python_embeded\Scripts\pip.exe install -r .\ComfyUI\custom_nodes\comfyui-finegrain\requirements.txt

Manual installation

The nodes are published at https://registry.comfy.org/publishers/finegrain/nodes/comfyui-finegrain.

  1. Clone the repository:
cd custom_nodes
git clone https://github.com/finegrain-ai/comfyui-finegrain.git
  1. Install the nodes' requirements:

On Linux:

# ensure you activated the python virtual environment used by ComfyUI
pip install -r custom_nodes/comfyui-finegrain/requirements.txt

On Windows:

.\python_embeded\Scripts\pip.exe install -r .\ComfyUI\custom_nodes\comfyui-finegrain\requirements.txt

Workflow examples

[!Note] All the below workflow examples were made using comfyui-finegrain v2.0.0. <br> To import them into ComfyUI, drag and drop the .png file into the ComfyUI window.

All our workflows are also available on OpenArt: https://openart.ai/workflows/profile/finegrain

Prompt to erase

Instantly remove any object, along with its shadows and reflections, just by naming it.

Prompt to erase workflow

Prompt to cutout

Instantly isolate any object in a photo into a perfect cutout, just by naming it.

Prompt to cutout workflow

Prompt to recolor

Instantly change the color of any object in a photo, even through occlusions, just by naming it.

Prompt to recolor workflow

Swap

Replace any object in a photo with another, recreating shadows and reflections so naturally it looks like the new object was always there — perfectly preserved in every detail.

Swap workflow

Blend

Seamlessly integrate any object into a scene, recreating shadows and reflections for a result so natural it looks like it was always there — perfectly preserved in every detail.

Blend workflow

Generate packshot

Generate Packshot – Transform any mundane photo into a stunning white-background image with a perfectly natural shadow.

Generate packshot workflow

Remove background

Remove Background – Our pixel-perfect, high-resolution take on a classic, effortlessly extracting the main object from its background.

Remove background workflow