feat: add end frame auto-detection to Seedance Pro node
- Add optional end_frame parameter to Seedance Pro image-to-video mode - Automatically detect and use first+last frame generation when end frame is provided - Update documentation to reflect new functionality - Maintain backward compatibility with existing workflows
This commit is contained in:
@@ -61,9 +61,10 @@ pip install -r requirements.txt
|
||||
- Output: Video URL (STRING)
|
||||
- Use case: Generate videos that maintain style/appearance consistency with reference materials
|
||||
|
||||
- **Seedance Pro Text/Image-to-Video**: High-quality video generation
|
||||
- Input: Text prompt, mode selection, optional input image, resolution, ratio, duration
|
||||
- **Seedance Pro Text/Image-to-Video**: High-quality video generation with end frame support
|
||||
- Input: Text prompt, mode selection, optional input image, optional end frame, resolution, ratio, duration
|
||||
- Output: Video URL (STRING)
|
||||
- Features: Automatic first+last frame detection when end frame is provided in image-to-video mode
|
||||
- Use case: Premium quality video generation for professional use
|
||||
|
||||
### Image Generation Nodes (Seed/ImageGeneration)
|
||||
@@ -98,11 +99,11 @@ pip install -r requirements.txt
|
||||
|
||||
### Video Generation Workflow
|
||||
1. **Choose the appropriate video node** based on your input type:
|
||||
- Text only → Seedance Lite Text-to-Video
|
||||
- Single image → Seedance Lite Image-to-Video
|
||||
- Two images → Seedance Lite First+Last Frame
|
||||
- Text only → Seedance Lite Text-to-Video or Seedance Pro (text-to-video mode)
|
||||
- Single image → Seedance Lite Image-to-Video or Seedance Pro (image-to-video mode)
|
||||
- Two images → Seedance Lite First+Last Frame or Seedance Pro (image-to-video mode with end frame)
|
||||
- Multiple references → Seedance Lite Reference Images
|
||||
- High quality → Seedance Pro
|
||||
- High quality → Seedance Pro (supports all modes with automatic detection)
|
||||
|
||||
2. **Configure parameters**:
|
||||
- **Prompt**: Describe what you want in the video
|
||||
@@ -180,6 +181,7 @@ pip install -r requirements.txt
|
||||
- **Be specific in prompts**: Include details about movement, camera angles, and style
|
||||
- **Use appropriate ratios**: Match your intended use case (16:9 for landscape, 9:16 for mobile, etc.)
|
||||
- **Leverage reference images**: For consistent character/style appearance across videos
|
||||
- **Seedance Pro end frame support**: In image-to-video mode, connect an optional end frame to automatically enable first+last frame generation for smoother transitions
|
||||
|
||||
### Image Generation
|
||||
- **Detailed prompts work better**: Include style, lighting, composition details
|
||||
|
||||
@@ -376,6 +376,7 @@ class SeedanceProNode:
|
||||
},
|
||||
"optional": {
|
||||
"image": ("IMAGE",),
|
||||
"end_frame": ("IMAGE",),
|
||||
"framepersecond": ("INT", {"default": 24, "min": 24, "max": 24, "step": 1}),
|
||||
"seed": ("INT", {"default": -1, "min": -1, "max": 2147483647}),
|
||||
"camerafixed": ("BOOLEAN", {"default": False}),
|
||||
@@ -387,13 +388,14 @@ class SeedanceProNode:
|
||||
CATEGORY = "Seed/VideoGeneration"
|
||||
|
||||
def generate_video(
|
||||
self,
|
||||
prompt,
|
||||
self,
|
||||
prompt,
|
||||
mode,
|
||||
resolution,
|
||||
ratio,
|
||||
resolution,
|
||||
ratio,
|
||||
duration,
|
||||
image=None,
|
||||
end_frame=None,
|
||||
framepersecond=24,
|
||||
seed=-1,
|
||||
camerafixed=False
|
||||
@@ -419,19 +421,20 @@ class SeedanceProNode:
|
||||
}
|
||||
]
|
||||
|
||||
# Add image if in image-to-video mode
|
||||
# Add image(s) if in image-to-video mode
|
||||
if mode == "image-to-video":
|
||||
if image is None:
|
||||
return BytePlusApiHandler.handle_video_generation_error(
|
||||
"Seedance Pro", "Image is required for image-to-video mode"
|
||||
)
|
||||
|
||||
|
||||
# Convert first frame
|
||||
image_base64 = BytePlusImageUtils.image_to_base64(image)
|
||||
if not image_base64:
|
||||
return BytePlusApiHandler.handle_video_generation_error(
|
||||
"Seedance Pro", "Failed to convert image to base64"
|
||||
)
|
||||
|
||||
|
||||
content.append({
|
||||
"type": "image_url",
|
||||
"image_url": {
|
||||
@@ -439,6 +442,23 @@ class SeedanceProNode:
|
||||
},
|
||||
"role": "first_frame"
|
||||
})
|
||||
|
||||
# Check if end_frame is provided for first+last frame generation
|
||||
if end_frame is not None:
|
||||
# Convert last frame
|
||||
last_frame_base64 = BytePlusImageUtils.image_to_base64(end_frame)
|
||||
if not last_frame_base64:
|
||||
return BytePlusApiHandler.handle_video_generation_error(
|
||||
"Seedance Pro", "Failed to convert end frame image to base64"
|
||||
)
|
||||
|
||||
content.append({
|
||||
"type": "image_url",
|
||||
"image_url": {
|
||||
"url": last_frame_base64
|
||||
},
|
||||
"role": "last_frame"
|
||||
})
|
||||
|
||||
# Submit to BytePlus API
|
||||
video_url = BytePlusApiHandler.submit_and_get_result(
|
||||
|
||||
Reference in New Issue
Block a user