Fix aspect_ratio for better results

This commit is contained in:
cellzero
2024-12-26 15:36:28 +08:00
parent 8473c47ca7
commit a2e18df4c8
3 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -361,7 +361,7 @@ class Ruyi_I2VSampler:
original_width, original_height = start_img[0].size if type(start_img) is list else Image.open(start_img).size
closest_size, closest_ratio = get_closest_ratio(original_height, original_width, ratios=aspect_ratio_sample_size)
height, width = [int(x / 16) * 16 for x in closest_size]
aspect_ratio = "16:9" if width > height else "9:16"
aspect_ratio = "16:9" # Do not change, currently "16:9" works better
# Get Pipeline
pipeline = ruyi_model['pipeline']
+1 -1
View File
@@ -26,7 +26,7 @@ video_length = 120 # The max video length is 120 frames (24 frames
base_resolution = 512 # # The pixels in the generated video are approximately 512 x 512. Values in the range of [384, 896] typically produce good video quality.
video_size = None # Override base_resolution. Format: [height, width], e.g., [384, 672]
# Control settings
aspect_ratio = "16:9" # Choose in ["16:9", "9:16"], note that this is only the hint
aspect_ratio = "16:9" # Do not change, currently "16:9" works better
motion = "auto" # Motion control, choose in ["1", "2", "3", "4", "auto"]
camera_direction = "auto" # Camera control, choose in ["static", "left", "right", "up", "down", "auto"]
# Sampler settings
+1 -1
View File
@@ -26,7 +26,7 @@ video_length = 120 # The max video length is 120 frames (24 frames
base_resolution = 512 # # The pixels in the generated video are approximately 512 x 512. Values in the range of [384, 896] typically produce good video quality.
video_size = None # Override base_resolution. Format: [height, width], e.g., [384, 672]
# Control settings
aspect_ratio = "9:16" # Choose in ["16:9", "9:16"], note that this is only the hint
aspect_ratio = "16:9" # Do not change, currently "16:9" works better
motion = "auto" # Motion control, choose in ["1", "2", "3", "4", "auto"]
camera_direction = "auto" # Camera control, choose in ["static", "left", "right", "up", "down", "auto"]
# Sampler settings