mirror of
https://github.com/facefusion/facefusion.git
synced 2026-04-22 17:36:16 +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>
45 lines
1.3 KiB
Python
45 lines
1.3 KiB
Python
import os
|
|
import tempfile
|
|
|
|
from facefusion.filesystem import create_directory, is_directory, is_file, remove_directory
|
|
from facefusion.types import JobStatus
|
|
|
|
|
|
def is_test_job_file(file_path : str, job_status : JobStatus) -> bool:
|
|
return is_file(get_test_job_file(file_path, job_status))
|
|
|
|
|
|
def get_test_job_file(file_path : str, job_status : JobStatus) -> str:
|
|
return os.path.join(get_test_jobs_directory(), job_status, file_path)
|
|
|
|
|
|
def get_test_jobs_directory() -> str:
|
|
return os.path.join(tempfile.gettempdir(), 'facefusion-test-jobs')
|
|
|
|
|
|
def get_test_example_file(file_path : str) -> str:
|
|
return os.path.join(get_test_examples_directory(), file_path)
|
|
|
|
|
|
def get_test_examples_directory() -> str:
|
|
return os.path.join(tempfile.gettempdir(), 'facefusion-test-examples')
|
|
|
|
|
|
def is_test_output_file(file_path : str) -> bool:
|
|
return is_file(get_test_output_file(file_path))
|
|
|
|
|
|
def get_test_output_file(file_path : str) -> str:
|
|
return os.path.join(get_test_outputs_directory(), file_path)
|
|
|
|
|
|
def get_test_outputs_directory() -> str:
|
|
return os.path.join(tempfile.gettempdir(), 'facefusion-test-outputs')
|
|
|
|
|
|
def prepare_test_output_directory() -> bool:
|
|
test_outputs_directory = get_test_outputs_directory()
|
|
remove_directory(test_outputs_directory)
|
|
create_directory(test_outputs_directory)
|
|
return is_directory(test_outputs_directory)
|