Nodes Browser
ComfyDeploy: How ComfyUI-Fal-API-Flux works in ComfyUI?
What is ComfyUI-Fal-API-Flux?
This repository contains custom nodes for ComfyUI that integrate the fal.ai FLUX.1 [dev] with LoRA API, specifically for text-to-image generation. These nodes allow you to use the FLUX.1 model directly within your ComfyUI workflows.
How to install it in ComfyDeploy?
Head over to the machine page
- Click on the "Create a new machine" button
- Select the
Edit
build steps - Add a new step -> Custom Node
- Search for
ComfyUI-Fal-API-Flux
and select it - Close the build step dialig and then click on the "Save" button to rebuild the machine
ComfyUI-Fal-API-Flux
This repository contains custom nodes for ComfyUI that integrate the fal.ai FLUX.1 APIs for text-to-image and image-to-image generation. These nodes allow you to use the FLUX.1 models directly within your ComfyUI workflows.
Features
- Text-to-image generation using fal.ai's FLUX.1 [dev] and FLUX.1 [pro] models
- Image-to-image generation using FLUX.1 [dev] model
- Support for LoRA models
- ControlNet and ControlNet Union support
- Customizable generation parameters (image size, inference steps, guidance scale)
- Multiple image generation in a single request
- Seed support for reproducible results
- Safety tolerance settings for FLUX.1 [pro]
Prerequisites
- ComfyUI installed and set up
- Python 3.7+
- PyTorch 2.0.1 or later
- A fal.ai API key with access to the FLUX.1 models
Installation
There are two ways to install ComfyUI-Fal-API-Flux:
Method 1: Using ComfyUI Manager (Recommended)
- Install ComfyUI Manager if you haven't already.
- Open ComfyUI and navigate to the "Manager" tab.
- Search for "ComfyUI-Fal-API-Flux" in the custom nodes section.
- Click "Install" to automatically download and install the custom nodes.
Method 2: Manual Installation
- Clone this repository into your ComfyUI's
custom_nodes
directory:cd /path/to/ComfyUI/custom_nodes git clone https://github.com/your-username/ComfyUI-Fal-API-Flux.git
- Navigate to the cloned directory:
cd ComfyUI-Fal-API-Flux
- Install the required dependencies:
pip install -r requirements.txt
After installation using either method:
- Configure your API key (see Configuration section below)
- Restart ComfyUI if it's already running
Configuration
To use these custom nodes, you need to set up your fal.ai API key:
- Create a
config.ini
file in the root directory of the project. - Add the following content to
config.ini
:[falai] api_key = your_api_key_here
- Replace
your_api_key_here
with your actual fal.ai API key. - Save the file.
Keep your config.ini
file secure and do not share it publicly.
Usage
After installation, you'll find the following new nodes in the ComfyUI interface:
- "Fal API Flux Dev": The main node for text-to-image generation using FLUX.1 [dev].
- "Fal API Flux Dev Image-to-Image": A node for image-to-image generation using FLUX.1 [dev].
- "Fal API Flux Dev with LoRA": A node for text-to-image generation using FLUX.1 [dev] with LoRA support.
- "Fal API Flux Dev with LoRA Image-to-Image": A node for image-to-image generation using FLUX.1 [dev] with LoRA support.
- "Fal API Flux with LoRA and ControlNet": A node for text-to-image generation using FLUX.1 [dev] with LoRA and ControlNet support.
- "Fal API Flux with LoRA and ControlNet Image-to-Image": A node for image-to-image generation using FLUX.1 [dev] with LoRA and ControlNet support.
- "Fal API Flux Pro": A node for text-to-image generation using FLUX.1 [pro].
- "Fal API Flux Pro V1.1": An updated node for text-to-image generation using FLUX.1 [pro] V1.1.
- "Fal API Flux LoRA Config": A node for configuring LoRA models.
- "Fal API Flux ControlNet Config": A node for configuring ControlNet.
- "Fal API Flux ControlNet Union Config": A node for configuring ControlNet Union.
Basic Usage
- Add one of the Fal API Flux nodes to your workflow.
- Configure the node parameters (prompt, image size, etc.).
- Connect the output to a "Preview Image" or "Save Image" node to see the results.
Using LoRA
- Add a "Fal API Flux LoRA Config" node to your workflow.
- Configure the LoRA URL and scale.
- Connect the output of the LoRA Config node to the
lora
input of a compatible Fal API Flux node.
Using ControlNet
- Add a "Fal API Flux ControlNet Config" or "Fal API Flux ControlNet Union Config" node to your workflow.
- Configure the ControlNet parameters.
- Connect the output to the
controlnet
orcontrolnet_union
input of a compatible Fal API Flux node.
Image-to-Image Generation
- Use a ComfyUI image loader node to load an input image.
- Connect the loaded image to an image-to-image node (e.g., "Fal API Flux Dev Image-to-Image").
- Configure the node parameters, including the strength of the transformation.
Example Workflows
Example workflows are provided in the examples
folder of this repository. To use them:
- Locate the desired workflow image in the
examples
folder. - Open ComfyUI in your web browser.
- Drag and drop the workflow image directly onto the ComfyUI canvas.
These example workflows provide starting points for using the Fal API Flux nodes in your own projects.
Troubleshooting
If you encounter issues:
- Ensure you have access to the FLUX.1 models on fal.ai.
- Check the ComfyUI console for detailed error messages and logs.
- Verify that your API key is correctly set in the
config.ini
file. - Make sure your LoRA URL is correct and compatible with FLUX.1 [dev].
- For persistent issues, enable debug logging and check the logs for API responses and image processing details.
Contributing
Contributions to improve the nodes or extend their functionality are welcome! Please feel free to submit issues or pull requests.
License
This project is licensed under the MIT License - see the LICENSE file for details.
Acknowledgements
Disclaimer
This project is not officially affiliated with or endorsed by fal.ai or ComfyUI. Use it at your own risk and be sure to comply with fal.ai's terms of service when using their API.