mirror of
https://git.datalinker.icu/comfyanonymous/ComfyUI
synced 2026-08-15 20:43:31 +08:00
Fix av library being a required import at startup
Move av import to be deferred in get_container_format() method to preserve the optional nature of video dependencies. This allows ComfyUI to start without av installed, only requiring it when video features are used.
This commit is contained in:
parent
37d620a6b8
commit
d9812c44b7
@ -2,7 +2,6 @@ from __future__ import annotations
|
||||
from abc import ABC, abstractmethod
|
||||
from typing import Optional, Union
|
||||
import io
|
||||
import av
|
||||
from comfy_api.util import VideoContainer, VideoCodec, VideoComponents
|
||||
|
||||
class VideoInput(ABC):
|
||||
@ -80,6 +79,7 @@ class VideoInput(ABC):
|
||||
Container format as string
|
||||
"""
|
||||
# Default implementation - subclasses should override for better performance
|
||||
import av
|
||||
source = self.get_stream_source()
|
||||
with av.open(source, mode="r") as container:
|
||||
return container.format.name
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user