Compare commits
2 commits
d40666408e
...
c62e263349
| Author | SHA1 | Date | |
|---|---|---|---|
| c62e263349 | |||
| c6f4c1621b |
3 changed files with 18 additions and 9 deletions
13
generate.py
13
generate.py
|
|
@ -686,7 +686,7 @@ def wan_reference_to_video(foreground, background, keep=False):
|
|||
background_url,
|
||||
],
|
||||
"aspect_ratio": "16:9",
|
||||
"resolution": "1080p",
|
||||
"resolution": "720p",
|
||||
"enable_prompt_expansion": False,
|
||||
"multi_shots": True,
|
||||
"enable_safety_checker": False
|
||||
|
|
@ -788,7 +788,7 @@ def ltx_a2v(item, character, prompt=None, first_frame=None, keep=False):
|
|||
ox.net.save_url(output_url, output, overwrite=True)
|
||||
ai = add_ai_variant(item, output, "ai:audio-to-video")
|
||||
ai.data["model"] = model
|
||||
ai.data["prompt"] = prompt
|
||||
ai.data["prompt"] = ox.escape_html(prompt)
|
||||
ai.data["seed"] = result["seed"]
|
||||
ai.save()
|
||||
first_frame.add(ai)
|
||||
|
|
@ -930,12 +930,12 @@ def describe_item(item, neutral=False):
|
|||
if isinstance(item, str):
|
||||
item = Item.objects.get(public_id=item)
|
||||
if item.get("prompt") and neutral:
|
||||
return item.get("prompt")
|
||||
return ox.decode_html(item.get("prompt"))
|
||||
video_url = public_video_url(item)
|
||||
prompt = describe_video(video_url, neutral)
|
||||
if neutral:
|
||||
item.refresh_from_db()
|
||||
item.data["prompt"] = prompt
|
||||
item.data["prompt"] = ox.escape_html(prompt)
|
||||
item.save()
|
||||
return prompt
|
||||
|
||||
|
|
@ -1510,6 +1510,9 @@ def process_reshoot_firstframe(character='P1'):
|
|||
item.refresh_from_db()
|
||||
add_tag(item, 'ai-failed')
|
||||
print('>> failed', item)
|
||||
continue
|
||||
if not first_frame:
|
||||
continue
|
||||
if first_frame.items.filter(data__type__icontains='ai:').exists():
|
||||
continue
|
||||
print(item, first_frame)
|
||||
|
|
@ -1527,7 +1530,7 @@ def process_motion_firstframe(character="P1", keep=False):
|
|||
if ai.exists() or 'ai-failed' in item.data.get('tags', []):
|
||||
print('>> skip', item)
|
||||
continue
|
||||
print(i)
|
||||
print(item)
|
||||
try:
|
||||
replace_character_motion_control(item, character, keep=keep)
|
||||
except:
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ class Command(BaseCommand):
|
|||
|
||||
def add_arguments(self, parser):
|
||||
parser.add_argument('--prefix', action='store', dest='prefix', default=default_prefix, help='prefix to build clips in')
|
||||
parser.add_argument('--offset', action='store', dest='offset', default="1024", help='inital offset in pi')
|
||||
parser.add_argument('--offset', action='store', dest='offset', default=None, help='inital offset in pi')
|
||||
|
||||
def handle(self, **options):
|
||||
update_subtitles(options)
|
||||
|
|
|
|||
12
render.py
12
render.py
|
|
@ -98,7 +98,7 @@ def compose(clips, fragment, target=150, base=1024, voice_over=None, options=Non
|
|||
ai_clips.append(clip)
|
||||
else:
|
||||
non_ai_clips.append(clip)
|
||||
if ai_length < target * 0.6 and ai_clips:
|
||||
if ai_length < target * 0.7 and ai_clips:
|
||||
clip = random_choice(seq, ai_clips, pop=True)
|
||||
clip["use_ai"] = True
|
||||
selected_clips.append(clip)
|
||||
|
|
@ -825,9 +825,16 @@ def load_defaults(options):
|
|||
|
||||
def update_subtitles(options):
|
||||
import item.models
|
||||
|
||||
options = load_defaults(options)
|
||||
prefix = Path(options['prefix'])
|
||||
|
||||
if options['offset'] is None:
|
||||
offsets = [int(folder) for folder in os.listdir(prefix / 'render') if folder.isdigit()]
|
||||
for offset in offsets:
|
||||
options['offset'] = offset
|
||||
update_subtitles(options)
|
||||
return
|
||||
|
||||
base = int(options['offset'])
|
||||
lang, tlang = parse_lang(options["lang"])
|
||||
|
||||
|
|
@ -1052,7 +1059,6 @@ def generate_clips(options):
|
|||
if '-a-t' in variant:
|
||||
b_variant = variant.replace('-a-t', '-b-t').split('-t')[0]
|
||||
for old in voice_over[fragment][type]:
|
||||
print(type(old))
|
||||
if isinstance(old, list) and old[0]['variant'].startswith(b_variant):
|
||||
old.insert(0, vo_variant)
|
||||
done = True
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue