Add camera orbit control
This commit is contained in:
+71
-1
@@ -6,6 +6,7 @@ import random
|
||||
try:
|
||||
from .prompt_builder import (
|
||||
build_camera_config_json,
|
||||
build_camera_orbit_config_json,
|
||||
build_cast_config_json,
|
||||
build_category_config_json,
|
||||
build_character_slot_json,
|
||||
@@ -23,6 +24,8 @@ try:
|
||||
camera_distance_choices,
|
||||
camera_lens_choices,
|
||||
camera_mode_choices,
|
||||
camera_orbit_focus_choices,
|
||||
camera_orbit_framing_choices,
|
||||
camera_orientation_choices,
|
||||
camera_phone_choices,
|
||||
camera_priority_choices,
|
||||
@@ -52,6 +55,7 @@ try:
|
||||
except ImportError:
|
||||
from prompt_builder import (
|
||||
build_camera_config_json,
|
||||
build_camera_orbit_config_json,
|
||||
build_cast_config_json,
|
||||
build_category_config_json,
|
||||
build_character_slot_json,
|
||||
@@ -69,6 +73,8 @@ except ImportError:
|
||||
camera_distance_choices,
|
||||
camera_lens_choices,
|
||||
camera_mode_choices,
|
||||
camera_orbit_focus_choices,
|
||||
camera_orbit_framing_choices,
|
||||
camera_orientation_choices,
|
||||
camera_phone_choices,
|
||||
camera_priority_choices,
|
||||
@@ -373,6 +379,68 @@ class SxCPCameraControl:
|
||||
)
|
||||
|
||||
|
||||
class SxCPCameraOrbitControl:
|
||||
@classmethod
|
||||
def INPUT_TYPES(cls):
|
||||
return {
|
||||
"required": {
|
||||
"enabled": ("BOOLEAN", {"default": True}),
|
||||
"camera_mode": (camera_mode_choices(), {"default": "standard"}),
|
||||
"horizontal_angle": ("INT", {"default": 0, "min": 0, "max": 359, "step": 1}),
|
||||
"vertical_angle": ("INT", {"default": 0, "min": -90, "max": 90, "step": 1}),
|
||||
"zoom": ("FLOAT", {"default": 5.0, "min": 0.0, "max": 10.0, "step": 0.1}),
|
||||
"framing": (camera_orbit_framing_choices(), {"default": "from_zoom"}),
|
||||
"subject_focus": (camera_orbit_focus_choices(), {"default": "auto"}),
|
||||
"lens": (camera_lens_choices(), {"default": "auto"}),
|
||||
"orientation": (camera_orientation_choices(), {"default": "auto"}),
|
||||
"phone_visibility": (camera_phone_choices(), {"default": "auto"}),
|
||||
"priority": (camera_priority_choices(), {"default": "locked"}),
|
||||
"camera_detail": (camera_detail_choices(), {"default": "compact"}),
|
||||
"include_degrees": ("BOOLEAN", {"default": True}),
|
||||
}
|
||||
}
|
||||
|
||||
RETURN_TYPES = ("STRING", "STRING", "STRING")
|
||||
RETURN_NAMES = ("camera_config", "camera_prompt", "camera_info_json")
|
||||
FUNCTION = "build"
|
||||
CATEGORY = "prompt_builder"
|
||||
|
||||
def build(
|
||||
self,
|
||||
enabled,
|
||||
camera_mode,
|
||||
horizontal_angle,
|
||||
vertical_angle,
|
||||
zoom,
|
||||
framing,
|
||||
subject_focus,
|
||||
lens,
|
||||
orientation,
|
||||
phone_visibility,
|
||||
priority,
|
||||
camera_detail,
|
||||
include_degrees,
|
||||
):
|
||||
config = build_camera_orbit_config_json(
|
||||
enabled=enabled,
|
||||
camera_mode=camera_mode,
|
||||
horizontal_angle=horizontal_angle,
|
||||
vertical_angle=vertical_angle,
|
||||
zoom=zoom,
|
||||
framing=framing,
|
||||
subject_focus=subject_focus,
|
||||
lens=lens,
|
||||
orientation=orientation,
|
||||
phone_visibility=phone_visibility,
|
||||
priority=priority,
|
||||
camera_detail=camera_detail,
|
||||
include_degrees=include_degrees,
|
||||
)
|
||||
parsed = json.loads(config)
|
||||
camera_prompt = parsed.get("custom_camera_prompt", "")
|
||||
return config, camera_prompt, json.dumps(parsed, ensure_ascii=True, sort_keys=True)
|
||||
|
||||
|
||||
class SxCPCategoryPreset:
|
||||
@classmethod
|
||||
def INPUT_TYPES(cls):
|
||||
@@ -1083,7 +1151,7 @@ class SxCPInstaOFOptions:
|
||||
"platform_style": (["hybrid", "instagram", "onlyfans"], {"default": "hybrid"}),
|
||||
"continuity": (["same_creator_same_room", "same_creator_new_scene"], {"default": "same_creator_same_room"}),
|
||||
"hardcore_clothing_continuity": (["none", "same_outfit", "partially_removed", "implied_nude", "explicit_nude"], {"default": "partially_removed"}),
|
||||
"softcore_camera_mode": (camera_mode_choices(), {"default": "handheld_selfie"}),
|
||||
"softcore_camera_mode": (["from_camera_config"] + camera_mode_choices(), {"default": "handheld_selfie"}),
|
||||
"hardcore_camera_mode": (["from_camera_config", "same_as_softcore"] + camera_mode_choices(), {"default": "from_camera_config"}),
|
||||
"camera_detail": (camera_detail_choices(), {"default": "compact"}),
|
||||
"hardcore_detail_density": (hardcore_detail_density_choices(), {"default": "balanced"}),
|
||||
@@ -1233,6 +1301,7 @@ NODE_CLASS_MAPPINGS = {
|
||||
"SxCPSeedControl": SxCPSeedControl,
|
||||
"SxCPSeedLocker": SxCPSeedLocker,
|
||||
"SxCPCameraControl": SxCPCameraControl,
|
||||
"SxCPCameraOrbitControl": SxCPCameraOrbitControl,
|
||||
"SxCPCategoryPreset": SxCPCategoryPreset,
|
||||
"SxCPCastControl": SxCPCastControl,
|
||||
"SxCPGenerationProfile": SxCPGenerationProfile,
|
||||
@@ -1254,6 +1323,7 @@ NODE_DISPLAY_NAME_MAPPINGS = {
|
||||
"SxCPSeedControl": "SxCP Seed Control",
|
||||
"SxCPSeedLocker": "SxCP Seed Locker",
|
||||
"SxCPCameraControl": "SxCP Camera Control",
|
||||
"SxCPCameraOrbitControl": "SxCP Camera Orbit Control",
|
||||
"SxCPCategoryPreset": "SxCP Category Preset",
|
||||
"SxCPCastControl": "SxCP Cast Control",
|
||||
"SxCPGenerationProfile": "SxCP Generation Profile",
|
||||
|
||||
Reference in New Issue
Block a user