ComfyUI-JaRue

ComfyUI-JaRue
★ 7

字幕抓取YouTube动画提示自动化
从YouTube拉取视频字幕并转换为可用于AnimatedDiff或ComfyUI批量提示动画的帧级脚本,支持按fps聚合,便于自动化生成prompt动画。
💡 将YouTube字幕转换为AnimatedDiff/ComfyUI的帧提示动画。
🍴 3 Forks💻 Python🔄 2024-06-14
📦
网盘下载
复制链接后前往夸克网盘下载
https://pan.quark.cn/s/e00a65475347
📦 requirements.txt
youtube-transcript-api
os
comfy
folder_paths
base64
io
PIL
numpy
torch
textwrap
youtube2prompt
YouTube2Transcript
t2icui
📄 README

ComfyUI-JaRue

Takes a YouTube Video ID and pulls a transcript (if available) from the YouTube server and delivers it in a format you can link to AnimatedDiff or any other ComfyUI batch prompt animation.

video_id – Find this on any YouTube video by visiting the page and extracting it from the url. If a YouTube video does not have a transcript the tool will give you an error telling you.

fps – Frames per second allows you to reduce a higher-framed YouTube transcript down to 10fps which is more friendly for batch animations in ComfyUI. You will see the frame counts return based on your fps setting.

begin – If you want to start reading the transcript later in the timeline you can enter a starting frame here and the frame counts will adjust. If you do this more than once you need to keep track of the last number and add it to the new number because the begin frame will always start at the beginning of the YouTube video and not at your last begin point.

cache – Enable cache to avoid spamming YouTube. When you disable cache and press queue the prior cache will be deleted and will force the tool to ask YouTube for the transcripts again.

You will need the YouTube Transcript API Library installed. See link.

https://pypi.org/project/youtube-transcript-api/

After following the install instructions you may discover an error in ComfyUI telling you the library is still not found. To fix this issue you will need to manually copy the api library you installed from your python library into your ComfyUI custom_nodes directory.

There is a Text2Image tool included with this library so you can superimpose the captions on top of the video but i am still working on the code to tie it all together. Right now, you can generate an image with the caption and manually connect that into a batch video.

If you have trouble with the library installs you can remove the jru_text2image.py file from the __init__.py by commenting out the line and rebooting ComfyUI so you can use the YouTube tool.

I cover this node here in a video: https://youtu.be/Si4mwBQuzYQ?si=X306LyKT5NgDvP7a