Node packVerificadoExterno
ComfyUI-Kontext-API
Nodes for interacting with Kontext API in ComfyUI
Responsable@SanDiegoDudeUnratedcalidad
Perfil del paquete
- Estado
- Verificado
- Publicador
- @SanDiegoDude
- Fuente
- GitHub
Léeme
ComfyUI-Kontext-API
A custom ComfyUI node for integrating with the Fal Kontext API for advanced image editing and generation.
SINGLE IMAGE NODE image
MULTI-IMAGE NODE image
Features
- Image-to-Image Generation: Transform images based on text prompts using Fal's Kontext model
- Single Image Output: Generates one image per request for optimal ComfyUI compatibility
- Seed Control: Use specific seeds for reproducible results or -1 for random
- Prompt Enhancement: Optional AI prompt enhancement (can be disabled)
- Multi-Image Support: Process multiple images (1 required, up to 3 optional) with the Kontext Max model
- Automatic Image Resizing: Large images are automatically resized to fit under 1.25MP
- Fal Storage Integration: Images are automatically uploaded to Fal's storage service to avoid API size limits
Installation
- Clone this repository into your ComfyUI custom nodes directory:
cd ComfyUI/custom_nodes
git clone https://github.com/SanDiegoDude/ComfyUI-Kontext-API.git
- Install required dependencies:
cd ComfyUI-Kontext-API
pip install -r requirements.txt
- Set up your Fal API key (REQUIRED):
Getting a Fal API Key
- Sign up at https://fal.ai/
- Go to your dashboard
- Generate an API key
Setting up the API Key
Choose one of these methods:
Option 1: Create a .fal_key file (Recommended)
- Create a file named
.fal_keyin theComfyUI-Kontext-APIdirectory - Put your Fal API key in this file (just the key, nothing else)
- The file should contain only your API key, for example:
fal_1234567890abcdef - Note: The
.fal_keyfile is already in.gitignorefor security
Option 2: Set environment variable
export FAL_KEY="your_fal_api_key_here"
Usage
- Find either node in the
image/generationcategory:- Fal Kontext API: For single image processing
- Fal Kontext Max (Multi-Image): For processing multiple images
- Connect your input image(s):
- Single node: Connect one image to the
imageinput - Multi node: Connect 1-4 images to
image1throughimage4inputs
- Single node: Connect one image to the
- Enter your prompt describing the desired transformation
- Adjust settings as needed
Technical Details
Image Upload System
To avoid API size limits when processing multiple images, this node automatically:
- Resizes images to fit under 1.25MP (1,250,000 pixels)
- Uploads images to Fal's storage service using
fal_client.upload_file() - Uses the returned URLs instead of base64 data in API calls
- Cleans up temporary files after upload
This approach ensures reliable processing of multiple images without hitting the 4MB payload limit.
Node Inputs
Fal Kontext API (Single Image)
- prompt (STRING): Text description of the desired image transformation
- image (IMAGE): Input image to transform
- seed (INT): Random seed (-1 for random, default: -1)
- disable_prompt_enhancement (BOOLEAN): Disable AI prompt enhancement (default: False)
Fal Kontext Max (Multi-Image)
- prompt (STRING): Text description of the desired image transformation
- image1 (IMAGE): Required input image
- image2 (IMAGE, optional): Additional input image
- image3 (IMAGE, optional): Additional input image
- image4 (IMAGE, optional): Additional input image
- aspect_ratio (COMBO): Output image aspect ratio
- seed (INT): Random seed (0 for random, default: 0)
- guidance_scale (FLOAT): How closely to follow the prompt (default: 3.5)
- output_format (COMBO): Output image format (jpeg/png)
- disable_prompt_enhancement (BOOLEAN): Disable AI prompt enhancement (default: False)
- **image_prompt_str
Nodos de este paquete
2 nodos
Nodos de este paquete
2 nodos- FalKontextMaxMultiImageNode
- KontextAPINode
Fuentes
3 fuentes
Fuentes
3 fuentesGitHubFuenteVersión ba00397f6efa452e06099bb4bba8a5b6ea6ef6de
github.com/SanDiegoDude/ComfyUI-Kontext-APIVerificado 3 oct
Registro de ComfyFuente
raw.githubusercontent.com/Comfy-Org/ComfyUI-Manager/main/extension-node-map.jsonVerificado 3 oct
Extractos de fuentes
1 extracto
Extractos de fuentes
1 extractoSource context: Repo SanDiegoDude/ComfyUI-Kontext-API
