ComfyUI-RMBG 3.3 Workflows (photo, hair/fur, box cutout, video)
===============================================================

Article: https://freakyjolly.com/comfyui-rmbg-3-3-canvas-video-matting/

What's inside:
  - 1_RMBG_Remove_Background_Photo.json: ComfyUI workflow (UI format)
  - 1_RMBG_Remove_Background_Photo_api.json: API format
  - 2_FeyNoBg_Hair_Fur_Glass.json: ComfyUI workflow (UI format)
  - 2_FeyNoBg_Hair_Fur_Glass_api.json: API format
  - 3_Florence2_Finegrain_Box_Cutout.json: ComfyUI workflow (UI format)
  - 3_Florence2_Finegrain_Box_Cutout_api.json: API format
  - 4_VRMBG_Video_Background_Removal.json: ComfyUI workflow (UI format)
  - 4_VRMBG_Video_Background_Removal_api.json: API format

Required models (download each file and put it in the folder shown):
  - RMBG-2.0 (auto-download on first run)
      folder: ComfyUI/models/RMBG/RMBG-2.0/
      download: https://huggingface.co/1038lab/RMBG-2.0
  - FeyNoBg (auto-download on first run)
      folder: ComfyUI/models/RMBG/FeyNoBg/
      download: https://huggingface.co/1038lab/FeyNobg
  - Florence-2-large (auto-download on first run)
      folder: ComfyUI/models/LLM/Florence-2-large/
      download: https://huggingface.co/microsoft/Florence-2-large
  - Finegrain box segmenter (auto-download on first run)
      folder: ComfyUI/models/RMBG/finegrain-box-segmenter/
      download: https://huggingface.co/1038lab/finegrain-box-segmenter
  - VRMBG-3.0: gated, download manually (model.safetensors, config.json, vrmbg3_config.py, model.py)
      folder: ComfyUI/models/RMBG/VRMBG-3.0/
      download: https://huggingface.co/briaai/VRMBG-3.0

Custom nodes:
  - ComfyUI-RMBG 3.3+: https://github.com/1038lab/ComfyUI-RMBG  (ComfyUI Manager > Install Missing Custom Nodes, or git clone into ComfyUI/custom_nodes/)
  - ComfyUI-VideoHelperSuite (Video Combine, workflow 4 only): https://github.com/Kosinkadink/ComfyUI-VideoHelperSuite  (ComfyUI Manager > Install Missing Custom Nodes, or git clone into ComfyUI/custom_nodes/)

How to use:
  1. Install ComfyUI-RMBG (and VideoHelperSuite for the video workflow) and restart ComfyUI.
  2. Drag one of the four numbered workflows onto the canvas.
  3. Pick your image or video in the Load node and queue. Models 1 to 3 download themselves the first time.
  4. For workflow 4, request access to briaai/VRMBG-3.0, run hf auth login, then: hf download briaai/VRMBG-3.0 --local-dir ComfyUI/models/RMBG/VRMBG-3.0

Notes:
  - Workflow 1: RMBG-2.0 at sensitivity 0.5 and process_res 1024, alpha background; the mask preview goes through Mask to Image. Add 1 to 3 mask_blur for soft edges, or mask_offset -1/-2 for halos.
  - Workflow 3: change the Florence-2 prompt to the object you want ("the white sneaker" is an example). With nothing connected to bboxes, Finegrain cuts out the whole image.
  - Workflow 4: green background (#00FF00) because MP4 has no alpha. For long videos feed chunks and leave reset_state off between chunks of the same shot.
  - RMBG-2.0 is non-commercial; BiRefNet (BiRefNetRMBG node) is the commercial-friendly option.

Model weights are not included. Each model keeps its own licence; check the model page before commercial use.
Workflow shared by FreakyJolly.com.
