This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "W": 960, | |
| "H": 540, | |
| "show_info_on_ui": true, | |
| "tiling": false, | |
| "restore_faces": false, | |
| "seed_resize_from_w": 0, | |
| "seed_resize_from_h": 0, | |
| "seed": 2456787099, | |
| "sampler": "Euler a", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # get last frame from video | |
| ffmpeg -i input.mp4 -vf select='eq(pict_type\,PICT_TYPE_I)' -vframes 1 output.png | |
| # reverse video | |
| ffmpeg -i input.mp4 -vf reverse output.mp4 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import onnx | |
| def print_model_io(model_path): | |
| model = onnx.load(model_path) | |
| # Function to convert Dim objects to list of sizes | |
| def dim_list(tensor_type): | |
| return [d.dim_value for d in tensor_type.shape.dim] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| for dir in custom_nodes/*/; do | |
| if [ -d "$dir" ]; then | |
| echo "Entering module: $dir" | |
| (cd $dir && pip install -qq -r requirements.txt) | |
| fi | |
| done |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from huggingface_hub import HfApi, hf_hub_url | |
| import os | |
| hf_config = { | |
| "username":"", | |
| "repo_name":"", | |
| "token":"" | |
| } | |
| def upload_file_hf(file_path): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import requests | |
| from bs4 import BeautifulSoup | |
| web_url = "https://civitai.com/models/7371/rev-animated" | |
| model_type = "model" | |
| # Get download url | |
| response = requests.get(web_url) | |
| soup = BeautifulSoup(response.text, 'html.parser') | |
| url = soup.select(".mantine-UnstyledButton-root.mantine-Button-root.mantine-1movwzg")[0].get("href") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function extractEmailFromString(text: string): string { | |
| const matches = text.match( | |
| /([a-zA-Z0-9._-]+@[a-zA-Z0-9._-]+\.[a-zA-Z0-9_-]+)/gi | |
| ); | |
| return matches ? matches[0] : ""; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Remove audio from video file | |
| ffmpeg -i "video.mp4" -c copy -an "output.mp4" | |
| # Merge (video file without audio) with audio file | |
| ffmpeg -i "video.mp4" -i "audio.mp3" -c:v copy -c:a aac "output.mp4" | |
| # Trim video using start/end time (hh:mm:ss) | |
| ffmpeg -ss 00:00:00 -i "video.mp4" -c copy -t 00:00:15 "output.mp4" | |
| # Write text at middle of a video file |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function getRndInteger(min, max) { | |
| return Math.floor(Math.random() * (max - min) ) + min; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| pm2 start npm --name <name> -- run <script> |
NewerOlder