[Model] Add circlestone-labs/Anima (#4083)
Signed-off-by: akshatvishu <akshatnayak197@gmail.com>
This commit is contained in:
1 parent
698f716012
commit
415005be22
33 files changed
+3127
-46
No files matched your search
@@ -1568,31 +1568,31 @@ class WorkerWrapperBase:
|
||||
gpu_id: GPU device ID
|
||||
od_config: OmniDiffusionConfig configuration
|
||||
worker_extension_cls: Optional qualified name of worker extension class
|
||||
custom_pipeline_args: Optional arguments for custom pipeline initialization
|
||||
custom_pipeline_args: Optional arguments passed to native pipelines.
|
||||
A ``pipeline_class`` entry triggers custom pipeline initialization.
|
||||
"""
|
||||
self.gpu_id = gpu_id
|
||||
self.od_config = od_config
|
||||
self.base_worker_class = base_worker_class
|
||||
self.worker_extension_cls = worker_extension_cls
|
||||
self.custom_pipeline_args = custom_pipeline_args
|
||||
self.uses_custom_pipeline = bool(custom_pipeline_args and "pipeline_class" in custom_pipeline_args)
|
||||
|
||||
# Prepare worker class with extension support
|
||||
worker_class = self._prepare_worker_class()
|
||||
|
||||
# Create the actual worker instance
|
||||
# When custom_pipeline_args is provided, skip initial model loading
|
||||
# since re_init_pipeline will handle it. This avoids allocating memory
|
||||
# through CuMemAllocator twice, which causes assertion failures in
|
||||
# sleep mode.
|
||||
# Only dynamic custom pipelines skip initial loading; native pipelines
|
||||
# may also use custom_pipeline_args for model-specific component paths.
|
||||
self.worker = worker_class(
|
||||
local_rank=gpu_id,
|
||||
rank=gpu_id,
|
||||
od_config=od_config,
|
||||
skip_load_model=(self.custom_pipeline_args is not None),
|
||||
skip_load_model=self.uses_custom_pipeline,
|
||||
)
|
||||
|
||||
# Re-initialize pipeline with custom pipeline if provided
|
||||
if self.custom_pipeline_args is not None:
|
||||
if self.uses_custom_pipeline:
|
||||
self.worker.re_init_pipeline(self.custom_pipeline_args)
|
||||
|
||||
def _prepare_worker_class(self) -> type:
|
||||
@@ -1605,8 +1605,8 @@ class WorkerWrapperBase:
|
||||
"""
|
||||
worker_class = self.base_worker_class
|
||||
|
||||
# If custom_pipeline_args is provided, use CustomPipelineWorkerExtension
|
||||
if self.custom_pipeline_args is not None:
|
||||
# If custom pipeline initialization is requested, use CustomPipelineWorkerExtension.
|
||||
if self.uses_custom_pipeline:
|
||||
# Set worker_extension_cls to CustomPipelineWorkerExtension if not already set
|
||||
if self.worker_extension_cls is None:
|
||||
self.worker_extension_cls = CustomPipelineWorkerExtension
|
||||
|
||||
Reference in new issue
Block a user