[diffusion] refactor: clean useless files (#14094)
This commit is contained in:
@@ -1,55 +0,0 @@
|
|||||||
# Copied and adapted from: https://github.com/hao-ai-lab/FastVideo
|
|
||||||
|
|
||||||
from enum import Enum
|
|
||||||
|
|
||||||
from sglang.multimodal_gen.runtime.utils.logging_utils import init_logger
|
|
||||||
|
|
||||||
logger = init_logger(__name__)
|
|
||||||
|
|
||||||
|
|
||||||
class DatasetType(str, Enum):
|
|
||||||
"""
|
|
||||||
Enumeration for different dataset types.
|
|
||||||
"""
|
|
||||||
|
|
||||||
HF = "hf"
|
|
||||||
MERGED = "merged"
|
|
||||||
|
|
||||||
@classmethod
|
|
||||||
def from_string(cls, value: str) -> "DatasetType":
|
|
||||||
"""Convert string to DatasetType enum."""
|
|
||||||
try:
|
|
||||||
return cls(value.lower())
|
|
||||||
except ValueError:
|
|
||||||
raise ValueError(
|
|
||||||
f"Invalid dataset type: {value}. Must be one of: {', '.join([m.value for m in cls])}"
|
|
||||||
) from None
|
|
||||||
|
|
||||||
@classmethod
|
|
||||||
def choices(cls) -> list[str]:
|
|
||||||
"""Get all available choices as strings for argparse."""
|
|
||||||
return [dataset_type.value for dataset_type in cls]
|
|
||||||
|
|
||||||
|
|
||||||
class VideoLoaderType(str, Enum):
|
|
||||||
"""
|
|
||||||
Enumeration for different video loaders.
|
|
||||||
"""
|
|
||||||
|
|
||||||
TORCHCODEC = "torchcodec"
|
|
||||||
TORCHVISION = "torchvision"
|
|
||||||
|
|
||||||
@classmethod
|
|
||||||
def from_string(cls, value: str) -> "VideoLoaderType":
|
|
||||||
"""Convert string to VideoLoader enum."""
|
|
||||||
try:
|
|
||||||
return cls(value.lower())
|
|
||||||
except ValueError:
|
|
||||||
raise ValueError(
|
|
||||||
f"Invalid video loader: {value}. Must be one of: {', '.join([m.value for m in cls])}"
|
|
||||||
) from None
|
|
||||||
|
|
||||||
@classmethod
|
|
||||||
def choices(cls) -> list[str]:
|
|
||||||
"""Get all available choices as strings for argparse."""
|
|
||||||
return [video_loader.value for video_loader in cls]
|
|
||||||
@@ -1,48 +0,0 @@
|
|||||||
{
|
|
||||||
"embedded_cfg_scale": 6,
|
|
||||||
"flow_shift": 17,
|
|
||||||
"dit_cpu_offload": false,
|
|
||||||
"disable_autocast": false,
|
|
||||||
"precision": "bf16",
|
|
||||||
"vae_precision": "fp32",
|
|
||||||
"vae_tiling": true,
|
|
||||||
"vae_sp": true,
|
|
||||||
"vae_config": {
|
|
||||||
"load_encoder": false,
|
|
||||||
"load_decoder": true,
|
|
||||||
"tile_sample_min_height": 256,
|
|
||||||
"tile_sample_min_width": 256,
|
|
||||||
"tile_sample_min_num_frames": 16,
|
|
||||||
"tile_sample_stride_height": 192,
|
|
||||||
"tile_sample_stride_width": 192,
|
|
||||||
"tile_sample_stride_num_frames": 12,
|
|
||||||
"blend_num_frames": 4,
|
|
||||||
"use_tiling": true,
|
|
||||||
"use_temporal_tiling": true,
|
|
||||||
"use_parallel_tiling": true
|
|
||||||
},
|
|
||||||
"dit_config": {
|
|
||||||
"prefix": "Hunyuan",
|
|
||||||
"quant_config": null
|
|
||||||
},
|
|
||||||
"text_encoder_precisions": [
|
|
||||||
"fp16",
|
|
||||||
"fp16"
|
|
||||||
],
|
|
||||||
"text_encoder_configs": [
|
|
||||||
{
|
|
||||||
"prefix": "llama",
|
|
||||||
"quant_config": null,
|
|
||||||
"lora_config": null
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"prefix": "clip",
|
|
||||||
"quant_config": null,
|
|
||||||
"lora_config": null,
|
|
||||||
"num_hidden_layers_override": null,
|
|
||||||
"require_post_norm": null
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"mask_strategy_file_path": null,
|
|
||||||
"enable_torch_compile": false
|
|
||||||
}
|
|
||||||
@@ -1,41 +0,0 @@
|
|||||||
{
|
|
||||||
"embedded_cfg_scale": 6.0,
|
|
||||||
"flow_shift": 3,
|
|
||||||
"dit_cpu_offload": true,
|
|
||||||
"disable_autocast": false,
|
|
||||||
"precision": "bf16",
|
|
||||||
"vae_precision": "fp32",
|
|
||||||
"vae_tiling": false,
|
|
||||||
"vae_sp": false,
|
|
||||||
"vae_config": {
|
|
||||||
"load_encoder": false,
|
|
||||||
"load_decoder": true,
|
|
||||||
"tile_sample_min_height": 256,
|
|
||||||
"tile_sample_min_width": 256,
|
|
||||||
"tile_sample_min_num_frames": 16,
|
|
||||||
"tile_sample_stride_height": 192,
|
|
||||||
"tile_sample_stride_width": 192,
|
|
||||||
"tile_sample_stride_num_frames": 12,
|
|
||||||
"blend_num_frames": 8,
|
|
||||||
"use_tiling": false,
|
|
||||||
"use_temporal_tiling": false,
|
|
||||||
"use_parallel_tiling": false,
|
|
||||||
"use_feature_cache": true
|
|
||||||
},
|
|
||||||
"dit_config": {
|
|
||||||
"prefix": "Wan",
|
|
||||||
"quant_config": null
|
|
||||||
},
|
|
||||||
"text_encoder_precisions": [
|
|
||||||
"fp32"
|
|
||||||
],
|
|
||||||
"text_encoder_configs": [
|
|
||||||
{
|
|
||||||
"prefix": "t5",
|
|
||||||
"quant_config": null,
|
|
||||||
"lora_config": null
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"mask_strategy_file_path": null,
|
|
||||||
"enable_torch_compile": false
|
|
||||||
}
|
|
||||||
@@ -1,49 +0,0 @@
|
|||||||
{
|
|
||||||
"embedded_cfg_scale": 6.0,
|
|
||||||
"flow_shift": 3,
|
|
||||||
"dit_cpu_offload": true,
|
|
||||||
"disable_autocast": false,
|
|
||||||
"precision": "bf16",
|
|
||||||
"vae_precision": "fp32",
|
|
||||||
"vae_tiling": false,
|
|
||||||
"vae_sp": false,
|
|
||||||
"vae_config": {
|
|
||||||
"load_encoder": true,
|
|
||||||
"load_decoder": true,
|
|
||||||
"tile_sample_min_height": 256,
|
|
||||||
"tile_sample_min_width": 256,
|
|
||||||
"tile_sample_min_num_frames": 16,
|
|
||||||
"tile_sample_stride_height": 192,
|
|
||||||
"tile_sample_stride_width": 192,
|
|
||||||
"tile_sample_stride_num_frames": 12,
|
|
||||||
"blend_num_frames": 8,
|
|
||||||
"use_tiling": false,
|
|
||||||
"use_temporal_tiling": false,
|
|
||||||
"use_parallel_tiling": false,
|
|
||||||
"use_feature_cache": true
|
|
||||||
},
|
|
||||||
"dit_config": {
|
|
||||||
"prefix": "Wan",
|
|
||||||
"quant_config": null
|
|
||||||
},
|
|
||||||
"text_encoder_precisions": [
|
|
||||||
"fp32"
|
|
||||||
],
|
|
||||||
"text_encoder_configs": [
|
|
||||||
{
|
|
||||||
"prefix": "t5",
|
|
||||||
"quant_config": null,
|
|
||||||
"lora_config": null
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"mask_strategy_file_path": null,
|
|
||||||
"enable_torch_compile": false,
|
|
||||||
"image_encoder_config": {
|
|
||||||
"prefix": "clip",
|
|
||||||
"quant_config": null,
|
|
||||||
"lora_config": null,
|
|
||||||
"num_hidden_layers_override": null,
|
|
||||||
"require_post_norm": null
|
|
||||||
},
|
|
||||||
"image_encoder_precision": "fp32"
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user