12 Commits
8 changed files with 1252 additions and 32 deletions
+21
View File
@@ -0,0 +1,21 @@
name: Publish to Comfy registry
on:
workflow_dispatch:
push:
branches:
- main
paths:
- "pyproject.toml"
jobs:
publish-node:
name: Publish Custom Node to registry
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Publish Custom Node
uses: Comfy-Org/publish-node-action@main
with:
personal_access_token: ${{ secrets.REGISTRY_ACCESS_TOKEN }}
+76 -23
View File
@@ -1,19 +1,20 @@
# Camera Control Prompt Node
# Camera Control & Relighting Prompt Nodes
Advanced camera control prompt generator for ComfyUI, optimized for **dx8152's MultiAngle LoRA**.
Advanced prompt generators for ComfyUI, optimized for **dx8152's MultiAngle LoRA** and relighting workflows.
## Author
**Lorenzo Mercugliano**
## Description
A powerful ComfyUI custom node that converts camera control parameters into bilingual prompts (Chinese + English). Designed to work seamlessly with dx8152's MultiAngle LoRA for precise camera control in image generation workflows.
A collection of powerful ComfyUI custom nodes that convert camera control and lighting parameters into bilingual prompts (Chinese + English). Designed to work seamlessly with dx8152's MultiAngle LoRA for precise camera control and relighting in image generation workflows.
## Features
- **Multi-directional camera movements** (horizontal, vertical, forward)
- **Camera rotation** with precise angle control (-90° to 90°)
- **Special view modes** (top-down, wide-angle, close-up)
- **Relighting control** with 10 directional light sources
- **Bilingual output** (Chinese + English prompts)
- **Optimized interface** with sliders and toggle controls
- **Optimized interface** with sliders, toggles, and dropdowns
- **No redundancy** - smart parameter organization
## Installation
@@ -21,23 +22,27 @@ A powerful ComfyUI custom node that converts camera control parameters into bili
2. The folder structure should be: `ComfyUI/custom_nodes/camera_control_prompt/`
3. Restart ComfyUI
## Node Inputs
## Nodes
### Sliders (0-1 or Range Values)
- **move_horizontal** (-1 to 1): Left/Right camera movement
- -1 = Move left
- 0 = No movement
- 1 = Move right
### 1. Camera Control Prompt Generator
- **move_vertical** (-1 to 1): Up/Down camera movement
- -1 = Move down
- 0 = No movement
- 1 = Move up
#### Node Inputs
**Dropdowns:**
- **move_horizontal**: Left/Right camera movement
- none = No movement
- left = Move left
- right = Move right
- **move_forward** (0 to 1): Forward camera movement (toggle)
- 0 = No movement
- 1 = Move forward
- **move_vertical**: Up/Down camera movement
- none = No movement
- up = Move up
- down = Move down
- **move_forward**: Forward camera movement
- no = No movement
- yes = Move forward
**Sliders:**
- **rotate** (-90 to 90, step 45): Camera rotation
- -90 = Rotate 90° left
- -45 = Rotate 45° left
@@ -45,29 +50,77 @@ A powerful ComfyUI custom node that converts camera control parameters into bili
- 45 = Rotate 45° right
- 90 = Rotate 90° right
### Buttons (Boolean)
**Buttons (Boolean):**
- **view_top_down**: Enable top-down view
- **view_wide_angle**: Enable wide-angle lens
- **view_close_up**: Enable close-up view
- **view_bottom_up**: Enable bottom-up view
---
### 2. Relighting Prompt Generator
#### Node Inputs
**Dropdown:**
- **light_direction**: Select the light source direction
- front = 前方 (Front)
- front_left = 左前方 (Front Left)
- left = 左方 (Left)
- back_left = 左后方 (Back Left)
- back = 后方 (Back)
- back_right = 右后方 (Back Right)
- right = 右方 (Right)
- front_right = 右前方 (Front Right)
- above = 上方 (Above)
- below = 下方 (Below)
**Buttons (Boolean):**
- **use_chinese**: Toggle between Chinese (True) and English (False) output
- True = Chinese prompt (default)
- False = English prompt
## Output
Single STRING output containing the complete bilingual camera control prompt, ready to use with dx8152's MultiAngle LoRA.
Both nodes output a single STRING containing the complete prompt, ready to use with dx8152's MultiAngle LoRA and relighting workflows.
## Example Usage
### Camera Control Prompt Generator
**Inputs:**
- move_horizontal: 1 (right)
- move_vertical: 0
- move_forward: 1
- rotate: 45 (right rotation)
- move_horizontal: right
- move_vertical: none
- move_forward: yes
- rotate: 45
- view_top_down: False
- view_wide_angle: True
- view_close_up: False
- view_bottom_up: False
**Output:**
```
将镜头向右移动 Move the camera right. 将镜头向前移动 Move the camera forward. 将镜头向右旋转45度 Rotate the camera 45 degrees to the right. 将镜头转为广角镜头 Turn the camera to a wide-angle lens.
```
---
### Relighting Prompt Generator
**Inputs (Chinese):**
- light_direction: front_left
- use_chinese: True
**Output:**
```
使用图2的亮度贴图对图1重新照明(光源来自左前方)
```
**Inputs (English):**
- light_direction: back_right
- use_chinese: False
**Output:**
```
Relight Figure 1 using the luminance map from Figure 2 (light source from the back right)
```
## Compatibility
- **ComfyUI**: Latest versions
- **LoRA**: Optimized for dx8152's MultiAngle LoRA
+7 -8
View File
@@ -7,14 +7,13 @@ Optimized for: dx8152's MultiAngle LoRA
License: MIT
"""
from .camera_control_prompt_node import CameraControlPromptNode
from .camera_control_prompt_node import NODE_CLASS_MAPPINGS as CAMERA_MAPPINGS
from .camera_control_prompt_node import NODE_DISPLAY_NAME_MAPPINGS as CAMERA_DISPLAY_MAPPINGS
from .light_control_prompt_node import NODE_CLASS_MAPPINGS as LIGHT_MAPPINGS
from .light_control_prompt_node import NODE_DISPLAY_NAME_MAPPINGS as LIGHT_DISPLAY_MAPPINGS
NODE_CLASS_MAPPINGS = {
"CameraControlPromptNode": CameraControlPromptNode
}
NODE_DISPLAY_NAME_MAPPINGS = {
"CameraControlPromptNode": "Camera Control Prompt Generator"
}
# Merge dei mappings da entrambi i nodi
NODE_CLASS_MAPPINGS = {**CAMERA_MAPPINGS, **LIGHT_MAPPINGS}
NODE_DISPLAY_NAME_MAPPINGS = {**CAMERA_DISPLAY_MAPPINGS, **LIGHT_DISPLAY_MAPPINGS}
__all__ = ['NODE_CLASS_MAPPINGS', 'NODE_DISPLAY_NAME_MAPPINGS']
+8 -1
View File
@@ -57,6 +57,10 @@ class CameraControlPromptNode:
"view_close_up": ("BOOLEAN", {
"default": False
}),
"view_bottom_up": ("BOOLEAN", {
"default": False
}),
}
}
@@ -65,7 +69,7 @@ class CameraControlPromptNode:
FUNCTION = "generate_prompt"
CATEGORY = "prompt/camera"
def generate_prompt(self, move_horizontal, move_vertical, move_forward, rotate, view_top_down, view_wide_angle, view_close_up):
def generate_prompt(self, move_horizontal, move_vertical, move_forward, rotate, view_top_down, view_wide_angle, view_close_up, view_bottom_up):
"""Genera il prompt basato sui parametri camera"""
prompt_parts = []
@@ -105,6 +109,9 @@ class CameraControlPromptNode:
if view_close_up:
prompt_parts.append("将镜头转为特写镜头 Turn the camera to a close-up.")
if view_bottom_up:
prompt_parts.append("將相機方向調整為由下而上的視角 Turn the camera to a bottom-up view.")
# Concatena tutte le parti con spazio
final_prompt = " ".join(prompt_parts)
+91
View File
@@ -0,0 +1,91 @@
"""
Light Control Prompt Node for ComfyUI
Generates lighting direction prompts for image relighting
Author: Lorenzo Mercu
Description: Light control prompt generator for relighting workflows
Features: Multi-directional light source control, bilingual prompts
"""
class RelightingPromptNode:
"""
Nodo che genera il prompt ottimizzato per il relighting
basandosi sulla direzione della luce selezionata
"""
@classmethod
def INPUT_TYPES(cls):
return {
"required": {
"light_direction": ([
"front", # 前方
"front_left", # 左前方
"left", # 左方
"back_left", # 左后方
"back", # 后方
"back_right", # 右后方
"right", # 右方
"front_right", # 右前方
"above", # 上方
"below" # 下方
], {"default": "front"}),
"use_chinese": ("BOOLEAN", {"default": True}),
}
}
RETURN_TYPES = ("STRING",)
RETURN_NAMES = ("prompt",)
FUNCTION = "generate_prompt"
CATEGORY = "relighting"
def generate_prompt(self, light_direction, use_chinese):
"""Genera il prompt basato sulla direzione della luce"""
# Mappatura direzioni luce - Cinese
light_directions_cn = {
"front": "光源来自前方",
"front_left": "光源来自左前方",
"left": "光源来自左方",
"back_left": "光源来自左后方",
"back": "光源来自后方",
"back_right": "光源来自右后方",
"right": "光源来自右方",
"front_right": "光源来自右前方",
"above": "光源来自上方",
"below": "光源来自下方"
}
# Mappatura direzioni luce - Inglese
light_directions_en = {
"front": "light source from the front",
"front_left": "light source from the front left",
"left": "light source from the left",
"back_left": "light source from the back left",
"back": "light source from the back",
"back_right": "light source from the back right",
"right": "light source from the right",
"front_right": "light source from the front right",
"above": "light source from above",
"below": "light source from below"
}
# Genera il prompt nella lingua selezionata
if use_chinese:
direction_text = light_directions_cn.get(light_direction, "光源来自前方")
final_prompt = f"使用图2的亮度贴图对图1重新照明({direction_text})"
else:
direction_text = light_directions_en.get(light_direction, "light source from the front")
final_prompt = f"Relight Figure 1 using the luminance map from Figure 2 ({direction_text})"
return (final_prompt,)
# Mappings per ComfyUI
NODE_CLASS_MAPPINGS = {
"RelightingPromptNode": RelightingPromptNode
}
NODE_DISPLAY_NAME_MAPPINGS = {
"RelightingPromptNode": "Relighting Prompt Generator"
}
BIN
View File
Binary file not shown.
+33
View File
@@ -0,0 +1,33 @@
[project]
name = "multiple-angle-camera-control"
description = "Advanced camera and light control prompt generator for ComfyUI, optimized for dx8152's MultiAngle LoRA. Simplifies multi-directional movements, rotations, and special views with bilingual output."
version = "1.0.1"
license = {file = "LICENSE"}
# classifiers = [
# # For OS-independent nodes (works on all operating systems)
# "Operating System :: OS Independent",
#
# # OR for OS-specific nodes, specify the supported systems:
# "Operating System :: Microsoft :: Windows", # Windows specific
# "Operating System :: POSIX :: Linux", # Linux specific
# "Operating System :: MacOS", # macOS specific
#
# # GPU Accelerator support. Pick the ones that are supported by your extension.
# "Environment :: GPU :: NVIDIA CUDA", # NVIDIA CUDA support
# "Environment :: GPU :: AMD ROCm", # AMD ROCm support
# "Environment :: GPU :: Intel Arc", # Intel Arc support
# "Environment :: NPU :: Huawei Ascend", # Huawei Ascend support
# "Environment :: GPU :: Apple Metal", # Apple Metal support
# ]
[project.urls]
Repository = "https://github.com/mercu-lore/-Multiple-Angle-Camera-Control"
Documentation = "https://github.com/mercu-lore/-Multiple-Angle-Camera-Control/wiki"
"Bug Tracker" = "https://github.com/mercu-lore/-Multiple-Angle-Camera-Control/issues"
[tool.comfy]
PublisherId = "mercu-lore"
DisplayName = "Multiple-Angle-Camera-Control"
Icon = ""
includes = []
# "requires-comfyui" = ">=1.0.0"
File diff suppressed because it is too large Load Diff