lightspeed.trex.comfyui.core#

  • SPDX-FileCopyrightText: Copyright (c) 2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved.

  • SPDX-License-Identifier: Apache-2.0

  • Licensed under the Apache License, Version 2.0 (the “License”);

  • you may not use this file except in compliance with the License.

  • You may obtain a copy of the License at

  • https://www.apache.org/licenses/LICENSE-2.0

  • Unless required by applicable law or agreed to in writing, software

  • distributed under the License is distributed on an “AS IS” BASIS,

  • WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

  • See the License for the specific language governing permissions and

  • limitations under the License.

class lightspeed.trex.comfyui.core.ComfyUICoreExtension#

Register ComfyUI persistence and job handlers with the Kit lifecycle.

on_shutdown() → None#

Unregister handlers and invalidate every cached context core.

static on_stage_event(context_name: str, event) → None#

Refresh only jobs that target the USD context whose stage changed.

Parameters:
  • context_name – USD context that emitted the stage event.

  • event – USD stage lifecycle event.

on_startup(ext_id: str) → None#

Register ComfyUI persisted types and apply handlers.

Parameters:

ext_id – Extension identifier supplied by Kit.

class lightspeed.trex.comfyui.core.SetComfyUIOutputFieldCommand(
workflow_output: WorkflowOutput,
field_name: Literal['apply_behavior', 'texture_type'],
value: OutputApplyBehavior | str | None,
)#

Change one workflow output setting with undo support.

do() → None#

Apply the selected output setting.

undo() → None#

Restore the previous output setting.

lightspeed.trex.comfyui.core.get_comfyui_core_instance(
context_name: str,
) → ComfyUICore#

Get or create the ComfyUI core for a USD context.

Parameters:

context_name – USD context name.

Returns:

Cached or newly created core for the context.

Raises:

RuntimeError – If extension shutdown is in progress.