not i
This commit is contained in:
parent
ce47e23e18
commit
d40666408e
2 changed files with 23 additions and 19 deletions
|
|
@ -741,11 +741,11 @@ def wan_animate_replace(item, character, keep=False):
|
|||
shutil.rmtree(os.path.dirname(output))
|
||||
return ai
|
||||
|
||||
def ltx_a2v(item, character, prompt=None, keep=False):
|
||||
def ltx_a2v(item, character, prompt=None, first_frame=None, keep=False):
|
||||
video_url = public_video_url(item)
|
||||
audio_path = item.streams()[0].file.data.path
|
||||
if first_frame is None:
|
||||
character = get_character_document(character)
|
||||
|
||||
position = 0
|
||||
cid = get_character_document(character).get_id()
|
||||
first_frame = item.documents.filter(
|
||||
|
|
@ -788,6 +788,7 @@ def ltx_a2v(item, character, prompt=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["seed"] = result["seed"]
|
||||
ai.save()
|
||||
first_frame.add(ai)
|
||||
|
|
|
|||
19
render.py
19
render.py
|
|
@ -418,17 +418,17 @@ def get_fragments(clips, voice_over, prefix):
|
|||
if "conditions" in con:
|
||||
for sub in con["conditions"]:
|
||||
if sub['key'] == "tags" and sub['operator'] == '==':
|
||||
fragment['tags'].append(sub['value'])
|
||||
fragment['tags'].append(sub['value'].lower().strip())
|
||||
elif sub['key'] == "tags" and sub['operator'] == '!=':
|
||||
fragment['tags'].append(sub['value'])
|
||||
fragment['tags'].append(sub['value'].lower().strip())
|
||||
elif sub['key'] == 'type' and sub['value'] in ('source', ''):
|
||||
pass
|
||||
else:
|
||||
print(l.name, 'unknown sub condition', sub)
|
||||
elif con.get('key') == "tags" and con['operator'] == '==':
|
||||
fragment['tags'].append(con['value'])
|
||||
fragment['tags'].append(con['value'].lower().strip())
|
||||
elif con.get('key') == "tags" and con['operator'] == '!=':
|
||||
fragment['anti-tags'].append(con['value'])
|
||||
fragment['anti-tags'].append(con['value'].lower().strip())
|
||||
|
||||
fragment["id"] = int(fragment['name'].split(' ')[0])
|
||||
sources = []
|
||||
|
|
@ -729,7 +729,7 @@ def render_all(options):
|
|||
join_subtitles(base_prefix, options)
|
||||
|
||||
print("Duration - Target: %s Actual: %s" % (target_position, position))
|
||||
print(json.dumps(dict(stats), sort_keys=True, indent=2))
|
||||
#print(json.dumps(dict(stats), sort_keys=True, indent=2))
|
||||
with open(_cache, "w") as fd:
|
||||
json.dump(_CACHE, fd)
|
||||
|
||||
|
|
@ -983,7 +983,7 @@ def generate_clips(options):
|
|||
continue
|
||||
cd = format_duration(clip["duration"], fps)
|
||||
clip["duration"] = cd
|
||||
clip['tags'] = i.data.get('tags', [])
|
||||
clip['tags'] = [t.lower().strip() for t in i.data.get('tags', [])]
|
||||
adjust_volume = i.data.get('adjustvolume', '')
|
||||
if adjust_volume:
|
||||
clip['volume'] = float(adjust_volume)
|
||||
|
|
@ -1126,13 +1126,16 @@ def unused_tags():
|
|||
voice_over = json.load(fd)
|
||||
fragments = get_fragments(clips, voice_over, prefix)
|
||||
tags = []
|
||||
anti_tags = []
|
||||
|
||||
for fragment in fragments:
|
||||
tags += fragment['tags']
|
||||
anti_tags += fragment['anti-tags']
|
||||
|
||||
used_tags = set(tags)
|
||||
all_tags = {t.value for t in item.models.Facet.objects.filter(key='tags').distinct()}
|
||||
unused_tags = all_tags - used_tags
|
||||
used_anti_tags = set(anti_tags)
|
||||
all_tags = {t.value.strip().lower() for t in item.models.Facet.objects.filter(key='tags').distinct()}
|
||||
unused_tags = all_tags - used_tags - used_anti_tags
|
||||
unused_items = itemlist.models.List.objects.get(name='Unused Material').items.all()
|
||||
with open("/srv/pandora/static/power/unused-tags.txt", "w") as fd:
|
||||
for tag in sorted(unused_tags):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue