Upload 153 files
Browse filesThis view is limited to 50 files because it contains too many changes. Β See raw diff
Files changed (50)
- .gitattributes+32
- aiorbust-ofm-pack-main/.gitignoreAdded+3
- aiorbust-ofm-pack-main/Dataset Images/2b8f22cca7c5c65e0f21d65339776b4a.jpgAdded
- aiorbust-ofm-pack-main/Dataset Images/3a7787cfa10c5bfbd1269e0a9b45ada4.jpgAdded
- aiorbust-ofm-pack-main/Dataset Images/4140ac46b33e548feda14b0fefc85bcb.jpgAdded
- aiorbust-ofm-pack-main/Dataset Images/43ee157d566b5aada5a3dcb47fb4afa8.jpgAdded
- aiorbust-ofm-pack-main/Dataset Images/4fb2f922a21d1cc3f7384e16bc817fe6.jpgAdded
- aiorbust-ofm-pack-main/Dataset Images/557147ab88ff595e5d4ba0e137304454.jpgAdded
- aiorbust-ofm-pack-main/Dataset Images/66730e5442b4c86a386965fa9678246a.jpgAdded
- aiorbust-ofm-pack-main/Dataset Images/69bed9b86d77e264664fff7869050be6.jpgAdded
- aiorbust-ofm-pack-main/Dataset Images/798efdefba3b245397347b2329bfd676.jpgAdded
- aiorbust-ofm-pack-main/Dataset Images/89ad03f568856e28c5507b9f1b3fe236.jpgAdded
- aiorbust-ofm-pack-main/Dataset Images/8b39dd90e95c7893c075434326b5cc62.jpgAdded
- aiorbust-ofm-pack-main/Dataset Images/a229b2355ab189a8188e9c82c9d3f4dd.jpgAdded
- aiorbust-ofm-pack-main/Dataset Images/adcd4d40bbf245ea29ce8d37ae6e2dc3.jpgAdded
- aiorbust-ofm-pack-main/Dataset Images/b16eb5e209202daa432b94e25959e5df.jpgAdded
- aiorbust-ofm-pack-main/Dataset Images/b36dba1f247bc466b79a1ba6e74fc0e7.jpgAdded
- aiorbust-ofm-pack-main/Dataset Images/b4bfd0bd35af867d1cdfdf900f72862a.jpgAdded
- aiorbust-ofm-pack-main/Dataset Images/c26a6085d8ad35128a3034aa0b001ec7.jpgAdded
- aiorbust-ofm-pack-main/Dataset Images/cb85eaee18ef536bcb713afb29bbb7d4.jpgAdded
- aiorbust-ofm-pack-main/Dataset Images/d0777b481e9b691e2428652b0b87cf3a.jpgAdded
- aiorbust-ofm-pack-main/Dataset Images/e389100aba8793f91cf7f03323f66100.jpgAdded
- aiorbust-ofm-pack-main/Dataset Images/e7bf042c20ca4000301dac977087e344.jpgAdded
- aiorbust-ofm-pack-main/Dataset Images/ee05e18211a38e7b2cd66fc172d388e1.jpgAdded
- aiorbust-ofm-pack-main/Example Faces/1a056bdce17022bfd6999f03945543ff.jpgAdded
- aiorbust-ofm-pack-main/Example Faces/392d48ced9a0f1a196e4a685087e5ac5.jpgAdded
- aiorbust-ofm-pack-main/Example Faces/75563368a304d1fec5a9f033aa97880d.jpgAdded
- aiorbust-ofm-pack-main/Example Faces/8b16036925ea003fb119a8b523448259.jpgAdded
- aiorbust-ofm-pack-main/Example Faces/9a1ecdb690dba74b2e90bb86a71e38e6.jpgAdded
- aiorbust-ofm-pack-main/Example Faces/a934f7b2cd16c41d1a775d4e955e87af.jpgAdded
- aiorbust-ofm-pack-main/Example Faces/b16eb5e209202daa432b94e25959e5df.jpgAdded
- aiorbust-ofm-pack-main/Example Faces/bcef8092ce8d4b4646c58dc8bd196c63.jpgAdded
- aiorbust-ofm-pack-main/Example Faces/c26a6085d8ad35128a3034aa0b001ec7.jpgAdded
- aiorbust-ofm-pack-main/Example Faces/c8288f2ceb488d300b075947bd86feb1.jpgAdded
- aiorbust-ofm-pack-main/Example Faces/ca8a48fd043663ee4f3e932c5eb33fd2.jpgAdded
- aiorbust-ofm-pack-main/Example Faces/cf63397bd45e32541178921182357e25.jpgAdded
- aiorbust-ofm-pack-main/Example Faces/ea2302a9ddb7ea4220fbc142cc00de98.jpgAdded
- aiorbust-ofm-pack-main/Example Faces/f33a36302bba4c005896c205242135c5.jpgAdded
- aiorbust-ofm-pack-main/Example Faces/f92c11a3eb8141a5a443c17ee1a0fe1a.jpgAdded
- aiorbust-ofm-pack-main/Example Faces/fd1b3747c03944a16dde6a22e5ea5640.jpgAdded
- aiorbust-ofm-pack-main/NODES.mdAdded+345
- aiorbust-ofm-pack-main/Node.pyAdded+703
- aiorbust-ofm-pack-main/README.mdAdded+89
- aiorbust-ofm-pack-main/Tattoos/02e55877541b2abc009c40857bb81f7c.jpgAdded
- aiorbust-ofm-pack-main/Tattoos/379aa9dc1fc4cb71d0abcf9e41031df6.jpgAdded
- aiorbust-ofm-pack-main/Tattoos/38cb0b53461bc5072be6fd4601ab9086.jpgAdded
- aiorbust-ofm-pack-main/Tattoos/49f2fc0dbff9bc228392b680db029b27.jpgAdded
- aiorbust-ofm-pack-main/Tattoos/5c92d43a5b8eb4846805f182125fbbe4.jpgAdded
- aiorbust-ofm-pack-main/Tattoos/5d8eafa003576838106a0c4bf08c7052.jpgAdded
- aiorbust-ofm-pack-main/Tattoos/b3e14391b8dcd3e7cb05170e74b0aa40.jpgAdded
32 unmodified lines333435363738394041424344454647484950515253545556575859606162636465666732 unmodified lines*.zip filter=lfs diff=lfs merge=lfs -text*.zst filter=lfs diff=lfs merge=lfs -text*tfevents* filter=lfs diff=lfs merge=lfs -textaiorbust-ofm-pack-main/Dataset[[:space:]]Images/2b8f22cca7c5c65e0f21d65339776b4a.jpg filter=lfs diff=lfs merge=lfs -textaiorbust-ofm-pack-main/Dataset[[:space:]]Images/3a7787cfa10c5bfbd1269e0a9b45ada4.jpg filter=lfs diff=lfs merge=lfs -textaiorbust-ofm-pack-main/Dataset[[:space:]]Images/4fb2f922a21d1cc3f7384e16bc817fe6.jpg filter=lfs diff=lfs merge=lfs -textaiorbust-ofm-pack-main/Dataset[[:space:]]Images/89ad03f568856e28c5507b9f1b3fe236.jpg filter=lfs diff=lfs merge=lfs -textaiorbust-ofm-pack-main/Dataset[[:space:]]Images/a229b2355ab189a8188e9c82c9d3f4dd.jpg filter=lfs diff=lfs merge=lfs -textaiorbust-ofm-pack-main/Dataset[[:space:]]Images/adcd4d40bbf245ea29ce8d37ae6e2dc3.jpg filter=lfs diff=lfs merge=lfs -textaiorbust-ofm-pack-main/Dataset[[:space:]]Images/b36dba1f247bc466b79a1ba6e74fc0e7.jpg filter=lfs diff=lfs merge=lfs -textaiorbust-ofm-pack-main/Dataset[[:space:]]Images/c26a6085d8ad35128a3034aa0b001ec7.jpg filter=lfs diff=lfs merge=lfs -textaiorbust-ofm-pack-main/Dataset[[:space:]]Images/cb85eaee18ef536bcb713afb29bbb7d4.jpg filter=lfs diff=lfs merge=lfs -textaiorbust-ofm-pack-main/Dataset[[:space:]]Images/d0777b481e9b691e2428652b0b87cf3a.jpg filter=lfs diff=lfs merge=lfs -textaiorbust-ofm-pack-main/Dataset[[:space:]]Images/ee05e18211a38e7b2cd66fc172d388e1.jpg filter=lfs diff=lfs merge=lfs -textaiorbust-ofm-pack-main/dataset_output/LORA_Flat/LORA_001.jpg filter=lfs diff=lfs merge=lfs -textaiorbust-ofm-pack-main/dataset_output/LORA_Skinny/LORA_001.jpg filter=lfs diff=lfs merge=lfs -textaiorbust-ofm-pack-main/Example[[:space:]]Faces/392d48ced9a0f1a196e4a685087e5ac5.jpg filter=lfs diff=lfs merge=lfs -textaiorbust-ofm-pack-main/Example[[:space:]]Faces/8b16036925ea003fb119a8b523448259.jpg filter=lfs diff=lfs merge=lfs -textaiorbust-ofm-pack-main/Example[[:space:]]Faces/9a1ecdb690dba74b2e90bb86a71e38e6.jpg filter=lfs diff=lfs merge=lfs -textaiorbust-ofm-pack-main/Example[[:space:]]Faces/c26a6085d8ad35128a3034aa0b001ec7.jpg filter=lfs diff=lfs merge=lfs -textaiorbust-ofm-pack-main/Example[[:space:]]Faces/ca8a48fd043663ee4f3e932c5eb33fd2.jpg filter=lfs diff=lfs merge=lfs -textaiorbust-ofm-pack-main/Example[[:space:]]Faces/ea2302a9ddb7ea4220fbc142cc00de98.jpg filter=lfs diff=lfs merge=lfs -textaiorbust-ofm-pack-main/Example[[:space:]]Faces/fd1b3747c03944a16dde6a22e5ea5640.jpg filter=lfs diff=lfs merge=lfs -textaiorbust-ofm-pack-main/example[[:space:]]influencer[[:space:]]images/can[[:space:]]you[[:space:]]find[[:space:]]me[[:space:]]in[[:space:]]the[[:space:]]forest[[:space:]](1).jpg filter=lfs diff=lfs merge=lfs -textaiorbust-ofm-pack-main/example[[:space:]]influencer[[:space:]]images/can[[:space:]]you[[:space:]]find[[:space:]]me[[:space:]]in[[:space:]]the[[:space:]]forest[[:space:]](2).jpg filter=lfs diff=lfs merge=lfs -textaiorbust-ofm-pack-main/example[[:space:]]influencer[[:space:]]images/can[[:space:]]you[[:space:]]find[[:space:]]me[[:space:]]in[[:space:]]the[[:space:]]forest.jpg filter=lfs diff=lfs merge=lfs -textaiorbust-ofm-pack-main/example[[:space:]]influencer[[:space:]]images/feeling[[:space:]]ethereal[[:space:]]π¦π.jpg filter=lfs diff=lfs merge=lfs -textaiorbust-ofm-pack-main/example[[:space:]]influencer[[:space:]]images/I[[:space:]]like[[:space:]]when[[:space:]]you[[:space:]]stare[[:space:]]π§‘[[:space:]](1).jpg filter=lfs diff=lfs merge=lfs -textaiorbust-ofm-pack-main/example[[:space:]]influencer[[:space:]]images/I[[:space:]]like[[:space:]]when[[:space:]]you[[:space:]]stare[[:space:]]π§‘[[:space:]](2).jpg filter=lfs diff=lfs merge=lfs -textaiorbust-ofm-pack-main/example[[:space:]]influencer[[:space:]]images/kiss[[:space:]]me[[:space:]]more[[:space:]]π[[:space:]](2).jpg filter=lfs diff=lfs merge=lfs -textaiorbust-ofm-pack-main/example[[:space:]]influencer[[:space:]]images/kiss[[:space:]]me[[:space:]]more[[:space:]]π[[:space:]](4).jpg filter=lfs diff=lfs merge=lfs -textaiorbust-ofm-pack-main/example[[:space:]]influencer[[:space:]]images/kiss[[:space:]]me[[:space:]]more[[:space:]]π.jpg filter=lfs diff=lfs merge=lfs -textaiorbust-ofm-pack-main/nano[[:space:]]banana[[:space:]]2.png filter=lfs diff=lfs merge=lfs -textaiorbust-ofm-pack-main/Tattoos/49f2fc0dbff9bc228392b680db029b27.jpg filter=lfs diff=lfs merge=lfs -textaiorbust-ofm-pack-main/Tattoos/5d8eafa003576838106a0c4bf08c7052.jpg filter=lfs diff=lfs merge=lfs -text123__pycache__/*.pyc*.pyo123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345# Aiorbust OFM Pack (Monthly) - Node Documentation
## Table of Contents
1. [Nano Banana Pro Edit](#nano-banana-pro-edit)2. [Nano Banana 2 Edit](#nano-banana-2-edit)3. [Seedream 4.5 Edit (Wavespeed)](#seedream-45-edit-wavespeed)4. [Seedream 4.5 Edit (fal.ai)](#seedream-45-edit-falai)5. [Prompt Generator](#prompt-generator)6. [Prompt Selector](#prompt-selector)7. [Directory Image Loader](#directory-image-loader)8. [Video Frame Extractor](#video-frame-extractor)9. [Lora Caption Generator](#lora-caption-generator)10. [Remove Image Metadata](#remove-image-metadata)11. [Save as Phone Photo](#save-as-phone-photo)12. [Load API Keys](#load-api-keys)
---
## Nano Banana Pro Edit
**Display Name:** Aiorbust Nano Banana Pro Edit**Category:** image
Edits or generates images using the Google Gemini 3 Pro image model. Accepts one or more input images along with a text prompt to guide the edit. Automatically detects aspect ratio from the input image when set to "auto".
### Inputs
| Name | Type | Required | Default | Description ||------|------|----------|---------|-------------|| images | IMAGE | Yes | β | Input image(s) to edit || api_key | STRING | Yes | β | Google Gemini API key || prompt | STRING | Yes | β | Text instruction describing the desired edit || aspect_ratio | Dropdown | No | auto | `auto`, `1:1`, `2:3`, `3:2`, `3:4`, `4:3`, `4:5`, `5:4`, `9:16`, `16:9`, `21:9` || image_size | Dropdown | No | 2K | `1K`, `2K`, `4K` || temperature | FLOAT | No | 1.0 | Creativity control (0.0 - 2.0) || seed | INT | No | 0 | Random seed for reproducibility || safety_threshold | Dropdown | No | OFF | Content safety filter level |
### Outputs
| Name | Type | Description ||------|------|-------------|| image | IMAGE | The edited/generated image |
---
## Nano Banana 2 Edit
**Display Name:** Aiorbust Nano Banana 2 Edit**Category:** image
Edits images using the Google Gemini 3.1 Flash image model. Faster than Nano Banana Pro but with a smaller model. Defaults to 1K output resolution.
### Inputs
| Name | Type | Required | Default | Description ||------|------|----------|---------|-------------|| images | IMAGE | Yes | β | Input image(s) to edit || api_key | STRING | Yes | β | Google Gemini API key || prompt | STRING | Yes | β | Text instruction describing the desired edit || aspect_ratio | Dropdown | No | auto | `auto`, `1:1`, `2:3`, `3:2`, `3:4`, `4:3`, `4:5`, `5:4`, `9:16`, `16:9`, `21:9` || image_size | Dropdown | No | 1K | `1K`, `2K`, `4K` || temperature | FLOAT | No | 1.0 | Creativity control (0.0 - 2.0, step 0.05) || seed | INT | No | 0 | Random seed for reproducibility || safety_threshold | Dropdown | No | OFF | Content safety filter level |
### Outputs
| Name | Type | Description ||------|------|-------------|| image | IMAGE | The edited/generated image |
---
## Seedream 4.5 Edit (Wavespeed)
**Display Name:** Aiorbust Seedream 4.5 Edit(Wavespeed)**Category:** image
Edits images using ByteDance's Seedream 4.5 model hosted on WaveSpeed API. Supports 1-10 reference images for context-aware editing with facial feature, lighting, and color tone preservation. Can output up to 4 images per run. When size is set to "auto", it scales the input aspect ratio to approximately 2K resolution.
### Inputs
| Name | Type | Required | Default | Description ||------|------|----------|---------|-------------|| images | IMAGE | Yes | β | 1-10 reference images || wavespeed_apikey | STRING | Yes | β | WaveSpeed API key || prompt | STRING | Yes | β | Text instruction for the edit || size | Dropdown | No | auto β match input (2K) | Preset sizes: auto, square 1:1, landscape 4:3, portrait 3:4, portrait 4:5, landscape 5:4, landscape 16:9, portrait 9:16 || num_images | INT | No | 1 | Number of output images (1-4) || use_custom_size | BOOLEAN | No | False | Enable custom width/height instead of presets || custom_width | INT | No | 2048 | Custom output width (512-8192, step 64) || custom_height | INT | No | 2048 | Custom output height (512-8192, step 64) |
### Outputs
| Name | Type | Description ||------|------|-------------|| image | IMAGE | Edited image(s) as a batch tensor |
---
## Seedream 4.5 Edit (fal.ai)
**Display Name:** Aiorbust Seedream 4.5 Edit(fal.ai)**Category:** image
Same Seedream 4.5 model as above but hosted on fal.ai. Functionally identical with a different API backend. Use this if you have a fal.ai API key instead of WaveSpeed.
### Inputs
| Name | Type | Required | Default | Description ||------|------|----------|---------|-------------|| images | IMAGE | Yes | β | 1-10 reference images || fal_apikey | STRING | Yes | β | fal.ai API key || prompt | STRING | Yes | β | Text instruction for the edit || size | Dropdown | No | auto β match input (2K) | Preset sizes (same options as WaveSpeed version) || num_images | INT | No | 1 | Number of output images (1-4) || use_custom_size | BOOLEAN | No | False | Enable custom width/height instead of presets || custom_width | INT | No | 2048 | Custom output width (512-8192, step 64) || custom_height | INT | No | 2048 | Custom output height (512-8192, step 64) |
### Outputs
| Name | Type | Description ||------|------|-------------|| image | IMAGE | Edited image(s) as a batch tensor |
---
## Prompt Generator
**Display Name:** Aiorbust Prompt Generator**Category:** utils
Generates prompts using Gemini or Grok LLMs. Supports 6 modes: JSON image analysis (detailed visual breakdown), style transfer prompt extraction, 4 Seedream Edit configurations for multi-face/body reference workflows, and a custom prompt mode. Can optionally analyze input images.
### Inputs
| Name | Type | Required | Default | Description ||------|------|----------|---------|-------------|| mode | Dropdown | Yes | JSON Image Analysis | `JSON Image Analysis`, `Style Transfer Prompt`, `Seedream Edit (2 face + 1 ref)`, `Seedream Edit (1 face + 1 ref)`, `Seedream Edit (2 face and body + 1 ref)`, `Seedream Edit (2 faces + 2 bodies + 1ref)`, `Custom Prompt` || provider | Dropdown | Yes | Gemini | `Gemini` or `Grok` || gemini_api_key | STRING | No | β | Google Gemini API key (required when provider is Gemini) || grok_api_key | STRING | No | β | xAI Grok API key (required when provider is Grok) || images | IMAGE | No | β | Input images for analysis || custom_prompt | STRING | No | β | Custom instruction text (used in Custom Prompt mode) || gemini_model | Dropdown | No | gemini-2.5-pro | `gemini-2.5-pro`, `gemini-2.5-flash`, `gemini-2.0-flash` || grok_model | Dropdown | No | grok-4.20-0309-reasoning | Various Grok models (reasoning and non-reasoning variants) || temperature | FLOAT | No | 1.0 | Creativity control (0.0 - 2.0) || max_tokens | INT | No | 8192 | Maximum output length (64 - 65536) || safety_threshold | Dropdown | No | BLOCK_ONLY_HIGH | Content safety filter level || seed | INT | No | 0 | Random seed |
### Outputs
| Name | Type | Description ||------|------|-------------|| prompt | STRING | The generated prompt text |
---
## Prompt Selector
**Display Name:** Aiorbust Prompt Selector**Category:** utils
Select from pre-written example prompts stored in text files, or type your own. Prompts are loaded from `.txt` files in the `prompts/` directory (separated by `---` delimiters). If user-provided text is entered, it takes priority over the selected example.
### Inputs
| Name | Type | Required | Default | Description ||------|------|----------|---------|-------------|| prompt_file | Dropdown | Yes | β | Select a prompt file or "Pose and Style Transfer Prompts" || example_prompt | Dropdown | Yes | β | Select a specific prompt from the loaded file || prompt_text | STRING | Yes | β | Custom prompt text (overrides selection if non-empty) |
### Outputs
| Name | Type | Description ||------|------|-------------|| prompt | STRING | The selected or typed prompt |
---
## Directory Image Loader
**Display Name:** Aiorbust Directory Image Loader**Category:** image
Loads images one at a time from a folder, auto-incrementing through all files. Designed for batch workflows β automatically queues the next image after each run. Supports both relative paths (subfolders of ComfyUI/input/) and absolute paths.
Supported formats: `.png`, `.jpg`, `.jpeg`, `.webp`, `.bmp`, `.tiff`, `.tif`
### Inputs
| Name | Type | Required | Default | Description ||------|------|----------|---------|-------------|| use_absolute_path | BOOLEAN | Yes | False | Toggle between input subfolder or absolute path || run_count | INT | Yes | 1 | Controls which image index to load (auto-increments) || input_folder | Dropdown | No | β | Subfolder within ComfyUI/input/ || absolute_path | STRING | No | β | Full path to an image directory |
### Outputs
| Name | Type | Description ||------|------|-------------|| image | IMAGE | The loaded image tensor || filename | STRING | Name of the current file || filepath | STRING | Full path to the current file || current_index | INT | Current image index (1-based) || total_count | INT | Total number of images in the folder |
---
## Video Frame Extractor
**Display Name:** Aiorbust Video Frame Extractor**Category:** image
Extracts frames from video files using PyAV. Upload a video to ComfyUI's input folder, choose a start time and frame count, and select which extracted frame to output. Includes a preview button in the UI to browse frames visually.
Supported formats: `.mp4`, `.avi`, `.mov`, `.mkv`, `.webm`, `.flv`, `.wmv`, `.m4v`
### Inputs
| Name | Type | Required | Default | Description ||------|------|----------|---------|-------------|| video | Dropdown | Yes | β | Video file from ComfyUI/input/ (supports upload) || start_second | FLOAT | Yes | 0.0 | Start time in seconds (0 - 86400) || frame_count | INT | Yes | 10 | Number of frames to extract (1 - 9999) || frame_interval | INT | Yes | 1 | Sample every Nth frame (1 - 300) || selected_frame | INT | Yes | 0 | Which extracted frame to use as output (0 - 9998) |
### Outputs
| Name | Type | Description ||------|------|-------------|| image | IMAGE | The selected frame as an image tensor |
---
## Lora Caption Generator
**Display Name:** Aiorbust Lora Caption Generator**Category:** image
Generates LoRA training captions for images using Gemini or Grok vision APIs. Creates a `.txt` caption file per image with the same filename. Designed to work with the Directory Image Loader for batch captioning. Optionally prepends a trigger word to each caption.
### Inputs
| Name | Type | Required | Default | Description ||------|------|----------|---------|-------------|| image | IMAGE | Yes | β | Input image to caption || filename | STRING | Yes | β | Filename (must be connected from another node) || api_key | STRING | Yes | β | Gemini or Grok API key || provider | Dropdown | Yes | gemini | `gemini` or `grok` || trigger_word | STRING | Yes | β | Word prepended to each caption (e.g. "ohwx") || output_folder_name | STRING | Yes | lora_captions | Subfolder name in ComfyUI/output/ || gemini_model | Dropdown | No | gemini-2.5-flash | Gemini model to use || grok_model | Dropdown | No | grok-2-vision-latest | Grok model to use || caption_instruction | STRING | No | (detailed default) | Custom instruction for the vision model || temperature | FLOAT | No | 0.7 | Creativity control (0.0 - 2.0) || max_tokens | INT | No | 512 | Maximum caption length (64 - 4096) || overwrite_existing | BOOLEAN | No | False | Whether to overwrite existing caption files |
### Outputs
| Name | Type | Description ||------|------|-------------|| caption | STRING | The generated caption text || caption_filepath | STRING | Path to the saved .txt file |
---
## Remove Image Metadata
**Display Name:** Aiorbust Remove Image Metadata**Category:** image
Batch-strips all metadata (EXIF, XMP, PNG chunks, ICC profiles, C2PA) from images in a folder and re-saves them as clean JPEGs. Optionally adds subtle noise to further break any steganographic fingerprints.
### Inputs
| Name | Type | Required | Default | Description ||------|------|----------|---------|-------------|| folder | Dropdown | Yes | β | Subfolder within ComfyUI/input/ || filename_prefix | STRING | Yes | ComfyUI | Prefix for output filenames || output_folder | STRING | Yes | cleaned | Subfolder name in ComfyUI/output/ || quality | INT | Yes | 93 | JPEG quality (1-100) || add_noise | BOOLEAN | No | True | Add subtle noise to break fingerprints |
### Outputs
None (output node only). Saves cleaned images to `ComfyUI/output/<output_folder>/`.
---
## Save as Phone Photo
**Display Name:** Aiorbust Save as Phone Photo**Category:** image
Batch-saves images with realistic phone camera EXIF metadata. Supports iPhone 15/16 Pro Max and Samsung Galaxy S24/S25 Ultra with authentic device-specific EXIF data (make, model, software version, focal length, f-number, ISO, exposure). Optionally adds GPS coordinates and subtle noise.
### Inputs
| Name | Type | Required | Default | Description ||------|------|----------|---------|-------------|| folder | Dropdown | Yes | β | Subfolder within ComfyUI/input/ || filename_prefix | STRING | Yes | ComfyUI | Prefix for output filenames || phone_model | Dropdown | Yes | β | `iPhone 15 Pro Max`, `iPhone 16 Pro Max`, `Samsung Galaxy S24 Ultra`, `Samsung Galaxy S25 Ultra` || resolution | Dropdown | Yes | 12MP | `12MP`, `48MP/50MP`, `Original` || gps_location | Dropdown | Yes | Random US City | `None`, `New York`, `Los Angeles`, `London`, `Tokyo`, `Paris`, `Sydney`, `Dubai`, `Random US City` || output_folder | STRING | Yes | phone_photos | Subfolder name in ComfyUI/output/ || quality | INT | Yes | 95 | JPEG quality (1-100) || add_noise | BOOLEAN | No | True | Add subtle noise for realism |
### Outputs
None (output node only). Saves images to `ComfyUI/output/<output_folder>/`.
---
## Load API Keys
**Display Name:** Aiorbust Load API Keys**Category:** utils
Simple utility node to enter API keys once and wire them to multiple nodes that need authentication. Avoids duplicating keys across your workflow.
### Inputs
| Name | Type | Required | Default | Description ||------|------|----------|---------|-------------|| gemini_api_key | STRING | Yes | β | Google Gemini API key || wavespeed_api_key | STRING | Yes | β | WaveSpeed API key |
### Outputs
| Name | Type | Description ||------|------|-------------|| gemini_api_key | STRING | Pass-through Gemini key || wavespeed_api_key | STRING | Pass-through WaveSpeed key |123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703"""ComfyUI custom nodes for Nano Banana Pro and Nano Banana 2 APIs.- Nano Banana Pro Edit: edit with images (Gemini 3 Pro).- Nano Banana 2 Edit: edit with images (Gemini 3.1 Flash).Each node returns image as ComfyUI IMAGE tensor [B, H, W, C]."""
import loggingimport ioimport base64import random as _random
import requestsimport torchimport numpy as npfrom PIL import Image
_SAFETY_THRESHOLDS = [ "OFF", "BLOCK_NONE", "BLOCK_ONLY_HIGH", "BLOCK_MEDIUM_AND_ABOVE", "BLOCK_LOW_AND_ABOVE",]
_HARM_CATEGORIES = ( "HARM_CATEGORY_HARASSMENT", "HARM_CATEGORY_HATE_SPEECH", "HARM_CATEGORY_SEXUALLY_EXPLICIT", "HARM_CATEGORY_DANGEROUS_CONTENT",)
_ASPECT_RATIOS = [ "auto", "1:1", "2:3", "3:2", "3:4", "4:3", "4:5", "5:4", "9:16", "16:9", "21:9",]
_IMAGE_SIZES = ["1K", "2K", "4K"]
# ---------- Nano Banana Pro Edit ----------
class NanoBananaProEditAPINode: """Edit/Generate images via Gemini 3 Pro (gemimg.py reference implementation)."""
MODEL_ID = "gemini-3-pro-image-preview" BASE_URL = "https://generativelanguage.googleapis.com/v1beta/models" _cached_api_key = ""
@classmethod def INPUT_TYPES(cls): return { "required": { "images": ("IMAGE",), "api_key": ("STRING", {"default": "", "multiline": False}), "prompt": ("STRING", {"default": "", "multiline": True}), }, "optional": { "aspect_ratio": (_ASPECT_RATIOS, {"default": "auto"}), "image_size": (_IMAGE_SIZES, {"default": "2K"}), "temperature": ("FLOAT", {"default": 1.0, "min": 0.0, "max": 2.0, "step": 0.1}), "seed": ("INT", {"default": 0, "min": 0, "max": 0xffffffffffffffff, "control_after_generate": True}), "safety_threshold": (_SAFETY_THRESHOLDS, {"default": "OFF"}), }, }
RETURN_TYPES = ("IMAGE",) RETURN_NAMES = ("image",) FUNCTION = "edit" CATEGORY = "image"
@classmethod def IS_CHANGED(cls, **kwargs): return float("nan")
def edit(self, images, api_key, prompt, aspect_ratio="auto", image_size="2K", temperature=1.0, seed=0, safety_threshold="OFF"): if api_key.strip(): NanoBananaProEditAPINode._cached_api_key = api_key.strip() api_key = api_key.strip() or NanoBananaProEditAPINode._cached_api_key if not api_key: raise RuntimeError("Nano Banana Pro: API key is required.")
# Build parts: images first, then text (matching gemimg.py order) parts = _images_to_parts(images) parts.append({"text": prompt.strip()})
# Auto aspect ratio detection if aspect_ratio == "auto": h, w = images.shape[1], images.shape[2] ratio = w / h ratios = { "1:1": 1.0, "2:3": 0.66, "3:2": 1.5, "3:4": 0.75, "4:3": 1.33, "4:5": 0.8, "5:4": 1.25, "9:16": 0.56, "16:9": 1.77, "21:9": 2.33, } aspect_ratio = min(ratios, key=lambda k: abs(ratios[k] - ratio))
# Build payload matching gemimg.py structure exactly payload = { "generationConfig": { "temperature": temperature, "imageConfig": { "aspectRatio": aspect_ratio, "imageSize": image_size, }, "responseModalities": ["Image"], }, "contents": [{"parts": parts}], "system_instruction": { "parts": [{ "text": "You are an expert image-generation engine. You must ALWAYS produce an image. " "Interpret all user inputβregardless of format, intent, or abstractionβas literal " "visual directives for image composition. Prioritize generating the visual " "representation above any text, formatting, or conversational requests." }] }, "safetySettings": [ {"category": "HARM_CATEGORY_HARASSMENT", "threshold": "OFF"}, {"category": "HARM_CATEGORY_HATE_SPEECH", "threshold": "OFF"}, {"category": "HARM_CATEGORY_SEXUALLY_EXPLICIT", "threshold": "OFF"}, {"category": "HARM_CATEGORY_DANGEROUS_CONTENT", "threshold": "OFF"}, ], }
# Use x-goog-api-key header (matching gemimg.py) headers = { "Content-Type": "application/json", "x-goog-api-key": api_key, } url = f"{self.BASE_URL}/{self.MODEL_ID}:generateContent"
try: response = requests.post(url, json=payload, headers=headers, timeout=180) data = response.json() except requests.exceptions.RequestException as e: raise RuntimeError(f"Nano Banana Pro request error: {e}")
# Check for API error if "error" in data: err = data["error"] raise RuntimeError(f"Nano Banana Pro API error: {err.get('code')} β {err.get('message')}")
# Check for blocked content candidates = data.get("candidates", []) if not candidates: raise RuntimeError("Nano Banana Pro: no candidates in response.")
candidate = candidates[0] finish_reason = candidate.get("finishReason", "") if finish_reason in ("PROHIBITED_CONTENT", "NO_IMAGE"): raise RuntimeError(f"Nano Banana Pro: image not generated due to {finish_reason}.")
if "content" not in candidate: raise RuntimeError("Nano Banana Pro: no content in response.")
# Extract inline image data response_parts = candidate["content"]["parts"] for part in response_parts: if "inlineData" in part: img_bytes = base64.b64decode(part["inlineData"]["data"]) return _image_bytes_to_tensor(img_bytes, "Nano Banana Pro")
raise RuntimeError("Nano Banana Pro: no image found in response parts.")
# ---------- Nano Banana 2 Edit ----------
class NanoBanana2EditAPINode: """Edit images via Gemini 3.1 Flash API."""
MODEL_ID = "gemini-3.1-flash-image-preview" BASE_URL = f"https://generativelanguage.googleapis.com/v1beta/models/{MODEL_ID}:generateContent" _cached_api_key = ""
@classmethod def INPUT_TYPES(cls): return { "required": { "images": ("IMAGE",), "api_key": ("STRING", {"default": "", "multiline": False}), "prompt": ("STRING", {"default": "", "multiline": True}), }, "optional": { "aspect_ratio": (_ASPECT_RATIOS, {"default": "auto"}), "image_size": (_IMAGE_SIZES, {"default": "1K"}), "temperature": ("FLOAT", {"default": 1.0, "min": 0.0, "max": 2.0, "step": 0.05}), "seed": ("INT", {"default": 0, "min": 0, "max": 0xffffffffffffffff, "control_after_generate": True}), "safety_threshold": (_SAFETY_THRESHOLDS, {"default": "OFF"}), }, }
RETURN_TYPES = ("IMAGE",) RETURN_NAMES = ("image",) FUNCTION = "edit" CATEGORY = "image"
@classmethod def IS_CHANGED(cls, **kwargs): return float("nan")
def edit(self, images, api_key, prompt, aspect_ratio="auto", image_size="1K", temperature=1.0, seed=0, safety_threshold="OFF"): if api_key.strip(): NanoBanana2EditAPINode._cached_api_key = api_key.strip() api_key = api_key.strip() or NanoBanana2EditAPINode._cached_api_key if not api_key: raise RuntimeError("Nano Banana 2 Edit: API key is required.") if images.shape[0] == 0: raise RuntimeError("Nano Banana 2 Edit: at least one image is required.")
parts = _images_to_parts(images) parts.append({"text": prompt})
image_config = {} if aspect_ratio != "auto": image_config["aspectRatio"] = aspect_ratio if image_size: image_config["imageSize"] = image_size
gen_config = { "responseModalities": ["TEXT", "IMAGE"], "temperature": temperature, "seed": seed, } if image_config: gen_config["imageConfig"] = image_config
payload = { "contents": [{"role": "user", "parts": parts}], "systemInstruction": { "parts": [{ "text": "You are an expert image-generation engine. You must ALWAYS produce an image. " "Interpret all user inputβregardless of format, intent, or abstractionβas literal " "visual directives for image composition. Prioritize generating the visual " "representation above any text, formatting, or conversational requests." }] }, "generationConfig": gen_config, "safetySettings": [ {"category": "HARM_CATEGORY_HARASSMENT", "threshold": "OFF"}, {"category": "HARM_CATEGORY_HATE_SPEECH", "threshold": "OFF"}, {"category": "HARM_CATEGORY_SEXUALLY_EXPLICIT", "threshold": "OFF"}, {"category": "HARM_CATEGORY_DANGEROUS_CONTENT", "threshold": "OFF"}, ], }
url = f"{self.BASE_URL}?key={api_key}" try: response = requests.post(url, json=payload, headers={"Content-Type": "application/json"}, timeout=120) response.raise_for_status() data = response.json() except requests.exceptions.HTTPError as e: raise RuntimeError(_api_error_msg("Nano Banana 2 Edit", e)) except requests.exceptions.RequestException as e: raise RuntimeError(f"Nano Banana 2 Edit request error: {e!s}")
raw = _extract_image_from_gemini_response(data, "Nano Banana 2 Edit") if not raw: detail = _gemini_response_summary(data) raise RuntimeError(f"Nano Banana 2 Edit: no image in response. {detail}") return _image_bytes_to_tensor(raw, "Nano Banana 2 Edit")
# ---------- Seedream 4.5 Edit (WaveSpeed) ----------
import time as _time
_SEEDREAM_SIZES = [ "auto β match input (2K)", "1920*1920 β square (1:1)", "2560*1920 β landscape_4_3 (4:3)", "1920*2560 β portrait_4_3 (3:4)", "1536*1920 β portrait_4_5 (4:5)", "1920*1536 β landscape_5_4 (5:4)", "2560*1440 β landscape_16_9 (16:9)", "1440*2560 β portrait_16_9 (9:16)",]
class SeedreamEditAPINode: """Edit images via ByteDance Seedream 4.5 Edit on WaveSpeed API.
Supports 1-10 reference images for context-aware editing with facial feature, lighting, and color tone preservation up to 4K. """
BASE_URL = "https://api.wavespeed.ai/api/v3/bytedance/seedream-v4.5/edit" _cached_api_key = ""
@classmethod def INPUT_TYPES(cls): return { "required": { "images": ("IMAGE",), "wavespeed_apikey": ("STRING", {"default": "", "multiline": False}), "prompt": ("STRING", {"default": "", "multiline": True}), }, "optional": { "size": (_SEEDREAM_SIZES, {"default": "auto β match input (2K)"}), "num_images": ("INT", {"default": 1, "min": 1, "max": 4, "step": 1}), "use_custom_size": ("BOOLEAN", {"default": False}), "custom_width": ("INT", {"default": 2048, "min": 512, "max": 8192, "step": 64}), "custom_height": ("INT", {"default": 2048, "min": 512, "max": 8192, "step": 64}), }, }
RETURN_TYPES = ("IMAGE",) RETURN_NAMES = ("image",) FUNCTION = "edit" CATEGORY = "image"
@classmethod def IS_CHANGED(cls, **kwargs): return float("nan")
def edit(self, images, wavespeed_apikey, prompt, size="auto β match input (2K)", num_images=1, use_custom_size=False, custom_width=2048, custom_height=2048): if wavespeed_apikey.strip(): SeedreamEditAPINode._cached_api_key = wavespeed_apikey.strip() api_key = wavespeed_apikey.strip() or SeedreamEditAPINode._cached_api_key if not api_key: raise RuntimeError("Seedream 4.5 Edit: WaveSpeed API key is required.") if not prompt.strip(): raise RuntimeError("Seedream 4.5 Edit: prompt is required.") if images.shape[0] == 0: raise RuntimeError("Seedream 4.5 Edit: at least one image is required.")
# Resolve size if use_custom_size: api_size = f"{custom_width}*{custom_height}" elif size.startswith("auto"): # Use first image's exact aspect ratio, scale to meet minimum pixels h, w = images.shape[1], images.shape[2] min_pixels = 3686400 # Scale up proportionally until we meet minimum pixels scale = max(1.0, (min_pixels / (w * h)) ** 0.5) new_w = int(round(w * scale / 64) * 64) new_h = int(round(h * scale / 64) * 64) # Clamp to API limits new_w = max(512, min(8192, new_w)) new_h = max(512, min(8192, new_h)) api_size = f"{new_w}*{new_h}" logging.info("Seedream auto size: input %dx%d -> output %s", w, h, api_size) else: api_size = size.split(" ")[0] # e.g. "2048*2048" from "2048*2048 β square_hd (1:1)"
# Convert images to data URIs (max 10) image_uris = [] count = min(images.shape[0], 10) for i in range(count): img_np = (255.0 * images[i].cpu().numpy()).clip(0, 255).astype(np.uint8) pil = Image.fromarray(img_np) buf = io.BytesIO() pil.save(buf, format="PNG") b64 = base64.b64encode(buf.getvalue()).decode("ascii") image_uris.append(f"data:image/png;base64,{b64}")
payload = { "images": image_uris, "prompt": prompt, "size": api_size, "num_images": num_images, "enable_sync_mode": True, "enable_base64_output": True, } headers = { "Authorization": f"Bearer {api_key}", "Content-Type": "application/json", }
try: response = requests.post(self.BASE_URL, json=payload, headers=headers, timeout=180) response.raise_for_status() result = response.json() except requests.exceptions.HTTPError as e: raise RuntimeError(_api_error_msg("Seedream 4.5 Edit", e)) except requests.exceptions.RequestException as e: raise RuntimeError(f"Seedream 4.5 Edit request error: {e!s}")
data = result.get("data", {})
# Async polling fallback if sync mode didn't complete immediately if data.get("status") not in ("completed",): poll_url = data.get("urls", {}).get("get", "") if not poll_url: raise RuntimeError("Seedream 4.5 Edit: no poll URL and task not completed.") for _ in range(90): _time.sleep(2) try: poll_resp = requests.get(poll_url, headers=headers, timeout=30) poll_resp.raise_for_status() data = poll_resp.json().get("data", {}) except requests.exceptions.RequestException as e: logging.warning("Seedream 4.5 Edit poll error: %s", e) continue if data.get("status") == "completed": break if data.get("status") == "failed": raise RuntimeError(f"Seedream 4.5 Edit failed: {data.get('error', 'unknown error')}") else: raise RuntimeError("Seedream 4.5 Edit timed out after 3 minutes.")
outputs = data.get("outputs", []) if not outputs: raise RuntimeError("Seedream 4.5 Edit: no images in API response.")
# Decode all output images import torch tensors = [] for idx, output in enumerate(outputs): if output.startswith("data:"): b64_data = output.split(",", 1)[-1] raw = base64.b64decode(b64_data) elif output.startswith("http"): try: img_resp = requests.get(output, timeout=60) img_resp.raise_for_status() raw = img_resp.content except requests.exceptions.RequestException as e: raise RuntimeError(f"Seedream 4.5 Edit: failed to download image {idx}: {e!s}") else: # Assume raw base64 raw = base64.b64decode(output) tensor_tuple = _image_bytes_to_tensor(raw, "Seedream 4.5 Edit") tensors.append(tensor_tuple[0])
if not tensors: raise RuntimeError("Seedream 4.5 Edit: no valid images decoded.")
batched = torch.cat(tensors, dim=0) return (batched,)
# ---------- Seedream 4.5 Edit (fal.ai) ----------
_FAL_SEEDREAM_SIZES = [ "auto β match input (2K)", "1920*1920 β square (1:1)", "2560*1920 β landscape (4:3)", "1920*2560 β portrait (3:4)", "1536*1920 β portrait (4:5)", "1920*1536 β landscape (5:4)", "2560*1440 β landscape (16:9)", "1440*2560 β portrait (9:16)",]
_FAL_SIZE_MAP = { "1920*1920": "square_hd", "2560*1920": "landscape_4_3", "1920*2560": "portrait_4_3", "1536*1920": {"width": 1536, "height": 1920}, "1920*1536": {"width": 1920, "height": 1536}, "2560*1440": "landscape_16_9", "1440*2560": "portrait_16_9",}
class SeedreamEditFalAPINode: """Edit images via ByteDance Seedream 4.5 Edit on fal.ai.
Supports 1-10 reference images for context-aware editing with facial feature, lighting, and color tone preservation up to 4K. """
BASE_URL = "https://fal.run/fal-ai/bytedance/seedream/v4.5/edit" _cached_api_key = ""
@classmethod def INPUT_TYPES(cls): return { "required": { "images": ("IMAGE",), "fal_apikey": ("STRING", {"default": "", "multiline": False}), "prompt": ("STRING", {"default": "", "multiline": True}), }, "optional": { "size": (_FAL_SEEDREAM_SIZES, {"default": "auto β match input (2K)"}), "num_images": ("INT", {"default": 1, "min": 1, "max": 4, "step": 1}), "use_custom_size": ("BOOLEAN", {"default": False}), "custom_width": ("INT", {"default": 2048, "min": 512, "max": 8192, "step": 64}), "custom_height": ("INT", {"default": 2048, "min": 512, "max": 8192, "step": 64}), }, }
RETURN_TYPES = ("IMAGE",) RETURN_NAMES = ("image",) FUNCTION = "edit" CATEGORY = "image"
@classmethod def IS_CHANGED(cls, **kwargs): return float("nan")
def edit(self, images, fal_apikey, prompt, size="auto β match input (2K)", num_images=1, use_custom_size=False, custom_width=2048, custom_height=2048): if fal_apikey.strip(): SeedreamEditFalAPINode._cached_api_key = fal_apikey.strip() api_key = fal_apikey.strip() or SeedreamEditFalAPINode._cached_api_key if not api_key: raise RuntimeError("Seedream 4.5 Edit (fal.ai): fal.ai API key is required.") if not prompt.strip(): raise RuntimeError("Seedream 4.5 Edit (fal.ai): prompt is required.") if images.shape[0] == 0: raise RuntimeError("Seedream 4.5 Edit (fal.ai): at least one image is required.")
# Resolve size if use_custom_size: fal_size = {"width": custom_width, "height": custom_height} elif size.startswith("auto"): # Use first image's exact aspect ratio, scale to ~2K h, w = images.shape[1], images.shape[2] target_pixels = 1920 * 1920 # 2K target current_pixels = w * h scale = (target_pixels / current_pixels) ** 0.5 new_w = int(round(w * scale / 64) * 64) new_h = int(round(h * scale / 64) * 64) new_w = max(512, min(4096, new_w)) new_h = max(512, min(4096, new_h)) fal_size = {"width": new_w, "height": new_h} logging.info("Seedream (fal.ai) auto size: input %dx%d -> output %dx%d", w, h, new_w, new_h) else: dimension_str = size.split(" ")[0] fal_size = _FAL_SIZE_MAP.get(dimension_str, "square_hd")
# Convert images to data URIs (max 10) image_urls = [] count = min(images.shape[0], 10) for i in range(count): img_np = (255.0 * images[i].cpu().numpy()).clip(0, 255).astype(np.uint8) pil = Image.fromarray(img_np) buf = io.BytesIO() pil.save(buf, format="PNG") b64 = base64.b64encode(buf.getvalue()).decode("ascii") image_urls.append(f"data:image/png;base64,{b64}")
payload = { "prompt": prompt, "image_urls": image_urls, "image_size": fal_size, "num_images": num_images, "seed": _random.randint(0, 2147483647), "enable_safety_checker": False, } headers = { "Authorization": f"Key {api_key}", "Content-Type": "application/json", }
try: response = requests.post(self.BASE_URL, json=payload, headers=headers, timeout=180) response.raise_for_status() result = response.json() except requests.exceptions.HTTPError as e: raise RuntimeError(_api_error_msg("Seedream 4.5 Edit (fal.ai)", e)) except requests.exceptions.RequestException as e: raise RuntimeError(f"Seedream 4.5 Edit (fal.ai) request error: {e!s}")
fal_images = result.get("images", []) if not fal_images: raise RuntimeError("Seedream 4.5 Edit (fal.ai): no images in API response.")
# Download and decode all result images tensors = [] for idx, fal_img in enumerate(fal_images): img_url = fal_img.get("url", "") if not img_url: logging.warning("Seedream 4.5 Edit (fal.ai): no URL for image %d, skipping.", idx) continue try: img_resp = requests.get(img_url, timeout=60) img_resp.raise_for_status() raw = img_resp.content except requests.exceptions.RequestException as e: raise RuntimeError(f"Seedream 4.5 Edit (fal.ai): failed to download image {idx}: {e!s}") tensor_tuple = _image_bytes_to_tensor(raw, "Seedream 4.5 Edit (fal.ai)") tensors.append(tensor_tuple[0])
if not tensors: raise RuntimeError("Seedream 4.5 Edit (fal.ai): no valid images downloaded.")
import torch batched = torch.cat(tensors, dim=0) return (batched,)
# ---------- Helpers ----------
def _images_to_parts(images): """Convert ComfyUI IMAGE tensor [B, H, W, C] to list of inlineData parts.""" parts = [] for i in range(images.shape[0]): img_np = (255.0 * images[i].cpu().numpy()).clip(0, 255).astype(np.uint8) pil = Image.fromarray(img_np) buf = io.BytesIO() pil.save(buf, format="PNG") b64 = base64.b64encode(buf.getvalue()).decode("ascii") parts.append({"inlineData": {"mimeType": "image/png", "data": b64}}) return parts
def _apply_gemini_safety(payload, threshold): """Apply safety threshold to all harm categories.""" payload["safetySettings"] = [ {"category": cat, "threshold": threshold} for cat in _HARM_CATEGORIES ]
def _gemini_response_summary(data): """Return a human-readable summary of why a Gemini response contained no image.""" try: candidates = data.get("candidates") or [] if not candidates: prompt_feedback = data.get("promptFeedback", {}) block_reason = prompt_feedback.get("blockReason", "") if block_reason: return f"Prompt was blocked: {block_reason}" return "No candidates returned." candidate = candidates[0] finish_reason = candidate.get("finishReason", "") parts = candidate.get("content", {}).get("parts") or [] text_parts = [p["text"] for p in parts if "text" in p and not p.get("thought")] if text_parts: snippet = " | ".join(text_parts)[:300] return f"Model returned text only (finishReason={finish_reason}): {snippet}" return f"No image part in response (finishReason={finish_reason})." except Exception: return ""
def _extract_image_from_gemini_response(data, log_name): """Extract the first non-thought inline image from a Gemini generateContent response.""" try: candidates = data.get("candidates") or [] if not candidates: logging.warning("%s: response has no candidates. Full response: %s", log_name, data) return None candidate = candidates[0] finish_reason = candidate.get("finishReason", "") parts = candidate.get("content", {}).get("parts") or [] logging.info("%s: finishReason=%s, part count=%d", log_name, finish_reason, len(parts)) text_parts = [] for part in parts: if part.get("thought"): continue if "inlineData" in part: b64 = part["inlineData"].get("data") if b64: return base64.b64decode(b64) if "text" in part: text_parts.append(part["text"]) if text_parts: logging.warning( "%s: API returned text instead of image (finishReason=%s). Text: %s", log_name, finish_reason, " | ".join(text_parts)[:500], ) else: logging.warning( "%s: no image or text in response. finishReason=%s. Full response: %s", log_name, finish_reason, str(data)[:1000], ) except (KeyError, TypeError, ValueError) as e: logging.warning("%s parse response: %s β raw: %s", log_name, e, str(data)[:500]) return None
def _api_error_msg(service, e): msg = f"{service} API HTTP error: {e.response.status_code}" try: body = e.response.json() if "error" in body: msg += f" β {body.get('error', body)}" elif "message" in body: msg += f" β {body.get('message', body)}" except Exception: text = e.response.text if text: msg += f" β {text[:200]}" return msg
def _image_bytes_to_tensor(raw, log_name): try: image = Image.open(io.BytesIO(raw)).convert("RGB") except Exception as e: logging.error("%s: failed to decode image: %s", log_name, e) raise RuntimeError(f"Failed to decode image from API: {e}") from e arr = np.array(image).astype(np.float32) / 255.0 tensor = torch.from_numpy(arr)[None, ...] return (tensor,)
# ---------- ComfyUI registration ----------
NODE_CLASS_MAPPINGS = { "NanoBananaProEditAPINode": NanoBananaProEditAPINode, "NanoBanana2EditAPINode": NanoBanana2EditAPINode, "SeedreamEditAPINode": SeedreamEditAPINode, "SeedreamEditFalAPINode": SeedreamEditFalAPINode,}
NODE_DISPLAY_NAME_MAPPINGS = { "NanoBananaProEditAPINode": "Aiorbust Nano Banana Pro Edit", "NanoBanana2EditAPINode": "Aiorbust Nano Banana 2 Edit", "SeedreamEditAPINode": "Aiorbust Seedream 4.5 Edit(Wavespeed)", "SeedreamEditFalAPINode": "Aiorbust Seedream 4.5 Edit(fal.ai)",}1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889# aiorbust OFM ComfyUI Nodes (Monthly)
Custom ComfyUI nodes for AI-powered image editing and prompt management.
## Nodes
### Nano Banana Pro Edit
Edit and transform images using Google's Gemini 3 Pro model through a simple API call. Supports custom aspect ratios, resolution up to 4K, and adjustable safety filters.
**Inputs:**
| Input | Type | Default | Description ||---|---|---|---|| images | IMAGE | β | Input image(s) to edit || api_key | String | β | Your Google Gemini API key || prompt | Multiline String | β | Instructions for how to edit the image || aspect_ratio | Dropdown | `auto` | Output aspect ratio: auto, 1:1, 2:3, 3:2, 3:4, 4:3, 4:5, 5:4, 9:16, 16:9, 21:9 || image_size | Dropdown | `2K` | Output resolution: 1K, 2K, or 4K || temperature | Float (0β2) | 1.0 | Controls creativity β higher = more creative || safety_threshold | Dropdown | `BLOCK_ONLY_HIGH` | Content safety filter level |
**Output:** `IMAGE` tensor
---
### Nano Banana 2 Edit
A faster, lighter image editor powered by Gemini 3.1 Flash for quick image edits and modifications. Same flexible controls as Pro but optimized for speed.
**Inputs:**
| Input | Type | Default | Description ||---|---|---|---|| images | IMAGE | β | Input image(s) to edit || api_key | String | β | Your Google Gemini API key || prompt | Multiline String | β | Instructions for how to edit the image || aspect_ratio | Dropdown | `auto` | Output aspect ratio || image_size | Dropdown | `1K` | Output resolution: 1K, 2K, or 4K || temperature | Float (0β2) | 1.0 | Controls creativity || safety_threshold | Dropdown | `BLOCK_ONLY_HIGH` | Content safety filter level |
**Output:** `IMAGE` tensor
---
### Example Prompt Selector
Browse and select from pre-written example prompts stored in text files. Outputs the selected prompt as a STRING to connect to other nodes.
**Inputs:**
| Input | Type | Description ||---|---|---|| prompt_file | Dropdown | Select which `.txt` file to browse prompts from || example_prompt | Dropdown | Browse prompts from the selected file || prompt_text | Multiline String | Editable text area β auto-populated when you select a prompt. Edit to customize. |
**Output:** `STRING` β the prompt text. Uses `prompt_text` if manually edited, otherwise the selected example prompt.
**Navigation:** Use the `Prev Prompt` / `Next Prompt` buttons to cycle through prompts, or click the dropdown to pick directly.
#### Adding Your Own Prompts
1. Create a `.txt` file in the `prompts/` folder (e.g., `prompts/my_styles.txt`)2. Write one prompt per block, separated by `---` on its own line:
```A beautiful sunset over the ocean, golden light, dramatic clouds---A cyberpunk street scene at night, neon reflections, rain-soaked pavement---A cozy cabin interior with fireplace, warm lighting, rustic furniture```
3. Restart ComfyUI β the new file appears in the `prompt_file` dropdown
## File Structure
```aiorbust-OFM-pack-Monthly/βββ __init__.py # Node registrationβββ Node.py # NanoBananaProEditAPINode, NanoBanana2EditAPINodeβββ prompt_selector.py # PromptSelectorNode + API routesβββ js/β βββ prompt_selector.js # Frontend: prompt navigation + text populationβββ prompts/ βββ *.txt # Prompt files (--- separated)```.gitattributes+32
aiorbust-ofm-pack-main/.gitignoreAdded+3
aiorbust-ofm-pack-main/Dataset Images/2b8f22cca7c5c65e0f21d65339776b4a.jpgAdded

Large File Pointer Details
- SHA256: d0ed1791fa1482975a35152ab6e6f19bd2aa532765ee0573f983bd47e08bd7ec
- Pointer size: 131 Bytes
- Size of remote file: 147 kB
aiorbust-ofm-pack-main/Dataset Images/3a7787cfa10c5bfbd1269e0a9b45ada4.jpgAdded

Large File Pointer Details
- SHA256: 5c33ccea13666b19a8c96fff20080fcb73e3ea3feaf11c0477cf5a2edaa7ceb2
- Pointer size: 131 Bytes
- Size of remote file: 112 kB
aiorbust-ofm-pack-main/Dataset Images/4140ac46b33e548feda14b0fefc85bcb.jpgAdded

aiorbust-ofm-pack-main/Dataset Images/43ee157d566b5aada5a3dcb47fb4afa8.jpgAdded

aiorbust-ofm-pack-main/Dataset Images/4fb2f922a21d1cc3f7384e16bc817fe6.jpgAdded

Large File Pointer Details
- SHA256: 39049a002039cf3b548d372ba5d3ebc39970768e42fc4794939b2d4843ad6d22
- Pointer size: 131 Bytes
- Size of remote file: 197 kB
aiorbust-ofm-pack-main/Dataset Images/557147ab88ff595e5d4ba0e137304454.jpgAdded

aiorbust-ofm-pack-main/Dataset Images/66730e5442b4c86a386965fa9678246a.jpgAdded

aiorbust-ofm-pack-main/Dataset Images/69bed9b86d77e264664fff7869050be6.jpgAdded

aiorbust-ofm-pack-main/Dataset Images/798efdefba3b245397347b2329bfd676.jpgAdded

aiorbust-ofm-pack-main/Dataset Images/89ad03f568856e28c5507b9f1b3fe236.jpgAdded

Large File Pointer Details
- SHA256: 1003c872aaeb306d1d8b4040a260b03359de112287f68c5e2236085e63d0cbf8
- Pointer size: 131 Bytes
- Size of remote file: 116 kB
aiorbust-ofm-pack-main/Dataset Images/8b39dd90e95c7893c075434326b5cc62.jpgAdded

aiorbust-ofm-pack-main/Dataset Images/a229b2355ab189a8188e9c82c9d3f4dd.jpgAdded

Large File Pointer Details
- SHA256: 08336ecbe215dc17ffdc9a7d9766bbae29cf78381388c052a20befbb4e68bf1a
- Pointer size: 131 Bytes
- Size of remote file: 100 kB
aiorbust-ofm-pack-main/Dataset Images/adcd4d40bbf245ea29ce8d37ae6e2dc3.jpgAdded

Large File Pointer Details
- SHA256: d5c2b35c0e9f584bc1d2090a2eba9a465356c82b2baf2619ac5908d476eb7ad4
- Pointer size: 131 Bytes
- Size of remote file: 180 kB
aiorbust-ofm-pack-main/Dataset Images/b16eb5e209202daa432b94e25959e5df.jpgAdded

aiorbust-ofm-pack-main/Dataset Images/b36dba1f247bc466b79a1ba6e74fc0e7.jpgAdded

Large File Pointer Details
- SHA256: 3d556cbbf0b9adea0e5725793a06c4b49d6f4a0868a0d502dfe2244910fdafd5
- Pointer size: 131 Bytes
- Size of remote file: 110 kB
aiorbust-ofm-pack-main/Dataset Images/b4bfd0bd35af867d1cdfdf900f72862a.jpgAdded

aiorbust-ofm-pack-main/Dataset Images/c26a6085d8ad35128a3034aa0b001ec7.jpgAdded

Large File Pointer Details
- SHA256: 1bc699d7c6ef77b956b0b6ef971a40eb522675089a3a818b2355ad393eb7734b
- Pointer size: 131 Bytes
- Size of remote file: 133 kB
aiorbust-ofm-pack-main/Dataset Images/cb85eaee18ef536bcb713afb29bbb7d4.jpgAdded

Large File Pointer Details
- SHA256: 502df9f007b66ace821ba5d8461ba0a9c580e3d8bc10d3bea788df918d8e9c4d
- Pointer size: 131 Bytes
- Size of remote file: 102 kB
aiorbust-ofm-pack-main/Dataset Images/d0777b481e9b691e2428652b0b87cf3a.jpgAdded

Large File Pointer Details
- SHA256: 6a4b17c153087fea04de63947ae6c414a8af5a0113b63df614dadc2e0c1386a5
- Pointer size: 131 Bytes
- Size of remote file: 171 kB
aiorbust-ofm-pack-main/Dataset Images/e389100aba8793f91cf7f03323f66100.jpgAdded

aiorbust-ofm-pack-main/Dataset Images/e7bf042c20ca4000301dac977087e344.jpgAdded

aiorbust-ofm-pack-main/Dataset Images/ee05e18211a38e7b2cd66fc172d388e1.jpgAdded

Large File Pointer Details
- SHA256: d3ec814f13919332a1a2c5b9f7c4dd253b2d6e9a56a5970ecd3450fc5040a491
- Pointer size: 131 Bytes
- Size of remote file: 106 kB
aiorbust-ofm-pack-main/Example Faces/1a056bdce17022bfd6999f03945543ff.jpgAdded

aiorbust-ofm-pack-main/Example Faces/392d48ced9a0f1a196e4a685087e5ac5.jpgAdded

Large File Pointer Details
- SHA256: e1acf3af4a568ba4704fe44ef4604c77874088fa730f29934e718f227157daa7
- Pointer size: 131 Bytes
- Size of remote file: 107 kB
aiorbust-ofm-pack-main/Example Faces/75563368a304d1fec5a9f033aa97880d.jpgAdded

aiorbust-ofm-pack-main/Example Faces/8b16036925ea003fb119a8b523448259.jpgAdded

Large File Pointer Details
- SHA256: b523c2edf1ffcda0b171266aeb877fa30100f4b46eed4dd6bf2e45b510fdfe35
- Pointer size: 131 Bytes
- Size of remote file: 112 kB
aiorbust-ofm-pack-main/Example Faces/9a1ecdb690dba74b2e90bb86a71e38e6.jpgAdded

Large File Pointer Details
- SHA256: dd97b24c5dd40cedb2a2e4ca9b923d02351b5727d65d2be26c4e8f0bdc45dfaa
- Pointer size: 131 Bytes
- Size of remote file: 114 kB
aiorbust-ofm-pack-main/Example Faces/a934f7b2cd16c41d1a775d4e955e87af.jpgAdded

aiorbust-ofm-pack-main/Example Faces/b16eb5e209202daa432b94e25959e5df.jpgAdded

aiorbust-ofm-pack-main/Example Faces/bcef8092ce8d4b4646c58dc8bd196c63.jpgAdded

aiorbust-ofm-pack-main/Example Faces/c26a6085d8ad35128a3034aa0b001ec7.jpgAdded

Large File Pointer Details
- SHA256: 1bc699d7c6ef77b956b0b6ef971a40eb522675089a3a818b2355ad393eb7734b
- Pointer size: 131 Bytes
- Size of remote file: 133 kB
aiorbust-ofm-pack-main/Example Faces/c8288f2ceb488d300b075947bd86feb1.jpgAdded

aiorbust-ofm-pack-main/Example Faces/ca8a48fd043663ee4f3e932c5eb33fd2.jpgAdded

Large File Pointer Details
- SHA256: 770dbcde35db4a38df93709b231ad3fac2d1ea47df3faf52f30cc8fd2dbc5c37
- Pointer size: 131 Bytes
- Size of remote file: 163 kB
aiorbust-ofm-pack-main/Example Faces/cf63397bd45e32541178921182357e25.jpgAdded

aiorbust-ofm-pack-main/Example Faces/ea2302a9ddb7ea4220fbc142cc00de98.jpgAdded

Large File Pointer Details
- SHA256: 3eeda9057385e6a25e813301a0f99dbf98f65c95719f98544860aaf4e1752ed4
- Pointer size: 131 Bytes
- Size of remote file: 227 kB
aiorbust-ofm-pack-main/Example Faces/f33a36302bba4c005896c205242135c5.jpgAdded

aiorbust-ofm-pack-main/Example Faces/f92c11a3eb8141a5a443c17ee1a0fe1a.jpgAdded

aiorbust-ofm-pack-main/Example Faces/fd1b3747c03944a16dde6a22e5ea5640.jpgAdded

Large File Pointer Details
- SHA256: 4871ce328f9c47d16358cf56db75fabb6e4feced771ccea3b457195a114b0f4a
- Pointer size: 131 Bytes
- Size of remote file: 114 kB
aiorbust-ofm-pack-main/NODES.mdAdded+345
aiorbust-ofm-pack-main/Node.pyAdded+703
aiorbust-ofm-pack-main/README.mdAdded+89
aiorbust-ofm-pack-main/Tattoos/02e55877541b2abc009c40857bb81f7c.jpgAdded

aiorbust-ofm-pack-main/Tattoos/379aa9dc1fc4cb71d0abcf9e41031df6.jpgAdded

aiorbust-ofm-pack-main/Tattoos/38cb0b53461bc5072be6fd4601ab9086.jpgAdded

aiorbust-ofm-pack-main/Tattoos/49f2fc0dbff9bc228392b680db029b27.jpgAdded

Large File Pointer Details
- SHA256: 1eac76048cda920f22390d72822d7fee93d2bb37fbf417bdee6a67900338836d
- Pointer size: 131 Bytes
- Size of remote file: 182 kB
aiorbust-ofm-pack-main/Tattoos/5c92d43a5b8eb4846805f182125fbbe4.jpgAdded

aiorbust-ofm-pack-main/Tattoos/5d8eafa003576838106a0c4bf08c7052.jpgAdded

Large File Pointer Details
- SHA256: 41f3d478b7fad47d9c28ba5df3ee6f757aca00e7b6afb8281d4a32bfebce0cfd
- Pointer size: 131 Bytes
- Size of remote file: 167 kB
aiorbust-ofm-pack-main/Tattoos/b3e14391b8dcd3e7cb05170e74b0aa40.jpgAdded
