mirror of
https://github.com/facefusion/facefusion.git
synced 2026-07-12 05:06:36 +02:00
423fee9d7f
This commit adds comprehensive API process functionality including: - Remote streaming support - Session management and context handling - Media type support (video/audio/image) - Asset management and path isolation - Workflow refactoring and optimization - Security improvements and state violation handling - Gallery and image resolution features - Audio support - Analysis tools - Version guard 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
29 lines
773 B
Python
29 lines
773 B
Python
import itertools
|
|
import shutil
|
|
from typing import List
|
|
|
|
from facefusion import metadata
|
|
from facefusion.types import Command
|
|
|
|
|
|
def run(commands : List[Command]) -> List[Command]:
|
|
user_agent = metadata.get('name') + '/' + metadata.get('version')
|
|
|
|
return [ shutil.which('curl'), '--user-agent', user_agent, '--insecure', '--location', '--silent' ] + commands
|
|
|
|
|
|
def chain(*commands : List[Command]) -> List[Command]:
|
|
return list(itertools.chain(*commands))
|
|
|
|
|
|
def head(url : str) -> List[Command]:
|
|
return [ '-I', url ]
|
|
|
|
|
|
def download(url : str, download_file_path : str) -> List[Command]:
|
|
return [ '--create-dirs', '--continue-at', '-', '--output', download_file_path, url ]
|
|
|
|
|
|
def set_timeout(timeout : int) -> List[Command]:
|
|
return [ '--connect-timeout', str(timeout) ]
|