From f712a46c4a5148d835d8acde68727c2b19d88a89 Mon Sep 17 00:00:00 2001 From: j Date: Sat, 17 Jan 2026 11:39:35 +0000 Subject: [PATCH] as much ai as possible --- render.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/render.py b/render.py index 59b4654..7a45047 100644 --- a/render.py +++ b/render.py @@ -122,6 +122,22 @@ def compose(clips, target=150, base=1024, voice_over=None, options=None): if subs: scene["subtitles"] = subs + selected_clips_length = 0 + selected_clips = [] + non_ai_clips = [] + for clip in clips: + if 'ai' in clip: + selected_clips.append(clip) + selected_clips_length += clip['duration'] + else: + non_ai_clips.append(clip) + + while selected_clips_length < target and non_ai_clips: + clip = random_choice(seq, non_ai_clips, pop=True) + selected_clips.append(clip) + selected_clips_length += clip['duration'] + + clips = selected_clips clip = None while target - length > 0 and clips: ''' @@ -789,6 +805,8 @@ def generate_clips(options): clip = {} durations = [] for e in item.models.Item.objects.filter(data__title=i.data['title']): + if 'skip' in e.data.get('tags', []): + continue if 'type' not in e.data: print("ignoring invalid video %s (no type)" % e) continue