ComfyUI Extension: ComfyUI OneReward Node
A custom node for ComfyUI that integrates OneReward model for high-quality image inpainting, outpainting, and object removal.
Custom Nodes (0)
README
ComfyUI OneReward Node
A custom node for ComfyUI that integrates OneReward model for high-quality image inpainting, outpainting, and object removal.
⨠Features
- šØ Intelligent Image Inpainting: Powered by OneReward model based on FLUX architecture
- š¼ļø Image Restoration: Smart fill of blank areas with prompt-guided content
- š§½ Object Removal: Automatically remove unwanted elements from images
- š CFG Support: Built-in Classifier-Free Guidance for enhanced generation quality
- āļø Memory Optimization: Quantization and CPU offload support for consumer-grade GPUs (~16GB VRAM)
- š Flexible Control: True CFG parameter control for fine-tuning results
š§ Node List
Core Nodes
- RH_OneReward_Loader: Load and initialize OneReward models with optimization options
- RH_OneReward_Sampler: Prompt-guided image inpainting and restoration generator
- RH_OneReward_Eraser: Intelligent object removal tool
š Quick Installation
Step 1: Install the Node
# Navigate to ComfyUI custom_nodes directory
cd ComfyUI/custom_nodes
# Clone the repository
git clone https://github.com/HM-RunningHub/ComfyUI_RH_OneReward
# Install dependencies
cd ComfyUI_RH_OneReward
pip install -r requirements.txt
Step 2: Download Required Models
# Download FLUX.1-Fill-dev model (Required base model)
huggingface-cli download black-forest-labs/FLUX.1-Fill-dev --local-dir models/black-forest-labs/FLUX.1-Fill-dev
# Download OneReward models
# Download standard OneReward model
huggingface-cli download black-forest-labs/flux.1-fill-dev-OneReward-transformer --local-dir models/OneReward/flux.1-fill-dev-OneReward-transformer
# Download dynamic OneReward model (optional)
huggingface-cli download black-forest-labs/flux.1-fill-dev-OneRewardDynamic-transformer --local-dir models/OneReward/flux.1-fill-dev-OneRewardDynamic-transformer
# Final model structure should look like:
models/
āāā black-forest-labs/
ā āāā FLUX.1-Fill-dev/
ā āāā text_encoder/
ā āāā text_encoder_2/
ā āāā tokenizer/
ā āāā tokenizer_2/
ā āāā transformer/
ā āāā vae/
ā āāā scheduler/
āāā OneReward/
āāā flux.1-fill-dev-OneReward-transformer/
āāā flux.1-fill-dev-OneRewardDynamic-transformer/
# Restart ComfyUI
š Usage
Basic Workflow
[RH_OneReward_Loader] ā [RH_OneReward_Sampler] ā [Save Image]
Generation Types
Image Inpainting
- Load image that needs filling
- Provide mask layer marking areas to be filled
- Input text prompt describing the fill content
- Generate intelligently filled images
Image Restoration
- Load damaged or incomplete images
- Use mask to mark areas needing repair
- Input prompt describing restoration content
- Generate naturally restored images
Object Removal
- Use RH_OneReward_Eraser node
- Load image containing unwanted elements
- Provide mask marking areas to remove
- Automatically remove and fill background
š ļø Technical Requirements
- GPU: 16GB+ VRAM (with quantization optimization)
- RAM: 32GB+ recommended
- Storage: ~30GB for all models
- FLUX.1-Fill-dev: ~24GB
- OneReward models: ~6GB
- CUDA: Required for optimal performance
ā ļø Important Notes
- Model Paths: Models must be placed in specific directories:
- FLUX.1-Fill-dev ā
models/black-forest-labs/FLUX.1-Fill-dev/
- OneReward models ā
models/OneReward/
- FLUX.1-Fill-dev ā
- Low-memory GPUs automatically enable quantization and CPU offload optimization
- All model files must be downloaded before first use
- Supports true_cfg parameter for quality control
š License
This project is licensed under Apache 2.0 License.
š References
š¤ Contributing
Contributions are welcome! Please feel free to submit issues and pull requests.
ā Citation
If you find this project useful, please consider citing the related papers:
@article{onereward2024,
title={OneReward: Unified Image Inpainting and Outpainting},
author={OneReward Team},
year={2024},
journal={arXiv preprint},
}