diff --git a/demo/realtime-img2img/app_config.py b/demo/realtime-img2img/app_config.py index 252a992a5..e29c5afe0 100644 --- a/demo/realtime-img2img/app_config.py +++ b/demo/realtime-img2img/app_config.py @@ -12,7 +12,7 @@ def load_controlnet_registry(): """Load ControlNet registry from config file""" try: registry_path = Path(__file__).parent / "controlnet_registry.yaml" - with open(registry_path, "r") as f: + with open(registry_path) as f: config_data = yaml.safe_load(f) # Extract the available_controlnets section @@ -27,7 +27,7 @@ def load_default_settings(): """Load default settings from YAML config file""" try: registry_path = Path(__file__).parent / "controlnet_registry.yaml" - with open(registry_path, "r") as f: + with open(registry_path) as f: config_data = yaml.safe_load(f) return config_data.get("defaults", {}) diff --git a/demo/realtime-img2img/connection_manager.py b/demo/realtime-img2img/connection_manager.py index e35c09df7..8683e46dc 100644 --- a/demo/realtime-img2img/connection_manager.py +++ b/demo/realtime-img2img/connection_manager.py @@ -7,7 +7,6 @@ from fastapi import WebSocket from starlette.websockets import WebSocketState - Connections = Dict[UUID, Dict[str, Union[WebSocket, asyncio.Queue]]] diff --git a/demo/realtime-img2img/img2img.py b/demo/realtime-img2img/img2img.py index a1e6ada8c..3a45b8145 100644 --- a/demo/realtime-img2img/img2img.py +++ b/demo/realtime-img2img/img2img.py @@ -2,7 +2,6 @@ import os import sys - sys.path.append( os.path.join( os.path.dirname(__file__), @@ -18,7 +17,6 @@ from PIL import Image from pydantic import BaseModel, Field - # Default values for pipeline parameters default_negative_prompt = "black and white, blurry, low resolution, pixelated, pixel art, low quality, low fidelity" diff --git a/demo/realtime-img2img/input_control.py b/demo/realtime-img2img/input_control.py index be1e3fe03..ba895019a 100644 --- a/demo/realtime-img2img/input_control.py +++ b/demo/realtime-img2img/input_control.py @@ -148,7 +148,7 @@ def _monitor_gamepad(self) -> None: finally: try: pygame.quit() - except: + except: # noqa: E722 # TODO: pre-existing, untouched by this refactor pass @@ -161,6 +161,7 @@ class InputManager: def __init__(self): self.inputs: Dict[str, InputControl] = {} self.parameter_update_callback: Optional[Callable[[str, float], None]] = None + self._background_tasks: set = set() def add_input(self, input_id: str, input_control: InputControl) -> None: """Add an input control""" @@ -171,7 +172,9 @@ def add_input(self, input_id: str, input_control: InputControl) -> None: def remove_input(self, input_id: str) -> None: """Remove an input control""" if input_id in self.inputs: - asyncio.create_task(self.inputs[input_id].stop()) + task = asyncio.create_task(self.inputs[input_id].stop()) + self._background_tasks.add(task) + task.add_done_callback(self._background_tasks.discard) del self.inputs[input_id] logging.info(f"InputManager: Removed input control {input_id}") diff --git a/demo/realtime-img2img/main.py b/demo/realtime-img2img/main.py index aa5fe5873..754fa26a3 100644 --- a/demo/realtime-img2img/main.py +++ b/demo/realtime-img2img/main.py @@ -11,7 +11,6 @@ from img2img import Pipeline from input_control import InputManager - # fix mime error on windows mimetypes.add_type("application/javascript", ".js") @@ -333,7 +332,7 @@ def add_controlnet(self, controlnet_config: dict): def remove_controlnet(self, index: int): """Remove ControlNet from AppState - SINGLE SOURCE OF TRUTH""" if index < len(self.controlnet_info["controlnets"]): - removed = self.controlnet_info["controlnets"].pop(index) + removed = self.controlnet_info["controlnets"].pop(index) # noqa: F841 # TODO: pre-existing, untouched by this refactor # Re-index remaining controlnets for i, controlnet in enumerate(self.controlnet_info["controlnets"]): controlnet["index"] = i @@ -380,7 +379,7 @@ def remove_hook_processor(self, hook_type: str, processor_index: int): if hook_type in self.pipeline_hooks: processors = self.pipeline_hooks[hook_type]["processors"] if processor_index < len(processors): - removed = processors.pop(processor_index) + removed = processors.pop(processor_index) # noqa: F841 # TODO: pre-existing, untouched by this refactor # Re-index remaining processors for i, processor in enumerate(processors): processor["index"] = i @@ -538,7 +537,7 @@ def generate_pipeline_config(self): if self.ipadapter_info["enabled"]: config["use_ipadapter"] = True # Preserve original ipadapters config but update runtime values - if "ipadapters" in config and config["ipadapters"]: + if config.get("ipadapters"): # Update existing config with current values config["ipadapters"][0].update( {"scale": self.ipadapter_info["scale"], "weight_type": self.ipadapter_info["weight_type"]} @@ -880,8 +879,8 @@ def get_available_controlnets(): def _create_pipeline(self): """Create pipeline using AppState as single source of truth""" logger.info("_create_pipeline: Creating pipeline using AppState as single source of truth") - device = torch.device("cuda" if torch.cuda.is_available() else "cpu") - torch_dtype = torch.float16 + device = torch.device("cuda" if torch.cuda.is_available() else "cpu") # noqa: F841 # TODO: pre-existing, untouched by this refactor + torch_dtype = torch.float16 # noqa: F841 # TODO: pre-existing, untouched by this refactor # Generate pipeline config from AppState - SINGLE SOURCE OF TRUTH pipeline_config = self.app_state.generate_pipeline_config() @@ -906,7 +905,7 @@ def _create_pipeline(self): if "use_safety_checker" in pipeline_config: args_dict["safety_checker"] = pipeline_config["use_safety_checker"] - updated_args = Args(**args_dict) + updated_args = Args(**args_dict) # noqa: F841 # TODO: pre-existing, untouched by this refactor # Create Pipeline instance with the pre-created wrapper and config pipeline = Pipeline(wrapper=wrapper, config=pipeline_config) @@ -941,7 +940,7 @@ def _cleanup_temp_files(self): try: if os.path.exists(temp_path): os.unlink(temp_path) - except: + except: # noqa: E722 # TODO: pre-existing, untouched by this refactor pass self._temp_config_files.clear() diff --git a/demo/realtime-img2img/routes/common/api_utils.py b/demo/realtime-img2img/routes/common/api_utils.py index 0a5425774..6095ba1b9 100644 --- a/demo/realtime-img2img/routes/common/api_utils.py +++ b/demo/realtime-img2img/routes/common/api_utils.py @@ -42,7 +42,7 @@ async def handle_api_request( except Exception as e: logging.exception(f"{operation_name}: Failed to parse request: {e}") - raise HTTPException(status_code=400, detail=f"Invalid request format: {str(e)}") + raise HTTPException(status_code=400, detail=f"Invalid request format: {e!s}") from e def create_success_response(message: str, **extra_data) -> JSONResponse: @@ -74,7 +74,7 @@ def handle_api_error(error: Exception, operation_name: str, status_code: int = 5 HTTPException with standardized error message """ logging.error(f"{operation_name}: Failed: {error}") - return HTTPException(status_code=status_code, detail=f"Failed to {operation_name.lower()}: {str(error)}") + return HTTPException(status_code=status_code, detail=f"Failed to {operation_name.lower()}: {error!s}") def validate_pipeline(pipeline: Any, operation_name: str) -> None: diff --git a/demo/realtime-img2img/routes/controlnet.py b/demo/realtime-img2img/routes/controlnet.py index 3bb0084fc..80ff36b6b 100644 --- a/demo/realtime-img2img/routes/controlnet.py +++ b/demo/realtime-img2img/routes/controlnet.py @@ -15,7 +15,6 @@ ) from .common.dependencies import get_app_instance, get_available_controlnets - router = APIRouter(prefix="/api", tags=["controlnet"]) @@ -48,7 +47,7 @@ async def upload_controlnet_config(file: UploadFile = File(...), app_instance=De try: config_data = yaml.safe_load(content.decode("utf-8")) except yaml.YAMLError as e: - raise HTTPException(status_code=400, detail=f"Invalid YAML format: {str(e)}") + raise HTTPException(status_code=400, detail=f"Invalid YAML format: {e!s}") from e # YAML is source of truth - completely replace any runtime modifications app_instance.app_state.uploaded_config = config_data @@ -78,12 +77,12 @@ async def upload_controlnet_config(file: UploadFile = File(...), app_instance=De # Get config prompt if available config_prompt = config_data.get("prompt", None) # Get negative prompt if available - config_negative_prompt = config_data.get("negative_prompt", None) + config_negative_prompt = config_data.get("negative_prompt", None) # noqa: F841 # TODO: pre-existing, untouched by this refactor # Get t_index_list from config if available from app_config import DEFAULT_SETTINGS - t_index_list = config_data.get("t_index_list", DEFAULT_SETTINGS.get("t_index_list", [35, 45])) + t_index_list = config_data.get("t_index_list", DEFAULT_SETTINGS.get("t_index_list", [35, 45])) # noqa: F841 # TODO: pre-existing, untouched by this refactor # Get acceleration from config if available config_acceleration = config_data.get("acceleration", app_instance.args.acceleration) @@ -109,7 +108,7 @@ async def upload_controlnet_config(file: UploadFile = File(...), app_instance=De ) except (ValueError, TypeError): - raise HTTPException(status_code=400, detail="Invalid width/height values in config") + raise HTTPException(status_code=400, detail="Invalid width/height values in config") from None # Build current resolution string current_resolution = None @@ -165,7 +164,7 @@ async def upload_controlnet_config(file: UploadFile = File(...), app_instance=De except Exception as e: logging.exception(f"upload_controlnet_config: Failed to upload configuration: {e}") - raise HTTPException(status_code=500, detail=f"Failed to upload configuration: {str(e)}") + raise HTTPException(status_code=500, detail=f"Failed to upload configuration: {e!s}") from e @router.get("/controlnet/info") @@ -208,7 +207,7 @@ async def get_current_blending_config(app_instance=Depends(get_app_instance)): ) except Exception as e: - raise handle_api_error(e, "get_current_blending_config") + raise handle_api_error(e, "get_current_blending_config") from e @router.post("/controlnet/update-strength") @@ -243,7 +242,7 @@ async def update_controlnet_strength(request: Request, app_instance=Depends(get_ return create_success_response(f"Updated ControlNet {controlnet_index} strength to {strength}") except Exception as e: - raise handle_api_error(e, "update_controlnet_strength") + raise handle_api_error(e, "update_controlnet_strength") from e @router.get("/controlnet/available") @@ -274,7 +273,6 @@ async def get_available_controlnets_endpoint( elif "sd-turbo" in ml or "sd21" in ml or "sd2.1" in ml or "2-1" in ml or "stable-diffusion-2" in ml: model_type = "sd21" - # Handle case where available_controlnets dependency returns None if available_controlnets is None: logging.warning("get_available_controlnets: available_controlnets dependency returned None") @@ -304,7 +302,7 @@ async def get_available_controlnets_endpoint( ) except Exception as e: - raise handle_api_error(e, "get_available_controlnets_endpoint") + raise handle_api_error(e, "get_available_controlnets_endpoint") from e @router.post("/controlnet/add") @@ -383,7 +381,7 @@ async def add_controlnet( ) except Exception as e: - raise handle_api_error(e, "add_controlnet") + raise handle_api_error(e, "add_controlnet") from e @router.get("/controlnet/status") @@ -411,7 +409,7 @@ async def get_controlnet_status(app_instance=Depends(get_app_instance)): ) except Exception as e: - raise handle_api_error(e, "get_controlnet_status") + raise handle_api_error(e, "get_controlnet_status") from e @router.post("/controlnet/remove") @@ -435,7 +433,7 @@ async def remove_controlnet(request: Request, app_instance=Depends(get_app_insta if index < 0 or index >= len(controlnets): raise HTTPException(status_code=400, detail=f"ControlNet index {index} out of range") - removed_controlnet = controlnets.pop(index) + removed_controlnet = controlnets.pop(index) # noqa: F841 # TODO: pre-existing, untouched by this refactor # Remove from AppState - SINGLE SOURCE OF TRUTH app_instance.app_state.remove_controlnet(index) @@ -461,7 +459,7 @@ async def remove_controlnet(request: Request, app_instance=Depends(get_app_insta ) except Exception as e: - raise handle_api_error(e, "remove_controlnet") + raise handle_api_error(e, "remove_controlnet") from e # Preprocessor endpoints (closely related to ControlNet) @@ -504,7 +502,7 @@ async def get_preprocessors_info(app_instance=Depends(get_app_instance)): ) except Exception as e: - raise handle_api_error(e, "get_preprocessors_info") + raise handle_api_error(e, "get_preprocessors_info") from e @router.post("/preprocessors/switch") @@ -536,7 +534,7 @@ async def switch_preprocessor(request: Request, app_instance=Depends(get_app_ins # Update the preprocessor in AppState controlnet = app_instance.app_state.controlnet_info["controlnets"][controlnet_index] - old_preprocessor = controlnet.get("preprocessor", "unknown") + old_preprocessor = controlnet.get("preprocessor", "unknown") # noqa: F841 # TODO: pre-existing, untouched by this refactor controlnet["preprocessor"] = preprocessor_name controlnet["preprocessor_params"] = {} # Reset parameters when switching @@ -565,7 +563,7 @@ async def switch_preprocessor(request: Request, app_instance=Depends(get_app_ins return create_success_response(f"Switched ControlNet {controlnet_index} preprocessor to {preprocessor_name}") except Exception as e: - raise handle_api_error(e, "switch_preprocessor") + raise handle_api_error(e, "switch_preprocessor") from e @router.post("/preprocessors/update-params") @@ -577,7 +575,7 @@ async def update_preprocessor_params(request: Request, app_instance=Depends(get_ data = await request.json() except Exception as json_error: logging.error(f"update_preprocessor_params: JSON parsing failed: {json_error}") - raise HTTPException(status_code=400, detail=f"Invalid JSON: {json_error}") + raise HTTPException(status_code=400, detail=f"Invalid JSON: {json_error}") from json_error controlnet_index = data.get("controlnet_index") params = data.get("params", {}) @@ -641,8 +639,8 @@ async def update_preprocessor_params(request: Request, app_instance=Depends(get_ ) except Exception as e: - logging.exception(f"update_preprocessor_params: Exception occurred: {str(e)}") - raise handle_api_error(e, "update_preprocessor_params") + logging.exception(f"update_preprocessor_params: Exception occurred: {e!s}") + raise handle_api_error(e, "update_preprocessor_params") from e @router.get("/preprocessors/current-params/{controlnet_index}") @@ -702,4 +700,4 @@ async def get_current_preprocessor_params(controlnet_index: int, app_instance=De ) except Exception as e: - raise handle_api_error(e, "get_current_preprocessor_params") + raise handle_api_error(e, "get_current_preprocessor_params") from e diff --git a/demo/realtime-img2img/routes/debug.py b/demo/realtime-img2img/routes/debug.py index 4fcd9e3b7..e7bf7db95 100644 --- a/demo/realtime-img2img/routes/debug.py +++ b/demo/realtime-img2img/routes/debug.py @@ -9,7 +9,6 @@ from .common.dependencies import get_app_instance - router = APIRouter(prefix="/api/debug", tags=["debug"]) @@ -37,7 +36,7 @@ async def enable_debug_mode(app_instance=Depends(get_app_instance)): ) except Exception as e: logging.exception(f"enable_debug_mode: Failed to enable debug mode: {e}") - raise HTTPException(status_code=500, detail=f"Failed to enable debug mode: {str(e)}") + raise HTTPException(status_code=500, detail=f"Failed to enable debug mode: {e!s}") from e @router.post("/disable", response_model=DebugResponse) @@ -57,7 +56,7 @@ async def disable_debug_mode(app_instance=Depends(get_app_instance)): ) except Exception as e: logging.exception(f"disable_debug_mode: Failed to disable debug mode: {e}") - raise HTTPException(status_code=500, detail=f"Failed to disable debug mode: {str(e)}") + raise HTTPException(status_code=500, detail=f"Failed to disable debug mode: {e!s}") from e @router.post("/step", response_model=DebugResponse) @@ -82,7 +81,7 @@ async def step_frame(app_instance=Depends(get_app_instance)): raise except Exception as e: logging.exception(f"step_frame: Failed to step frame: {e}") - raise HTTPException(status_code=500, detail=f"Failed to step frame: {str(e)}") + raise HTTPException(status_code=500, detail=f"Failed to step frame: {e!s}") from e @router.get("/status", response_model=DebugResponse) @@ -97,4 +96,4 @@ async def get_debug_status(app_instance=Depends(get_app_instance)): ) except Exception as e: logging.exception(f"get_debug_status: Failed to get debug status: {e}") - raise HTTPException(status_code=500, detail=f"Failed to get debug status: {str(e)}") + raise HTTPException(status_code=500, detail=f"Failed to get debug status: {e!s}") from e diff --git a/demo/realtime-img2img/routes/inference.py b/demo/realtime-img2img/routes/inference.py index f1c81dd4a..38d6186a0 100644 --- a/demo/realtime-img2img/routes/inference.py +++ b/demo/realtime-img2img/routes/inference.py @@ -11,7 +11,6 @@ from .common.dependencies import get_app_instance, get_default_settings, get_pipeline_class - router = APIRouter(prefix="/api", tags=["inference"]) @@ -97,7 +96,7 @@ async def stream(user_id: uuid.UUID, request: Request, app_instance=Depends(get_ app_instance._cleanup_pipeline(old_pipeline) app_instance.pipeline = app_instance._create_pipeline() - acceleration_changed = True + acceleration_changed = True # noqa: F841 # TODO: pre-existing, untouched by this refactor logging.info("stream: Pipeline recreated with new acceleration") # IPAdapter style images are now handled dynamically in pipeline.predict() @@ -188,7 +187,7 @@ async def generate_frames(): except Exception as e: logging.exception(f"stream: Error in streaming endpoint: {e}") - raise HTTPException(status_code=500, detail=f"Streaming failed: {str(e)}") + raise HTTPException(status_code=500, detail=f"Streaming failed: {e!s}") from e @router.get("/state") @@ -247,7 +246,7 @@ async def get_app_state( except Exception as e: logging.error(f"get_app_state: Error getting application state: {e}") - raise HTTPException(status_code=500, detail=f"Failed to get application state: {str(e)}") + raise HTTPException(status_code=500, detail=f"Failed to get application state: {e!s}") from e @router.get("/settings") diff --git a/demo/realtime-img2img/routes/input_sources.py b/demo/realtime-img2img/routes/input_sources.py index 1029f2398..5e01e9a42 100644 --- a/demo/realtime-img2img/routes/input_sources.py +++ b/demo/realtime-img2img/routes/input_sources.py @@ -16,7 +16,6 @@ from .common.api_utils import create_success_response, handle_api_error, handle_api_request from .common.dependencies import get_app_instance - router = APIRouter(prefix="/api/input-sources", tags=["input-sources"]) logger = logging.getLogger("input_sources_api") @@ -59,7 +58,7 @@ async def set_input_source(request: Request, app_instance=Depends(get_app_instan try: source_type = InputSourceType(source_type_str) except ValueError: - raise HTTPException(status_code=400, detail=f"Invalid source type: {source_type_str}") + raise HTTPException(status_code=400, detail=f"Invalid source type: {source_type_str}") from None # Validate index for controlnet if component == "controlnet" and index is None: @@ -139,7 +138,7 @@ async def upload_component_image( except Exception as e: # Clean up file if image processing fails file_path.unlink(missing_ok=True) - raise HTTPException(status_code=400, detail=f"Invalid image file: {str(e)}") + raise HTTPException(status_code=400, detail=f"Invalid image file: {e!s}") from e # Get input source manager and set source manager = _get_input_source_manager(app_instance) diff --git a/demo/realtime-img2img/routes/ipadapter.py b/demo/realtime-img2img/routes/ipadapter.py index edf7a4519..db924e6d4 100644 --- a/demo/realtime-img2img/routes/ipadapter.py +++ b/demo/realtime-img2img/routes/ipadapter.py @@ -16,7 +16,6 @@ ) from .common.dependencies import get_app_instance - router = APIRouter(prefix="/api", tags=["ipadapter"]) # Legacy upload endpoint removed - use /api/input-sources/upload-image/ipadapter instead @@ -42,7 +41,7 @@ async def get_default_image(): ) except Exception as e: - raise handle_api_error(e, "get_default_image") + raise handle_api_error(e, "get_default_image") from e @router.post("/ipadapter/update-scale") @@ -68,7 +67,7 @@ async def update_ipadapter_scale(request: Request, app_instance=Depends(get_app_ return create_success_response(f"Updated IPAdapter scale to {scale}") except Exception as e: - raise handle_api_error(e, "update_ipadapter_scale") + raise handle_api_error(e, "update_ipadapter_scale") from e @router.post("/ipadapter/update-weight-type") @@ -94,7 +93,7 @@ async def update_ipadapter_weight_type(request: Request, app_instance=Depends(ge return create_success_response(f"Updated IPAdapter weight type to {weight_type}") except Exception as e: - raise handle_api_error(e, "update_ipadapter_weight_type") + raise handle_api_error(e, "update_ipadapter_weight_type") from e @router.post("/ipadapter/update-enabled") @@ -119,4 +118,4 @@ async def update_ipadapter_enabled(request: Request, app_instance=Depends(get_ap return create_success_response(f"IPAdapter {'enabled' if enabled else 'disabled'} successfully") except Exception as e: - raise handle_api_error(e, "update_ipadapter_enabled") + raise handle_api_error(e, "update_ipadapter_enabled") from e diff --git a/demo/realtime-img2img/routes/parameters.py b/demo/realtime-img2img/routes/parameters.py index 27f4b0d06..3526e9322 100644 --- a/demo/realtime-img2img/routes/parameters.py +++ b/demo/realtime-img2img/routes/parameters.py @@ -10,7 +10,6 @@ from .common.api_utils import create_success_response, handle_api_error, handle_api_request from .common.dependencies import get_app_instance - router = APIRouter(prefix="/api", tags=["parameters"]) @@ -56,7 +55,7 @@ async def update_params(request: Request, app_instance=Depends(get_app_instance) logging.info(f"update_params: {message}") return JSONResponse({"status": "success", "message": message}) except ValueError: - raise HTTPException(status_code=400, detail="Invalid resolution format") + raise HTTPException(status_code=400, detail="Invalid resolution format") from None else: raise HTTPException( status_code=400, detail="Resolution must be {width: int, height: int} or 'widthxheight' string" @@ -103,7 +102,7 @@ async def update_params(request: Request, app_instance=Depends(get_app_instance) except Exception as e: logging.exception(f"update_params: Failed to update parameters: {e}") - raise HTTPException(status_code=500, detail=f"Failed to update parameters: {str(e)}") + raise HTTPException(status_code=500, detail=f"Failed to update parameters: {e!s}") from e async def _update_single_parameter( @@ -126,7 +125,7 @@ async def _update_single_parameter( return create_success_response(f"Updated {parameter_name} to {value}", **{parameter_name: value}) except Exception as e: - raise handle_api_error(e, operation_name) + raise handle_api_error(e, operation_name) from e @router.post("/update-guidance-scale") @@ -231,7 +230,7 @@ async def update_blending(request: Request, app_instance=Depends(get_app_instanc return create_success_response(f"Updated {' and '.join(updated_types)} blending", updated_types=updated_types) except Exception as e: - raise handle_api_error(e, "update_blending") + raise handle_api_error(e, "update_blending") from e @router.post("/blending/update-prompt-weight") @@ -257,7 +256,7 @@ async def update_prompt_weight(request: Request, app_instance=Depends(get_app_in return create_success_response(f"Updated prompt weight {index} to {weight}") except Exception as e: - raise handle_api_error(e, "update_prompt_weight") + raise handle_api_error(e, "update_prompt_weight") from e @router.post("/blending/update-seed-weight") @@ -283,4 +282,4 @@ async def update_seed_weight(request: Request, app_instance=Depends(get_app_inst return create_success_response(f"Updated seed weight {index} to {weight}") except Exception as e: - raise handle_api_error(e, "update_seed_weight") + raise handle_api_error(e, "update_seed_weight") from e diff --git a/demo/realtime-img2img/routes/pipeline_hooks.py b/demo/realtime-img2img/routes/pipeline_hooks.py index 0c7184ef6..eece7dcda 100644 --- a/demo/realtime-img2img/routes/pipeline_hooks.py +++ b/demo/realtime-img2img/routes/pipeline_hooks.py @@ -10,7 +10,6 @@ from .common.api_utils import create_success_response, handle_api_error from .common.dependencies import get_app_instance - router = APIRouter(prefix="/api", tags=["pipeline-hooks"]) @@ -28,7 +27,7 @@ async def get_pipeline_hooks_info_config(app_instance=Depends(get_app_instance)) } return JSONResponse(hooks_info) except Exception as e: - raise handle_api_error(e, "get_pipeline_hooks_info_config") + raise handle_api_error(e, "get_pipeline_hooks_info_config") from e # Individual hook type endpoints that frontend expects @@ -124,7 +123,7 @@ async def get_hook_processors_info(hook_type: str, app_instance=Depends(get_app_ ) except Exception as e: - raise handle_api_error(e, "get_hook_processors_info") + raise handle_api_error(e, "get_hook_processors_info") from e @router.post("/pipeline-hooks/{hook_type}/add") @@ -179,7 +178,7 @@ async def add_hook_processor(hook_type: str, request: Request, app_instance=Depe return create_success_response(f"Added {processor_type} processor to {hook_type}") except Exception as e: - raise handle_api_error(e, "add_hook_processor") + raise handle_api_error(e, "add_hook_processor") from e @router.delete("/pipeline-hooks/{hook_type}/remove/{processor_index}") @@ -216,7 +215,7 @@ async def remove_hook_processor(hook_type: str, processor_index: int, app_instan return create_success_response(f"Removed processor {processor_index} from {hook_type}") except Exception as e: - raise handle_api_error(e, "remove_hook_processor") + raise handle_api_error(e, "remove_hook_processor") from e @router.post("/pipeline-hooks/{hook_type}/toggle") @@ -264,7 +263,7 @@ async def toggle_hook_processor(hook_type: str, request: Request, app_instance=D ) except Exception as e: - raise handle_api_error(e, "toggle_hook_processor") + raise handle_api_error(e, "toggle_hook_processor") from e @router.post("/pipeline-hooks/{hook_type}/switch") @@ -347,7 +346,7 @@ async def switch_hook_processor(hook_type: str, request: Request, app_instance=D return create_success_response(f"Switched processor {processor_index} in {hook_type} to {new_processor_type}") except Exception as e: - raise handle_api_error(e, "switch_hook_processor") + raise handle_api_error(e, "switch_hook_processor") from e @router.post("/pipeline-hooks/{hook_type}/update-params") @@ -438,9 +437,9 @@ async def update_hook_processor_params(hook_type: str, request: Request, app_ins ) except Exception as e: - logging.exception(f"update_hook_processor_params: Exception occurred: {str(e)}") + logging.exception(f"update_hook_processor_params: Exception occurred: {e!s}") logging.error(f"update_hook_processor_params: Exception type: {type(e).__name__}") - raise handle_api_error(e, "update_hook_processor_params") + raise handle_api_error(e, "update_hook_processor_params") from e @router.get("/pipeline-hooks/{hook_type}/current-params/{processor_index}") @@ -501,4 +500,4 @@ async def get_current_hook_processor_params( ) except Exception as e: - raise handle_api_error(e, "get_current_hook_processor_params") + raise handle_api_error(e, "get_current_hook_processor_params") from e diff --git a/demo/realtime-img2img/routes/websocket.py b/demo/realtime-img2img/routes/websocket.py index 2a2c87a0a..126c1f5f8 100644 --- a/demo/realtime-img2img/routes/websocket.py +++ b/demo/realtime-img2img/routes/websocket.py @@ -14,7 +14,6 @@ from .common.dependencies import get_app_instance, get_pipeline_class - router = APIRouter(prefix="/api", tags=["websocket"]) diff --git a/demo/realtime-img2img/util.py b/demo/realtime-img2img/util.py index e64ddc36a..3d818d254 100644 --- a/demo/realtime-img2img/util.py +++ b/demo/realtime-img2img/util.py @@ -1,18 +1,17 @@ +import io from importlib import import_module from types import ModuleType -from typing import Dict, Any -from pydantic import BaseModel as PydanticBaseModel, Field -from PIL import Image -import io + import torch -from torchvision.io import encode_jpeg, decode_jpeg +from PIL import Image +from torchvision.io import decode_jpeg, encode_jpeg def get_pipeline_class(pipeline_name: str) -> ModuleType: try: module = import_module(f"pipelines.{pipeline_name}") except ModuleNotFoundError: - raise ValueError(f"Pipeline {pipeline_name} module not found") + raise ValueError(f"Pipeline {pipeline_name} module not found") from None pipeline_class = getattr(module, "Pipeline", None) @@ -55,7 +54,7 @@ def bytes_to_pt(image_bytes: bytes) -> torch.Tensor: # Normalise to [0, 1] on the decode device (fused kernel on GPU). image_tensor = image_tensor.float() / 255.0 - + return image_tensor @@ -75,24 +74,24 @@ def pil_to_frame(image: Image.Image) -> bytes: def pt_to_frame(tensor: torch.Tensor) -> bytes: """ Convert PyTorch tensor directly to JPEG frame bytes using torchvision - + Args: tensor: PyTorch tensor with shape (C, H, W) or (1, C, H, W), values in [0, 1] - + Returns: bytes: JPEG frame data for streaming """ # Handle batch dimension - take first image if batched if tensor.dim() == 4: tensor = tensor[0] - + # Convert to uint8 format (0-255) and ensure correct shape (C, H, W) tensor_uint8 = (tensor * 255).clamp(0, 255).to(torch.uint8) - + # Encode directly to JPEG bytes using torchvision jpeg_bytes = encode_jpeg(tensor_uint8, quality=90) frame_data = jpeg_bytes.cpu().numpy().tobytes() - + return ( b"--frame\r\n" + b"Content-Type: image/jpeg\r\n" diff --git a/demo/realtime-img2img/utils/video_utils.py b/demo/realtime-img2img/utils/video_utils.py index 4ba9d4924..b4915b6ec 100644 --- a/demo/realtime-img2img/utils/video_utils.py +++ b/demo/realtime-img2img/utils/video_utils.py @@ -233,7 +233,7 @@ def validate_video_file(video_path: str) -> Tuple[bool, str]: return True, "Video file is valid" except Exception as e: - return False, f"Video validation error: {str(e)}" + return False, f"Video validation error: {e!s}" # Supported video formats diff --git a/demo/realtime-txt2img/config.py b/demo/realtime-txt2img/config.py index f7bb12403..a5700e4ce 100644 --- a/demo/realtime-txt2img/config.py +++ b/demo/realtime-txt2img/config.py @@ -4,7 +4,6 @@ import torch - SAFETY_CHECKER = os.environ.get("SAFETY_CHECKER", "False") == "True" diff --git a/demo/realtime-txt2img/main.py b/demo/realtime-txt2img/main.py index 18931f9ec..6fedfce60 100644 --- a/demo/realtime-txt2img/main.py +++ b/demo/realtime-txt2img/main.py @@ -14,12 +14,10 @@ from PIL import Image from pydantic import BaseModel - sys.path.append(os.path.join(os.path.dirname(__file__), "..", "..")) from streamdiffusion import StreamDiffusionWrapper - logger = logging.getLogger("uvicorn") PROJECT_DIR = Path(__file__).parent.parent diff --git a/demo/vid2vid/app.py b/demo/vid2vid/app.py index c7f4a37ff..e9add2d82 100644 --- a/demo/vid2vid/app.py +++ b/demo/vid2vid/app.py @@ -7,12 +7,10 @@ from torchvision.io import read_video, write_video from tqdm import tqdm - sys.path.append(os.path.join(os.path.dirname(__file__), "..", "..")) from streamdiffusion import StreamDiffusionWrapper - CURRENT_DIR = os.path.dirname(os.path.abspath(__file__)) diff --git a/examples/benchmark/ab_bench.py b/examples/benchmark/ab_bench.py index a59a1ed90..86aa4afe5 100644 --- a/examples/benchmark/ab_bench.py +++ b/examples/benchmark/ab_bench.py @@ -64,15 +64,13 @@ from pathlib import Path from typing import TYPE_CHECKING, Any, Dict, List, Optional, Tuple - if TYPE_CHECKING: - import PIL.Image # noqa: F401 — used in type annotations only + import PIL.Image import numpy as np import torch from tqdm import tqdm - # ── repo root on sys.path so streamdiffusion is importable without install ───── _REPO_ROOT = Path(__file__).resolve().parents[2] if str(_REPO_ROOT) not in sys.path: @@ -81,7 +79,6 @@ from streamdiffusion.tools.gpu_profiler import configure as _prof_configure # noqa: E402 from streamdiffusion.tools.gpu_profiler import profiler # noqa: E402 - # ────────────────────────────────────────────────────────────────────────────── # Helpers # ────────────────────────────────────────────────────────────────────────────── diff --git a/examples/benchmark/multi.py b/examples/benchmark/multi.py index 443835b99..5ab7c85d2 100644 --- a/examples/benchmark/multi.py +++ b/examples/benchmark/multi.py @@ -13,7 +13,6 @@ from streamdiffusion.image_utils import postprocess_image - sys.path.append(os.path.join(os.path.dirname(__file__), "..", "..")) from streamdiffusion import StreamDiffusionWrapper @@ -23,7 +22,7 @@ def _postprocess_image(queue: Queue) -> None: while True: try: if not queue.empty(): - output = postprocess_image(queue.get(block=False), output_type="pil")[0] + output = postprocess_image(queue.get(block=False), output_type="pil")[0] # noqa: F841 # TODO: pre-existing, untouched by this refactor time.sleep(0.0005) except KeyboardInterrupt: return diff --git a/examples/benchmark/single.py b/examples/benchmark/single.py index 133abc13b..46b264a78 100644 --- a/examples/benchmark/single.py +++ b/examples/benchmark/single.py @@ -9,7 +9,6 @@ import torch from tqdm import tqdm - sys.path.append(os.path.join(os.path.dirname(__file__), "..", "..")) from streamdiffusion import StreamDiffusionWrapper diff --git a/examples/config/config_ipadapter_stream_test.py b/examples/config/config_ipadapter_stream_test.py index b8141e033..db5aaf40c 100644 --- a/examples/config/config_ipadapter_stream_test.py +++ b/examples/config/config_ipadapter_stream_test.py @@ -354,7 +354,7 @@ def main(): print("=" * 50) try: - metrics = process_video_ipadapter_stream( + metrics = process_video_ipadapter_stream( # noqa: F841 # TODO: pre-existing, untouched by this refactor args.config, args.input_video, args.static_image, args.output_dir, engine_only=args.engine_only ) if args.engine_only: diff --git a/examples/config/config_video_test.py b/examples/config/config_video_test.py index 69a8d39e6..a82c26583 100644 --- a/examples/config/config_video_test.py +++ b/examples/config/config_video_test.py @@ -228,7 +228,7 @@ def main(): # Get the script directory to make paths relative to it script_dir = Path(__file__).parent - default_config = script_dir.parent.parent / "configs" / "controlnet_examples" / "multi_controlnet_example.yaml" + default_config = script_dir.parent.parent / "configs" / "controlnet_examples" / "multi_controlnet_example.yaml" # noqa: F841 # TODO: pre-existing, untouched by this refactor parser.add_argument("--config", type=str, required=True, help="Path to ControlNet configuration file") parser.add_argument("--input-video", type=str, required=True, help="Path to input video file") @@ -270,7 +270,7 @@ def main(): print(f"main: Output directory: {args.output_dir}") try: - metrics = process_video(args.config, args.input_video, args.output_dir, engine_only=args.engine_only) + metrics = process_video(args.config, args.input_video, args.output_dir, engine_only=args.engine_only) # noqa: F841 # TODO: pre-existing, untouched by this refactor if args.engine_only: print("main: Engine-only mode completed successfully!") return 0 diff --git a/examples/img2img/multi.py b/examples/img2img/multi.py index af112585b..0f59e8cb3 100644 --- a/examples/img2img/multi.py +++ b/examples/img2img/multi.py @@ -5,12 +5,10 @@ import fire - sys.path.append(os.path.join(os.path.dirname(__file__), "..", "..")) from streamdiffusion import StreamDiffusionWrapper - CURRENT_DIR = os.path.dirname(os.path.abspath(__file__)) diff --git a/examples/img2img/single.py b/examples/img2img/single.py index b894bc031..493753442 100644 --- a/examples/img2img/single.py +++ b/examples/img2img/single.py @@ -4,12 +4,10 @@ import fire - sys.path.append(os.path.join(os.path.dirname(__file__), "..", "..")) from streamdiffusion import StreamDiffusionWrapper - CURRENT_DIR = os.path.dirname(os.path.abspath(__file__)) diff --git a/examples/optimal-performance/multi.py b/examples/optimal-performance/multi.py index e154dfcc1..a68c8511d 100644 --- a/examples/optimal-performance/multi.py +++ b/examples/optimal-performance/multi.py @@ -11,12 +11,10 @@ from streamdiffusion.image_utils import postprocess_image - sys.path.append(os.path.join(os.path.dirname(__file__), "..", "..")) from streamdiffusion import StreamDiffusionWrapper - image_update_counter = 0 diff --git a/examples/optimal-performance/single.py b/examples/optimal-performance/single.py index ec610de72..abe71c6ce 100644 --- a/examples/optimal-performance/single.py +++ b/examples/optimal-performance/single.py @@ -6,7 +6,6 @@ import fire - sys.path.append(os.path.join(os.path.dirname(__file__), "..", "..")) from streamdiffusion import StreamDiffusionWrapper diff --git a/examples/screen/main.py b/examples/screen/main.py index 405ff6eec..918b46c61 100644 --- a/examples/screen/main.py +++ b/examples/screen/main.py @@ -14,13 +14,11 @@ from streamdiffusion.image_utils import pil2tensor - sys.path.append(os.path.join(os.path.dirname(__file__), "..", "..")) from streamdiffusion import StreamDiffusionWrapper from utils.viewer import receive_images - inputs = [] top = 0 left = 0 @@ -30,9 +28,11 @@ def screen( event: threading.Event, height: int = 512, width: int = 512, - monitor: Dict[str, int] = {"top": 300, "left": 200, "width": 512, "height": 512}, + monitor: Optional[Dict[str, int]] = None, ): global inputs + if monitor is None: + monitor = {"top": 300, "left": 200, "width": 512, "height": 512} with mss.mss() as sct: while True: if event.is_set(): diff --git a/examples/txt2img/multi.py b/examples/txt2img/multi.py index 1d3301966..b82f1b0a5 100644 --- a/examples/txt2img/multi.py +++ b/examples/txt2img/multi.py @@ -4,12 +4,10 @@ import fire - sys.path.append(os.path.join(os.path.dirname(__file__), "..", "..")) from streamdiffusion import StreamDiffusionWrapper - CURRENT_DIR = os.path.dirname(os.path.abspath(__file__)) diff --git a/examples/txt2img/single.py b/examples/txt2img/single.py index f3c8763aa..550566bf0 100644 --- a/examples/txt2img/single.py +++ b/examples/txt2img/single.py @@ -4,12 +4,10 @@ import fire - sys.path.append(os.path.join(os.path.dirname(__file__), "..", "..")) from streamdiffusion import StreamDiffusionWrapper - CURRENT_DIR = os.path.dirname(os.path.abspath(__file__)) diff --git a/examples/txt2img/spacing_compare.py b/examples/txt2img/spacing_compare.py index 0e226ede0..b3995f7bf 100644 --- a/examples/txt2img/spacing_compare.py +++ b/examples/txt2img/spacing_compare.py @@ -25,11 +25,9 @@ import torch from PIL import Image - sys.path.append(os.path.join(os.path.dirname(__file__), "..", "..")) from streamdiffusion import StreamDiffusionWrapper - CURRENT_DIR = os.path.dirname(os.path.abspath(__file__)) INPUT_IMAGE = os.path.join(CURRENT_DIR, "..", "..", "images", "inputs", "input.png") OUTPUT_DIR = os.path.join(CURRENT_DIR, "..", "..", "images", "outputs", "spacing_compare") @@ -124,7 +122,7 @@ def run_model(model_id: str) -> None: brightness = mean_brightness(img) print( - f" {sampler_name:12s} on_grid={str(grid_flag):5s} sub_ts={[int(t) for t in sub_ts]}\n" + f" {sampler_name:12s} on_grid={grid_flag!s:5s} sub_ts={[int(t) for t in sub_ts]}\n" f" brightness={brightness:.4f} ({description})" ) diff --git a/examples/vid2vid/main.py b/examples/vid2vid/main.py index a045b29ad..8098ce38f 100644 --- a/examples/vid2vid/main.py +++ b/examples/vid2vid/main.py @@ -7,12 +7,10 @@ from torchvision.io import read_video, write_video from tqdm import tqdm - sys.path.append(os.path.join(os.path.dirname(__file__), "..", "..")) from streamdiffusion import StreamDiffusionWrapper - CURRENT_DIR = os.path.dirname(os.path.abspath(__file__)) diff --git a/pyproject.toml b/pyproject.toml index 3b4b63bd0..16d082195 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,28 +1,66 @@ [tool.ruff] line-length = 119 +target-version = "py310" # contract floor: setup.py python_requires>=3.10 +# venv/ is already in ruff's default excludes. +extend-exclude = ["logs", "profiler_logs", "profiles", "*.egg-info", "demo/*/frontend", "engines", "models"] [tool.ruff.lint] -# Never enforce `E501` (line length violations). -ignore = ["C901", "E501", "E741", "F402", "F403", "F405", "F823"] -select = ["C", "E", "F", "I", "W"] +select = ["E", "W", "F", "I", "C4", "B", "UP", "SIM", "RUF", "PERF", "NPY"] +ignore = [ + "E501", # line length — formatter handles wrapping; long literals stay + "E741", # ambiguous single-letter names — common in math/diffusion code + "F402", + "F823", + "UP006", # keep typing.Dict/List annotations — no mass churn + "UP007", # keep typing.Union + "UP035", # keep typing imports + "UP045", # keep typing.Optional + # --- Adopted incrementally: non-auto-fixable residuals, ignored pending follow-up --- + "SIM102", "SIM105", "SIM108", "SIM110", "SIM115", "SIM117", "SIM118", "SIM101", "SIM201", # stylistic + "PERF203", "PERF401", "PERF102", # perf hints + "RUF001", "RUF002", "RUF003", # ambiguous-unicode in math docstrings + "RUF012", "RUF013", "RUF005", "RUF015", "RUF059", # annotation/misc deferral + "B905", "B007", # zip-strict / unused-loop-var (behaviour-sensitive) + "RUF022", "RUF046", "UP008", # stylistic +] + +[tool.ruff.lint.flake8-bugbear] +# Calls safe to use as argument/dataclass defaults — silences B006/B008/RUF009 for these. +extend-immutable-calls = ["fastapi.Depends", "fastapi.File", "torch.device"] -# Ignore import violations in all `__init__.py` files. [tool.ruff.lint.per-file-ignores] "__init__.py" = ["E402", "F401", "F811"] +# The only two files using `from ... import *`: +"src/streamdiffusion/acceleration/tensorrt/builder.py" = ["F403", "F405"] +"src/streamdiffusion/acceleration/tensorrt/runtime_engines/unet_engine.py" = ["F403", "F405"] +# sys.path-hack entry points import after path setup: +"tests/**" = ["E402"] +"scripts/**" = ["E402"] +"utils/**" = ["E402"] +"StreamDiffusionTD/*.py" = ["E402"] +# Deliberate ordering: circular-import avoidance / patch-before-import. +"demo/realtime-img2img/main.py" = ["E402"] +"src/streamdiffusion/acceleration/tensorrt/export_wrappers/unet_unified_export.py" = ["E402"] [tool.ruff.lint.isort] -lines-after-imports = 2 known-first-party = ["streamdiffusion"] [tool.ruff.format] -# Like Black, use double quotes for strings. +# Black-compatible. quote-style = "double" - -# Like Black, indent with spaces, rather than tabs. indent-style = "space" - -# Like Black, respect magic trailing commas. skip-magic-trailing-comma = false - -# Like Black, automatically detect the appropriate line ending. line-ending = "auto" +docstring-code-format = true + +[tool.pyrefly] +project-includes = ["src", "StreamDiffusionTD", "tests", "custom_processors", "scripts", "tools", "utils"] +project-excludes = ["tests/manual/**", "tests/quality/**", "demo/**", "examples/**"] +search-path = ["src"] +python-version = "3.10" +python-interpreter-path = "venv/Scripts/python.exe" +# Pre-existing errors are frozen in the baseline; only new errors fail the check. +# Refresh after intentional fixes: pyrefly check --update-baseline +baseline = "pyrefly-baseline.json" +# Warn-severity GPU anti-pattern lints (.item() sync stalls, hard-coded .cuda(), print(tensor)). +pytorch-efficiency-lints = true diff --git a/pyrefly-baseline.json b/pyrefly-baseline.json new file mode 100644 index 000000000..55e05f59b --- /dev/null +++ b/pyrefly-baseline.json @@ -0,0 +1,9580 @@ +{ + "errors": [ + { + "line": 254, + "column": 22, + "stop_line": 254, + "stop_column": 35, + "path": "scripts\\profiling\\profile_nsys.py", + "code": -2, + "name": "bad-argument-type", + "description": "Argument `str` is not assignable to parameter `acceleration` with type `Literal['none', 'tensorrt', 'xformers']` in function `streamdiffusion.wrapper.StreamDiffusionWrapper.__init__`", + "concise_description": "Argument `str` is not assignable to parameter `acceleration` with type `Literal['none', 'tensorrt', 'xformers']` in function `streamdiffusion.wrapper.StreamDiffusionWrapper.__init__`", + "severity": "error" + }, + { + "line": 350, + "column": 1, + "stop_line": 350, + "stop_column": 38, + "path": "scripts\\profiling\\profile_nsys.py", + "code": -2, + "name": "missing-attribute", + "description": "Object of class `NoneType` has no attribute `cudaProfilerStart`", + "concise_description": "Object of class `NoneType` has no attribute `cudaProfilerStart`", + "severity": "error" + }, + { + "line": 359, + "column": 1, + "stop_line": 359, + "stop_column": 37, + "path": "scripts\\profiling\\profile_nsys.py", + "code": -2, + "name": "missing-attribute", + "description": "Object of class `NoneType` has no attribute `cudaProfilerStop`", + "concise_description": "Object of class `NoneType` has no attribute `cudaProfilerStop`", + "severity": "error" + }, + { + "line": 103, + "column": 12, + "stop_line": 103, + "stop_column": 18, + "path": "scripts\\test_lora_sanity.py", + "code": -2, + "name": "bad-return", + "description": "Returned type `Tensor | list[Tensor]` is not assignable to declared return type `Image`", + "concise_description": "Returned type `Tensor | list[Tensor]` is not assignable to declared return type `Image`", + "severity": "error" + }, + { + "line": 97, + "column": 33, + "stop_line": 97, + "stop_column": 38, + "path": "src\\streamdiffusion\\_patches\\diffusers_kvo_patch.py", + "code": -2, + "name": "bad-assignment", + "description": "`(self: Unknown, attn: Unknown, hidden_states: Unknown, encoder_hidden_states: Unknown | None = None, attention_mask: Unknown | None = None, temb: Unknown | None = None, kvo_cache: Unknown | None = None, *args: Unknown, **kwargs: Unknown) -> tuple[Tensor, Unknown | None]` is not assignable to attribute `__call__` with type `(self: AttnProcessor2_0, attn: Attention, hidden_states: Tensor, encoder_hidden_states: Tensor | None = None, attention_mask: Tensor | None = None, temb: Tensor | None = None, kvo_cache: list[Tensor] | None = None, *args: Unknown, **kwargs: Unknown) -> Tensor`", + "concise_description": "`(self: Unknown, attn: Unknown, hidden_states: Unknown, encoder_hidden_states: Unknown | None = None, attention_mask: Unknown | None = None, temb: Unknown | None = None, kvo_cache: Unknown | None = None, *args: Unknown, **kwargs: Unknown) -> tuple[Tensor, Unknown | None]` is not assignable to attribute `__call__` with type `(self: AttnProcessor2_0, attn: Attention, hidden_states: Tensor, encoder_hidden_states: Tensor | None = None, attention_mask: Tensor | None = None, temb: Tensor | None = None, kvo_cache: list[Tensor] | None = None, *args: Unknown, **kwargs: Unknown) -> Tensor`", + "severity": "error" + }, + { + "line": 174, + "column": 60, + "stop_line": 174, + "stop_column": 96, + "path": "src\\streamdiffusion\\_patches\\diffusers_kvo_patch.py", + "code": -2, + "name": "unsupported-operation", + "description": "`None` is not subscriptable", + "concise_description": "`None` is not subscriptable", + "severity": "error" + }, + { + "line": 177, + "column": 48, + "stop_line": 177, + "stop_column": 64, + "path": "src\\streamdiffusion\\_patches\\diffusers_kvo_patch.py", + "code": -2, + "name": "missing-attribute", + "description": "Object of class `NoneType` has no attribute `reshape`", + "concise_description": "Object of class `NoneType` has no attribute `reshape`", + "severity": "error" + }, + { + "line": 199, + "column": 27, + "stop_line": 199, + "stop_column": 35, + "path": "src\\streamdiffusion\\_patches\\diffusers_kvo_patch.py", + "code": -2, + "name": "unbound-name", + "description": "`gate_msa` may be uninitialized", + "concise_description": "`gate_msa` may be uninitialized", + "severity": "error" + }, + { + "line": 201, + "column": 27, + "stop_line": 201, + "stop_column": 35, + "path": "src\\streamdiffusion\\_patches\\diffusers_kvo_patch.py", + "code": -2, + "name": "unbound-name", + "description": "`gate_msa` may be uninitialized", + "concise_description": "`gate_msa` may be uninitialized", + "severity": "error" + }, + { + "line": 218, + "column": 64, + "stop_line": 218, + "stop_column": 100, + "path": "src\\streamdiffusion\\_patches\\diffusers_kvo_patch.py", + "code": -2, + "name": "unsupported-operation", + "description": "`None` is not subscriptable", + "concise_description": "`None` is not subscriptable", + "severity": "error" + }, + { + "line": 236, + "column": 60, + "stop_line": 236, + "stop_column": 96, + "path": "src\\streamdiffusion\\_patches\\diffusers_kvo_patch.py", + "code": -2, + "name": "unsupported-operation", + "description": "`None` is not subscriptable", + "concise_description": "`None` is not subscriptable", + "severity": "error" + }, + { + "line": 241, + "column": 60, + "stop_line": 241, + "stop_column": 69, + "path": "src\\streamdiffusion\\_patches\\diffusers_kvo_patch.py", + "code": -2, + "name": "unbound-name", + "description": "`scale_mlp` may be uninitialized", + "concise_description": "`scale_mlp` may be uninitialized", + "severity": "error" + }, + { + "line": 241, + "column": 82, + "stop_line": 241, + "stop_column": 91, + "path": "src\\streamdiffusion\\_patches\\diffusers_kvo_patch.py", + "code": -2, + "name": "unbound-name", + "description": "`shift_mlp` may be uninitialized", + "concise_description": "`shift_mlp` may be uninitialized", + "severity": "error" + }, + { + "line": 255, + "column": 25, + "stop_line": 255, + "stop_column": 33, + "path": "src\\streamdiffusion\\_patches\\diffusers_kvo_patch.py", + "code": -2, + "name": "unbound-name", + "description": "`gate_mlp` may be uninitialized", + "concise_description": "`gate_mlp` may be uninitialized", + "severity": "error" + }, + { + "line": 257, + "column": 25, + "stop_line": 257, + "stop_column": 33, + "path": "src\\streamdiffusion\\_patches\\diffusers_kvo_patch.py", + "code": -2, + "name": "unbound-name", + "description": "`gate_mlp` may be uninitialized", + "concise_description": "`gate_mlp` may be uninitialized", + "severity": "error" + }, + { + "line": 341, + "column": 26, + "stop_line": 341, + "stop_column": 34, + "path": "src\\streamdiffusion\\_patches\\diffusers_kvo_patch.py", + "code": -2, + "name": "unbound-name", + "description": "`residual` may be uninitialized", + "concise_description": "`residual` may be uninitialized", + "severity": "error" + }, + { + "line": 342, + "column": 28, + "stop_line": 342, + "stop_column": 38, + "path": "src\\streamdiffusion\\_patches\\diffusers_kvo_patch.py", + "code": -2, + "name": "unbound-name", + "description": "`batch_size` may be uninitialized", + "concise_description": "`batch_size` may be uninitialized", + "severity": "error" + }, + { + "line": 343, + "column": 24, + "stop_line": 343, + "stop_column": 30, + "path": "src\\streamdiffusion\\_patches\\diffusers_kvo_patch.py", + "code": -2, + "name": "unbound-name", + "description": "`height` may be uninitialized", + "concise_description": "`height` may be uninitialized", + "severity": "error" + }, + { + "line": 344, + "column": 23, + "stop_line": 344, + "stop_column": 28, + "path": "src\\streamdiffusion\\_patches\\diffusers_kvo_patch.py", + "code": -2, + "name": "unbound-name", + "description": "`width` may be uninitialized", + "concise_description": "`width` may be uninitialized", + "severity": "error" + }, + { + "line": 345, + "column": 27, + "stop_line": 345, + "stop_column": 36, + "path": "src\\streamdiffusion\\_patches\\diffusers_kvo_patch.py", + "code": -2, + "name": "unbound-name", + "description": "`inner_dim` may be uninitialized", + "concise_description": "`inner_dim` may be uninitialized", + "severity": "error" + }, + { + "line": 354, + "column": 35, + "stop_line": 354, + "stop_column": 52, + "path": "src\\streamdiffusion\\_patches\\diffusers_kvo_patch.py", + "code": -2, + "name": "unbound-name", + "description": "`embedded_timestep` may be uninitialized", + "concise_description": "`embedded_timestep` may be uninitialized", + "severity": "error" + }, + { + "line": 355, + "column": 24, + "stop_line": 355, + "stop_column": 30, + "path": "src\\streamdiffusion\\_patches\\diffusers_kvo_patch.py", + "code": -2, + "name": "unbound-name", + "description": "`height` may be uninitialized", + "concise_description": "`height` may be uninitialized", + "severity": "error" + }, + { + "line": 356, + "column": 23, + "stop_line": 356, + "stop_column": 28, + "path": "src\\streamdiffusion\\_patches\\diffusers_kvo_patch.py", + "code": -2, + "name": "unbound-name", + "description": "`width` may be uninitialized", + "concise_description": "`width` may be uninitialized", + "severity": "error" + }, + { + "line": 360, + "column": 21, + "stop_line": 360, + "stop_column": 27, + "path": "src\\streamdiffusion\\_patches\\diffusers_kvo_patch.py", + "code": -2, + "name": "unbound-name", + "description": "`output` may be uninitialized", + "concise_description": "`output` may be uninitialized", + "severity": "error" + }, + { + "line": 362, + "column": 48, + "stop_line": 362, + "stop_column": 54, + "path": "src\\streamdiffusion\\_patches\\diffusers_kvo_patch.py", + "code": -2, + "name": "unbound-name", + "description": "`output` may be uninitialized", + "concise_description": "`output` may be uninitialized", + "severity": "error" + }, + { + "line": 408, + "column": 34, + "stop_line": 408, + "stop_column": 48, + "path": "src\\streamdiffusion\\_patches\\diffusers_kvo_patch.py", + "code": -2, + "name": "bad-index", + "description": "Cannot index into `object`\n Object of class `object` has no attribute `__getitem__`", + "concise_description": "Cannot index into `object`", + "severity": "error" + }, + { + "line": 426, + "column": 39, + "stop_line": 426, + "stop_column": 47, + "path": "src\\streamdiffusion\\_patches\\diffusers_kvo_patch.py", + "code": -2, + "name": "bad-assignment", + "description": "`(self: Unknown, hidden_states: Unknown, temb: Unknown | None = None, encoder_hidden_states: Unknown | None = None, attention_mask: Unknown | None = None, cross_attention_kwargs: Unknown | None = None, encoder_attention_mask: Unknown | None = None, kvo_cache: object | Unknown = ...) -> tuple[Unknown, list[Unknown]] | Unknown` is not assignable to attribute `forward` with type `(self: UNetMidBlock2DCrossAttn, hidden_states: Tensor, temb: Tensor | None = None, encoder_hidden_states: Tensor | None = None, attention_mask: Tensor | None = None, cross_attention_kwargs: dict[str, Any] | None = None, encoder_attention_mask: Tensor | None = None, kvo_cache: list[Tensor] | None = None) -> Tensor`", + "concise_description": "`(self: Unknown, hidden_states: Unknown, temb: Unknown | None = None, encoder_hidden_states: Unknown | None = None, attention_mask: Unknown | None = None, cross_attention_kwargs: Unknown | None = None, encoder_attention_mask: Unknown | None = None, kvo_cache: object | Unknown = ...) -> tuple[Unknown, list[Unknown]] | Unknown` is not assignable to attribute `forward` with type `(self: UNetMidBlock2DCrossAttn, hidden_states: Tensor, temb: Tensor | None = None, encoder_hidden_states: Tensor | None = None, attention_mask: Tensor | None = None, cross_attention_kwargs: dict[str, Any] | None = None, encoder_attention_mask: Tensor | None = None, kvo_cache: list[Tensor] | None = None) -> Tensor`", + "severity": "error" + }, + { + "line": 474, + "column": 34, + "stop_line": 474, + "stop_column": 46, + "path": "src\\streamdiffusion\\_patches\\diffusers_kvo_patch.py", + "code": -2, + "name": "bad-index", + "description": "Cannot index into `object`\n Object of class `object` has no attribute `__getitem__`", + "concise_description": "Cannot index into `object`", + "severity": "error" + }, + { + "line": 501, + "column": 36, + "stop_line": 501, + "stop_column": 44, + "path": "src\\streamdiffusion\\_patches\\diffusers_kvo_patch.py", + "code": -2, + "name": "bad-assignment", + "description": "`(self: Unknown, hidden_states: Unknown, temb: Unknown | None = None, encoder_hidden_states: Unknown | None = None, attention_mask: Unknown | None = None, cross_attention_kwargs: Unknown | None = None, encoder_attention_mask: Unknown | None = None, additional_residuals: Unknown | None = None, kvo_cache: object | Unknown = ...) -> tuple[Unknown, Unknown] | tuple[Unknown, Unknown, list[Unknown]]` is not assignable to attribute `forward` with type `(self: CrossAttnDownBlock2D, hidden_states: Tensor, temb: Tensor | None = None, encoder_hidden_states: Tensor | None = None, attention_mask: Tensor | None = None, cross_attention_kwargs: dict[str, Any] | None = None, encoder_attention_mask: Tensor | None = None, additional_residuals: Tensor | None = None, kvo_cache: list[Tensor] | None = None) -> tuple[Tensor, tuple[Tensor, ...]]`", + "concise_description": "`(self: Unknown, hidden_states: Unknown, temb: Unknown | None = None, encoder_hidden_states: Unknown | None = None, attention_mask: Unknown | None = None, cross_attention_kwargs: Unknown | None = None, encoder_attention_mask: Unknown | None = None, additional_residuals: Unknown | None = None, kvo_cache: object | Unknown = ...) -> tuple[Unknown, Unknown] | tuple[Unknown, Unknown, list[Unknown]]` is not assignable to attribute `forward` with type `(self: CrossAttnDownBlock2D, hidden_states: Tensor, temb: Tensor | None = None, encoder_hidden_states: Tensor | None = None, attention_mask: Tensor | None = None, cross_attention_kwargs: dict[str, Any] | None = None, encoder_attention_mask: Tensor | None = None, additional_residuals: Tensor | None = None, kvo_cache: list[Tensor] | None = None) -> tuple[Tensor, tuple[Tensor, ...]]`", + "severity": "error" + }, + { + "line": 544, + "column": 52, + "stop_line": 544, + "stop_column": 63, + "path": "src\\streamdiffusion\\_patches\\diffusers_kvo_patch.py", + "code": -2, + "name": "not-callable", + "description": "Expected a callable, got `None`", + "concise_description": "Expected a callable, got `None`", + "severity": "error" + }, + { + "line": 587, + "column": 34, + "stop_line": 587, + "stop_column": 42, + "path": "src\\streamdiffusion\\_patches\\diffusers_kvo_patch.py", + "code": -2, + "name": "bad-assignment", + "description": "`(self: Unknown, hidden_states: Unknown, res_hidden_states_tuple: Unknown, temb: Unknown | None = None, encoder_hidden_states: Unknown | None = None, cross_attention_kwargs: Unknown | None = None, upsample_size: Unknown | None = None, attention_mask: Unknown | None = None, encoder_attention_mask: Unknown | None = None, kvo_cache: Unknown | None = None) -> tuple[Unknown, list[Unknown]]` is not assignable to attribute `forward` with type `(self: CrossAttnUpBlock2D, hidden_states: Tensor, res_hidden_states_tuple: tuple[Tensor, ...], temb: Tensor | None = None, encoder_hidden_states: Tensor | None = None, cross_attention_kwargs: dict[str, Any] | None = None, upsample_size: int | None = None, attention_mask: Tensor | None = None, encoder_attention_mask: Tensor | None = None, kvo_cache: list[Tensor] | None = None) -> Tensor`", + "concise_description": "`(self: Unknown, hidden_states: Unknown, res_hidden_states_tuple: Unknown, temb: Unknown | None = None, encoder_hidden_states: Unknown | None = None, cross_attention_kwargs: Unknown | None = None, upsample_size: Unknown | None = None, attention_mask: Unknown | None = None, encoder_attention_mask: Unknown | None = None, kvo_cache: Unknown | None = None) -> tuple[Unknown, list[Unknown]]` is not assignable to attribute `forward` with type `(self: CrossAttnUpBlock2D, hidden_states: Tensor, res_hidden_states_tuple: tuple[Tensor, ...], temb: Tensor | None = None, encoder_hidden_states: Tensor | None = None, cross_attention_kwargs: dict[str, Any] | None = None, upsample_size: int | None = None, attention_mask: Tensor | None = None, encoder_attention_mask: Tensor | None = None, kvo_cache: list[Tensor] | None = None) -> Tensor`", + "severity": "error" + }, + { + "line": 687, + "column": 39, + "stop_line": 687, + "stop_column": 75, + "path": "src\\streamdiffusion\\_patches\\diffusers_kvo_patch.py", + "code": -2, + "name": "bad-argument-type", + "description": "Argument `Unknown | None` is not assignable to parameter `obj` with type `Sized` in function `len`\n Protocol `Sized` requires attribute `__len__`", + "concise_description": "Argument `Unknown | None` is not assignable to parameter `obj` with type `Sized` in function `len`", + "severity": "error" + }, + { + "line": 688, + "column": 68, + "stop_line": 688, + "stop_column": 108, + "path": "src\\streamdiffusion\\_patches\\diffusers_kvo_patch.py", + "code": -2, + "name": "missing-attribute", + "description": "Object of class `NoneType` has no attribute `pop`", + "concise_description": "Object of class `NoneType` has no attribute `pop`", + "severity": "error" + }, + { + "line": 706, + "column": 39, + "stop_line": 706, + "stop_column": 75, + "path": "src\\streamdiffusion\\_patches\\diffusers_kvo_patch.py", + "code": -2, + "name": "bad-argument-type", + "description": "Argument `Unknown | None` is not assignable to parameter `obj` with type `Sized` in function `len`\n Protocol `Sized` requires attribute `__len__`", + "concise_description": "Argument `Unknown | None` is not assignable to parameter `obj` with type `Sized` in function `len`", + "severity": "error" + }, + { + "line": 707, + "column": 31, + "stop_line": 707, + "stop_column": 71, + "path": "src\\streamdiffusion\\_patches\\diffusers_kvo_patch.py", + "code": -2, + "name": "missing-attribute", + "description": "Object of class `NoneType` has no attribute `pop`", + "concise_description": "Object of class `NoneType` has no attribute `pop`", + "severity": "error" + }, + { + "line": 740, + "column": 25, + "stop_line": 740, + "stop_column": 61, + "path": "src\\streamdiffusion\\_patches\\diffusers_kvo_patch.py", + "code": -2, + "name": "bad-argument-type", + "description": "Argument `Unknown | None` is not assignable to parameter `obj` with type `Sized` in function `len`\n Protocol `Sized` requires attribute `__len__`", + "concise_description": "Argument `Unknown | None` is not assignable to parameter `obj` with type `Sized` in function `len`", + "severity": "error" + }, + { + "line": 741, + "column": 37, + "stop_line": 741, + "stop_column": 76, + "path": "src\\streamdiffusion\\_patches\\diffusers_kvo_patch.py", + "code": -2, + "name": "unsupported-operation", + "description": "`None` is not subscriptable", + "concise_description": "`None` is not subscriptable", + "severity": "error" + }, + { + "line": 743, + "column": 27, + "stop_line": 743, + "stop_column": 67, + "path": "src\\streamdiffusion\\_patches\\diffusers_kvo_patch.py", + "code": -2, + "name": "missing-attribute", + "description": "Object of class `NoneType` has no attribute `pop`", + "concise_description": "Object of class `NoneType` has no attribute `pop`", + "severity": "error" + }, + { + "line": 3, + "column": 1, + "stop_line": 3, + "stop_column": 90, + "path": "src\\streamdiffusion\\acceleration\\sfast\\__init__.py", + "code": -2, + "name": "missing-import", + "description": "Cannot find module `sfast.compilers.stable_diffusion_pipeline_compiler`\n Looked in these locations (from config in `D:\\dev\\SDTD_032_dev\\StreamDiffusion\\pyproject.toml`):\n Search path (from config file): [\"D:\\\\dev\\\\SDTD_032_dev\\\\StreamDiffusion\\\\src\"]\n Import root (inferred from project layout): \"D:\\\\dev\\\\SDTD_032_dev\\\\StreamDiffusion\\\\src\"\n Site package path queried from interpreter: [\"C:\\\\Users\\\\Inter\\\\AppData\\\\Local\\\\Programs\\\\Python\\\\Python311\\\\DLLs\", \"C:\\\\Users\\\\Inter\\\\AppData\\\\Local\\\\Programs\\\\Python\\\\Python311\", \"D:\\\\dev\\\\SDTD_032_dev\\\\StreamDiffusion\\\\venv\", \"D:\\\\dev\\\\SDTD_032_dev\\\\StreamDiffusion\\\\venv\\\\Lib\\\\site-packages\", \"D:\\\\dev\\\\SDTD_032_dev\\\\StreamDiffusion\\\\src\", \"D:\\\\dev\\\\SDTD_032_dev\\\\StreamDiffusion\\\\venv\\\\Lib\\\\site-packages\\\\win32\", \"D:\\\\dev\\\\SDTD_032_dev\\\\StreamDiffusion\\\\venv\\\\Lib\\\\site-packages\\\\win32\\\\lib\", \"D:\\\\dev\\\\SDTD_032_dev\\\\StreamDiffusion\\\\venv\\\\Lib\\\\site-packages\\\\Pythonwin\"]", + "concise_description": "Cannot find module `sfast.compilers.stable_diffusion_pipeline_compiler`", + "severity": "error" + }, + { + "line": 16, + "column": 20, + "stop_line": 16, + "stop_column": 28, + "path": "src\\streamdiffusion\\acceleration\\sfast\\__init__.py", + "code": -2, + "name": "missing-import", + "description": "Cannot find module `xformers`\n Looked in these locations (from config in `D:\\dev\\SDTD_032_dev\\StreamDiffusion\\pyproject.toml`):\n Search path (from config file): [\"D:\\\\dev\\\\SDTD_032_dev\\\\StreamDiffusion\\\\src\"]\n Import root (inferred from project layout): \"D:\\\\dev\\\\SDTD_032_dev\\\\StreamDiffusion\\\\src\"\n Site package path queried from interpreter: [\"C:\\\\Users\\\\Inter\\\\AppData\\\\Local\\\\Programs\\\\Python\\\\Python311\\\\DLLs\", \"C:\\\\Users\\\\Inter\\\\AppData\\\\Local\\\\Programs\\\\Python\\\\Python311\", \"D:\\\\dev\\\\SDTD_032_dev\\\\StreamDiffusion\\\\venv\", \"D:\\\\dev\\\\SDTD_032_dev\\\\StreamDiffusion\\\\venv\\\\Lib\\\\site-packages\", \"D:\\\\dev\\\\SDTD_032_dev\\\\StreamDiffusion\\\\src\", \"D:\\\\dev\\\\SDTD_032_dev\\\\StreamDiffusion\\\\venv\\\\Lib\\\\site-packages\\\\win32\", \"D:\\\\dev\\\\SDTD_032_dev\\\\StreamDiffusion\\\\venv\\\\Lib\\\\site-packages\\\\win32\\\\lib\", \"D:\\\\dev\\\\SDTD_032_dev\\\\StreamDiffusion\\\\venv\\\\Lib\\\\site-packages\\\\Pythonwin\"]", + "concise_description": "Cannot find module `xformers`", + "severity": "error" + }, + { + "line": 33, + "column": 9, + "stop_line": 33, + "stop_column": 16, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\__init__.py", + "code": -2, + "name": "bad-override", + "description": "Class member `StableDiffusionSafetyCheckerWrapper.forward` overrides parent class `StableDiffusionSafetyChecker` in an inconsistent manner\n `StableDiffusionSafetyCheckerWrapper.forward` has type `(self: StableDiffusionSafetyCheckerWrapper, clip_input: Unknown) -> Tensor`, which is not assignable to `(self: StableDiffusionSafetyCheckerWrapper, clip_input: Unknown, images: Unknown) -> tuple[Unknown, list[bool]]`, the type of `StableDiffusionSafetyChecker.forward`\n Signature mismatch:\n ...CheckerWrapper, clip_input: Unknown, images: Unknown) -> tuple[Unknown, list[bool]]: ...\n ^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ return type\n |\n parameters\n ...CheckerWrapper, clip_input: Unknown) -> Tensor: ...\n ^ ^^^^^^ return type\n |\n parameters", + "concise_description": "Class member `StableDiffusionSafetyCheckerWrapper.forward` overrides parent class `StableDiffusionSafetyChecker` in an inconsistent manner", + "severity": "error" + }, + { + "line": 59, + "column": 33, + "stop_line": 59, + "stop_column": 48, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\__init__.py", + "code": -2, + "name": "missing-attribute", + "description": "Object of class `AutoencoderKL` has no attribute `encode`", + "concise_description": "Object of class `AutoencoderKL` has no attribute `encode`", + "severity": "error" + }, + { + "line": 91, + "column": 11, + "stop_line": 91, + "stop_column": 17, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\__init__.py", + "code": -2, + "name": "missing-attribute", + "description": "Object of class `AutoencoderKL` has no attribute `to`", + "concise_description": "Object of class `AutoencoderKL` has no attribute `to`", + "severity": "error" + }, + { + "line": 153, + "column": 12, + "stop_line": 153, + "stop_column": 19, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\__init__.py", + "code": -2, + "name": "missing-attribute", + "description": "Object of class `UNet2DConditionModel` has no attribute `to`", + "concise_description": "Object of class `UNet2DConditionModel` has no attribute `to`", + "severity": "error" + }, + { + "line": 187, + "column": 18, + "stop_line": 187, + "stop_column": 31, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\__init__.py", + "code": -2, + "name": "missing-attribute", + "description": "Object of class `ControlNetModel` has no attribute `to`", + "concise_description": "Object of class `ControlNetModel` has no attribute `to`", + "severity": "error" + }, + { + "line": 256, + "column": 46, + "stop_line": 256, + "stop_column": 97, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\builder.py", + "code": -2, + "name": "unsupported-operation", + "description": "Cannot set item in `dict[str, dict[str, str]]`\n Argument `dict[str, float | str]` is not assignable to parameter `value` with type `dict[str, str]` in function `dict.__setitem__`", + "concise_description": "Cannot set item in `dict[str, dict[str, str]]`", + "severity": "error" + }, + { + "line": 276, + "column": 48, + "stop_line": 276, + "stop_column": 99, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\builder.py", + "code": -2, + "name": "unsupported-operation", + "description": "Cannot set item in `dict[str, dict[str, str]]`\n Argument `dict[str, float | str]` is not assignable to parameter `value` with type `dict[str, str]` in function `dict.__setitem__`", + "concise_description": "Cannot set item in `dict[str, dict[str, str]]`", + "severity": "error" + }, + { + "line": 408, + "column": 48, + "stop_line": 408, + "stop_column": 99, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\builder.py", + "code": -2, + "name": "unsupported-operation", + "description": "Cannot set item in `dict[str, dict[str, str]]`\n Argument `dict[str, float | str]` is not assignable to parameter `value` with type `dict[str, str]` in function `dict.__setitem__`", + "concise_description": "Cannot set item in `dict[str, dict[str, str]]`", + "severity": "error" + }, + { + "line": 419, + "column": 27, + "stop_line": 419, + "stop_column": 38, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\builder.py", + "code": -2, + "name": "missing-attribute", + "description": "No attribute `Runtime` in module `tensorrt`", + "concise_description": "No attribute `Runtime` in module `tensorrt`", + "severity": "error" + }, + { + "line": 423, + "column": 58, + "stop_line": 423, + "stop_column": 84, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\builder.py", + "code": -2, + "name": "missing-attribute", + "description": "No attribute `LayerInformationFormat` in module `tensorrt`", + "concise_description": "No attribute `LayerInformationFormat` in module `tensorrt`", + "severity": "error" + }, + { + "line": 462, + "column": 36, + "stop_line": 462, + "stop_column": 59, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\builder.py", + "code": -2, + "name": "bad-typed-dict-key", + "description": "`float` is not assignable to TypedDict key `total_elapsed_s` with type `bool | dict[str, dict[str, str]] | int | str`", + "concise_description": "`float` is not assignable to TypedDict key `total_elapsed_s` with type `bool | dict[str, dict[str, str]] | int | str`", + "severity": "error" + }, + { + "line": 467, + "column": 39, + "stop_line": 467, + "stop_column": 93, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\builder.py", + "code": -2, + "name": "bad-typed-dict-key", + "description": "`float` is not assignable to TypedDict key `engine_size_mb` with type `bool | dict[str, dict[str, str]] | int | str`", + "concise_description": "`float` is not assignable to TypedDict key `engine_size_mb` with type `bool | dict[str, dict[str, str]] | int | str`", + "severity": "error" + }, + { + "line": 142, + "column": 20, + "stop_line": 142, + "stop_column": 86, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\engine_manager.py", + "code": -2, + "name": "unsupported-operation", + "description": "`/` is not supported between `Path` and `(path: Unknown, cuda_stream: Unknown, **kwargs: Unknown) -> ControlNetModelEngine`\n Argument `(path: Unknown, cuda_stream: Unknown, **kwargs: Unknown) -> ControlNetModelEngine` is not assignable to parameter `key` with type `PathLike[str] | str` in function `pathlib.PurePath.__truediv__`\n Protocol `PathLike` requires attribute `__fspath__`", + "concise_description": "`/` is not supported between `Path` and `(path: Unknown, cuda_stream: Unknown, **kwargs: Unknown) -> ControlNetModelEngine`", + "severity": "error" + }, + { + "line": 142, + "column": 20, + "stop_line": 142, + "stop_column": 86, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\engine_manager.py", + "code": -2, + "name": "unsupported-operation", + "description": "`/` is not supported between `Path` and `(path: Unknown, cuda_stream: Unknown, **kwargs: Unknown) -> UNet2DConditionModelEngine`\n Argument `(path: Unknown, cuda_stream: Unknown, **kwargs: Unknown) -> UNet2DConditionModelEngine` is not assignable to parameter `key` with type `PathLike[str] | str` in function `pathlib.PurePath.__truediv__`\n Protocol `PathLike` requires attribute `__fspath__`", + "concise_description": "`/` is not supported between `Path` and `(path: Unknown, cuda_stream: Unknown, **kwargs: Unknown) -> UNet2DConditionModelEngine`", + "severity": "error" + }, + { + "line": 142, + "column": 20, + "stop_line": 142, + "stop_column": 86, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\engine_manager.py", + "code": -2, + "name": "unsupported-operation", + "description": "`/` is not supported between `Path` and `(path: Unknown, cuda_stream: Unknown, **kwargs: Unknown) -> str`\n Argument `(path: Unknown, cuda_stream: Unknown, **kwargs: Unknown) -> str` is not assignable to parameter `key` with type `PathLike[str] | str` in function `pathlib.PurePath.__truediv__`\n Protocol `PathLike` requires attribute `__fspath__`", + "concise_description": "`/` is not supported between `Path` and `(path: Unknown, cuda_stream: Unknown, **kwargs: Unknown) -> str`", + "severity": "error" + }, + { + "line": 142, + "column": 20, + "stop_line": 142, + "stop_column": 86, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\engine_manager.py", + "code": -2, + "name": "unsupported-operation", + "description": "`/` is not supported between `Path` and `(controlnet: diffusers.models.controlnets.controlnet.ControlNetModel | diffusers.utils.dummy_pt_objects.ControlNetModel, model_data: BaseModel, onnx_path: str, onnx_opt_path: str, engine_path: str, opt_batch_size: int | None = None, engine_build_options: dict[Unknown, Unknown] | None = None) -> None`\n Argument `(controlnet: diffusers.models.controlnets.controlnet.ControlNetModel | diffusers.utils.dummy_pt_objects.ControlNetModel, model_data: BaseModel, onnx_path: str, onnx_opt_path: str, engine_path: str, opt_batch_size: int | None = None, engine_build_options: dict[Unknown, Unknown] | None = None) -> None` is not assignable to parameter `key` with type `PathLike[str] | str` in function `pathlib.PurePath.__truediv__`\n Protocol `PathLike` requires attribute `__fspath__`", + "concise_description": "`/` is not supported between `Path` and `(controlnet: diffusers.models.controlnets.controlnet.ControlNetModel | diffusers.utils.dummy_pt_objects.ControlNetModel, model_data: BaseModel, onnx_path: str, onnx_opt_path: str, engine_path: str, opt_batch_size: int | None = None, engine_build_options: dict[Unknown, Unknown] | None = None) -> None`", + "severity": "error" + }, + { + "line": 142, + "column": 20, + "stop_line": 142, + "stop_column": 86, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\engine_manager.py", + "code": -2, + "name": "unsupported-operation", + "description": "`/` is not supported between `Path` and `(safety_checker: StableDiffusionSafetyCheckerWrapper, model_data: BaseModel, onnx_path: str, onnx_opt_path: str, engine_path: str, opt_batch_size: int | None = None, engine_build_options: dict[Unknown, Unknown] | None = None) -> None`\n Argument `(safety_checker: StableDiffusionSafetyCheckerWrapper, model_data: BaseModel, onnx_path: str, onnx_opt_path: str, engine_path: str, opt_batch_size: int | None = None, engine_build_options: dict[Unknown, Unknown] | None = None) -> None` is not assignable to parameter `key` with type `PathLike[str] | str` in function `pathlib.PurePath.__truediv__`\n Protocol `PathLike` requires attribute `__fspath__`", + "concise_description": "`/` is not supported between `Path` and `(safety_checker: StableDiffusionSafetyCheckerWrapper, model_data: BaseModel, onnx_path: str, onnx_opt_path: str, engine_path: str, opt_batch_size: int | None = None, engine_build_options: dict[Unknown, Unknown] | None = None) -> None`", + "severity": "error" + }, + { + "line": 142, + "column": 20, + "stop_line": 142, + "stop_column": 86, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\engine_manager.py", + "code": -2, + "name": "unsupported-operation", + "description": "`/` is not supported between `Path` and `(unet: diffusers.models.unets.unet_2d_condition.UNet2DConditionModel | diffusers.utils.dummy_pt_objects.UNet2DConditionModel, model_data: BaseModel, onnx_path: str, onnx_opt_path: str, engine_path: str, opt_batch_size: int | None = None, engine_build_options: dict[Unknown, Unknown] | None = None) -> None`\n Argument `(unet: diffusers.models.unets.unet_2d_condition.UNet2DConditionModel | diffusers.utils.dummy_pt_objects.UNet2DConditionModel, model_data: BaseModel, onnx_path: str, onnx_opt_path: str, engine_path: str, opt_batch_size: int | None = None, engine_build_options: dict[Unknown, Unknown] | None = None) -> None` is not assignable to parameter `key` with type `PathLike[str] | str` in function `pathlib.PurePath.__truediv__`\n Protocol `PathLike` requires attribute `__fspath__`", + "concise_description": "`/` is not supported between `Path` and `(unet: diffusers.models.unets.unet_2d_condition.UNet2DConditionModel | diffusers.utils.dummy_pt_objects.UNet2DConditionModel, model_data: BaseModel, onnx_path: str, onnx_opt_path: str, engine_path: str, opt_batch_size: int | None = None, engine_build_options: dict[Unknown, Unknown] | None = None) -> None`", + "severity": "error" + }, + { + "line": 142, + "column": 20, + "stop_line": 142, + "stop_column": 86, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\engine_manager.py", + "code": -2, + "name": "unsupported-operation", + "description": "`/` is not supported between `Path` and `(vae: diffusers.models.autoencoders.autoencoder_kl.AutoencoderKL | diffusers.utils.dummy_pt_objects.AutoencoderKL, model_data: BaseModel, onnx_path: str, onnx_opt_path: str, engine_path: str, opt_batch_size: int | None = None, engine_build_options: dict[Unknown, Unknown] | None = None) -> None`\n Argument `(vae: diffusers.models.autoencoders.autoencoder_kl.AutoencoderKL | diffusers.utils.dummy_pt_objects.AutoencoderKL, model_data: BaseModel, onnx_path: str, onnx_opt_path: str, engine_path: str, opt_batch_size: int | None = None, engine_build_options: dict[Unknown, Unknown] | None = None) -> None` is not assignable to parameter `key` with type `PathLike[str] | str` in function `pathlib.PurePath.__truediv__`\n Protocol `PathLike` requires attribute `__fspath__`", + "concise_description": "`/` is not supported between `Path` and `(vae: diffusers.models.autoencoders.autoencoder_kl.AutoencoderKL | diffusers.utils.dummy_pt_objects.AutoencoderKL, model_data: BaseModel, onnx_path: str, onnx_opt_path: str, engine_path: str, opt_batch_size: int | None = None, engine_build_options: dict[Unknown, Unknown] | None = None) -> None`", + "severity": "error" + }, + { + "line": 142, + "column": 20, + "stop_line": 142, + "stop_column": 86, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\engine_manager.py", + "code": -2, + "name": "unsupported-operation", + "description": "`/` is not supported between `Path` and `(vae: TorchVAEEncoder, model_data: BaseModel, onnx_path: str, onnx_opt_path: str, engine_path: str, opt_batch_size: int | None = None, engine_build_options: dict[Unknown, Unknown] | None = None) -> None`\n Argument `(vae: TorchVAEEncoder, model_data: BaseModel, onnx_path: str, onnx_opt_path: str, engine_path: str, opt_batch_size: int | None = None, engine_build_options: dict[Unknown, Unknown] | None = None) -> None` is not assignable to parameter `key` with type `PathLike[str] | str` in function `pathlib.PurePath.__truediv__`\n Protocol `PathLike` requires attribute `__fspath__`", + "concise_description": "`/` is not supported between `Path` and `(vae: TorchVAEEncoder, model_data: BaseModel, onnx_path: str, onnx_opt_path: str, engine_path: str, opt_batch_size: int | None = None, engine_build_options: dict[Unknown, Unknown] | None = None) -> None`", + "severity": "error" + }, + { + "line": 211, + "column": 20, + "stop_line": 211, + "stop_column": 55, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\engine_manager.py", + "code": -2, + "name": "unsupported-operation", + "description": "`/` is not supported between `Path` and `(path: Unknown, cuda_stream: Unknown, **kwargs: Unknown) -> ControlNetModelEngine`\n Argument `(path: Unknown, cuda_stream: Unknown, **kwargs: Unknown) -> ControlNetModelEngine` is not assignable to parameter `key` with type `PathLike[str] | str` in function `pathlib.PurePath.__truediv__`\n Protocol `PathLike` requires attribute `__fspath__`", + "concise_description": "`/` is not supported between `Path` and `(path: Unknown, cuda_stream: Unknown, **kwargs: Unknown) -> ControlNetModelEngine`", + "severity": "error" + }, + { + "line": 211, + "column": 20, + "stop_line": 211, + "stop_column": 55, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\engine_manager.py", + "code": -2, + "name": "unsupported-operation", + "description": "`/` is not supported between `Path` and `(path: Unknown, cuda_stream: Unknown, **kwargs: Unknown) -> UNet2DConditionModelEngine`\n Argument `(path: Unknown, cuda_stream: Unknown, **kwargs: Unknown) -> UNet2DConditionModelEngine` is not assignable to parameter `key` with type `PathLike[str] | str` in function `pathlib.PurePath.__truediv__`\n Protocol `PathLike` requires attribute `__fspath__`", + "concise_description": "`/` is not supported between `Path` and `(path: Unknown, cuda_stream: Unknown, **kwargs: Unknown) -> UNet2DConditionModelEngine`", + "severity": "error" + }, + { + "line": 211, + "column": 20, + "stop_line": 211, + "stop_column": 55, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\engine_manager.py", + "code": -2, + "name": "unsupported-operation", + "description": "`/` is not supported between `Path` and `(path: Unknown, cuda_stream: Unknown, **kwargs: Unknown) -> str`\n Argument `(path: Unknown, cuda_stream: Unknown, **kwargs: Unknown) -> str` is not assignable to parameter `key` with type `PathLike[str] | str` in function `pathlib.PurePath.__truediv__`\n Protocol `PathLike` requires attribute `__fspath__`", + "concise_description": "`/` is not supported between `Path` and `(path: Unknown, cuda_stream: Unknown, **kwargs: Unknown) -> str`", + "severity": "error" + }, + { + "line": 211, + "column": 20, + "stop_line": 211, + "stop_column": 55, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\engine_manager.py", + "code": -2, + "name": "unsupported-operation", + "description": "`/` is not supported between `Path` and `(controlnet: diffusers.models.controlnets.controlnet.ControlNetModel | diffusers.utils.dummy_pt_objects.ControlNetModel, model_data: BaseModel, onnx_path: str, onnx_opt_path: str, engine_path: str, opt_batch_size: int | None = None, engine_build_options: dict[Unknown, Unknown] | None = None) -> None`\n Argument `(controlnet: diffusers.models.controlnets.controlnet.ControlNetModel | diffusers.utils.dummy_pt_objects.ControlNetModel, model_data: BaseModel, onnx_path: str, onnx_opt_path: str, engine_path: str, opt_batch_size: int | None = None, engine_build_options: dict[Unknown, Unknown] | None = None) -> None` is not assignable to parameter `key` with type `PathLike[str] | str` in function `pathlib.PurePath.__truediv__`\n Protocol `PathLike` requires attribute `__fspath__`", + "concise_description": "`/` is not supported between `Path` and `(controlnet: diffusers.models.controlnets.controlnet.ControlNetModel | diffusers.utils.dummy_pt_objects.ControlNetModel, model_data: BaseModel, onnx_path: str, onnx_opt_path: str, engine_path: str, opt_batch_size: int | None = None, engine_build_options: dict[Unknown, Unknown] | None = None) -> None`", + "severity": "error" + }, + { + "line": 211, + "column": 20, + "stop_line": 211, + "stop_column": 55, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\engine_manager.py", + "code": -2, + "name": "unsupported-operation", + "description": "`/` is not supported between `Path` and `(safety_checker: StableDiffusionSafetyCheckerWrapper, model_data: BaseModel, onnx_path: str, onnx_opt_path: str, engine_path: str, opt_batch_size: int | None = None, engine_build_options: dict[Unknown, Unknown] | None = None) -> None`\n Argument `(safety_checker: StableDiffusionSafetyCheckerWrapper, model_data: BaseModel, onnx_path: str, onnx_opt_path: str, engine_path: str, opt_batch_size: int | None = None, engine_build_options: dict[Unknown, Unknown] | None = None) -> None` is not assignable to parameter `key` with type `PathLike[str] | str` in function `pathlib.PurePath.__truediv__`\n Protocol `PathLike` requires attribute `__fspath__`", + "concise_description": "`/` is not supported between `Path` and `(safety_checker: StableDiffusionSafetyCheckerWrapper, model_data: BaseModel, onnx_path: str, onnx_opt_path: str, engine_path: str, opt_batch_size: int | None = None, engine_build_options: dict[Unknown, Unknown] | None = None) -> None`", + "severity": "error" + }, + { + "line": 211, + "column": 20, + "stop_line": 211, + "stop_column": 55, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\engine_manager.py", + "code": -2, + "name": "unsupported-operation", + "description": "`/` is not supported between `Path` and `(unet: diffusers.models.unets.unet_2d_condition.UNet2DConditionModel | diffusers.utils.dummy_pt_objects.UNet2DConditionModel, model_data: BaseModel, onnx_path: str, onnx_opt_path: str, engine_path: str, opt_batch_size: int | None = None, engine_build_options: dict[Unknown, Unknown] | None = None) -> None`\n Argument `(unet: diffusers.models.unets.unet_2d_condition.UNet2DConditionModel | diffusers.utils.dummy_pt_objects.UNet2DConditionModel, model_data: BaseModel, onnx_path: str, onnx_opt_path: str, engine_path: str, opt_batch_size: int | None = None, engine_build_options: dict[Unknown, Unknown] | None = None) -> None` is not assignable to parameter `key` with type `PathLike[str] | str` in function `pathlib.PurePath.__truediv__`\n Protocol `PathLike` requires attribute `__fspath__`", + "concise_description": "`/` is not supported between `Path` and `(unet: diffusers.models.unets.unet_2d_condition.UNet2DConditionModel | diffusers.utils.dummy_pt_objects.UNet2DConditionModel, model_data: BaseModel, onnx_path: str, onnx_opt_path: str, engine_path: str, opt_batch_size: int | None = None, engine_build_options: dict[Unknown, Unknown] | None = None) -> None`", + "severity": "error" + }, + { + "line": 211, + "column": 20, + "stop_line": 211, + "stop_column": 55, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\engine_manager.py", + "code": -2, + "name": "unsupported-operation", + "description": "`/` is not supported between `Path` and `(vae: diffusers.models.autoencoders.autoencoder_kl.AutoencoderKL | diffusers.utils.dummy_pt_objects.AutoencoderKL, model_data: BaseModel, onnx_path: str, onnx_opt_path: str, engine_path: str, opt_batch_size: int | None = None, engine_build_options: dict[Unknown, Unknown] | None = None) -> None`\n Argument `(vae: diffusers.models.autoencoders.autoencoder_kl.AutoencoderKL | diffusers.utils.dummy_pt_objects.AutoencoderKL, model_data: BaseModel, onnx_path: str, onnx_opt_path: str, engine_path: str, opt_batch_size: int | None = None, engine_build_options: dict[Unknown, Unknown] | None = None) -> None` is not assignable to parameter `key` with type `PathLike[str] | str` in function `pathlib.PurePath.__truediv__`\n Protocol `PathLike` requires attribute `__fspath__`", + "concise_description": "`/` is not supported between `Path` and `(vae: diffusers.models.autoencoders.autoencoder_kl.AutoencoderKL | diffusers.utils.dummy_pt_objects.AutoencoderKL, model_data: BaseModel, onnx_path: str, onnx_opt_path: str, engine_path: str, opt_batch_size: int | None = None, engine_build_options: dict[Unknown, Unknown] | None = None) -> None`", + "severity": "error" + }, + { + "line": 211, + "column": 20, + "stop_line": 211, + "stop_column": 55, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\engine_manager.py", + "code": -2, + "name": "unsupported-operation", + "description": "`/` is not supported between `Path` and `(vae: TorchVAEEncoder, model_data: BaseModel, onnx_path: str, onnx_opt_path: str, engine_path: str, opt_batch_size: int | None = None, engine_build_options: dict[Unknown, Unknown] | None = None) -> None`\n Argument `(vae: TorchVAEEncoder, model_data: BaseModel, onnx_path: str, onnx_opt_path: str, engine_path: str, opt_batch_size: int | None = None, engine_build_options: dict[Unknown, Unknown] | None = None) -> None` is not assignable to parameter `key` with type `PathLike[str] | str` in function `pathlib.PurePath.__truediv__`\n Protocol `PathLike` requires attribute `__fspath__`", + "concise_description": "`/` is not supported between `Path` and `(vae: TorchVAEEncoder, model_data: BaseModel, onnx_path: str, onnx_opt_path: str, engine_path: str, opt_batch_size: int | None = None, engine_build_options: dict[Unknown, Unknown] | None = None) -> None`", + "severity": "error" + }, + { + "line": 346, + "column": 29, + "stop_line": 346, + "stop_column": 35, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\engine_manager.py", + "code": -2, + "name": "not-callable", + "description": "Expected a callable, got `str`", + "concise_description": "Expected a callable, got `str`", + "severity": "error" + }, + { + "line": 346, + "column": 35, + "stop_line": 346, + "stop_column": 75, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\engine_manager.py", + "code": -2, + "name": "missing-argument", + "description": "Missing argument `onnx_path` in function `streamdiffusion.acceleration.tensorrt.compile_controlnet`", + "concise_description": "Missing argument `onnx_path` in function `streamdiffusion.acceleration.tensorrt.compile_controlnet`", + "severity": "error" + }, + { + "line": 346, + "column": 35, + "stop_line": 346, + "stop_column": 75, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\engine_manager.py", + "code": -2, + "name": "missing-argument", + "description": "Missing argument `onnx_opt_path` in function `streamdiffusion.acceleration.tensorrt.compile_controlnet`", + "concise_description": "Missing argument `onnx_opt_path` in function `streamdiffusion.acceleration.tensorrt.compile_controlnet`", + "severity": "error" + }, + { + "line": 346, + "column": 35, + "stop_line": 346, + "stop_column": 75, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\engine_manager.py", + "code": -2, + "name": "missing-argument", + "description": "Missing argument `engine_path` in function `streamdiffusion.acceleration.tensorrt.compile_controlnet`", + "concise_description": "Missing argument `engine_path` in function `streamdiffusion.acceleration.tensorrt.compile_controlnet`", + "severity": "error" + }, + { + "line": 346, + "column": 35, + "stop_line": 346, + "stop_column": 75, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\engine_manager.py", + "code": -2, + "name": "missing-argument", + "description": "Missing argument `onnx_path` in function `streamdiffusion.acceleration.tensorrt.compile_safety_checker`", + "concise_description": "Missing argument `onnx_path` in function `streamdiffusion.acceleration.tensorrt.compile_safety_checker`", + "severity": "error" + }, + { + "line": 346, + "column": 35, + "stop_line": 346, + "stop_column": 75, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\engine_manager.py", + "code": -2, + "name": "missing-argument", + "description": "Missing argument `onnx_opt_path` in function `streamdiffusion.acceleration.tensorrt.compile_safety_checker`", + "concise_description": "Missing argument `onnx_opt_path` in function `streamdiffusion.acceleration.tensorrt.compile_safety_checker`", + "severity": "error" + }, + { + "line": 346, + "column": 35, + "stop_line": 346, + "stop_column": 75, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\engine_manager.py", + "code": -2, + "name": "missing-argument", + "description": "Missing argument `engine_path` in function `streamdiffusion.acceleration.tensorrt.compile_safety_checker`", + "concise_description": "Missing argument `engine_path` in function `streamdiffusion.acceleration.tensorrt.compile_safety_checker`", + "severity": "error" + }, + { + "line": 346, + "column": 35, + "stop_line": 346, + "stop_column": 75, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\engine_manager.py", + "code": -2, + "name": "missing-argument", + "description": "Missing argument `onnx_path` in function `streamdiffusion.acceleration.tensorrt.compile_unet`", + "concise_description": "Missing argument `onnx_path` in function `streamdiffusion.acceleration.tensorrt.compile_unet`", + "severity": "error" + }, + { + "line": 346, + "column": 35, + "stop_line": 346, + "stop_column": 75, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\engine_manager.py", + "code": -2, + "name": "missing-argument", + "description": "Missing argument `onnx_opt_path` in function `streamdiffusion.acceleration.tensorrt.compile_unet`", + "concise_description": "Missing argument `onnx_opt_path` in function `streamdiffusion.acceleration.tensorrt.compile_unet`", + "severity": "error" + }, + { + "line": 346, + "column": 35, + "stop_line": 346, + "stop_column": 75, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\engine_manager.py", + "code": -2, + "name": "missing-argument", + "description": "Missing argument `engine_path` in function `streamdiffusion.acceleration.tensorrt.compile_unet`", + "concise_description": "Missing argument `engine_path` in function `streamdiffusion.acceleration.tensorrt.compile_unet`", + "severity": "error" + }, + { + "line": 346, + "column": 35, + "stop_line": 346, + "stop_column": 75, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\engine_manager.py", + "code": -2, + "name": "missing-argument", + "description": "Missing argument `onnx_path` in function `streamdiffusion.acceleration.tensorrt.compile_vae_decoder`", + "concise_description": "Missing argument `onnx_path` in function `streamdiffusion.acceleration.tensorrt.compile_vae_decoder`", + "severity": "error" + }, + { + "line": 346, + "column": 35, + "stop_line": 346, + "stop_column": 75, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\engine_manager.py", + "code": -2, + "name": "missing-argument", + "description": "Missing argument `onnx_opt_path` in function `streamdiffusion.acceleration.tensorrt.compile_vae_decoder`", + "concise_description": "Missing argument `onnx_opt_path` in function `streamdiffusion.acceleration.tensorrt.compile_vae_decoder`", + "severity": "error" + }, + { + "line": 346, + "column": 35, + "stop_line": 346, + "stop_column": 75, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\engine_manager.py", + "code": -2, + "name": "missing-argument", + "description": "Missing argument `engine_path` in function `streamdiffusion.acceleration.tensorrt.compile_vae_decoder`", + "concise_description": "Missing argument `engine_path` in function `streamdiffusion.acceleration.tensorrt.compile_vae_decoder`", + "severity": "error" + }, + { + "line": 346, + "column": 35, + "stop_line": 346, + "stop_column": 75, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\engine_manager.py", + "code": -2, + "name": "missing-argument", + "description": "Missing argument `onnx_path` in function `streamdiffusion.acceleration.tensorrt.compile_vae_encoder`", + "concise_description": "Missing argument `onnx_path` in function `streamdiffusion.acceleration.tensorrt.compile_vae_encoder`", + "severity": "error" + }, + { + "line": 346, + "column": 35, + "stop_line": 346, + "stop_column": 75, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\engine_manager.py", + "code": -2, + "name": "missing-argument", + "description": "Missing argument `onnx_opt_path` in function `streamdiffusion.acceleration.tensorrt.compile_vae_encoder`", + "concise_description": "Missing argument `onnx_opt_path` in function `streamdiffusion.acceleration.tensorrt.compile_vae_encoder`", + "severity": "error" + }, + { + "line": 346, + "column": 35, + "stop_line": 346, + "stop_column": 75, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\engine_manager.py", + "code": -2, + "name": "missing-argument", + "description": "Missing argument `engine_path` in function `streamdiffusion.acceleration.tensorrt.compile_vae_encoder`", + "concise_description": "Missing argument `engine_path` in function `streamdiffusion.acceleration.tensorrt.compile_vae_encoder`", + "severity": "error" + }, + { + "line": 346, + "column": 36, + "stop_line": 346, + "stop_column": 47, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\engine_manager.py", + "code": -2, + "name": "bad-argument-type", + "description": "Argument `Path` is not assignable to parameter `controlnet` with type `diffusers.models.controlnets.controlnet.ControlNetModel | diffusers.utils.dummy_pt_objects.ControlNetModel` in function `streamdiffusion.acceleration.tensorrt.compile_controlnet`", + "concise_description": "Argument `Path` is not assignable to parameter `controlnet` with type `diffusers.models.controlnets.controlnet.ControlNetModel | diffusers.utils.dummy_pt_objects.ControlNetModel` in function `streamdiffusion.acceleration.tensorrt.compile_controlnet`", + "severity": "error" + }, + { + "line": 346, + "column": 36, + "stop_line": 346, + "stop_column": 47, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\engine_manager.py", + "code": -2, + "name": "bad-argument-type", + "description": "Argument `Path` is not assignable to parameter `safety_checker` with type `StableDiffusionSafetyCheckerWrapper` in function `streamdiffusion.acceleration.tensorrt.compile_safety_checker`", + "concise_description": "Argument `Path` is not assignable to parameter `safety_checker` with type `StableDiffusionSafetyCheckerWrapper` in function `streamdiffusion.acceleration.tensorrt.compile_safety_checker`", + "severity": "error" + }, + { + "line": 346, + "column": 36, + "stop_line": 346, + "stop_column": 47, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\engine_manager.py", + "code": -2, + "name": "bad-argument-type", + "description": "Argument `Path` is not assignable to parameter `unet` with type `diffusers.models.unets.unet_2d_condition.UNet2DConditionModel | diffusers.utils.dummy_pt_objects.UNet2DConditionModel` in function `streamdiffusion.acceleration.tensorrt.compile_unet`", + "concise_description": "Argument `Path` is not assignable to parameter `unet` with type `diffusers.models.unets.unet_2d_condition.UNet2DConditionModel | diffusers.utils.dummy_pt_objects.UNet2DConditionModel` in function `streamdiffusion.acceleration.tensorrt.compile_unet`", + "severity": "error" + }, + { + "line": 346, + "column": 36, + "stop_line": 346, + "stop_column": 47, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\engine_manager.py", + "code": -2, + "name": "bad-argument-type", + "description": "Argument `Path` is not assignable to parameter `vae` with type `diffusers.models.autoencoders.autoencoder_kl.AutoencoderKL | diffusers.utils.dummy_pt_objects.AutoencoderKL` in function `streamdiffusion.acceleration.tensorrt.compile_vae_decoder`", + "concise_description": "Argument `Path` is not assignable to parameter `vae` with type `diffusers.models.autoencoders.autoencoder_kl.AutoencoderKL | diffusers.utils.dummy_pt_objects.AutoencoderKL` in function `streamdiffusion.acceleration.tensorrt.compile_vae_decoder`", + "severity": "error" + }, + { + "line": 346, + "column": 36, + "stop_line": 346, + "stop_column": 47, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\engine_manager.py", + "code": -2, + "name": "bad-argument-type", + "description": "Argument `Path` is not assignable to parameter `vae` with type `TorchVAEEncoder` in function `streamdiffusion.acceleration.tensorrt.compile_vae_encoder`", + "concise_description": "Argument `Path` is not assignable to parameter `vae` with type `TorchVAEEncoder` in function `streamdiffusion.acceleration.tensorrt.compile_vae_encoder`", + "severity": "error" + }, + { + "line": 346, + "column": 49, + "stop_line": 346, + "stop_column": 74, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\engine_manager.py", + "code": -2, + "name": "bad-argument-type", + "description": "Argument `dict[Unknown, Unknown] | None` is not assignable to parameter `model_data` with type `BaseModel` in function `streamdiffusion.acceleration.tensorrt.compile_controlnet`", + "concise_description": "Argument `dict[Unknown, Unknown] | None` is not assignable to parameter `model_data` with type `BaseModel` in function `streamdiffusion.acceleration.tensorrt.compile_controlnet`", + "severity": "error" + }, + { + "line": 346, + "column": 49, + "stop_line": 346, + "stop_column": 74, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\engine_manager.py", + "code": -2, + "name": "bad-argument-type", + "description": "Argument `dict[Unknown, Unknown] | None` is not assignable to parameter `model_data` with type `BaseModel` in function `streamdiffusion.acceleration.tensorrt.compile_safety_checker`", + "concise_description": "Argument `dict[Unknown, Unknown] | None` is not assignable to parameter `model_data` with type `BaseModel` in function `streamdiffusion.acceleration.tensorrt.compile_safety_checker`", + "severity": "error" + }, + { + "line": 346, + "column": 49, + "stop_line": 346, + "stop_column": 74, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\engine_manager.py", + "code": -2, + "name": "bad-argument-type", + "description": "Argument `dict[Unknown, Unknown] | None` is not assignable to parameter `model_data` with type `BaseModel` in function `streamdiffusion.acceleration.tensorrt.compile_unet`", + "concise_description": "Argument `dict[Unknown, Unknown] | None` is not assignable to parameter `model_data` with type `BaseModel` in function `streamdiffusion.acceleration.tensorrt.compile_unet`", + "severity": "error" + }, + { + "line": 346, + "column": 49, + "stop_line": 346, + "stop_column": 74, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\engine_manager.py", + "code": -2, + "name": "bad-argument-type", + "description": "Argument `dict[Unknown, Unknown] | None` is not assignable to parameter `model_data` with type `BaseModel` in function `streamdiffusion.acceleration.tensorrt.compile_vae_decoder`", + "concise_description": "Argument `dict[Unknown, Unknown] | None` is not assignable to parameter `model_data` with type `BaseModel` in function `streamdiffusion.acceleration.tensorrt.compile_vae_decoder`", + "severity": "error" + }, + { + "line": 346, + "column": 49, + "stop_line": 346, + "stop_column": 74, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\engine_manager.py", + "code": -2, + "name": "bad-argument-type", + "description": "Argument `dict[Unknown, Unknown] | None` is not assignable to parameter `model_data` with type `BaseModel` in function `streamdiffusion.acceleration.tensorrt.compile_vae_encoder`", + "concise_description": "Argument `dict[Unknown, Unknown] | None` is not assignable to parameter `model_data` with type `BaseModel` in function `streamdiffusion.acceleration.tensorrt.compile_vae_encoder`", + "severity": "error" + }, + { + "line": 351, + "column": 20, + "stop_line": 351, + "stop_column": 26, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\engine_manager.py", + "code": -2, + "name": "not-callable", + "description": "Expected a callable, got `str`", + "concise_description": "Expected a callable, got `str`", + "severity": "error" + }, + { + "line": 351, + "column": 26, + "stop_line": 356, + "stop_column": 14, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\engine_manager.py", + "code": -2, + "name": "missing-argument", + "description": "Missing argument `onnx_path` in function `streamdiffusion.acceleration.tensorrt.compile_controlnet`", + "concise_description": "Missing argument `onnx_path` in function `streamdiffusion.acceleration.tensorrt.compile_controlnet`", + "severity": "error" + }, + { + "line": 351, + "column": 26, + "stop_line": 356, + "stop_column": 14, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\engine_manager.py", + "code": -2, + "name": "missing-argument", + "description": "Missing argument `onnx_opt_path` in function `streamdiffusion.acceleration.tensorrt.compile_controlnet`", + "concise_description": "Missing argument `onnx_opt_path` in function `streamdiffusion.acceleration.tensorrt.compile_controlnet`", + "severity": "error" + }, + { + "line": 351, + "column": 26, + "stop_line": 356, + "stop_column": 14, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\engine_manager.py", + "code": -2, + "name": "missing-argument", + "description": "Missing argument `engine_path` in function `streamdiffusion.acceleration.tensorrt.compile_controlnet`", + "concise_description": "Missing argument `engine_path` in function `streamdiffusion.acceleration.tensorrt.compile_controlnet`", + "severity": "error" + }, + { + "line": 351, + "column": 26, + "stop_line": 356, + "stop_column": 14, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\engine_manager.py", + "code": -2, + "name": "missing-argument", + "description": "Missing argument `onnx_path` in function `streamdiffusion.acceleration.tensorrt.compile_safety_checker`", + "concise_description": "Missing argument `onnx_path` in function `streamdiffusion.acceleration.tensorrt.compile_safety_checker`", + "severity": "error" + }, + { + "line": 351, + "column": 26, + "stop_line": 356, + "stop_column": 14, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\engine_manager.py", + "code": -2, + "name": "missing-argument", + "description": "Missing argument `onnx_opt_path` in function `streamdiffusion.acceleration.tensorrt.compile_safety_checker`", + "concise_description": "Missing argument `onnx_opt_path` in function `streamdiffusion.acceleration.tensorrt.compile_safety_checker`", + "severity": "error" + }, + { + "line": 351, + "column": 26, + "stop_line": 356, + "stop_column": 14, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\engine_manager.py", + "code": -2, + "name": "missing-argument", + "description": "Missing argument `engine_path` in function `streamdiffusion.acceleration.tensorrt.compile_safety_checker`", + "concise_description": "Missing argument `engine_path` in function `streamdiffusion.acceleration.tensorrt.compile_safety_checker`", + "severity": "error" + }, + { + "line": 351, + "column": 26, + "stop_line": 356, + "stop_column": 14, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\engine_manager.py", + "code": -2, + "name": "missing-argument", + "description": "Missing argument `onnx_path` in function `streamdiffusion.acceleration.tensorrt.compile_unet`", + "concise_description": "Missing argument `onnx_path` in function `streamdiffusion.acceleration.tensorrt.compile_unet`", + "severity": "error" + }, + { + "line": 351, + "column": 26, + "stop_line": 356, + "stop_column": 14, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\engine_manager.py", + "code": -2, + "name": "missing-argument", + "description": "Missing argument `onnx_opt_path` in function `streamdiffusion.acceleration.tensorrt.compile_unet`", + "concise_description": "Missing argument `onnx_opt_path` in function `streamdiffusion.acceleration.tensorrt.compile_unet`", + "severity": "error" + }, + { + "line": 351, + "column": 26, + "stop_line": 356, + "stop_column": 14, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\engine_manager.py", + "code": -2, + "name": "missing-argument", + "description": "Missing argument `engine_path` in function `streamdiffusion.acceleration.tensorrt.compile_unet`", + "concise_description": "Missing argument `engine_path` in function `streamdiffusion.acceleration.tensorrt.compile_unet`", + "severity": "error" + }, + { + "line": 351, + "column": 26, + "stop_line": 356, + "stop_column": 14, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\engine_manager.py", + "code": -2, + "name": "missing-argument", + "description": "Missing argument `onnx_path` in function `streamdiffusion.acceleration.tensorrt.compile_vae_decoder`", + "concise_description": "Missing argument `onnx_path` in function `streamdiffusion.acceleration.tensorrt.compile_vae_decoder`", + "severity": "error" + }, + { + "line": 351, + "column": 26, + "stop_line": 356, + "stop_column": 14, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\engine_manager.py", + "code": -2, + "name": "missing-argument", + "description": "Missing argument `onnx_opt_path` in function `streamdiffusion.acceleration.tensorrt.compile_vae_decoder`", + "concise_description": "Missing argument `onnx_opt_path` in function `streamdiffusion.acceleration.tensorrt.compile_vae_decoder`", + "severity": "error" + }, + { + "line": 351, + "column": 26, + "stop_line": 356, + "stop_column": 14, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\engine_manager.py", + "code": -2, + "name": "missing-argument", + "description": "Missing argument `engine_path` in function `streamdiffusion.acceleration.tensorrt.compile_vae_decoder`", + "concise_description": "Missing argument `engine_path` in function `streamdiffusion.acceleration.tensorrt.compile_vae_decoder`", + "severity": "error" + }, + { + "line": 351, + "column": 26, + "stop_line": 356, + "stop_column": 14, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\engine_manager.py", + "code": -2, + "name": "missing-argument", + "description": "Missing argument `onnx_path` in function `streamdiffusion.acceleration.tensorrt.compile_vae_encoder`", + "concise_description": "Missing argument `onnx_path` in function `streamdiffusion.acceleration.tensorrt.compile_vae_encoder`", + "severity": "error" + }, + { + "line": 351, + "column": 26, + "stop_line": 356, + "stop_column": 14, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\engine_manager.py", + "code": -2, + "name": "missing-argument", + "description": "Missing argument `onnx_opt_path` in function `streamdiffusion.acceleration.tensorrt.compile_vae_encoder`", + "concise_description": "Missing argument `onnx_opt_path` in function `streamdiffusion.acceleration.tensorrt.compile_vae_encoder`", + "severity": "error" + }, + { + "line": 351, + "column": 26, + "stop_line": 356, + "stop_column": 14, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\engine_manager.py", + "code": -2, + "name": "missing-argument", + "description": "Missing argument `engine_path` in function `streamdiffusion.acceleration.tensorrt.compile_vae_encoder`", + "concise_description": "Missing argument `engine_path` in function `streamdiffusion.acceleration.tensorrt.compile_vae_encoder`", + "severity": "error" + }, + { + "line": 352, + "column": 17, + "stop_line": 352, + "stop_column": 28, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\engine_manager.py", + "code": -2, + "name": "bad-argument-type", + "description": "Argument `Path` is not assignable to parameter `controlnet` with type `diffusers.models.controlnets.controlnet.ControlNetModel | diffusers.utils.dummy_pt_objects.ControlNetModel` in function `streamdiffusion.acceleration.tensorrt.compile_controlnet`", + "concise_description": "Argument `Path` is not assignable to parameter `controlnet` with type `diffusers.models.controlnets.controlnet.ControlNetModel | diffusers.utils.dummy_pt_objects.ControlNetModel` in function `streamdiffusion.acceleration.tensorrt.compile_controlnet`", + "severity": "error" + }, + { + "line": 352, + "column": 17, + "stop_line": 352, + "stop_column": 28, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\engine_manager.py", + "code": -2, + "name": "bad-argument-type", + "description": "Argument `Path` is not assignable to parameter `safety_checker` with type `StableDiffusionSafetyCheckerWrapper` in function `streamdiffusion.acceleration.tensorrt.compile_safety_checker`", + "concise_description": "Argument `Path` is not assignable to parameter `safety_checker` with type `StableDiffusionSafetyCheckerWrapper` in function `streamdiffusion.acceleration.tensorrt.compile_safety_checker`", + "severity": "error" + }, + { + "line": 352, + "column": 17, + "stop_line": 352, + "stop_column": 28, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\engine_manager.py", + "code": -2, + "name": "bad-argument-type", + "description": "Argument `Path` is not assignable to parameter `unet` with type `diffusers.models.unets.unet_2d_condition.UNet2DConditionModel | diffusers.utils.dummy_pt_objects.UNet2DConditionModel` in function `streamdiffusion.acceleration.tensorrt.compile_unet`", + "concise_description": "Argument `Path` is not assignable to parameter `unet` with type `diffusers.models.unets.unet_2d_condition.UNet2DConditionModel | diffusers.utils.dummy_pt_objects.UNet2DConditionModel` in function `streamdiffusion.acceleration.tensorrt.compile_unet`", + "severity": "error" + }, + { + "line": 352, + "column": 17, + "stop_line": 352, + "stop_column": 28, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\engine_manager.py", + "code": -2, + "name": "bad-argument-type", + "description": "Argument `Path` is not assignable to parameter `vae` with type `diffusers.models.autoencoders.autoencoder_kl.AutoencoderKL | diffusers.utils.dummy_pt_objects.AutoencoderKL` in function `streamdiffusion.acceleration.tensorrt.compile_vae_decoder`", + "concise_description": "Argument `Path` is not assignable to parameter `vae` with type `diffusers.models.autoencoders.autoencoder_kl.AutoencoderKL | diffusers.utils.dummy_pt_objects.AutoencoderKL` in function `streamdiffusion.acceleration.tensorrt.compile_vae_decoder`", + "severity": "error" + }, + { + "line": 352, + "column": 17, + "stop_line": 352, + "stop_column": 28, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\engine_manager.py", + "code": -2, + "name": "bad-argument-type", + "description": "Argument `Path` is not assignable to parameter `vae` with type `TorchVAEEncoder` in function `streamdiffusion.acceleration.tensorrt.compile_vae_encoder`", + "concise_description": "Argument `Path` is not assignable to parameter `vae` with type `TorchVAEEncoder` in function `streamdiffusion.acceleration.tensorrt.compile_vae_encoder`", + "severity": "error" + }, + { + "line": 353, + "column": 17, + "stop_line": 353, + "stop_column": 42, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\engine_manager.py", + "code": -2, + "name": "bad-argument-type", + "description": "Argument `dict[Unknown, Unknown] | None` is not assignable to parameter `model_data` with type `BaseModel` in function `streamdiffusion.acceleration.tensorrt.compile_controlnet`", + "concise_description": "Argument `dict[Unknown, Unknown] | None` is not assignable to parameter `model_data` with type `BaseModel` in function `streamdiffusion.acceleration.tensorrt.compile_controlnet`", + "severity": "error" + }, + { + "line": 353, + "column": 17, + "stop_line": 353, + "stop_column": 42, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\engine_manager.py", + "code": -2, + "name": "bad-argument-type", + "description": "Argument `dict[Unknown, Unknown] | None` is not assignable to parameter `model_data` with type `BaseModel` in function `streamdiffusion.acceleration.tensorrt.compile_safety_checker`", + "concise_description": "Argument `dict[Unknown, Unknown] | None` is not assignable to parameter `model_data` with type `BaseModel` in function `streamdiffusion.acceleration.tensorrt.compile_safety_checker`", + "severity": "error" + }, + { + "line": 353, + "column": 17, + "stop_line": 353, + "stop_column": 42, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\engine_manager.py", + "code": -2, + "name": "bad-argument-type", + "description": "Argument `dict[Unknown, Unknown] | None` is not assignable to parameter `model_data` with type `BaseModel` in function `streamdiffusion.acceleration.tensorrt.compile_unet`", + "concise_description": "Argument `dict[Unknown, Unknown] | None` is not assignable to parameter `model_data` with type `BaseModel` in function `streamdiffusion.acceleration.tensorrt.compile_unet`", + "severity": "error" + }, + { + "line": 353, + "column": 17, + "stop_line": 353, + "stop_column": 42, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\engine_manager.py", + "code": -2, + "name": "bad-argument-type", + "description": "Argument `dict[Unknown, Unknown] | None` is not assignable to parameter `model_data` with type `BaseModel` in function `streamdiffusion.acceleration.tensorrt.compile_vae_decoder`", + "concise_description": "Argument `dict[Unknown, Unknown] | None` is not assignable to parameter `model_data` with type `BaseModel` in function `streamdiffusion.acceleration.tensorrt.compile_vae_decoder`", + "severity": "error" + }, + { + "line": 353, + "column": 17, + "stop_line": 353, + "stop_column": 42, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\engine_manager.py", + "code": -2, + "name": "bad-argument-type", + "description": "Argument `dict[Unknown, Unknown] | None` is not assignable to parameter `model_data` with type `BaseModel` in function `streamdiffusion.acceleration.tensorrt.compile_vae_encoder`", + "concise_description": "Argument `dict[Unknown, Unknown] | None` is not assignable to parameter `model_data` with type `BaseModel` in function `streamdiffusion.acceleration.tensorrt.compile_vae_encoder`", + "severity": "error" + }, + { + "line": 354, + "column": 17, + "stop_line": 354, + "stop_column": 27, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\engine_manager.py", + "code": -2, + "name": "unexpected-keyword", + "description": "Unexpected keyword argument `model_type` in function `streamdiffusion.acceleration.tensorrt.compile_controlnet`", + "concise_description": "Unexpected keyword argument `model_type` in function `streamdiffusion.acceleration.tensorrt.compile_controlnet`", + "severity": "error" + }, + { + "line": 354, + "column": 17, + "stop_line": 354, + "stop_column": 27, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\engine_manager.py", + "code": -2, + "name": "unexpected-keyword", + "description": "Unexpected keyword argument `model_type` in function `streamdiffusion.acceleration.tensorrt.compile_safety_checker`", + "concise_description": "Unexpected keyword argument `model_type` in function `streamdiffusion.acceleration.tensorrt.compile_safety_checker`", + "severity": "error" + }, + { + "line": 354, + "column": 17, + "stop_line": 354, + "stop_column": 27, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\engine_manager.py", + "code": -2, + "name": "unexpected-keyword", + "description": "Unexpected keyword argument `model_type` in function `streamdiffusion.acceleration.tensorrt.compile_unet`", + "concise_description": "Unexpected keyword argument `model_type` in function `streamdiffusion.acceleration.tensorrt.compile_unet`", + "severity": "error" + }, + { + "line": 354, + "column": 17, + "stop_line": 354, + "stop_column": 27, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\engine_manager.py", + "code": -2, + "name": "unexpected-keyword", + "description": "Unexpected keyword argument `model_type` in function `streamdiffusion.acceleration.tensorrt.compile_vae_decoder`", + "concise_description": "Unexpected keyword argument `model_type` in function `streamdiffusion.acceleration.tensorrt.compile_vae_decoder`", + "severity": "error" + }, + { + "line": 354, + "column": 17, + "stop_line": 354, + "stop_column": 27, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\engine_manager.py", + "code": -2, + "name": "unexpected-keyword", + "description": "Unexpected keyword argument `model_type` in function `streamdiffusion.acceleration.tensorrt.compile_vae_encoder`", + "concise_description": "Unexpected keyword argument `model_type` in function `streamdiffusion.acceleration.tensorrt.compile_vae_encoder`", + "severity": "error" + }, + { + "line": 355, + "column": 17, + "stop_line": 355, + "stop_column": 31, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\engine_manager.py", + "code": -2, + "name": "unexpected-keyword", + "description": "Unexpected keyword argument `use_cuda_graph` in function `streamdiffusion.acceleration.tensorrt.compile_controlnet`", + "concise_description": "Unexpected keyword argument `use_cuda_graph` in function `streamdiffusion.acceleration.tensorrt.compile_controlnet`", + "severity": "error" + }, + { + "line": 355, + "column": 17, + "stop_line": 355, + "stop_column": 31, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\engine_manager.py", + "code": -2, + "name": "unexpected-keyword", + "description": "Unexpected keyword argument `use_cuda_graph` in function `streamdiffusion.acceleration.tensorrt.compile_safety_checker`", + "concise_description": "Unexpected keyword argument `use_cuda_graph` in function `streamdiffusion.acceleration.tensorrt.compile_safety_checker`", + "severity": "error" + }, + { + "line": 355, + "column": 17, + "stop_line": 355, + "stop_column": 31, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\engine_manager.py", + "code": -2, + "name": "unexpected-keyword", + "description": "Unexpected keyword argument `use_cuda_graph` in function `streamdiffusion.acceleration.tensorrt.compile_unet`", + "concise_description": "Unexpected keyword argument `use_cuda_graph` in function `streamdiffusion.acceleration.tensorrt.compile_unet`", + "severity": "error" + }, + { + "line": 355, + "column": 17, + "stop_line": 355, + "stop_column": 31, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\engine_manager.py", + "code": -2, + "name": "unexpected-keyword", + "description": "Unexpected keyword argument `use_cuda_graph` in function `streamdiffusion.acceleration.tensorrt.compile_vae_decoder`", + "concise_description": "Unexpected keyword argument `use_cuda_graph` in function `streamdiffusion.acceleration.tensorrt.compile_vae_decoder`", + "severity": "error" + }, + { + "line": 355, + "column": 17, + "stop_line": 355, + "stop_column": 31, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\engine_manager.py", + "code": -2, + "name": "unexpected-keyword", + "description": "Unexpected keyword argument `use_cuda_graph` in function `streamdiffusion.acceleration.tensorrt.compile_vae_encoder`", + "concise_description": "Unexpected keyword argument `use_cuda_graph` in function `streamdiffusion.acceleration.tensorrt.compile_vae_encoder`", + "severity": "error" + }, + { + "line": 358, + "column": 20, + "stop_line": 358, + "stop_column": 26, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\engine_manager.py", + "code": -2, + "name": "not-callable", + "description": "Expected a callable, got `str`", + "concise_description": "Expected a callable, got `str`", + "severity": "error" + }, + { + "line": 358, + "column": 26, + "stop_line": 358, + "stop_column": 66, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\engine_manager.py", + "code": -2, + "name": "missing-argument", + "description": "Missing argument `onnx_path` in function `streamdiffusion.acceleration.tensorrt.compile_controlnet`", + "concise_description": "Missing argument `onnx_path` in function `streamdiffusion.acceleration.tensorrt.compile_controlnet`", + "severity": "error" + }, + { + "line": 358, + "column": 26, + "stop_line": 358, + "stop_column": 66, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\engine_manager.py", + "code": -2, + "name": "missing-argument", + "description": "Missing argument `onnx_opt_path` in function `streamdiffusion.acceleration.tensorrt.compile_controlnet`", + "concise_description": "Missing argument `onnx_opt_path` in function `streamdiffusion.acceleration.tensorrt.compile_controlnet`", + "severity": "error" + }, + { + "line": 358, + "column": 26, + "stop_line": 358, + "stop_column": 66, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\engine_manager.py", + "code": -2, + "name": "missing-argument", + "description": "Missing argument `engine_path` in function `streamdiffusion.acceleration.tensorrt.compile_controlnet`", + "concise_description": "Missing argument `engine_path` in function `streamdiffusion.acceleration.tensorrt.compile_controlnet`", + "severity": "error" + }, + { + "line": 358, + "column": 26, + "stop_line": 358, + "stop_column": 66, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\engine_manager.py", + "code": -2, + "name": "missing-argument", + "description": "Missing argument `onnx_path` in function `streamdiffusion.acceleration.tensorrt.compile_safety_checker`", + "concise_description": "Missing argument `onnx_path` in function `streamdiffusion.acceleration.tensorrt.compile_safety_checker`", + "severity": "error" + }, + { + "line": 358, + "column": 26, + "stop_line": 358, + "stop_column": 66, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\engine_manager.py", + "code": -2, + "name": "missing-argument", + "description": "Missing argument `onnx_opt_path` in function `streamdiffusion.acceleration.tensorrt.compile_safety_checker`", + "concise_description": "Missing argument `onnx_opt_path` in function `streamdiffusion.acceleration.tensorrt.compile_safety_checker`", + "severity": "error" + }, + { + "line": 358, + "column": 26, + "stop_line": 358, + "stop_column": 66, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\engine_manager.py", + "code": -2, + "name": "missing-argument", + "description": "Missing argument `engine_path` in function `streamdiffusion.acceleration.tensorrt.compile_safety_checker`", + "concise_description": "Missing argument `engine_path` in function `streamdiffusion.acceleration.tensorrt.compile_safety_checker`", + "severity": "error" + }, + { + "line": 358, + "column": 26, + "stop_line": 358, + "stop_column": 66, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\engine_manager.py", + "code": -2, + "name": "missing-argument", + "description": "Missing argument `onnx_path` in function `streamdiffusion.acceleration.tensorrt.compile_unet`", + "concise_description": "Missing argument `onnx_path` in function `streamdiffusion.acceleration.tensorrt.compile_unet`", + "severity": "error" + }, + { + "line": 358, + "column": 26, + "stop_line": 358, + "stop_column": 66, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\engine_manager.py", + "code": -2, + "name": "missing-argument", + "description": "Missing argument `onnx_opt_path` in function `streamdiffusion.acceleration.tensorrt.compile_unet`", + "concise_description": "Missing argument `onnx_opt_path` in function `streamdiffusion.acceleration.tensorrt.compile_unet`", + "severity": "error" + }, + { + "line": 358, + "column": 26, + "stop_line": 358, + "stop_column": 66, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\engine_manager.py", + "code": -2, + "name": "missing-argument", + "description": "Missing argument `engine_path` in function `streamdiffusion.acceleration.tensorrt.compile_unet`", + "concise_description": "Missing argument `engine_path` in function `streamdiffusion.acceleration.tensorrt.compile_unet`", + "severity": "error" + }, + { + "line": 358, + "column": 26, + "stop_line": 358, + "stop_column": 66, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\engine_manager.py", + "code": -2, + "name": "missing-argument", + "description": "Missing argument `onnx_path` in function `streamdiffusion.acceleration.tensorrt.compile_vae_decoder`", + "concise_description": "Missing argument `onnx_path` in function `streamdiffusion.acceleration.tensorrt.compile_vae_decoder`", + "severity": "error" + }, + { + "line": 358, + "column": 26, + "stop_line": 358, + "stop_column": 66, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\engine_manager.py", + "code": -2, + "name": "missing-argument", + "description": "Missing argument `onnx_opt_path` in function `streamdiffusion.acceleration.tensorrt.compile_vae_decoder`", + "concise_description": "Missing argument `onnx_opt_path` in function `streamdiffusion.acceleration.tensorrt.compile_vae_decoder`", + "severity": "error" + }, + { + "line": 358, + "column": 26, + "stop_line": 358, + "stop_column": 66, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\engine_manager.py", + "code": -2, + "name": "missing-argument", + "description": "Missing argument `engine_path` in function `streamdiffusion.acceleration.tensorrt.compile_vae_decoder`", + "concise_description": "Missing argument `engine_path` in function `streamdiffusion.acceleration.tensorrt.compile_vae_decoder`", + "severity": "error" + }, + { + "line": 358, + "column": 26, + "stop_line": 358, + "stop_column": 66, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\engine_manager.py", + "code": -2, + "name": "missing-argument", + "description": "Missing argument `onnx_path` in function `streamdiffusion.acceleration.tensorrt.compile_vae_encoder`", + "concise_description": "Missing argument `onnx_path` in function `streamdiffusion.acceleration.tensorrt.compile_vae_encoder`", + "severity": "error" + }, + { + "line": 358, + "column": 26, + "stop_line": 358, + "stop_column": 66, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\engine_manager.py", + "code": -2, + "name": "missing-argument", + "description": "Missing argument `onnx_opt_path` in function `streamdiffusion.acceleration.tensorrt.compile_vae_encoder`", + "concise_description": "Missing argument `onnx_opt_path` in function `streamdiffusion.acceleration.tensorrt.compile_vae_encoder`", + "severity": "error" + }, + { + "line": 358, + "column": 26, + "stop_line": 358, + "stop_column": 66, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\engine_manager.py", + "code": -2, + "name": "missing-argument", + "description": "Missing argument `engine_path` in function `streamdiffusion.acceleration.tensorrt.compile_vae_encoder`", + "concise_description": "Missing argument `engine_path` in function `streamdiffusion.acceleration.tensorrt.compile_vae_encoder`", + "severity": "error" + }, + { + "line": 358, + "column": 27, + "stop_line": 358, + "stop_column": 38, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\engine_manager.py", + "code": -2, + "name": "bad-argument-type", + "description": "Argument `Path` is not assignable to parameter `controlnet` with type `diffusers.models.controlnets.controlnet.ControlNetModel | diffusers.utils.dummy_pt_objects.ControlNetModel` in function `streamdiffusion.acceleration.tensorrt.compile_controlnet`", + "concise_description": "Argument `Path` is not assignable to parameter `controlnet` with type `diffusers.models.controlnets.controlnet.ControlNetModel | diffusers.utils.dummy_pt_objects.ControlNetModel` in function `streamdiffusion.acceleration.tensorrt.compile_controlnet`", + "severity": "error" + }, + { + "line": 358, + "column": 27, + "stop_line": 358, + "stop_column": 38, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\engine_manager.py", + "code": -2, + "name": "bad-argument-type", + "description": "Argument `Path` is not assignable to parameter `safety_checker` with type `StableDiffusionSafetyCheckerWrapper` in function `streamdiffusion.acceleration.tensorrt.compile_safety_checker`", + "concise_description": "Argument `Path` is not assignable to parameter `safety_checker` with type `StableDiffusionSafetyCheckerWrapper` in function `streamdiffusion.acceleration.tensorrt.compile_safety_checker`", + "severity": "error" + }, + { + "line": 358, + "column": 27, + "stop_line": 358, + "stop_column": 38, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\engine_manager.py", + "code": -2, + "name": "bad-argument-type", + "description": "Argument `Path` is not assignable to parameter `unet` with type `diffusers.models.unets.unet_2d_condition.UNet2DConditionModel | diffusers.utils.dummy_pt_objects.UNet2DConditionModel` in function `streamdiffusion.acceleration.tensorrt.compile_unet`", + "concise_description": "Argument `Path` is not assignable to parameter `unet` with type `diffusers.models.unets.unet_2d_condition.UNet2DConditionModel | diffusers.utils.dummy_pt_objects.UNet2DConditionModel` in function `streamdiffusion.acceleration.tensorrt.compile_unet`", + "severity": "error" + }, + { + "line": 358, + "column": 27, + "stop_line": 358, + "stop_column": 38, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\engine_manager.py", + "code": -2, + "name": "bad-argument-type", + "description": "Argument `Path` is not assignable to parameter `vae` with type `diffusers.models.autoencoders.autoencoder_kl.AutoencoderKL | diffusers.utils.dummy_pt_objects.AutoencoderKL` in function `streamdiffusion.acceleration.tensorrt.compile_vae_decoder`", + "concise_description": "Argument `Path` is not assignable to parameter `vae` with type `diffusers.models.autoencoders.autoencoder_kl.AutoencoderKL | diffusers.utils.dummy_pt_objects.AutoencoderKL` in function `streamdiffusion.acceleration.tensorrt.compile_vae_decoder`", + "severity": "error" + }, + { + "line": 358, + "column": 27, + "stop_line": 358, + "stop_column": 38, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\engine_manager.py", + "code": -2, + "name": "bad-argument-type", + "description": "Argument `Path` is not assignable to parameter `vae` with type `TorchVAEEncoder` in function `streamdiffusion.acceleration.tensorrt.compile_vae_encoder`", + "concise_description": "Argument `Path` is not assignable to parameter `vae` with type `TorchVAEEncoder` in function `streamdiffusion.acceleration.tensorrt.compile_vae_encoder`", + "severity": "error" + }, + { + "line": 358, + "column": 40, + "stop_line": 358, + "stop_column": 65, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\engine_manager.py", + "code": -2, + "name": "bad-argument-type", + "description": "Argument `dict[Unknown, Unknown] | None` is not assignable to parameter `model_data` with type `BaseModel` in function `streamdiffusion.acceleration.tensorrt.compile_controlnet`", + "concise_description": "Argument `dict[Unknown, Unknown] | None` is not assignable to parameter `model_data` with type `BaseModel` in function `streamdiffusion.acceleration.tensorrt.compile_controlnet`", + "severity": "error" + }, + { + "line": 358, + "column": 40, + "stop_line": 358, + "stop_column": 65, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\engine_manager.py", + "code": -2, + "name": "bad-argument-type", + "description": "Argument `dict[Unknown, Unknown] | None` is not assignable to parameter `model_data` with type `BaseModel` in function `streamdiffusion.acceleration.tensorrt.compile_safety_checker`", + "concise_description": "Argument `dict[Unknown, Unknown] | None` is not assignable to parameter `model_data` with type `BaseModel` in function `streamdiffusion.acceleration.tensorrt.compile_safety_checker`", + "severity": "error" + }, + { + "line": 358, + "column": 40, + "stop_line": 358, + "stop_column": 65, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\engine_manager.py", + "code": -2, + "name": "bad-argument-type", + "description": "Argument `dict[Unknown, Unknown] | None` is not assignable to parameter `model_data` with type `BaseModel` in function `streamdiffusion.acceleration.tensorrt.compile_unet`", + "concise_description": "Argument `dict[Unknown, Unknown] | None` is not assignable to parameter `model_data` with type `BaseModel` in function `streamdiffusion.acceleration.tensorrt.compile_unet`", + "severity": "error" + }, + { + "line": 358, + "column": 40, + "stop_line": 358, + "stop_column": 65, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\engine_manager.py", + "code": -2, + "name": "bad-argument-type", + "description": "Argument `dict[Unknown, Unknown] | None` is not assignable to parameter `model_data` with type `BaseModel` in function `streamdiffusion.acceleration.tensorrt.compile_vae_decoder`", + "concise_description": "Argument `dict[Unknown, Unknown] | None` is not assignable to parameter `model_data` with type `BaseModel` in function `streamdiffusion.acceleration.tensorrt.compile_vae_decoder`", + "severity": "error" + }, + { + "line": 358, + "column": 40, + "stop_line": 358, + "stop_column": 65, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\engine_manager.py", + "code": -2, + "name": "bad-argument-type", + "description": "Argument `dict[Unknown, Unknown] | None` is not assignable to parameter `model_data` with type `BaseModel` in function `streamdiffusion.acceleration.tensorrt.compile_vae_encoder`", + "concise_description": "Argument `dict[Unknown, Unknown] | None` is not assignable to parameter `model_data` with type `BaseModel` in function `streamdiffusion.acceleration.tensorrt.compile_vae_encoder`", + "severity": "error" + }, + { + "line": 33, + "column": 21, + "stop_line": 33, + "stop_column": 33, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\export_wrappers\\unet_ipadapter_export.py", + "code": -2, + "name": "missing-attribute", + "description": "Object of class `UNet2DConditionModel` has no attribute `to`", + "concise_description": "Object of class `UNet2DConditionModel` has no attribute `to`", + "severity": "error" + }, + { + "line": 53, + "column": 26, + "stop_line": 53, + "stop_column": 51, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\export_wrappers\\unet_ipadapter_export.py", + "code": -2, + "name": "missing-attribute", + "description": "Object of class `UNet2DConditionModel` has no attribute `attn_processors`", + "concise_description": "Object of class `UNet2DConditionModel` has no attribute `attn_processors`", + "severity": "error" + }, + { + "line": 75, + "column": 26, + "stop_line": 75, + "stop_column": 51, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\export_wrappers\\unet_ipadapter_export.py", + "code": -2, + "name": "missing-attribute", + "description": "Object of class `UNet2DConditionModel` has no attribute `attn_processors`", + "concise_description": "Object of class `UNet2DConditionModel` has no attribute `attn_processors`", + "severity": "error" + }, + { + "line": 102, + "column": 36, + "stop_line": 102, + "stop_column": 52, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\export_wrappers\\unet_ipadapter_export.py", + "code": -2, + "name": "missing-attribute", + "description": "Object of class `UNet2DConditionModel` has no attribute `device`", + "concise_description": "Object of class `UNet2DConditionModel` has no attribute `device`", + "severity": "error" + }, + { + "line": 111, + "column": 13, + "stop_line": 111, + "stop_column": 41, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\export_wrappers\\unet_ipadapter_export.py", + "code": -2, + "name": "missing-attribute", + "description": "Object of class `UNet2DConditionModel` has no attribute `set_attn_processor`", + "concise_description": "Object of class `UNet2DConditionModel` has no attribute `set_attn_processor`", + "severity": "error" + }, + { + "line": 137, + "column": 36, + "stop_line": 137, + "stop_column": 61, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\export_wrappers\\unet_ipadapter_export.py", + "code": -2, + "name": "missing-attribute", + "description": "Object of class `UNet2DConditionModel` has no attribute `attn_processors`", + "concise_description": "Object of class `UNet2DConditionModel` has no attribute `attn_processors`", + "severity": "error" + }, + { + "line": 143, + "column": 67, + "stop_line": 143, + "stop_column": 83, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\export_wrappers\\unet_ipadapter_export.py", + "code": -2, + "name": "missing-attribute", + "description": "Object of class `UNet2DConditionModel` has no attribute `config`", + "concise_description": "Object of class `UNet2DConditionModel` has no attribute `config`", + "severity": "error" + }, + { + "line": 149, + "column": 35, + "stop_line": 149, + "stop_column": 51, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\export_wrappers\\unet_ipadapter_export.py", + "code": -2, + "name": "missing-attribute", + "description": "Object of class `UNet2DConditionModel` has no attribute `config`", + "concise_description": "Object of class `UNet2DConditionModel` has no attribute `config`", + "severity": "error" + }, + { + "line": 152, + "column": 49, + "stop_line": 152, + "stop_column": 65, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\export_wrappers\\unet_ipadapter_export.py", + "code": -2, + "name": "missing-attribute", + "description": "Object of class `UNet2DConditionModel` has no attribute `config`", + "concise_description": "Object of class `UNet2DConditionModel` has no attribute `config`", + "severity": "error" + }, + { + "line": 155, + "column": 35, + "stop_line": 155, + "stop_column": 51, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\export_wrappers\\unet_ipadapter_export.py", + "code": -2, + "name": "missing-attribute", + "description": "Object of class `UNet2DConditionModel` has no attribute `config`", + "concise_description": "Object of class `UNet2DConditionModel` has no attribute `config`", + "severity": "error" + }, + { + "line": 158, + "column": 35, + "stop_line": 158, + "stop_column": 51, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\export_wrappers\\unet_ipadapter_export.py", + "code": -2, + "name": "missing-attribute", + "description": "Object of class `UNet2DConditionModel` has no attribute `config`", + "concise_description": "Object of class `UNet2DConditionModel` has no attribute `config`", + "severity": "error" + }, + { + "line": 162, + "column": 40, + "stop_line": 162, + "stop_column": 55, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\export_wrappers\\unet_ipadapter_export.py", + "code": -2, + "name": "unsupported-operation", + "description": "Cannot set item in `dict[Unknown, AttnProcessor]`\n Argument `AttnProcessor | AttnProcessor2_0` is not assignable to parameter `value` with type `AttnProcessor` in function `dict.__setitem__`", + "concise_description": "Cannot set item in `dict[Unknown, AttnProcessor]`", + "severity": "error" + }, + { + "line": 169, + "column": 26, + "stop_line": 169, + "stop_column": 42, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\export_wrappers\\unet_ipadapter_export.py", + "code": -2, + "name": "missing-attribute", + "description": "Object of class `UNet2DConditionModel` has no attribute `device`", + "concise_description": "Object of class `UNet2DConditionModel` has no attribute `device`", + "severity": "error" + }, + { + "line": 174, + "column": 40, + "stop_line": 174, + "stop_column": 44, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\export_wrappers\\unet_ipadapter_export.py", + "code": -2, + "name": "unsupported-operation", + "description": "Cannot set item in `dict[Unknown, AttnProcessor]`\n Argument `TRTIPAttnProcessor | TRTIPAttnProcessor2_0` is not assignable to parameter `value` with type `AttnProcessor` in function `dict.__setitem__`", + "concise_description": "Cannot set item in `dict[Unknown, AttnProcessor]`", + "severity": "error" + }, + { + "line": 176, + "column": 13, + "stop_line": 176, + "stop_column": 41, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\export_wrappers\\unet_ipadapter_export.py", + "code": -2, + "name": "missing-attribute", + "description": "Object of class `UNet2DConditionModel` has no attribute `set_attn_processor`", + "concise_description": "Object of class `UNet2DConditionModel` has no attribute `set_attn_processor`", + "severity": "error" + }, + { + "line": 218, + "column": 44, + "stop_line": 218, + "stop_column": 61, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\export_wrappers\\unet_ipadapter_export.py", + "code": -2, + "name": "bad-index", + "description": "Cannot index into `Tensor`\n Argument `Module | Tensor` is not assignable to parameter `indices` with type `EllipsisType | SupportsIndex | Tensor | _NestedSequence[EllipsisType | Tensor | bool | int | slice[Any, Any, Any] | None] | bool | int | slice[Any, Any, Any] | tuple[_Index, ...] | None` in function `torch._C.TensorBase.__getitem__`", + "concise_description": "Cannot index into `Tensor`", + "severity": "error" + }, + { + "line": 220, + "column": 96, + "stop_line": 220, + "stop_column": 100, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\export_wrappers\\unet_ipadapter_export.py", + "code": -2, + "name": "bad-function-definition", + "description": "Default `None` is not assignable to parameter `ipadapter_scale` with type `Tensor`", + "concise_description": "Default `None` is not assignable to parameter `ipadapter_scale` with type `Tensor`", + "severity": "error" + }, + { + "line": 254, + "column": 16, + "stop_line": 254, + "stop_column": 25, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\export_wrappers\\unet_ipadapter_export.py", + "code": -2, + "name": "not-callable", + "description": "Expected a callable, got `UNet2DConditionModel`", + "concise_description": "Expected a callable, got `UNet2DConditionModel`", + "severity": "error" + }, + { + "line": 279, + "column": 55, + "stop_line": 279, + "stop_column": 59, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\export_wrappers\\unet_ipadapter_export.py", + "code": -2, + "name": "bad-argument-type", + "description": "Argument `diffusers.models.unets.unet_2d_condition.UNet2DConditionModel | diffusers.utils.dummy_pt_objects.UNet2DConditionModel` is not assignable to parameter `unet` with type `diffusers.models.unets.unet_2d_condition.UNet2DConditionModel` in function `streamdiffusion.model_detection.detect_model_from_diffusers_unet`", + "concise_description": "Argument `diffusers.models.unets.unet_2d_condition.UNet2DConditionModel | diffusers.utils.dummy_pt_objects.UNet2DConditionModel` is not assignable to parameter `unet` with type `diffusers.models.unets.unet_2d_condition.UNet2DConditionModel` in function `streamdiffusion.model_detection.detect_model_from_diffusers_unet`", + "severity": "error" + }, + { + "line": 280, + "column": 31, + "stop_line": 280, + "stop_column": 42, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\export_wrappers\\unet_ipadapter_export.py", + "code": -2, + "name": "missing-attribute", + "description": "Object of class `UNet2DConditionModel` has no attribute `config`", + "concise_description": "Object of class `UNet2DConditionModel` has no attribute `config`", + "severity": "error" + }, + { + "line": 283, + "column": 31, + "stop_line": 283, + "stop_column": 51, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\export_wrappers\\unet_ipadapter_export.py", + "code": -2, + "name": "missing-attribute", + "description": "Object of class `UNet2DConditionModel` has no attribute `attn_processors`", + "concise_description": "Object of class `UNet2DConditionModel` has no attribute `attn_processors`", + "severity": "error" + }, + { + "line": 21, + "column": 5, + "stop_line": 21, + "stop_column": 76, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\export_wrappers\\unet_sdxl_export.py", + "code": -2, + "name": "missing-import", + "description": "Cannot find module `diffusers.models.transformers.clip_text_model`\n Looked in these locations (from config in `D:\\dev\\SDTD_032_dev\\StreamDiffusion\\pyproject.toml`):\n Search path (from config file): [\"D:\\\\dev\\\\SDTD_032_dev\\\\StreamDiffusion\\\\src\"]\n Import root (inferred from project layout): \"D:\\\\dev\\\\SDTD_032_dev\\\\StreamDiffusion\\\\src\"\n Site package path queried from interpreter: [\"C:\\\\Users\\\\Inter\\\\AppData\\\\Local\\\\Programs\\\\Python\\\\Python311\\\\DLLs\", \"C:\\\\Users\\\\Inter\\\\AppData\\\\Local\\\\Programs\\\\Python\\\\Python311\", \"D:\\\\dev\\\\SDTD_032_dev\\\\StreamDiffusion\\\\venv\", \"D:\\\\dev\\\\SDTD_032_dev\\\\StreamDiffusion\\\\venv\\\\Lib\\\\site-packages\", \"D:\\\\dev\\\\SDTD_032_dev\\\\StreamDiffusion\\\\src\", \"D:\\\\dev\\\\SDTD_032_dev\\\\StreamDiffusion\\\\venv\\\\Lib\\\\site-packages\\\\win32\", \"D:\\\\dev\\\\SDTD_032_dev\\\\StreamDiffusion\\\\venv\\\\Lib\\\\site-packages\\\\win32\\\\lib\", \"D:\\\\dev\\\\SDTD_032_dev\\\\StreamDiffusion\\\\venv\\\\Lib\\\\site-packages\\\\Pythonwin\"]", + "concise_description": "Cannot find module `diffusers.models.transformers.clip_text_model`", + "severity": "error" + }, + { + "line": 24, + "column": 9, + "stop_line": 24, + "stop_column": 67, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\export_wrappers\\unet_sdxl_export.py", + "code": -2, + "name": "missing-import", + "description": "Cannot find module `diffusers.models.clip_text_model`\n Looked in these locations (from config in `D:\\dev\\SDTD_032_dev\\StreamDiffusion\\pyproject.toml`):\n Search path (from config file): [\"D:\\\\dev\\\\SDTD_032_dev\\\\StreamDiffusion\\\\src\"]\n Import root (inferred from project layout): \"D:\\\\dev\\\\SDTD_032_dev\\\\StreamDiffusion\\\\src\"\n Site package path queried from interpreter: [\"C:\\\\Users\\\\Inter\\\\AppData\\\\Local\\\\Programs\\\\Python\\\\Python311\\\\DLLs\", \"C:\\\\Users\\\\Inter\\\\AppData\\\\Local\\\\Programs\\\\Python\\\\Python311\", \"D:\\\\dev\\\\SDTD_032_dev\\\\StreamDiffusion\\\\venv\", \"D:\\\\dev\\\\SDTD_032_dev\\\\StreamDiffusion\\\\venv\\\\Lib\\\\site-packages\", \"D:\\\\dev\\\\SDTD_032_dev\\\\StreamDiffusion\\\\src\", \"D:\\\\dev\\\\SDTD_032_dev\\\\StreamDiffusion\\\\venv\\\\Lib\\\\site-packages\\\\win32\", \"D:\\\\dev\\\\SDTD_032_dev\\\\StreamDiffusion\\\\venv\\\\Lib\\\\site-packages\\\\win32\\\\lib\", \"D:\\\\dev\\\\SDTD_032_dev\\\\StreamDiffusion\\\\venv\\\\Lib\\\\site-packages\\\\Pythonwin\"]", + "concise_description": "Cannot find module `diffusers.models.clip_text_model`", + "severity": "error" + }, + { + "line": 95, + "column": 29, + "stop_line": 95, + "stop_column": 50, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\export_wrappers\\unet_sdxl_export.py", + "code": -2, + "name": "missing-attribute", + "description": "Object of class `NoneType` has no attribute `config`", + "concise_description": "Object of class `NoneType` has no attribute `config`", + "severity": "error" + }, + { + "line": 96, + "column": 21, + "stop_line": 96, + "stop_column": 42, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\export_wrappers\\unet_sdxl_export.py", + "code": -2, + "name": "missing-attribute", + "description": "Object of class `NoneType` has no attribute `config`", + "concise_description": "Object of class `NoneType` has no attribute `config`", + "severity": "error" + }, + { + "line": 209, + "column": 25, + "stop_line": 209, + "stop_column": 32, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\export_wrappers\\unet_sdxl_export.py", + "code": -2, + "name": "missing-attribute", + "description": "Object of class `UNet2DConditionModel` has no attribute `to`", + "concise_description": "Object of class `UNet2DConditionModel` has no attribute `to`", + "severity": "error" + }, + { + "line": 268, + "column": 16, + "stop_line": 268, + "stop_column": 41, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\export_wrappers\\unet_sdxl_export.py", + "code": -2, + "name": "missing-attribute", + "description": "Object of class `SDXLConditioningHandler` has no attribute `conditioning_handler`", + "concise_description": "Object of class `SDXLConditioningHandler` has no attribute `conditioning_handler`", + "severity": "error" + }, + { + "line": 285, + "column": 29, + "stop_line": 285, + "stop_column": 49, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\export_wrappers\\unet_sdxl_export.py", + "code": -2, + "name": "missing-attribute", + "description": "Object of class `SDXLConditioningHandler` has no attribute `supported_calls`", + "concise_description": "Object of class `SDXLConditioningHandler` has no attribute `supported_calls`", + "severity": "error" + }, + { + "line": 300, + "column": 37, + "stop_line": 300, + "stop_column": 41, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\export_wrappers\\unet_sdxl_export.py", + "code": -2, + "name": "bad-argument-type", + "description": "Argument `diffusers.models.unets.unet_2d_condition.UNet2DConditionModel | diffusers.utils.dummy_pt_objects.UNet2DConditionModel` is not assignable to parameter `model` with type `Module` in function `streamdiffusion.model_detection.detect_model`", + "concise_description": "Argument `diffusers.models.unets.unet_2d_condition.UNet2DConditionModel | diffusers.utils.dummy_pt_objects.UNet2DConditionModel` is not assignable to parameter `model` with type `Module` in function `streamdiffusion.model_detection.detect_model`", + "severity": "error" + }, + { + "line": 29, + "column": 18, + "stop_line": 29, + "stop_column": 34, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\export_wrappers\\unet_unified_export.py", + "code": -2, + "name": "missing-attribute", + "description": "Object of class `UNet2DConditionModel` has no attribute `down_blocks`", + "concise_description": "Object of class `UNet2DConditionModel` has no attribute `down_blocks`", + "severity": "error" + }, + { + "line": 37, + "column": 16, + "stop_line": 37, + "stop_column": 30, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\export_wrappers\\unet_unified_export.py", + "code": -2, + "name": "missing-attribute", + "description": "Object of class `UNet2DConditionModel` has no attribute `mid_block`", + "concise_description": "Object of class `UNet2DConditionModel` has no attribute `mid_block`", + "severity": "error" + }, + { + "line": 37, + "column": 50, + "stop_line": 37, + "stop_column": 64, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\export_wrappers\\unet_unified_export.py", + "code": -2, + "name": "missing-attribute", + "description": "Object of class `UNet2DConditionModel` has no attribute `mid_block`", + "concise_description": "Object of class `UNet2DConditionModel` has no attribute `mid_block`", + "severity": "error" + }, + { + "line": 38, + "column": 27, + "stop_line": 38, + "stop_column": 41, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\export_wrappers\\unet_unified_export.py", + "code": -2, + "name": "missing-attribute", + "description": "Object of class `UNet2DConditionModel` has no attribute `mid_block`", + "concise_description": "Object of class `UNet2DConditionModel` has no attribute `mid_block`", + "severity": "error" + }, + { + "line": 44, + "column": 18, + "stop_line": 44, + "stop_column": 32, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\export_wrappers\\unet_unified_export.py", + "code": -2, + "name": "missing-attribute", + "description": "Object of class `UNet2DConditionModel` has no attribute `up_blocks`", + "concise_description": "Object of class `UNet2DConditionModel` has no attribute `up_blocks`", + "severity": "error" + }, + { + "line": 95, + "column": 45, + "stop_line": 95, + "stop_column": 52, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\export_wrappers\\unet_unified_export.py", + "code": -2, + "name": "no-matching-overload", + "description": "No matching overload found for function `sum` called with arguments: (int)\n Possible overloads:\n (iterable: Iterable[Literal[-20, -19, -18, -17, -16, -15, -14, -13, -12, -11, -10, -9, -8, -7, -6, -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25] | bool], /, start: int = 0) -> int [closest match]\n (iterable: Iterable[_SupportsSumNoDefaultT], /) -> Literal[0] | _SupportsSumNoDefaultT\n (iterable: Iterable[_AddableT1], /, start: _AddableT2) -> _AddableT1 | _AddableT2", + "concise_description": "No matching overload found for function `sum` called with arguments: (int)", + "severity": "error" + }, + { + "line": 111, + "column": 17, + "stop_line": 111, + "stop_column": 26, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\export_wrappers\\unet_unified_export.py", + "code": -2, + "name": "bad-argument-type", + "description": "Argument `diffusers.models.unets.unet_2d_condition.UNet2DConditionModel | diffusers.utils.dummy_pt_objects.UNet2DConditionModel` is not assignable to parameter `unet` with type `diffusers.models.unets.unet_2d_condition.UNet2DConditionModel` in function `streamdiffusion.acceleration.tensorrt.export_wrappers.unet_controlnet_export.create_controlnet_wrapper`", + "concise_description": "Argument `diffusers.models.unets.unet_2d_condition.UNet2DConditionModel | diffusers.utils.dummy_pt_objects.UNet2DConditionModel` is not assignable to parameter `unet` with type `diffusers.models.unets.unet_2d_condition.UNet2DConditionModel` in function `streamdiffusion.acceleration.tensorrt.export_wrappers.unet_controlnet_export.create_controlnet_wrapper`", + "severity": "error" + }, + { + "line": 211, + "column": 15, + "stop_line": 211, + "stop_column": 24, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\export_wrappers\\unet_unified_export.py", + "code": -2, + "name": "not-callable", + "description": "Expected a callable, got `UNet2DConditionModel`", + "concise_description": "Expected a callable, got `UNet2DConditionModel`", + "severity": "error" + }, + { + "line": 279, + "column": 24, + "stop_line": 279, + "stop_column": 56, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\export_wrappers\\unet_unified_export.py", + "code": -2, + "name": "bad-return", + "description": "Returned type `tuple[Unknown, Unknown, *tuple[Unknown, ...]]` is not assignable to declared return type `Tensor`", + "concise_description": "Returned type `tuple[Unknown, Unknown, *tuple[Unknown, ...]]` is not assignable to declared return type `Tensor`", + "severity": "error" + }, + { + "line": 284, + "column": 20, + "stop_line": 284, + "stop_column": 102, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\export_wrappers\\unet_unified_export.py", + "code": -2, + "name": "bad-return", + "description": "Returned type `tuple[Unknown, Unknown, *tuple[Unknown, ...]] | Unknown` is not assignable to declared return type `Tensor`", + "concise_description": "Returned type `tuple[Unknown, Unknown, *tuple[Unknown, ...]] | Unknown` is not assignable to declared return type `Tensor`", + "severity": "error" + }, + { + "line": 123, + "column": 38, + "stop_line": 123, + "stop_column": 81, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\fp8_quantize.py", + "code": -2, + "name": "bad-context-manager", + "description": "Cannot use `autocast` as a context manager\n Return type `Literal[False] | object | None` of function `autocast.__exit__` is not assignable to expected return type `bool | None`", + "concise_description": "Cannot use `autocast` as a context manager", + "severity": "error" + }, + { + "line": 310, + "column": 38, + "stop_line": 310, + "stop_column": 81, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\fp8_quantize.py", + "code": -2, + "name": "bad-context-manager", + "description": "Cannot use `autocast` as a context manager\n Return type `Literal[False] | object | None` of function `autocast.__exit__` is not assignable to expected return type `bool | None`", + "concise_description": "Cannot use `autocast` as a context manager", + "severity": "error" + }, + { + "line": 117, + "column": 30, + "stop_line": 117, + "stop_column": 102, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\models\\attention_processors.py", + "code": -2, + "name": "bad-assignment", + "description": "`Tensor` is not assignable to variable `attention_mask` with type `FloatTensor | None`", + "concise_description": "`Tensor` is not assignable to variable `attention_mask` with type `FloatTensor | None`", + "severity": "error" + }, + { + "line": 118, + "column": 30, + "stop_line": 118, + "stop_column": 49, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\models\\attention_processors.py", + "code": -2, + "name": "missing-attribute", + "description": "Object of class `NoneType` has no attribute `view`", + "concise_description": "Object of class `NoneType` has no attribute `view`", + "severity": "error" + }, + { + "line": 118, + "column": 78, + "stop_line": 118, + "stop_column": 98, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\models\\attention_processors.py", + "code": -2, + "name": "missing-attribute", + "description": "Object of class `NoneType` has no attribute `shape`", + "concise_description": "Object of class `NoneType` has no attribute `shape`", + "severity": "error" + }, + { + "line": 131, + "column": 37, + "stop_line": 131, + "stop_column": 91, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\models\\attention_processors.py", + "code": -2, + "name": "bad-assignment", + "description": "`Tensor` is not assignable to variable `encoder_hidden_states` with type `FloatTensor | None`", + "concise_description": "`Tensor` is not assignable to variable `encoder_hidden_states` with type `FloatTensor | None`", + "severity": "error" + }, + { + "line": 152, + "column": 41, + "stop_line": 152, + "stop_column": 63, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\models\\attention_processors.py", + "code": -2, + "name": "missing-attribute", + "description": "Object of class `NoneType` has no attribute `transpose`", + "concise_description": "Object of class `NoneType` has no attribute `transpose`", + "severity": "error" + }, + { + "line": 163, + "column": 25, + "stop_line": 165, + "stop_column": 10, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\models\\attention_processors.py", + "code": -2, + "name": "bad-assignment", + "description": "`Tensor` is not assignable to variable `hidden_states` with type `FloatTensor`", + "concise_description": "`Tensor` is not assignable to variable `hidden_states` with type `FloatTensor`", + "severity": "error" + }, + { + "line": 167, + "column": 25, + "stop_line": 167, + "stop_column": 101, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\models\\attention_processors.py", + "code": -2, + "name": "bad-assignment", + "description": "`Tensor` is not assignable to variable `hidden_states` with type `FloatTensor`", + "concise_description": "`Tensor` is not assignable to variable `hidden_states` with type `FloatTensor`", + "severity": "error" + }, + { + "line": 168, + "column": 25, + "stop_line": 168, + "stop_column": 54, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\models\\attention_processors.py", + "code": -2, + "name": "bad-assignment", + "description": "`Tensor` is not assignable to variable `hidden_states` with type `FloatTensor`", + "concise_description": "`Tensor` is not assignable to variable `hidden_states` with type `FloatTensor`", + "severity": "error" + }, + { + "line": 176, + "column": 81, + "stop_line": 176, + "stop_column": 88, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\models\\attention_processors.py", + "code": -2, + "name": "unbound-name", + "description": "`channel` may be uninitialized", + "concise_description": "`channel` may be uninitialized", + "severity": "error" + }, + { + "line": 176, + "column": 90, + "stop_line": 176, + "stop_column": 96, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\models\\attention_processors.py", + "code": -2, + "name": "unbound-name", + "description": "`height` may be uninitialized", + "concise_description": "`height` may be uninitialized", + "severity": "error" + }, + { + "line": 176, + "column": 98, + "stop_line": 176, + "stop_column": 103, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\models\\attention_processors.py", + "code": -2, + "name": "unbound-name", + "description": "`width` may be uninitialized", + "concise_description": "`width` may be uninitialized", + "severity": "error" + }, + { + "line": 186, + "column": 42, + "stop_line": 186, + "stop_column": 50, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\models\\attention_processors.py", + "code": -2, + "name": "unbound-name", + "description": "`curr_key` may be uninitialized", + "concise_description": "`curr_key` may be uninitialized", + "severity": "error" + }, + { + "line": 186, + "column": 65, + "stop_line": 186, + "stop_column": 75, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\models\\attention_processors.py", + "code": -2, + "name": "unbound-name", + "description": "`curr_value` may be uninitialized", + "concise_description": "`curr_value` may be uninitialized", + "severity": "error" + }, + { + "line": 215, + "column": 61, + "stop_line": 215, + "stop_column": 70, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\models\\attention_processors.py", + "code": -2, + "name": "bad-argument-type", + "description": "Argument `Tensor` is not assignable to parameter `threshold` with type `float` in function `get_nn_feats`", + "concise_description": "Argument `Tensor` is not assignable to parameter `threshold` with type `float` in function `get_nn_feats`", + "severity": "error" + }, + { + "line": 38, + "column": 9, + "stop_line": 38, + "stop_column": 24, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\models\\controlnet_models.py", + "code": -2, + "name": "bad-override", + "description": "Class member `ControlNetTRT.get_input_names` overrides parent class `BaseModel` in an inconsistent manner\n `ControlNetTRT.get_input_names` has type `(self: ControlNetTRT) -> list[str]`, which is not assignable to `(self: ControlNetTRT) -> None`, the type of `BaseModel.get_input_names`\n Signature mismatch:\n expected: def get_input_names(self: ControlNetTRT) -> None: ...\n ^^^^ return type\n found: def get_input_names(self: ControlNetTRT) -> list[str]: ...\n ^^^^^^^^^ return type", + "concise_description": "Class member `ControlNetTRT.get_input_names` overrides parent class `BaseModel` in an inconsistent manner", + "severity": "error" + }, + { + "line": 42, + "column": 9, + "stop_line": 42, + "stop_column": 25, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\models\\controlnet_models.py", + "code": -2, + "name": "bad-override", + "description": "Class member `ControlNetTRT.get_output_names` overrides parent class `BaseModel` in an inconsistent manner\n `ControlNetTRT.get_output_names` has type `(self: ControlNetTRT) -> list[str]`, which is not assignable to `(self: ControlNetTRT) -> None`, the type of `BaseModel.get_output_names`\n Signature mismatch:\n expected: def get_output_names(self: ControlNetTRT) -> None: ...\n ^^^^ return type\n found: def get_output_names(self: ControlNetTRT) -> list[str]: ...\n ^^^^^^^^^ return type", + "concise_description": "Class member `ControlNetTRT.get_output_names` overrides parent class `BaseModel` in an inconsistent manner", + "severity": "error" + }, + { + "line": 47, + "column": 9, + "stop_line": 47, + "stop_column": 25, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\models\\controlnet_models.py", + "code": -2, + "name": "bad-override", + "description": "Class member `ControlNetTRT.get_dynamic_axes` overrides parent class `BaseModel` in an inconsistent manner\n `ControlNetTRT.get_dynamic_axes` has type `(self: ControlNetTRT) -> dict[str, dict[int, str]]`, which is not assignable to `(self: ControlNetTRT) -> None`, the type of `BaseModel.get_dynamic_axes`\n Signature mismatch:\n expected: def get_dynamic_axes(self: ControlNetTRT) -> None: ...\n ^^^^ return type\n found: def get_dynamic_axes(self: ControlNetTRT) -> dict[str, dict[int, str]]: ...\n ^^^^^^^^^^^^^^^^^^^^^^^^^ return type", + "concise_description": "Class member `ControlNetTRT.get_dynamic_axes` overrides parent class `BaseModel` in an inconsistent manner", + "severity": "error" + }, + { + "line": 58, + "column": 9, + "stop_line": 58, + "stop_column": 26, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\models\\controlnet_models.py", + "code": -2, + "name": "bad-override", + "description": "Class member `ControlNetTRT.get_input_profile` overrides parent class `BaseModel` in an inconsistent manner\n `ControlNetTRT.get_input_profile` has type `(self: ControlNetTRT, batch_size: Unknown, image_height: Unknown, image_width: Unknown, static_batch: Unknown, static_shape: Unknown) -> dict[str, list[tuple[int | Unknown] | tuple[Unknown]] | list[tuple[int | Unknown, int, int | Unknown] | tuple[Unknown, int, int | Unknown]] | list[tuple[int | Unknown, int, int | Unknown, int | Unknown] | tuple[Unknown, int, int | Unknown, int | Unknown]]]`, which is not assignable to `(self: ControlNetTRT, batch_size: Unknown, image_height: Unknown, image_width: Unknown, static_batch: Unknown, static_shape: Unknown) -> None`, the type of `BaseModel.get_input_profile`\n Signature mismatch:\n ...-> None: ...\n ^^^^ return type\n ...-> dict[str, list[tuple[int | Unknown] | tuple[Unknown]] | list[tuple[int | Unknown, int, int | Unknown] | tuple[Unknown, int, int | Unknown]] | list[tuple[int | Unknown, int, int | Unknown, int | Unknown] | tuple[Unknown, int, int | Unknown, int | Unknown]]]: ...\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ return type", + "concise_description": "Class member `ControlNetTRT.get_input_profile` overrides parent class `BaseModel` in an inconsistent manner", + "severity": "error" + }, + { + "line": 105, + "column": 9, + "stop_line": 105, + "stop_column": 25, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\models\\controlnet_models.py", + "code": -2, + "name": "bad-override", + "description": "Class member `ControlNetTRT.get_sample_input` overrides parent class `BaseModel` in an inconsistent manner\n `ControlNetTRT.get_sample_input` has type `(self: ControlNetTRT, batch_size: Unknown, image_height: Unknown, image_width: Unknown) -> tuple[Tensor, Tensor, Tensor, Tensor]`, which is not assignable to `(self: ControlNetTRT, batch_size: Unknown, image_height: Unknown, image_width: Unknown) -> None`, the type of `BaseModel.get_sample_input`\n Signature mismatch:\n ...ight: Unknown, image_width: Unknown) -> None: ...\n ^^^^ return type\n ...ight: Unknown, image_width: Unknown) -> tuple[Tensor, Tensor, Tensor, Tensor]: ...\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ return type", + "concise_description": "Class member `ControlNetTRT.get_sample_input` overrides parent class `BaseModel` in an inconsistent manner", + "severity": "error" + }, + { + "line": 181, + "column": 9, + "stop_line": 181, + "stop_column": 42, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\models\\controlnet_models.py", + "code": -2, + "name": "unsupported-operation", + "description": "Cannot set item in `None`\n Object of class `NoneType` has no attribute `__setitem__`", + "concise_description": "Cannot set item in `None`", + "severity": "error" + }, + { + "line": 207, + "column": 9, + "stop_line": 207, + "stop_column": 27, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\models\\controlnet_models.py", + "code": -2, + "name": "missing-attribute", + "description": "Object of class `NoneType` has no attribute `update`", + "concise_description": "Object of class `NoneType` has no attribute `update`", + "severity": "error" + }, + { + "line": 210, + "column": 9, + "stop_line": 210, + "stop_column": 25, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\models\\controlnet_models.py", + "code": -2, + "name": "bad-override", + "description": "Class member `ControlNetSDXLTRT.get_sample_input` overrides parent class `ControlNetTRT` in an inconsistent manner\n `ControlNetSDXLTRT.get_sample_input` has type `(self: ControlNetSDXLTRT, batch_size: Unknown, image_height: Unknown, image_width: Unknown) -> tuple[Tensor, Tensor, Tensor, Tensor, Tensor, Tensor, Tensor]`, which is not assignable to `(self: ControlNetSDXLTRT, batch_size: Unknown, image_height: Unknown, image_width: Unknown) -> tuple[Tensor, Tensor, Tensor, Tensor]`, the type of `ControlNetTRT.get_sample_input`\n Signature mismatch:\n ...nknown) -> tuple[Tensor, Tensor, Tensor, Tensor]: ...\n ^ return type\n ...nknown) -> tuple[Tensor, Tensor, Tensor, Tensor, Tensor, Tensor, Tensor]: ...\n ^^^^^^^^^^^^^^^^^^^^^^^^ return type", + "concise_description": "Class member `ControlNetSDXLTRT.get_sample_input` overrides parent class `ControlNetTRT` in an inconsistent manner", + "severity": "error" + }, + { + "line": 291, + "column": 34, + "stop_line": 295, + "stop_column": 10, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\models\\controlnet_models.py", + "code": -2, + "name": "bad-typed-dict-key", + "description": "`list[tuple[int | Unknown, int] | tuple[Unknown, int]]` is not assignable to TypedDict key `text_embeds` with type `list[tuple[int | Unknown] | tuple[Unknown]] | list[tuple[int | Unknown, int, int | Unknown] | tuple[Unknown, int, int | Unknown]] | list[tuple[int | Unknown, int, int | Unknown, int | Unknown] | tuple[Unknown, int, int | Unknown, int | Unknown]]`", + "concise_description": "`list[tuple[int | Unknown, int] | tuple[Unknown, int]]` is not assignable to TypedDict key `text_embeds` with type `list[tuple[int | Unknown] | tuple[Unknown]] | list[tuple[int | Unknown, int, int | Unknown] | tuple[Unknown, int, int | Unknown]] | list[tuple[int | Unknown, int, int | Unknown, int | Unknown] | tuple[Unknown, int, int | Unknown, int | Unknown]]`", + "severity": "error" + }, + { + "line": 298, + "column": 31, + "stop_line": 302, + "stop_column": 10, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\models\\controlnet_models.py", + "code": -2, + "name": "bad-typed-dict-key", + "description": "`list[tuple[int | Unknown, int] | tuple[Unknown, int]]` is not assignable to TypedDict key `time_ids` with type `list[tuple[int | Unknown] | tuple[Unknown]] | list[tuple[int | Unknown, int, int | Unknown] | tuple[Unknown, int, int | Unknown]] | list[tuple[int | Unknown, int, int | Unknown, int | Unknown] | tuple[Unknown, int, int | Unknown, int | Unknown]]`", + "concise_description": "`list[tuple[int | Unknown, int] | tuple[Unknown, int]]` is not assignable to TypedDict key `time_ids` with type `list[tuple[int | Unknown] | tuple[Unknown]] | list[tuple[int | Unknown, int, int | Unknown] | tuple[Unknown, int, int | Unknown]] | list[tuple[int | Unknown, int, int | Unknown, int | Unknown] | tuple[Unknown, int, int | Unknown, int | Unknown]]`", + "severity": "error" + }, + { + "line": 29, + "column": 44, + "stop_line": 29, + "stop_column": 58, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\models\\models.py", + "code": -2, + "name": "missing-module-attribute", + "description": "Could not import `fold_constants` from `polygraphy.backend.onnx.loader`", + "concise_description": "Could not import `fold_constants` from `polygraphy.backend.onnx.loader`", + "severity": "error" + }, + { + "line": 282, + "column": 9, + "stop_line": 282, + "stop_column": 24, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\models\\models.py", + "code": -2, + "name": "bad-override", + "description": "Class member `CLIP.get_input_names` overrides parent class `BaseModel` in an inconsistent manner\n `CLIP.get_input_names` has type `(self: CLIP) -> list[str]`, which is not assignable to `(self: CLIP) -> None`, the type of `BaseModel.get_input_names`\n Signature mismatch:\n expected: def get_input_names(self: CLIP) -> None: ...\n ^^^^ return type\n found: def get_input_names(self: CLIP) -> list[str]: ...\n ^^^^^^^^^ return type", + "concise_description": "Class member `CLIP.get_input_names` overrides parent class `BaseModel` in an inconsistent manner", + "severity": "error" + }, + { + "line": 285, + "column": 9, + "stop_line": 285, + "stop_column": 25, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\models\\models.py", + "code": -2, + "name": "bad-override", + "description": "Class member `CLIP.get_output_names` overrides parent class `BaseModel` in an inconsistent manner\n `CLIP.get_output_names` has type `(self: CLIP) -> list[str]`, which is not assignable to `(self: CLIP) -> None`, the type of `BaseModel.get_output_names`\n Signature mismatch:\n expected: def get_output_names(self: CLIP) -> None: ...\n ^^^^ return type\n found: def get_output_names(self: CLIP) -> list[str]: ...\n ^^^^^^^^^ return type", + "concise_description": "Class member `CLIP.get_output_names` overrides parent class `BaseModel` in an inconsistent manner", + "severity": "error" + }, + { + "line": 288, + "column": 9, + "stop_line": 288, + "stop_column": 25, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\models\\models.py", + "code": -2, + "name": "bad-override", + "description": "Class member `CLIP.get_dynamic_axes` overrides parent class `BaseModel` in an inconsistent manner\n `CLIP.get_dynamic_axes` has type `(self: CLIP) -> dict[str, dict[int, str]]`, which is not assignable to `(self: CLIP) -> None`, the type of `BaseModel.get_dynamic_axes`\n Signature mismatch:\n expected: def get_dynamic_axes(self: CLIP) -> None: ...\n ^^^^ return type\n found: def get_dynamic_axes(self: CLIP) -> dict[str, dict[int, str]]: ...\n ^^^^^^^^^^^^^^^^^^^^^^^^^ return type", + "concise_description": "Class member `CLIP.get_dynamic_axes` overrides parent class `BaseModel` in an inconsistent manner", + "severity": "error" + }, + { + "line": 291, + "column": 9, + "stop_line": 291, + "stop_column": 26, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\models\\models.py", + "code": -2, + "name": "bad-override", + "description": "Class member `CLIP.get_input_profile` overrides parent class `BaseModel` in an inconsistent manner\n `CLIP.get_input_profile` has type `(self: CLIP, batch_size: Unknown, image_height: Unknown, image_width: Unknown, static_batch: Unknown, static_shape: Unknown) -> dict[str, list[tuple[int | Unknown, int | Unknown] | tuple[Unknown, int | Unknown]]]`, which is not assignable to `(self: CLIP, batch_size: Unknown, image_height: Unknown, image_width: Unknown, static_batch: Unknown, static_shape: Unknown) -> None`, the type of `BaseModel.get_input_profile`\n Signature mismatch:\n ...ape: Unknown) -> None: ...\n ^^^^ return type\n ...ape: Unknown) -> dict[str, list[tuple[int | Unknown, int | Unknown] | tuple[Unknown, int | Unknown]]]: ...\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ return type", + "concise_description": "Class member `CLIP.get_input_profile` overrides parent class `BaseModel` in an inconsistent manner", + "severity": "error" + }, + { + "line": 304, + "column": 9, + "stop_line": 304, + "stop_column": 23, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\models\\models.py", + "code": -2, + "name": "bad-override", + "description": "Class member `CLIP.get_shape_dict` overrides parent class `BaseModel` in an inconsistent manner\n `CLIP.get_shape_dict` has type `(self: CLIP, batch_size: Unknown, image_height: Unknown, image_width: Unknown) -> dict[str, tuple[Unknown, int | Unknown] | tuple[Unknown, int | Unknown, int | Unknown]]`, which is not assignable to `(self: CLIP, batch_size: Unknown, image_height: Unknown, image_width: Unknown) -> None`, the type of `BaseModel.get_shape_dict`\n Signature mismatch:\n ...h: Unknown) -> None: ...\n ^^^^ return type\n ...h: Unknown) -> dict[str, tuple[Unknown, int | Unknown] | tuple[Unknown, int | Unknown, int | Unknown]]: ...\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ return type", + "concise_description": "Class member `CLIP.get_shape_dict` overrides parent class `BaseModel` in an inconsistent manner", + "severity": "error" + }, + { + "line": 311, + "column": 9, + "stop_line": 311, + "stop_column": 25, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\models\\models.py", + "code": -2, + "name": "bad-override", + "description": "Class member `CLIP.get_sample_input` overrides parent class `BaseModel` in an inconsistent manner\n `CLIP.get_sample_input` has type `(self: CLIP, batch_size: Unknown, image_height: Unknown, image_width: Unknown) -> Tensor`, which is not assignable to `(self: CLIP, batch_size: Unknown, image_height: Unknown, image_width: Unknown) -> None`, the type of `BaseModel.get_sample_input`\n Signature mismatch:\n expected: def get_sample_input(self: CLIP, batch_size: Unknown, image_height: Unknown, image_width: Unknown) -> None: ...\n ^^^^ return type\n found: def get_sample_input(self: CLIP, batch_size: Unknown, image_height: Unknown, image_width: Unknown) -> Tensor: ...\n ^^^^^^ return type", + "concise_description": "Class member `CLIP.get_sample_input` overrides parent class `BaseModel` in an inconsistent manner", + "severity": "error" + }, + { + "line": 341, + "column": 9, + "stop_line": 341, + "stop_column": 24, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\models\\models.py", + "code": -2, + "name": "bad-override", + "description": "Class member `SafetyChecker.get_input_names` overrides parent class `BaseModel` in an inconsistent manner\n `SafetyChecker.get_input_names` has type `(self: SafetyChecker) -> list[str]`, which is not assignable to `(self: SafetyChecker) -> None`, the type of `BaseModel.get_input_names`\n Signature mismatch:\n expected: def get_input_names(self: SafetyChecker) -> None: ...\n ^^^^ return type\n found: def get_input_names(self: SafetyChecker) -> list[str]: ...\n ^^^^^^^^^ return type", + "concise_description": "Class member `SafetyChecker.get_input_names` overrides parent class `BaseModel` in an inconsistent manner", + "severity": "error" + }, + { + "line": 344, + "column": 9, + "stop_line": 344, + "stop_column": 25, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\models\\models.py", + "code": -2, + "name": "bad-override", + "description": "Class member `SafetyChecker.get_output_names` overrides parent class `BaseModel` in an inconsistent manner\n `SafetyChecker.get_output_names` has type `(self: SafetyChecker) -> list[str]`, which is not assignable to `(self: SafetyChecker) -> None`, the type of `BaseModel.get_output_names`\n Signature mismatch:\n expected: def get_output_names(self: SafetyChecker) -> None: ...\n ^^^^ return type\n found: def get_output_names(self: SafetyChecker) -> list[str]: ...\n ^^^^^^^^^ return type", + "concise_description": "Class member `SafetyChecker.get_output_names` overrides parent class `BaseModel` in an inconsistent manner", + "severity": "error" + }, + { + "line": 347, + "column": 9, + "stop_line": 347, + "stop_column": 25, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\models\\models.py", + "code": -2, + "name": "bad-override", + "description": "Class member `SafetyChecker.get_dynamic_axes` overrides parent class `BaseModel` in an inconsistent manner\n `SafetyChecker.get_dynamic_axes` has type `(self: SafetyChecker) -> dict[str, dict[int, str]]`, which is not assignable to `(self: SafetyChecker) -> None`, the type of `BaseModel.get_dynamic_axes`\n Signature mismatch:\n expected: def get_dynamic_axes(self: SafetyChecker) -> None: ...\n ^^^^ return type\n found: def get_dynamic_axes(self: SafetyChecker) -> dict[str, dict[int, str]]: ...\n ^^^^^^^^^^^^^^^^^^^^^^^^^ return type", + "concise_description": "Class member `SafetyChecker.get_dynamic_axes` overrides parent class `BaseModel` in an inconsistent manner", + "severity": "error" + }, + { + "line": 350, + "column": 9, + "stop_line": 350, + "stop_column": 26, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\models\\models.py", + "code": -2, + "name": "bad-override", + "description": "Class member `SafetyChecker.get_input_profile` overrides parent class `BaseModel` in an inconsistent manner\n `SafetyChecker.get_input_profile` has type `(self: SafetyChecker, batch_size: Unknown, *args: Unknown, **kwargs: Unknown) -> dict[str, list[tuple[int | Unknown, int, int, int] | tuple[Unknown, int, int, int]]]`, which is not assignable to `(self: SafetyChecker, batch_size: Unknown, image_height: Unknown, image_width: Unknown, static_batch: Unknown, static_shape: Unknown) -> None`, the type of `BaseModel.get_input_profile`\n Signature mismatch:\n ...n, image_height: Unknown, image_width: Unknown, static_batch: Unknown, static_shape: Unknown) -> None: ...\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ parameters ^^^^ return type\n ...n, *args: Unknown, **kwargs: Unknown) -> dict[str, list[tuple[int | Unknown, int, int, int] | tuple[Unknown, int, int, int]]]: ...\n ^^^^^^^^^^^^^^^^^^^^^^^^ parameters ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ return type", + "concise_description": "Class member `SafetyChecker.get_input_profile` overrides parent class `BaseModel` in an inconsistent manner", + "severity": "error" + }, + { + "line": 359, + "column": 9, + "stop_line": 359, + "stop_column": 23, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\models\\models.py", + "code": -2, + "name": "bad-override", + "description": "Class member `SafetyChecker.get_shape_dict` overrides parent class `BaseModel` in an inconsistent manner\n `SafetyChecker.get_shape_dict` has type `(self: SafetyChecker, batch_size: Unknown, *args: Unknown, **kwargs: Unknown) -> dict[str, tuple[Unknown] | tuple[Unknown, int, int, int]]`, which is not assignable to `(self: SafetyChecker, batch_size: Unknown, image_height: Unknown, image_width: Unknown) -> None`, the type of `BaseModel.get_shape_dict`\n Signature mismatch:\n ...: Unknown, image_height: Unknown, image_width: Unknown) -> None: ...\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ parameters ^^^^ return type\n ...: Unknown, *args: Unknown, **kwargs: Unknown) -> dict[str, tuple[Unknown] | tuple[Unknown, int, int, int]]: ...\n ^^^^^^^^^^^^^^^^^^^^^^^^ parameters ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ return type", + "concise_description": "Class member `SafetyChecker.get_shape_dict` overrides parent class `BaseModel` in an inconsistent manner", + "severity": "error" + }, + { + "line": 365, + "column": 9, + "stop_line": 365, + "stop_column": 25, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\models\\models.py", + "code": -2, + "name": "bad-override", + "description": "Class member `SafetyChecker.get_sample_input` overrides parent class `BaseModel` in an inconsistent manner\n `SafetyChecker.get_sample_input` has type `(self: SafetyChecker, batch_size: Unknown, *args: Unknown, **kwargs: Unknown) -> tuple[Tensor]`, which is not assignable to `(self: SafetyChecker, batch_size: Unknown, image_height: Unknown, image_width: Unknown) -> None`, the type of `BaseModel.get_sample_input`\n Signature mismatch:\n expected: def get_sample_input(self: SafetyChecker, batch_size: Unknown, image_height: Unknown, image_width: Unknown) -> None: ...\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ parameters ^^^^ return type\n found: def get_sample_input(self: SafetyChecker, batch_size: Unknown, *args: Unknown, **kwargs: Unknown) -> tuple[Tensor]: ...\n ^^^^^^^^^^^^^^^^^^^^^^^^ parameters ^^^^^^^^^^^^^ return type", + "concise_description": "Class member `SafetyChecker.get_sample_input` overrides parent class `BaseModel` in an inconsistent manner", + "severity": "error" + }, + { + "line": 378, + "column": 9, + "stop_line": 378, + "stop_column": 24, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\models\\models.py", + "code": -2, + "name": "bad-override", + "description": "Class member `NSFWDetector.get_input_names` overrides parent class `BaseModel` in an inconsistent manner\n `NSFWDetector.get_input_names` has type `(self: NSFWDetector) -> list[str]`, which is not assignable to `(self: NSFWDetector) -> None`, the type of `BaseModel.get_input_names`\n Signature mismatch:\n expected: def get_input_names(self: NSFWDetector) -> None: ...\n ^^^^ return type\n found: def get_input_names(self: NSFWDetector) -> list[str]: ...\n ^^^^^^^^^ return type", + "concise_description": "Class member `NSFWDetector.get_input_names` overrides parent class `BaseModel` in an inconsistent manner", + "severity": "error" + }, + { + "line": 381, + "column": 9, + "stop_line": 381, + "stop_column": 25, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\models\\models.py", + "code": -2, + "name": "bad-override", + "description": "Class member `NSFWDetector.get_output_names` overrides parent class `BaseModel` in an inconsistent manner\n `NSFWDetector.get_output_names` has type `(self: NSFWDetector) -> list[str]`, which is not assignable to `(self: NSFWDetector) -> None`, the type of `BaseModel.get_output_names`\n Signature mismatch:\n expected: def get_output_names(self: NSFWDetector) -> None: ...\n ^^^^ return type\n found: def get_output_names(self: NSFWDetector) -> list[str]: ...\n ^^^^^^^^^ return type", + "concise_description": "Class member `NSFWDetector.get_output_names` overrides parent class `BaseModel` in an inconsistent manner", + "severity": "error" + }, + { + "line": 384, + "column": 9, + "stop_line": 384, + "stop_column": 25, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\models\\models.py", + "code": -2, + "name": "bad-override", + "description": "Class member `NSFWDetector.get_dynamic_axes` overrides parent class `BaseModel` in an inconsistent manner\n `NSFWDetector.get_dynamic_axes` has type `(self: NSFWDetector) -> dict[str, dict[int, str]]`, which is not assignable to `(self: NSFWDetector) -> None`, the type of `BaseModel.get_dynamic_axes`\n Signature mismatch:\n expected: def get_dynamic_axes(self: NSFWDetector) -> None: ...\n ^^^^ return type\n found: def get_dynamic_axes(self: NSFWDetector) -> dict[str, dict[int, str]]: ...\n ^^^^^^^^^^^^^^^^^^^^^^^^^ return type", + "concise_description": "Class member `NSFWDetector.get_dynamic_axes` overrides parent class `BaseModel` in an inconsistent manner", + "severity": "error" + }, + { + "line": 387, + "column": 9, + "stop_line": 387, + "stop_column": 26, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\models\\models.py", + "code": -2, + "name": "bad-override", + "description": "Class member `NSFWDetector.get_input_profile` overrides parent class `BaseModel` in an inconsistent manner\n `NSFWDetector.get_input_profile` has type `(self: NSFWDetector, batch_size: Unknown, *args: Unknown, **kwargs: Unknown) -> dict[str, list[tuple[int | Unknown, int, int, int] | tuple[Unknown, int, int, int]]]`, which is not assignable to `(self: NSFWDetector, batch_size: Unknown, image_height: Unknown, image_width: Unknown, static_batch: Unknown, static_shape: Unknown) -> None`, the type of `BaseModel.get_input_profile`\n Signature mismatch:\n ...n, image_height: Unknown, image_width: Unknown, static_batch: Unknown, static_shape: Unknown) -> None: ...\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ parameters ^^^^ return type\n ...n, *args: Unknown, **kwargs: Unknown) -> dict[str, list[tuple[int | Unknown, int, int, int] | tuple[Unknown, int, int, int]]]: ...\n ^^^^^^^^^^^^^^^^^^^^^^^^ parameters ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ return type", + "concise_description": "Class member `NSFWDetector.get_input_profile` overrides parent class `BaseModel` in an inconsistent manner", + "severity": "error" + }, + { + "line": 396, + "column": 9, + "stop_line": 396, + "stop_column": 23, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\models\\models.py", + "code": -2, + "name": "bad-override", + "description": "Class member `NSFWDetector.get_shape_dict` overrides parent class `BaseModel` in an inconsistent manner\n `NSFWDetector.get_shape_dict` has type `(self: NSFWDetector, batch_size: Unknown, *args: Unknown, **kwargs: Unknown) -> dict[str, tuple[Unknown, int] | tuple[Unknown, int, int, int]]`, which is not assignable to `(self: NSFWDetector, batch_size: Unknown, image_height: Unknown, image_width: Unknown) -> None`, the type of `BaseModel.get_shape_dict`\n Signature mismatch:\n ...Unknown, image_height: Unknown, image_width: Unknown) -> None: ...\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ parameters ^^^^ return type\n ...Unknown, *args: Unknown, **kwargs: Unknown) -> dict[str, tuple[Unknown, int] | tuple[Unknown, int, int, int]]: ...\n ^^^^^^^^^^^^^^^^^^^^^^^^ parameters ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ return type", + "concise_description": "Class member `NSFWDetector.get_shape_dict` overrides parent class `BaseModel` in an inconsistent manner", + "severity": "error" + }, + { + "line": 402, + "column": 9, + "stop_line": 402, + "stop_column": 25, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\models\\models.py", + "code": -2, + "name": "bad-override", + "description": "Class member `NSFWDetector.get_sample_input` overrides parent class `BaseModel` in an inconsistent manner\n `NSFWDetector.get_sample_input` has type `(self: NSFWDetector, batch_size: Unknown, *args: Unknown, **kwargs: Unknown) -> tuple[Tensor]`, which is not assignable to `(self: NSFWDetector, batch_size: Unknown, image_height: Unknown, image_width: Unknown) -> None`, the type of `BaseModel.get_sample_input`\n Signature mismatch:\n expected: def get_sample_input(self: NSFWDetector, batch_size: Unknown, image_height: Unknown, image_width: Unknown) -> None: ...\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ parameters ^^^^ return type\n found: def get_sample_input(self: NSFWDetector, batch_size: Unknown, *args: Unknown, **kwargs: Unknown) -> tuple[Tensor]: ...\n ^^^^^^^^^^^^^^^^^^^^^^^^ parameters ^^^^^^^^^^^^^ return type", + "concise_description": "Class member `NSFWDetector.get_sample_input` overrides parent class `BaseModel` in an inconsistent manner", + "severity": "error" + }, + { + "line": 409, + "column": 38, + "stop_line": 409, + "stop_column": 42, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\models\\models.py", + "code": -2, + "name": "bad-function-definition", + "description": "Default `None` is not assignable to parameter `unet` with type `UNet2DConditionModel`", + "concise_description": "Default `None` is not assignable to parameter `unet` with type `UNet2DConditionModel`", + "severity": "error" + }, + { + "line": 423, + "column": 30, + "stop_line": 423, + "stop_column": 34, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\models\\models.py", + "code": -2, + "name": "bad-function-definition", + "description": "Default `None` is not assignable to parameter `num_ip_layers` with type `int`", + "concise_description": "Default `None` is not assignable to parameter `num_ip_layers` with type `int`", + "severity": "error" + }, + { + "line": 622, + "column": 9, + "stop_line": 622, + "stop_column": 24, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\models\\models.py", + "code": -2, + "name": "bad-override", + "description": "Class member `UNet.get_input_names` overrides parent class `BaseModel` in an inconsistent manner\n `UNet.get_input_names` has type `(self: UNet) -> list[str]`, which is not assignable to `(self: UNet) -> None`, the type of `BaseModel.get_input_names`\n Signature mismatch:\n expected: def get_input_names(self: UNet) -> None: ...\n ^^^^ return type\n found: def get_input_names(self: UNet) -> list[str]: ...\n ^^^^^^^^^ return type", + "concise_description": "Class member `UNet.get_input_names` overrides parent class `BaseModel` in an inconsistent manner", + "severity": "error" + }, + { + "line": 644, + "column": 9, + "stop_line": 644, + "stop_column": 25, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\models\\models.py", + "code": -2, + "name": "bad-override", + "description": "Class member `UNet.get_output_names` overrides parent class `BaseModel` in an inconsistent manner\n `UNet.get_output_names` has type `(self: UNet) -> list[str]`, which is not assignable to `(self: UNet) -> None`, the type of `BaseModel.get_output_names`\n Signature mismatch:\n expected: def get_output_names(self: UNet) -> None: ...\n ^^^^ return type\n found: def get_output_names(self: UNet) -> list[str]: ...\n ^^^^^^^^^ return type", + "concise_description": "Class member `UNet.get_output_names` overrides parent class `BaseModel` in an inconsistent manner", + "severity": "error" + }, + { + "line": 665, + "column": 9, + "stop_line": 665, + "stop_column": 25, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\models\\models.py", + "code": -2, + "name": "bad-override", + "description": "Class member `UNet.get_dynamic_axes` overrides parent class `BaseModel` in an inconsistent manner\n `UNet.get_dynamic_axes` has type `(self: UNet) -> dict[str, dict[int, str]]`, which is not assignable to `(self: UNet) -> None`, the type of `BaseModel.get_dynamic_axes`\n Signature mismatch:\n expected: def get_dynamic_axes(self: UNet) -> None: ...\n ^^^^ return type\n found: def get_dynamic_axes(self: UNet) -> dict[str, dict[int, str]]: ...\n ^^^^^^^^^^^^^^^^^^^^^^^^^ return type", + "concise_description": "Class member `UNet.get_dynamic_axes` overrides parent class `BaseModel` in an inconsistent manner", + "severity": "error" + }, + { + "line": 707, + "column": 9, + "stop_line": 707, + "stop_column": 26, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\models\\models.py", + "code": -2, + "name": "bad-override", + "description": "Class member `UNet.get_input_profile` overrides parent class `BaseModel` in an inconsistent manner\n `UNet.get_input_profile` has type `(self: UNet, batch_size: Unknown, image_height: Unknown, image_width: Unknown, static_batch: Unknown, static_shape: Unknown) -> dict[str, list[tuple[int | Unknown] | tuple[Unknown]] | list[tuple[int | Unknown, int | Unknown, int | Unknown] | tuple[Unknown, int | Unknown, int | Unknown]] | list[tuple[int | Unknown, int | Unknown, int | Unknown, int | Unknown] | tuple[Unknown, int | Unknown, int | Unknown, int | Unknown]]]`, which is not assignable to `(self: UNet, batch_size: Unknown, image_height: Unknown, image_width: Unknown, static_batch: Unknown, static_shape: Unknown) -> None`, the type of `BaseModel.get_input_profile`\n Signature mismatch:\n ...-> None: ...\n ^^^^ return type\n ...-> dict[str, list[tuple[int | Unknown] | tuple[Unknown]] | list[tuple[int | Unknown, int | Unknown, int | Unknown] | tuple[Unknown, int | Unknown, int | Unknown]] | list[tuple[int | Unknown, int | Unknown, int | Unknown, int | Unknown] | tuple[Unknown, int | Unknown, int | Unknown, int | Unknown]]]: ...\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ return type", + "concise_description": "Class member `UNet.get_input_profile` overrides parent class `BaseModel` in an inconsistent manner", + "severity": "error" + }, + { + "line": 814, + "column": 33, + "stop_line": 814, + "stop_column": 41, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\models\\models.py", + "code": -2, + "name": "unsupported-operation", + "description": "Cannot set item in `dict[str, list[tuple[int | Unknown] | tuple[Unknown]] | list[tuple[int | Unknown, int | Unknown, int | Unknown] | tuple[Unknown, int | Unknown, int | Unknown]] | list[tuple[int | Unknown, int | Unknown, int | Unknown, int | Unknown] | tuple[Unknown, int | Unknown, int | Unknown, int | Unknown]]]`\n Argument `list[tuple[Unknown, Unknown, Unknown, Unknown, Unknown]]` is not assignable to parameter `value` with type `list[tuple[int | Unknown] | tuple[Unknown]] | list[tuple[int | Unknown, int | Unknown, int | Unknown] | tuple[Unknown, int | Unknown, int | Unknown]] | list[tuple[int | Unknown, int | Unknown, int | Unknown, int | Unknown] | tuple[Unknown, int | Unknown, int | Unknown, int | Unknown]]` in function `dict.__setitem__`", + "concise_description": "Cannot set item in `dict[str, list[tuple[int | Unknown] | tuple[Unknown]] | list[tuple[int | Unknown, int | Unknown, int | Unknown] | tuple[Unknown, int | Unknown, int | Unknown]] | list[tuple[int | Unknown, int | Unknown, int | Unknown, int | Unknown] | tuple[Unknown, int | Unknown, int | Unknown, int | Unknown]]]`", + "severity": "error" + }, + { + "line": 827, + "column": 9, + "stop_line": 827, + "stop_column": 23, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\models\\models.py", + "code": -2, + "name": "bad-override", + "description": "Class member `UNet.get_shape_dict` overrides parent class `BaseModel` in an inconsistent manner\n `UNet.get_shape_dict` has type `(self: UNet, batch_size: Unknown, image_height: Unknown, image_width: Unknown) -> dict[str, tuple[Unknown] | tuple[Unknown, int | Unknown, int | Unknown] | tuple[Unknown, int | Unknown, Unknown, Unknown] | tuple[Unknown, int, Unknown, Unknown]]`, which is not assignable to `(self: UNet, batch_size: Unknown, image_height: Unknown, image_width: Unknown) -> None`, the type of `BaseModel.get_shape_dict`\n Signature mismatch:\n ...-> None: ...\n ^^^^ return type\n ...-> dict[str, tuple[Unknown] | tuple[Unknown, int | Unknown, int | Unknown] | tuple[Unknown, int | Unknown, Unknown, Unknown] | tuple[Unknown, int, Unknown, Unknown]]: ...\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ return type", + "concise_description": "Class member `UNet.get_shape_dict` overrides parent class `BaseModel` in an inconsistent manner", + "severity": "error" + }, + { + "line": 856, + "column": 39, + "stop_line": 856, + "stop_column": 96, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\models\\models.py", + "code": -2, + "name": "unsupported-operation", + "description": "Cannot set item in `dict[str, tuple[Unknown] | tuple[Unknown, int | Unknown, int | Unknown] | tuple[Unknown, int | Unknown, Unknown, Unknown] | tuple[Unknown, int, Unknown, Unknown]]`\n Argument `tuple[Literal[2], int, Unknown, Unknown, Unknown]` is not assignable to parameter `value` with type `tuple[Unknown] | tuple[Unknown, int | Unknown, int | Unknown] | tuple[Unknown, int | Unknown, Unknown, Unknown] | tuple[Unknown, int, Unknown, Unknown]` in function `dict.__setitem__`", + "concise_description": "Cannot set item in `dict[str, tuple[Unknown] | tuple[Unknown, int | Unknown, int | Unknown] | tuple[Unknown, int | Unknown, Unknown, Unknown] | tuple[Unknown, int, Unknown, Unknown]]`", + "severity": "error" + }, + { + "line": 857, + "column": 40, + "stop_line": 857, + "stop_column": 78, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\models\\models.py", + "code": -2, + "name": "unsupported-operation", + "description": "Cannot set item in `dict[str, tuple[Unknown] | tuple[Unknown, int | Unknown, int | Unknown] | tuple[Unknown, int | Unknown, Unknown, Unknown] | tuple[Unknown, int, Unknown, Unknown]]`\n Argument `tuple[Literal[2], Literal[1], Unknown, Unknown, Unknown]` is not assignable to parameter `value` with type `tuple[Unknown] | tuple[Unknown, int | Unknown, int | Unknown] | tuple[Unknown, int | Unknown, Unknown, Unknown] | tuple[Unknown, int, Unknown, Unknown]` in function `dict.__setitem__`", + "concise_description": "Cannot set item in `dict[str, tuple[Unknown] | tuple[Unknown, int | Unknown, int | Unknown] | tuple[Unknown, int | Unknown, Unknown, Unknown] | tuple[Unknown, int, Unknown, Unknown]]`", + "severity": "error" + }, + { + "line": 871, + "column": 9, + "stop_line": 871, + "stop_column": 25, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\models\\models.py", + "code": -2, + "name": "bad-override", + "description": "Class member `UNet.get_sample_input` overrides parent class `BaseModel` in an inconsistent manner\n `UNet.get_sample_input` has type `(self: UNet, batch_size: Unknown, image_height: Unknown, image_width: Unknown) -> tuple[Tensor, ...]`, which is not assignable to `(self: UNet, batch_size: Unknown, image_height: Unknown, image_width: Unknown) -> None`, the type of `BaseModel.get_sample_input`\n Signature mismatch:\n expected: def get_sample_input(self: UNet, batch_size: Unknown, image_height: Unknown, image_width: Unknown) -> None: ...\n ^^^^ return type\n found: def get_sample_input(self: UNet, batch_size: Unknown, image_height: Unknown, image_width: Unknown) -> tuple[Tensor, ...]: ...\n ^^^^^^^^^^^^^^^^^^ return type", + "concise_description": "Class member `UNet.get_sample_input` overrides parent class `BaseModel` in an inconsistent manner", + "severity": "error" + }, + { + "line": 967, + "column": 9, + "stop_line": 967, + "stop_column": 24, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\models\\models.py", + "code": -2, + "name": "bad-override", + "description": "Class member `VAE.get_input_names` overrides parent class `BaseModel` in an inconsistent manner\n `VAE.get_input_names` has type `(self: VAE) -> list[str]`, which is not assignable to `(self: VAE) -> None`, the type of `BaseModel.get_input_names`\n Signature mismatch:\n expected: def get_input_names(self: VAE) -> None: ...\n ^^^^ return type\n found: def get_input_names(self: VAE) -> list[str]: ...\n ^^^^^^^^^ return type", + "concise_description": "Class member `VAE.get_input_names` overrides parent class `BaseModel` in an inconsistent manner", + "severity": "error" + }, + { + "line": 970, + "column": 9, + "stop_line": 970, + "stop_column": 25, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\models\\models.py", + "code": -2, + "name": "bad-override", + "description": "Class member `VAE.get_output_names` overrides parent class `BaseModel` in an inconsistent manner\n `VAE.get_output_names` has type `(self: VAE) -> list[str]`, which is not assignable to `(self: VAE) -> None`, the type of `BaseModel.get_output_names`\n Signature mismatch:\n expected: def get_output_names(self: VAE) -> None: ...\n ^^^^ return type\n found: def get_output_names(self: VAE) -> list[str]: ...\n ^^^^^^^^^ return type", + "concise_description": "Class member `VAE.get_output_names` overrides parent class `BaseModel` in an inconsistent manner", + "severity": "error" + }, + { + "line": 973, + "column": 9, + "stop_line": 973, + "stop_column": 25, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\models\\models.py", + "code": -2, + "name": "bad-override", + "description": "Class member `VAE.get_dynamic_axes` overrides parent class `BaseModel` in an inconsistent manner\n `VAE.get_dynamic_axes` has type `(self: VAE) -> dict[str, dict[int, str]]`, which is not assignable to `(self: VAE) -> None`, the type of `BaseModel.get_dynamic_axes`\n Signature mismatch:\n expected: def get_dynamic_axes(self: VAE) -> None: ...\n ^^^^ return type\n found: def get_dynamic_axes(self: VAE) -> dict[str, dict[int, str]]: ...\n ^^^^^^^^^^^^^^^^^^^^^^^^^ return type", + "concise_description": "Class member `VAE.get_dynamic_axes` overrides parent class `BaseModel` in an inconsistent manner", + "severity": "error" + }, + { + "line": 979, + "column": 9, + "stop_line": 979, + "stop_column": 26, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\models\\models.py", + "code": -2, + "name": "bad-override", + "description": "Class member `VAE.get_input_profile` overrides parent class `BaseModel` in an inconsistent manner\n `VAE.get_input_profile` has type `(self: VAE, batch_size: Unknown, image_height: Unknown, image_width: Unknown, static_batch: Unknown, static_shape: Unknown) -> dict[str, list[tuple[int | Unknown, int, int | Unknown, int | Unknown] | tuple[Unknown, int, Unknown, Unknown]]]`, which is not assignable to `(self: VAE, batch_size: Unknown, image_height: Unknown, image_width: Unknown, static_batch: Unknown, static_shape: Unknown) -> None`, the type of `BaseModel.get_input_profile`\n Signature mismatch:\n ...-> None: ...\n ^^^^ return type\n ...-> dict[str, list[tuple[int | Unknown, int, int | Unknown, int | Unknown] | tuple[Unknown, int, Unknown, Unknown]]]: ...\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ return type", + "concise_description": "Class member `VAE.get_input_profile` overrides parent class `BaseModel` in an inconsistent manner", + "severity": "error" + }, + { + "line": 1001, + "column": 9, + "stop_line": 1001, + "stop_column": 23, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\models\\models.py", + "code": -2, + "name": "bad-override", + "description": "Class member `VAE.get_shape_dict` overrides parent class `BaseModel` in an inconsistent manner\n `VAE.get_shape_dict` has type `(self: VAE, batch_size: Unknown, image_height: Unknown, image_width: Unknown) -> dict[str, tuple[Unknown, int, Unknown, Unknown]]`, which is not assignable to `(self: VAE, batch_size: Unknown, image_height: Unknown, image_width: Unknown) -> None`, the type of `BaseModel.get_shape_dict`\n Signature mismatch:\n ... Unknown, image_width: Unknown) -> None: ...\n ^^^^ return type\n ... Unknown, image_width: Unknown) -> dict[str, tuple[Unknown, int, Unknown, Unknown]]: ...\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ return type", + "concise_description": "Class member `VAE.get_shape_dict` overrides parent class `BaseModel` in an inconsistent manner", + "severity": "error" + }, + { + "line": 1008, + "column": 9, + "stop_line": 1008, + "stop_column": 25, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\models\\models.py", + "code": -2, + "name": "bad-override", + "description": "Class member `VAE.get_sample_input` overrides parent class `BaseModel` in an inconsistent manner\n `VAE.get_sample_input` has type `(self: VAE, batch_size: Unknown, image_height: Unknown, image_width: Unknown) -> Tensor`, which is not assignable to `(self: VAE, batch_size: Unknown, image_height: Unknown, image_width: Unknown) -> None`, the type of `BaseModel.get_sample_input`\n Signature mismatch:\n expected: def get_sample_input(self: VAE, batch_size: Unknown, image_height: Unknown, image_width: Unknown) -> None: ...\n ^^^^ return type\n found: def get_sample_input(self: VAE, batch_size: Unknown, image_height: Unknown, image_width: Unknown) -> Tensor: ...\n ^^^^^^ return type", + "concise_description": "Class member `VAE.get_sample_input` overrides parent class `BaseModel` in an inconsistent manner", + "severity": "error" + }, + { + "line": 1030, + "column": 9, + "stop_line": 1030, + "stop_column": 24, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\models\\models.py", + "code": -2, + "name": "bad-override", + "description": "Class member `VAEEncoder.get_input_names` overrides parent class `BaseModel` in an inconsistent manner\n `VAEEncoder.get_input_names` has type `(self: VAEEncoder) -> list[str]`, which is not assignable to `(self: VAEEncoder) -> None`, the type of `BaseModel.get_input_names`\n Signature mismatch:\n expected: def get_input_names(self: VAEEncoder) -> None: ...\n ^^^^ return type\n found: def get_input_names(self: VAEEncoder) -> list[str]: ...\n ^^^^^^^^^ return type", + "concise_description": "Class member `VAEEncoder.get_input_names` overrides parent class `BaseModel` in an inconsistent manner", + "severity": "error" + }, + { + "line": 1033, + "column": 9, + "stop_line": 1033, + "stop_column": 25, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\models\\models.py", + "code": -2, + "name": "bad-override", + "description": "Class member `VAEEncoder.get_output_names` overrides parent class `BaseModel` in an inconsistent manner\n `VAEEncoder.get_output_names` has type `(self: VAEEncoder) -> list[str]`, which is not assignable to `(self: VAEEncoder) -> None`, the type of `BaseModel.get_output_names`\n Signature mismatch:\n expected: def get_output_names(self: VAEEncoder) -> None: ...\n ^^^^ return type\n found: def get_output_names(self: VAEEncoder) -> list[str]: ...\n ^^^^^^^^^ return type", + "concise_description": "Class member `VAEEncoder.get_output_names` overrides parent class `BaseModel` in an inconsistent manner", + "severity": "error" + }, + { + "line": 1036, + "column": 9, + "stop_line": 1036, + "stop_column": 25, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\models\\models.py", + "code": -2, + "name": "bad-override", + "description": "Class member `VAEEncoder.get_dynamic_axes` overrides parent class `BaseModel` in an inconsistent manner\n `VAEEncoder.get_dynamic_axes` has type `(self: VAEEncoder) -> dict[str, dict[int, str]]`, which is not assignable to `(self: VAEEncoder) -> None`, the type of `BaseModel.get_dynamic_axes`\n Signature mismatch:\n expected: def get_dynamic_axes(self: VAEEncoder) -> None: ...\n ^^^^ return type\n found: def get_dynamic_axes(self: VAEEncoder) -> dict[str, dict[int, str]]: ...\n ^^^^^^^^^^^^^^^^^^^^^^^^^ return type", + "concise_description": "Class member `VAEEncoder.get_dynamic_axes` overrides parent class `BaseModel` in an inconsistent manner", + "severity": "error" + }, + { + "line": 1042, + "column": 9, + "stop_line": 1042, + "stop_column": 26, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\models\\models.py", + "code": -2, + "name": "bad-override", + "description": "Class member `VAEEncoder.get_input_profile` overrides parent class `BaseModel` in an inconsistent manner\n `VAEEncoder.get_input_profile` has type `(self: VAEEncoder, batch_size: Unknown, image_height: Unknown, image_width: Unknown, static_batch: Unknown, static_shape: Unknown) -> dict[str, list[tuple[int | Unknown, int, int | Unknown, int | Unknown] | tuple[Unknown, int, Unknown, Unknown]]]`, which is not assignable to `(self: VAEEncoder, batch_size: Unknown, image_height: Unknown, image_width: Unknown, static_batch: Unknown, static_shape: Unknown) -> None`, the type of `BaseModel.get_input_profile`\n Signature mismatch:\n ...-> None: ...\n ^^^^ return type\n ...-> dict[str, list[tuple[int | Unknown, int, int | Unknown, int | Unknown] | tuple[Unknown, int, Unknown, Unknown]]]: ...\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ return type", + "concise_description": "Class member `VAEEncoder.get_input_profile` overrides parent class `BaseModel` in an inconsistent manner", + "severity": "error" + }, + { + "line": 1068, + "column": 9, + "stop_line": 1068, + "stop_column": 23, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\models\\models.py", + "code": -2, + "name": "bad-override", + "description": "Class member `VAEEncoder.get_shape_dict` overrides parent class `BaseModel` in an inconsistent manner\n `VAEEncoder.get_shape_dict` has type `(self: VAEEncoder, batch_size: Unknown, image_height: Unknown, image_width: Unknown) -> dict[str, tuple[Unknown, int, Unknown, Unknown]]`, which is not assignable to `(self: VAEEncoder, batch_size: Unknown, image_height: Unknown, image_width: Unknown) -> None`, the type of `BaseModel.get_shape_dict`\n Signature mismatch:\n ... Unknown, image_width: Unknown) -> None: ...\n ^^^^ return type\n ... Unknown, image_width: Unknown) -> dict[str, tuple[Unknown, int, Unknown, Unknown]]: ...\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ return type", + "concise_description": "Class member `VAEEncoder.get_shape_dict` overrides parent class `BaseModel` in an inconsistent manner", + "severity": "error" + }, + { + "line": 1075, + "column": 9, + "stop_line": 1075, + "stop_column": 25, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\models\\models.py", + "code": -2, + "name": "bad-override", + "description": "Class member `VAEEncoder.get_sample_input` overrides parent class `BaseModel` in an inconsistent manner\n `VAEEncoder.get_sample_input` has type `(self: VAEEncoder, batch_size: Unknown, image_height: Unknown, image_width: Unknown) -> Tensor`, which is not assignable to `(self: VAEEncoder, batch_size: Unknown, image_height: Unknown, image_width: Unknown) -> None`, the type of `BaseModel.get_sample_input`\n Signature mismatch:\n expected: def get_sample_input(self: VAEEncoder, batch_size: Unknown, image_height: Unknown, image_width: Unknown) -> None: ...\n ^^^^ return type\n found: def get_sample_input(self: VAEEncoder, batch_size: Unknown, image_height: Unknown, image_width: Unknown) -> Tensor: ...\n ^^^^^^ return type", + "concise_description": "Class member `VAEEncoder.get_sample_input` overrides parent class `BaseModel` in an inconsistent manner", + "severity": "error" + }, + { + "line": 18, + "column": 31, + "stop_line": 18, + "stop_column": 47, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\models\\utils.py", + "code": -2, + "name": "not-iterable", + "description": "Type `Module` is not iterable\n Expected `__getitem__` to be a callable, got `Module | Tensor`", + "concise_description": "Type `Module` is not iterable", + "severity": "error" + }, + { + "line": 20, + "column": 36, + "stop_line": 20, + "stop_column": 65, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\models\\utils.py", + "code": -2, + "name": "missing-attribute", + "description": "Object of class `Tensor` has no attribute `transformer_blocks`", + "concise_description": "Object of class `Tensor` has no attribute `transformer_blocks`", + "severity": "error" + }, + { + "line": 49, + "column": 31, + "stop_line": 49, + "stop_column": 47, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\models\\utils.py", + "code": -2, + "name": "not-iterable", + "description": "Type `Module` is not iterable\n Expected `__getitem__` to be a callable, got `Module | Tensor`", + "concise_description": "Type `Module` is not iterable", + "severity": "error" + }, + { + "line": 51, + "column": 36, + "stop_line": 51, + "stop_column": 65, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\models\\utils.py", + "code": -2, + "name": "missing-attribute", + "description": "Object of class `Tensor` has no attribute `transformer_blocks`", + "concise_description": "Object of class `Tensor` has no attribute `transformer_blocks`", + "severity": "error" + }, + { + "line": 148, + "column": 31, + "stop_line": 148, + "stop_column": 47, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\models\\utils.py", + "code": -2, + "name": "not-iterable", + "description": "Type `Module` is not iterable\n Expected `__getitem__` to be a callable, got `Module | Tensor`", + "concise_description": "Type `Module` is not iterable", + "severity": "error" + }, + { + "line": 149, + "column": 26, + "stop_line": 149, + "stop_column": 55, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\models\\utils.py", + "code": -2, + "name": "missing-attribute", + "description": "Object of class `Tensor` has no attribute `transformer_blocks`", + "concise_description": "Object of class `Tensor` has no attribute `transformer_blocks`", + "severity": "error" + }, + { + "line": 162, + "column": 31, + "stop_line": 162, + "stop_column": 47, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\models\\utils.py", + "code": -2, + "name": "not-iterable", + "description": "Type `Module` is not iterable\n Expected `__getitem__` to be a callable, got `Module | Tensor`", + "concise_description": "Type `Module` is not iterable", + "severity": "error" + }, + { + "line": 163, + "column": 26, + "stop_line": 163, + "stop_column": 55, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\models\\utils.py", + "code": -2, + "name": "missing-attribute", + "description": "Object of class `Tensor` has no attribute `transformer_blocks`", + "concise_description": "Object of class `Tensor` has no attribute `transformer_blocks`", + "severity": "error" + }, + { + "line": 39, + "column": 31, + "stop_line": 39, + "stop_column": 66, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\runtime_engines\\controlnet_engine.py", + "code": -2, + "name": "missing-attribute", + "description": "Object of class `NoneType` has no attribute `get_tensor_shape`", + "concise_description": "Object of class `NoneType` has no attribute `get_tensor_shape`", + "severity": "error" + }, + { + "line": 110, + "column": 16, + "stop_line": 110, + "stop_column": 29, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\runtime_engines\\controlnet_engine.py", + "code": -2, + "name": "bad-return", + "description": "Returned type `dict[str, tuple[int, int, int, int]]` is not assignable to declared return type `dict[str, tuple[int, ...]]`", + "concise_description": "Returned type `dict[str, tuple[int, int, int, int]]` is not assignable to declared return type `dict[str, tuple[int, ...]]`", + "severity": "error" + }, + { + "line": 151, + "column": 26, + "stop_line": 151, + "stop_column": 41, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\runtime_engines\\controlnet_engine.py", + "code": -2, + "name": "no-matching-overload", + "description": "No matching overload found for function `typing.MutableMapping.update` called with arguments: (dict[str, tuple[int, ...]])\n Possible overloads:\n (m: SupportsKeysAndGetItem[str, Size], /) -> None [closest match]\n (m: SupportsKeysAndGetItem[str, Size], /, **kwargs: Size) -> None\n (m: Iterable[tuple[str, Size]], /) -> None\n (m: Iterable[tuple[str, Size]], /, **kwargs: Size) -> None\n (**kwargs: Size) -> None", + "concise_description": "No matching overload found for function `typing.MutableMapping.update` called with arguments: (dict[str, tuple[int, ...]])", + "severity": "error" + }, + { + "line": 186, + "column": 16, + "stop_line": 186, + "stop_column": 38, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\runtime_engines\\controlnet_engine.py", + "code": -2, + "name": "bad-return", + "description": "Returned type `tuple[list[Tensor], Tensor | None]` is not assignable to declared return type `tuple[list[Tensor], Tensor]`", + "concise_description": "Returned type `tuple[list[Tensor], Tensor | None]` is not assignable to declared return type `tuple[list[Tensor], Tensor]`", + "severity": "error" + }, + { + "line": 43, + "column": 39, + "stop_line": 43, + "stop_column": 54, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\utilities.py", + "code": -2, + "name": "missing-module-attribute", + "description": "Could not import `bytes_from_path` from `polygraphy.backend.common`", + "concise_description": "Could not import `bytes_from_path` from `polygraphy.backend.common`", + "severity": "error" + }, + { + "line": 44, + "column": 36, + "stop_line": 44, + "stop_column": 53, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\utilities.py", + "code": -2, + "name": "missing-module-attribute", + "description": "Could not import `engine_from_bytes` from `polygraphy.backend.trt`", + "concise_description": "Could not import `engine_from_bytes` from `polygraphy.backend.trt`", + "severity": "error" + }, + { + "line": 54, + "column": 23, + "stop_line": 54, + "stop_column": 34, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\utilities.py", + "code": -2, + "name": "missing-attribute", + "description": "No attribute `ILogger` in module `tensorrt`", + "concise_description": "No attribute `ILogger` in module `tensorrt`", + "severity": "error" + }, + { + "line": 73, + "column": 9, + "stop_line": 73, + "stop_column": 20, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\utilities.py", + "code": -2, + "name": "missing-attribute", + "description": "No attribute `ILogger` in module `tensorrt`", + "concise_description": "No attribute `ILogger` in module `tensorrt`", + "severity": "error" + }, + { + "line": 114, + "column": 9, + "stop_line": 114, + "stop_column": 20, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\utilities.py", + "code": -2, + "name": "missing-attribute", + "description": "No attribute `Builder` in module `tensorrt`", + "concise_description": "No attribute `Builder` in module `tensorrt`", + "severity": "error" + }, + { + "line": 276, + "column": 14, + "stop_line": 276, + "stop_column": 32, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\utilities.py", + "code": -2, + "name": "missing-attribute", + "description": "No attribute `IBuilderConfig` in module `tensorrt`", + "concise_description": "No attribute `IBuilderConfig` in module `tensorrt`", + "severity": "error" + }, + { + "line": 317, + "column": 25, + "stop_line": 317, + "stop_column": 52, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\utilities.py", + "code": -2, + "name": "missing-attribute", + "description": "No attribute `TilingOptimizationLevel` in module `tensorrt`", + "concise_description": "No attribute `TilingOptimizationLevel` in module `tensorrt`", + "severity": "error" + }, + { + "line": 318, + "column": 25, + "stop_line": 318, + "stop_column": 52, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\utilities.py", + "code": -2, + "name": "missing-attribute", + "description": "No attribute `TilingOptimizationLevel` in module `tensorrt`", + "concise_description": "No attribute `TilingOptimizationLevel` in module `tensorrt`", + "severity": "error" + }, + { + "line": 319, + "column": 29, + "stop_line": 319, + "stop_column": 56, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\utilities.py", + "code": -2, + "name": "missing-attribute", + "description": "No attribute `TilingOptimizationLevel` in module `tensorrt`", + "concise_description": "No attribute `TilingOptimizationLevel` in module `tensorrt`", + "severity": "error" + }, + { + "line": 320, + "column": 25, + "stop_line": 320, + "stop_column": 52, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\utilities.py", + "code": -2, + "name": "missing-attribute", + "description": "No attribute `TilingOptimizationLevel` in module `tensorrt`", + "concise_description": "No attribute `TilingOptimizationLevel` in module `tensorrt`", + "severity": "error" + }, + { + "line": 322, + "column": 82, + "stop_line": 322, + "stop_column": 109, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\utilities.py", + "code": -2, + "name": "missing-attribute", + "description": "No attribute `TilingOptimizationLevel` in module `tensorrt`", + "concise_description": "No attribute `TilingOptimizationLevel` in module `tensorrt`", + "severity": "error" + }, + { + "line": 351, + "column": 29, + "stop_line": 351, + "stop_column": 44, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\utilities.py", + "code": -2, + "name": "missing-attribute", + "description": "No attribute `BuilderFlag` in module `tensorrt`", + "concise_description": "No attribute `BuilderFlag` in module `tensorrt`", + "severity": "error" + }, + { + "line": 362, + "column": 40, + "stop_line": 362, + "stop_column": 58, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\utilities.py", + "code": -2, + "name": "missing-attribute", + "description": "No attribute `PreviewFeature` in module `tensorrt`", + "concise_description": "No attribute `PreviewFeature` in module `tensorrt`", + "severity": "error" + }, + { + "line": 389, + "column": 20, + "stop_line": 389, + "stop_column": 36, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\utilities.py", + "code": -2, + "name": "missing-attribute", + "description": "No attribute `TacticSource` in module `tensorrt`", + "concise_description": "No attribute `TacticSource` in module `tensorrt`", + "severity": "error" + }, + { + "line": 391, + "column": 27, + "stop_line": 391, + "stop_column": 43, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\utilities.py", + "code": -2, + "name": "missing-attribute", + "description": "No attribute `TacticSource` in module `tensorrt`", + "concise_description": "No attribute `TacticSource` in module `tensorrt`", + "severity": "error" + }, + { + "line": 392, + "column": 29, + "stop_line": 392, + "stop_column": 45, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\utilities.py", + "code": -2, + "name": "missing-attribute", + "description": "No attribute `TacticSource` in module `tensorrt`", + "concise_description": "No attribute `TacticSource` in module `tensorrt`", + "severity": "error" + }, + { + "line": 393, + "column": 29, + "stop_line": 393, + "stop_column": 45, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\utilities.py", + "code": -2, + "name": "missing-attribute", + "description": "No attribute `TacticSource` in module `tensorrt`", + "concise_description": "No attribute `TacticSource` in module `tensorrt`", + "severity": "error" + }, + { + "line": 394, + "column": 29, + "stop_line": 394, + "stop_column": 45, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\utilities.py", + "code": -2, + "name": "missing-attribute", + "description": "No attribute `TacticSource` in module `tensorrt`", + "concise_description": "No attribute `TacticSource` in module `tensorrt`", + "severity": "error" + }, + { + "line": 430, + "column": 31, + "stop_line": 430, + "stop_column": 39, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\utilities.py", + "code": -2, + "name": "unsupported-operation", + "description": "Cannot set item in `dict[type[complex128] | type[complex64] | type[float16] | type[float32] | type[float64] | type[int16] | type[int32] | type[int64] | type[int8] | type[uint8], dtype]`\n Argument `type[bool_]` is not assignable to parameter `key` with type `type[complex128] | type[complex64] | type[float16] | type[float32] | type[float64] | type[int16] | type[int32] | type[int64] | type[int8] | type[uint8]` in function `dict.__setitem__`", + "concise_description": "Cannot set item in `dict[type[complex128] | type[complex64] | type[float16] | type[float32] | type[float64] | type[int16] | type[int32] | type[int64] | type[int8] | type[uint8], dtype]`", + "severity": "error" + }, + { + "line": 432, + "column": 31, + "stop_line": 432, + "stop_column": 38, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\utilities.py", + "code": -2, + "name": "missing-attribute", + "description": "No attribute `bool` in module `numpy`", + "concise_description": "No attribute `bool` in module `numpy`", + "severity": "error" + }, + { + "line": 471, + "column": 19, + "stop_line": 471, + "stop_column": 32, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\utilities.py", + "code": -2, + "name": "missing-attribute", + "description": "No attribute `IProfiler` in module `tensorrt`", + "concise_description": "No attribute `IProfiler` in module `tensorrt`", + "severity": "error" + }, + { + "line": 519, + "column": 27, + "stop_line": 519, + "stop_column": 35, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\utilities.py", + "code": -2, + "name": "bad-index", + "description": "Cannot index into `deque[Unknown]`\n Argument `slice[int, int, int | Unknown]` is not assignable to parameter `key` with type `SupportsIndex` in function `collections.deque.__getitem__`\n Protocol `SupportsIndex` requires attribute `__index__`", + "concise_description": "Cannot index into `deque[Unknown]`", + "severity": "error" + }, + { + "line": 684, + "column": 20, + "stop_line": 684, + "stop_column": 32, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\utilities.py", + "code": -2, + "name": "missing-attribute", + "description": "No attribute `Refitter` in module `tensorrt`", + "concise_description": "No attribute `Refitter` in module `tensorrt`", + "severity": "error" + }, + { + "line": 688, + "column": 24, + "stop_line": 688, + "stop_column": 39, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\utilities.py", + "code": -2, + "name": "missing-attribute", + "description": "No attribute `WeightsRole` in module `tensorrt`", + "concise_description": "No attribute `WeightsRole` in module `tensorrt`", + "severity": "error" + }, + { + "line": 690, + "column": 26, + "stop_line": 690, + "stop_column": 41, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\utilities.py", + "code": -2, + "name": "missing-attribute", + "description": "No attribute `WeightsRole` in module `tensorrt`", + "concise_description": "No attribute `WeightsRole` in module `tensorrt`", + "severity": "error" + }, + { + "line": 722, + "column": 32, + "stop_line": 722, + "stop_column": 47, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\utilities.py", + "code": -2, + "name": "missing-attribute", + "description": "No attribute `WeightsRole` in module `tensorrt`", + "concise_description": "No attribute `WeightsRole` in module `tensorrt`", + "severity": "error" + }, + { + "line": 724, + "column": 34, + "stop_line": 724, + "stop_column": 49, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\utilities.py", + "code": -2, + "name": "missing-attribute", + "description": "No attribute `WeightsRole` in module `tensorrt`", + "concise_description": "No attribute `WeightsRole` in module `tensorrt`", + "severity": "error" + }, + { + "line": 782, + "column": 19, + "stop_line": 782, + "stop_column": 30, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\utilities.py", + "code": -2, + "name": "missing-attribute", + "description": "No attribute `Builder` in module `tensorrt`", + "concise_description": "No attribute `Builder` in module `tensorrt`", + "severity": "error" + }, + { + "line": 787, + "column": 18, + "stop_line": 787, + "stop_column": 32, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\utilities.py", + "code": -2, + "name": "missing-attribute", + "description": "No attribute `OnnxParser` in module `tensorrt`", + "concise_description": "No attribute `OnnxParser` in module `tensorrt`", + "severity": "error" + }, + { + "line": 788, + "column": 25, + "stop_line": 788, + "stop_column": 43, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\utilities.py", + "code": -2, + "name": "missing-attribute", + "description": "No attribute `OnnxParserFlag` in module `tensorrt`", + "concise_description": "No attribute `OnnxParserFlag` in module `tensorrt`", + "severity": "error" + }, + { + "line": 801, + "column": 42, + "stop_line": 801, + "stop_column": 64, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\utilities.py", + "code": -2, + "name": "missing-attribute", + "description": "No attribute `ProfilingVerbosity` in module `tensorrt`", + "concise_description": "No attribute `ProfilingVerbosity` in module `tensorrt`", + "severity": "error" + }, + { + "line": 807, + "column": 29, + "stop_line": 807, + "stop_column": 44, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\utilities.py", + "code": -2, + "name": "missing-attribute", + "description": "No attribute `BuilderFlag` in module `tensorrt`", + "concise_description": "No attribute `BuilderFlag` in module `tensorrt`", + "severity": "error" + }, + { + "line": 808, + "column": 25, + "stop_line": 808, + "stop_column": 40, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\utilities.py", + "code": -2, + "name": "missing-attribute", + "description": "No attribute `BuilderFlag` in module `tensorrt`", + "concise_description": "No attribute `BuilderFlag` in module `tensorrt`", + "severity": "error" + }, + { + "line": 811, + "column": 29, + "stop_line": 811, + "stop_column": 44, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\utilities.py", + "code": -2, + "name": "missing-attribute", + "description": "No attribute `BuilderFlag` in module `tensorrt`", + "concise_description": "No attribute `BuilderFlag` in module `tensorrt`", + "severity": "error" + }, + { + "line": 815, + "column": 42, + "stop_line": 815, + "stop_column": 60, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\utilities.py", + "code": -2, + "name": "missing-attribute", + "description": "No attribute `MemoryPoolType` in module `tensorrt`", + "concise_description": "No attribute `MemoryPoolType` in module `tensorrt`", + "severity": "error" + }, + { + "line": 902, + "column": 19, + "stop_line": 902, + "stop_column": 30, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\utilities.py", + "code": -2, + "name": "missing-attribute", + "description": "No attribute `Builder` in module `tensorrt`", + "concise_description": "No attribute `Builder` in module `tensorrt`", + "severity": "error" + }, + { + "line": 906, + "column": 34, + "stop_line": 906, + "stop_column": 67, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\utilities.py", + "code": -2, + "name": "missing-attribute", + "description": "No attribute `NetworkDefinitionCreationFlag` in module `tensorrt`", + "concise_description": "No attribute `NetworkDefinitionCreationFlag` in module `tensorrt`", + "severity": "error" + }, + { + "line": 909, + "column": 18, + "stop_line": 909, + "stop_column": 32, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\utilities.py", + "code": -2, + "name": "missing-attribute", + "description": "No attribute `OnnxParser` in module `tensorrt`", + "concise_description": "No attribute `OnnxParser` in module `tensorrt`", + "severity": "error" + }, + { + "line": 912, + "column": 25, + "stop_line": 912, + "stop_column": 43, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\utilities.py", + "code": -2, + "name": "missing-attribute", + "description": "No attribute `OnnxParserFlag` in module `tensorrt`", + "concise_description": "No attribute `OnnxParserFlag` in module `tensorrt`", + "severity": "error" + }, + { + "line": 924, + "column": 42, + "stop_line": 924, + "stop_column": 64, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\utilities.py", + "code": -2, + "name": "missing-attribute", + "description": "No attribute `ProfilingVerbosity` in module `tensorrt`", + "concise_description": "No attribute `ProfilingVerbosity` in module `tensorrt`", + "severity": "error" + }, + { + "line": 932, + "column": 20, + "stop_line": 932, + "stop_column": 35, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\utilities.py", + "code": -2, + "name": "missing-attribute", + "description": "No attribute `BuilderFlag` in module `tensorrt`", + "concise_description": "No attribute `BuilderFlag` in module `tensorrt`", + "severity": "error" + }, + { + "line": 935, + "column": 29, + "stop_line": 935, + "stop_column": 44, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\utilities.py", + "code": -2, + "name": "missing-attribute", + "description": "No attribute `BuilderFlag` in module `tensorrt`", + "concise_description": "No attribute `BuilderFlag` in module `tensorrt`", + "severity": "error" + }, + { + "line": 936, + "column": 29, + "stop_line": 936, + "stop_column": 44, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\utilities.py", + "code": -2, + "name": "missing-attribute", + "description": "No attribute `BuilderFlag` in module `tensorrt`", + "concise_description": "No attribute `BuilderFlag` in module `tensorrt`", + "severity": "error" + }, + { + "line": 937, + "column": 29, + "stop_line": 937, + "stop_column": 44, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\utilities.py", + "code": -2, + "name": "missing-attribute", + "description": "No attribute `BuilderFlag` in module `tensorrt`", + "concise_description": "No attribute `BuilderFlag` in module `tensorrt`", + "severity": "error" + }, + { + "line": 938, + "column": 29, + "stop_line": 938, + "stop_column": 44, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\utilities.py", + "code": -2, + "name": "missing-attribute", + "description": "No attribute `BuilderFlag` in module `tensorrt`", + "concise_description": "No attribute `BuilderFlag` in module `tensorrt`", + "severity": "error" + }, + { + "line": 943, + "column": 42, + "stop_line": 943, + "stop_column": 60, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\utilities.py", + "code": -2, + "name": "missing-attribute", + "description": "No attribute `MemoryPoolType` in module `tensorrt`", + "concise_description": "No attribute `MemoryPoolType` in module `tensorrt`", + "severity": "error" + }, + { + "line": 1019, + "column": 24, + "stop_line": 1019, + "stop_column": 60, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\utilities.py", + "code": -2, + "name": "missing-attribute", + "description": "Object of class `NoneType` has no attribute `create_execution_context`", + "concise_description": "Object of class `NoneType` has no attribute `create_execution_context`", + "severity": "error" + }, + { + "line": 1049, + "column": 26, + "stop_line": 1049, + "stop_column": 52, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\utilities.py", + "code": -2, + "name": "missing-attribute", + "description": "Object of class `NoneType` has no attribute `num_io_tensors`", + "concise_description": "Object of class `NoneType` has no attribute `num_io_tensors`", + "severity": "error" + }, + { + "line": 1050, + "column": 20, + "stop_line": 1050, + "stop_column": 47, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\utilities.py", + "code": -2, + "name": "missing-attribute", + "description": "Object of class `NoneType` has no attribute `get_tensor_name`", + "concise_description": "Object of class `NoneType` has no attribute `get_tensor_name`", + "severity": "error" + }, + { + "line": 1055, + "column": 25, + "stop_line": 1055, + "stop_column": 53, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\utilities.py", + "code": -2, + "name": "missing-attribute", + "description": "Object of class `NoneType` has no attribute `get_tensor_shape`", + "concise_description": "Object of class `NoneType` has no attribute `get_tensor_shape`", + "severity": "error" + }, + { + "line": 1057, + "column": 25, + "stop_line": 1057, + "stop_column": 53, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\utilities.py", + "code": -2, + "name": "missing-attribute", + "description": "Object of class `NoneType` has no attribute `get_tensor_dtype`", + "concise_description": "Object of class `NoneType` has no attribute `get_tensor_dtype`", + "severity": "error" + }, + { + "line": 1063, + "column": 33, + "stop_line": 1063, + "stop_column": 45, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\utilities.py", + "code": -2, + "name": "missing-attribute", + "description": "No attribute `DataType` in module `tensorrt`", + "concise_description": "No attribute `DataType` in module `tensorrt`", + "severity": "error" + }, + { + "line": 1067, + "column": 20, + "stop_line": 1067, + "stop_column": 47, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\utilities.py", + "code": -2, + "name": "missing-attribute", + "description": "Object of class `NoneType` has no attribute `get_tensor_mode`", + "concise_description": "Object of class `NoneType` has no attribute `get_tensor_mode`", + "severity": "error" + }, + { + "line": 1069, + "column": 24, + "stop_line": 1069, + "stop_column": 40, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\utilities.py", + "code": -2, + "name": "missing-attribute", + "description": "No attribute `TensorIOMode` in module `tensorrt`", + "concise_description": "No attribute `TensorIOMode` in module `tensorrt`", + "severity": "error" + }, + { + "line": 1070, + "column": 24, + "stop_line": 1070, + "stop_column": 52, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\utilities.py", + "code": -2, + "name": "missing-attribute", + "description": "Object of class `NoneType` has no attribute `set_input_shape`", + "concise_description": "Object of class `NoneType` has no attribute `set_input_shape`", + "severity": "error" + }, + { + "line": 1150, + "column": 34, + "stop_line": 1150, + "stop_column": 60, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\utilities.py", + "code": -2, + "name": "missing-attribute", + "description": "Object of class `NoneType` has no attribute `num_io_tensors`", + "concise_description": "Object of class `NoneType` has no attribute `num_io_tensors`", + "severity": "error" + }, + { + "line": 1151, + "column": 28, + "stop_line": 1151, + "stop_column": 55, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\utilities.py", + "code": -2, + "name": "missing-attribute", + "description": "Object of class `NoneType` has no attribute `get_tensor_name`", + "concise_description": "Object of class `NoneType` has no attribute `get_tensor_name`", + "severity": "error" + }, + { + "line": 1152, + "column": 24, + "stop_line": 1152, + "stop_column": 51, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\utilities.py", + "code": -2, + "name": "missing-attribute", + "description": "Object of class `NoneType` has no attribute `get_tensor_mode`", + "concise_description": "Object of class `NoneType` has no attribute `get_tensor_mode`", + "severity": "error" + }, + { + "line": 1152, + "column": 61, + "stop_line": 1152, + "stop_column": 77, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\utilities.py", + "code": -2, + "name": "missing-attribute", + "description": "No attribute `TensorIOMode` in module `tensorrt`", + "concise_description": "No attribute `TensorIOMode` in module `tensorrt`", + "severity": "error" + }, + { + "line": 1230, + "column": 24, + "stop_line": 1230, + "stop_column": 55, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\utilities.py", + "code": -2, + "name": "missing-attribute", + "description": "Object of class `NoneType` has no attribute `set_tensor_address`", + "concise_description": "Object of class `NoneType` has no attribute `set_tensor_address`", + "severity": "error" + }, + { + "line": 1245, + "column": 35, + "stop_line": 1245, + "stop_column": 64, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\utilities.py", + "code": -2, + "name": "missing-attribute", + "description": "Object of class `NoneType` has no attribute `execute_async_v3`", + "concise_description": "Object of class `NoneType` has no attribute `execute_async_v3`", + "severity": "error" + }, + { + "line": 1258, + "column": 35, + "stop_line": 1258, + "stop_column": 64, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\utilities.py", + "code": -2, + "name": "missing-attribute", + "description": "Object of class `NoneType` has no attribute `execute_async_v3`", + "concise_description": "Object of class `NoneType` has no attribute `execute_async_v3`", + "severity": "error" + }, + { + "line": 1276, + "column": 21, + "stop_line": 1276, + "stop_column": 50, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\utilities.py", + "code": -2, + "name": "missing-attribute", + "description": "Object of class `NoneType` has no attribute `execute_async_v3`", + "concise_description": "Object of class `NoneType` has no attribute `execute_async_v3`", + "severity": "error" + }, + { + "line": 1280, + "column": 27, + "stop_line": 1280, + "stop_column": 56, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\utilities.py", + "code": -2, + "name": "missing-attribute", + "description": "Object of class `NoneType` has no attribute `execute_async_v3`", + "concise_description": "Object of class `NoneType` has no attribute `execute_async_v3`", + "severity": "error" + }, + { + "line": 1303, + "column": 9, + "stop_line": 1303, + "stop_column": 116, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\utilities.py", + "code": -2, + "name": "bad-assignment", + "description": "`ndarray[Unknown, Unknown]` is not assignable to variable `images` with type `Tensor`", + "concise_description": "`ndarray[Unknown, Unknown]` is not assignable to variable `images` with type `Tensor`", + "severity": "error" + }, + { + "line": 1305, + "column": 29, + "stop_line": 1305, + "stop_column": 30, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\utilities.py", + "code": -2, + "name": "bad-argument-type", + "description": "Argument `Tensor` is not assignable to parameter `obj` with type `SupportsArrayInterface` in function `PIL.Image.fromarray`\n Protocol `SupportsArrayInterface` requires attribute `__array_interface__`", + "concise_description": "Argument `Tensor` is not assignable to parameter `obj` with type `SupportsArrayInterface` in function `PIL.Image.fromarray`", + "severity": "error" + }, + { + "line": 1320, + "column": 17, + "stop_line": 1320, + "stop_column": 47, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\utilities.py", + "code": -2, + "name": "bad-assignment", + "description": "`ndarray[Any, dtype[Any]]` is not assignable to variable `image` with type `Image`", + "concise_description": "`ndarray[Any, dtype[Any]]` is not assignable to variable `image` with type `Image`", + "severity": "error" + }, + { + "line": 1321, + "column": 13, + "stop_line": 1321, + "stop_column": 24, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\utilities.py", + "code": -2, + "name": "bad-index", + "description": "Cannot index into `Image`\n Object of class `Image` has no attribute `__getitem__`", + "concise_description": "Cannot index into `Image`", + "severity": "error" + }, + { + "line": 1322, + "column": 13, + "stop_line": 1322, + "stop_column": 87, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\utilities.py", + "code": -2, + "name": "bad-assignment", + "description": "`Tensor` is not assignable to variable `image` with type `Image`", + "concise_description": "`Tensor` is not assignable to variable `image` with type `Image`", + "severity": "error" + }, + { + "line": 1324, + "column": 16, + "stop_line": 1324, + "stop_column": 43, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\utilities.py", + "code": -2, + "name": "bad-assignment", + "description": "`ndarray[Any, dtype[Any]]` is not assignable to variable `mask` with type `Image`", + "concise_description": "`ndarray[Any, dtype[Any]]` is not assignable to variable `mask` with type `Image`", + "severity": "error" + }, + { + "line": 1325, + "column": 16, + "stop_line": 1325, + "stop_column": 27, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\utilities.py", + "code": -2, + "name": "missing-attribute", + "description": "Object of class `Image` has no attribute `astype`", + "concise_description": "Object of class `Image` has no attribute `astype`", + "severity": "error" + }, + { + "line": 1329, + "column": 12, + "stop_line": 1329, + "stop_column": 71, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\utilities.py", + "code": -2, + "name": "bad-assignment", + "description": "`Tensor` is not assignable to variable `mask` with type `Image`", + "concise_description": "`Tensor` is not assignable to variable `mask` with type `Image`", + "severity": "error" + }, + { + "line": 1331, + "column": 20, + "stop_line": 1331, + "stop_column": 40, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\utilities.py", + "code": -2, + "name": "unsupported-operation", + "description": "`*` is not supported between `Image` and `bool`\n Argument `Image` is not assignable to parameter `value` with type `int` in function `int.__rmul__`", + "concise_description": "`*` is not supported between `Image` and `bool`", + "severity": "error" + }, + { + "line": 1331, + "column": 29, + "stop_line": 1331, + "stop_column": 39, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\utilities.py", + "code": -2, + "name": "unsupported-operation", + "description": "`<` is not supported between `Image` and `float`\n Argument `Image` is not assignable to parameter `value` with type `float` in function `float.__gt__`", + "concise_description": "`<` is not supported between `Image` and `float`", + "severity": "error" + }, + { + "line": 1346, + "column": 13, + "stop_line": 1346, + "stop_column": 21, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\utilities.py", + "code": -2, + "name": "unexpected-keyword", + "description": "Unexpected keyword argument `hf_token` in function `streamdiffusion.acceleration.tensorrt.models.models.CLIP.__init__`", + "concise_description": "Unexpected keyword argument `hf_token` in function `streamdiffusion.acceleration.tensorrt.models.models.CLIP.__init__`", + "severity": "error" + }, + { + "line": 1352, + "column": 13, + "stop_line": 1352, + "stop_column": 21, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\utilities.py", + "code": -2, + "name": "unexpected-keyword", + "description": "Unexpected keyword argument `hf_token` in function `streamdiffusion.acceleration.tensorrt.models.models.UNet.__init__`", + "concise_description": "Unexpected keyword argument `hf_token` in function `streamdiffusion.acceleration.tensorrt.models.models.UNet.__init__`", + "severity": "error" + }, + { + "line": 1360, + "column": 13, + "stop_line": 1360, + "stop_column": 21, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\utilities.py", + "code": -2, + "name": "unexpected-keyword", + "description": "Unexpected keyword argument `hf_token` in function `streamdiffusion.acceleration.tensorrt.models.models.VAE.__init__`", + "concise_description": "Unexpected keyword argument `hf_token` in function `streamdiffusion.acceleration.tensorrt.models.models.VAE.__init__`", + "severity": "error" + }, + { + "line": 1363, + "column": 13, + "stop_line": 1363, + "stop_column": 26, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\utilities.py", + "code": -2, + "name": "unexpected-keyword", + "description": "Unexpected keyword argument `embedding_dim` in function `streamdiffusion.acceleration.tensorrt.models.models.VAE.__init__`", + "concise_description": "Unexpected keyword argument `embedding_dim` in function `streamdiffusion.acceleration.tensorrt.models.models.VAE.__init__`", + "severity": "error" + }, + { + "line": 1366, + "column": 13, + "stop_line": 1366, + "stop_column": 21, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\utilities.py", + "code": -2, + "name": "unexpected-keyword", + "description": "Unexpected keyword argument `hf_token` in function `streamdiffusion.acceleration.tensorrt.models.models.VAEEncoder.__init__`", + "concise_description": "Unexpected keyword argument `hf_token` in function `streamdiffusion.acceleration.tensorrt.models.models.VAEEncoder.__init__`", + "severity": "error" + }, + { + "line": 1369, + "column": 13, + "stop_line": 1369, + "stop_column": 26, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\utilities.py", + "code": -2, + "name": "unexpected-keyword", + "description": "Unexpected keyword argument `embedding_dim` in function `streamdiffusion.acceleration.tensorrt.models.models.VAEEncoder.__init__`", + "concise_description": "Unexpected keyword argument `embedding_dim` in function `streamdiffusion.acceleration.tensorrt.models.models.VAEEncoder.__init__`", + "severity": "error" + }, + { + "line": 1532, + "column": 34, + "stop_line": 1532, + "stop_column": 56, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\utilities.py", + "code": -2, + "name": "bad-context-manager", + "description": "Cannot use `autocast` as a context manager\n Return type `Literal[False] | object | None` of function `autocast.__exit__` is not assignable to expected return type `bool | None`", + "concise_description": "Cannot use `autocast` as a context manager", + "severity": "error" + }, + { + "line": 1542, + "column": 13, + "stop_line": 1542, + "stop_column": 19, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\utilities.py", + "code": -2, + "name": "bad-argument-type", + "description": "Argument `None` is not assignable to parameter `args` with type `tuple[Any, ...]` in function `torch.onnx.export`", + "concise_description": "Argument `None` is not assignable to parameter `args` with type `tuple[Any, ...]` in function `torch.onnx.export`", + "severity": "error" + }, + { + "line": 1622, + "column": 13, + "stop_line": 1622, + "stop_column": 27, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\utilities.py", + "code": -2, + "name": "bad-argument-type", + "description": "Argument `ModelProto | None` is not assignable to parameter `proto` with type `ModelProto | bytes` in function `onnx.save_model`", + "concise_description": "Argument `ModelProto | None` is not assignable to parameter `proto` with type `ModelProto | bytes` in function `onnx.save_model`", + "severity": "error" + }, + { + "line": 1635, + "column": 19, + "stop_line": 1635, + "stop_column": 33, + "path": "src\\streamdiffusion\\acceleration\\tensorrt\\utilities.py", + "code": -2, + "name": "bad-argument-type", + "description": "Argument `ModelProto | None` is not assignable to parameter `proto` with type `ModelProto | bytes` in function `onnx.save_model`", + "concise_description": "Argument `ModelProto | None` is not assignable to parameter `proto` with type `ModelProto | bytes` in function `onnx.save_model`", + "severity": "error" + }, + { + "line": 37, + "column": 21, + "stop_line": 37, + "stop_column": 45, + "path": "src\\streamdiffusion\\image_filter.py", + "code": -2, + "name": "missing-attribute", + "description": "Object of class `NoneType` has no attribute `item`", + "concise_description": "Object of class `NoneType` has no attribute `item`", + "severity": "error" + }, + { + "line": 47, + "column": 9, + "stop_line": 47, + "stop_column": 34, + "path": "src\\streamdiffusion\\image_filter.py", + "code": -2, + "name": "missing-attribute", + "description": "Object of class `NoneType` has no attribute `copy_`", + "concise_description": "Object of class `NoneType` has no attribute `copy_`", + "severity": "error" + }, + { + "line": 13, + "column": 12, + "stop_line": 13, + "stop_column": 36, + "path": "src\\streamdiffusion\\image_utils.py", + "code": -2, + "name": "missing-attribute", + "description": "Object of class `ndarray` has no attribute `clamp`", + "concise_description": "Object of class `ndarray` has no attribute `clamp`", + "severity": "error" + }, + { + "line": 20, + "column": 14, + "stop_line": 20, + "stop_column": 62, + "path": "src\\streamdiffusion\\image_utils.py", + "code": -2, + "name": "bad-assignment", + "description": "`ndarray[Unknown, Unknown]` is not assignable to variable `images` with type `Tensor`", + "concise_description": "`ndarray[Unknown, Unknown]` is not assignable to variable `images` with type `Tensor`", + "severity": "error" + }, + { + "line": 21, + "column": 12, + "stop_line": 21, + "stop_column": 18, + "path": "src\\streamdiffusion\\image_utils.py", + "code": -2, + "name": "bad-return", + "description": "Returned type `Tensor` is not assignable to declared return type `ndarray[Unknown, Unknown]`", + "concise_description": "Returned type `Tensor` is not assignable to declared return type `ndarray[Unknown, Unknown]`", + "severity": "error" + }, + { + "line": 37, + "column": 12, + "stop_line": 37, + "stop_column": 22, + "path": "src\\streamdiffusion\\image_utils.py", + "code": -2, + "name": "bad-return", + "description": "Returned type `list[Image]` is not assignable to declared return type `Image`", + "concise_description": "Returned type `list[Image]` is not assignable to declared return type `Image`", + "severity": "error" + }, + { + "line": 62, + "column": 13, + "stop_line": 62, + "stop_column": 31, + "path": "src\\streamdiffusion\\image_utils.py", + "code": -2, + "name": "bad-assignment", + "description": "`ndarray[Unknown, Unknown]` is not assignable to variable `image` with type `Tensor`", + "concise_description": "`ndarray[Unknown, Unknown]` is not assignable to variable `image` with type `Tensor`", + "severity": "error" + }, + { + "line": 68, + "column": 29, + "stop_line": 68, + "stop_column": 34, + "path": "src\\streamdiffusion\\image_utils.py", + "code": -2, + "name": "bad-argument-type", + "description": "Argument `Tensor` is not assignable to parameter `images` with type `ndarray[Unknown, Unknown]` in function `numpy_to_pil`", + "concise_description": "Argument `Tensor` is not assignable to parameter `images` with type `ndarray[Unknown, Unknown]` in function `numpy_to_pil`", + "severity": "error" + }, + { + "line": 10, + "column": 5, + "stop_line": 10, + "stop_column": 77, + "path": "src\\streamdiffusion\\model_detection.py", + "code": -2, + "name": "missing-import", + "description": "Cannot find module `diffusers.models.transformers.mm_dit`\n Looked in these locations (from config in `D:\\dev\\SDTD_032_dev\\StreamDiffusion\\pyproject.toml`):\n Search path (from config file): [\"D:\\\\dev\\\\SDTD_032_dev\\\\StreamDiffusion\\\\src\"]\n Import root (inferred from project layout): \"D:\\\\dev\\\\SDTD_032_dev\\\\StreamDiffusion\\\\src\"\n Site package path queried from interpreter: [\"C:\\\\Users\\\\Inter\\\\AppData\\\\Local\\\\Programs\\\\Python\\\\Python311\\\\DLLs\", \"C:\\\\Users\\\\Inter\\\\AppData\\\\Local\\\\Programs\\\\Python\\\\Python311\", \"D:\\\\dev\\\\SDTD_032_dev\\\\StreamDiffusion\\\\venv\", \"D:\\\\dev\\\\SDTD_032_dev\\\\StreamDiffusion\\\\venv\\\\Lib\\\\site-packages\", \"D:\\\\dev\\\\SDTD_032_dev\\\\StreamDiffusion\\\\src\", \"D:\\\\dev\\\\SDTD_032_dev\\\\StreamDiffusion\\\\venv\\\\Lib\\\\site-packages\\\\win32\", \"D:\\\\dev\\\\SDTD_032_dev\\\\StreamDiffusion\\\\venv\\\\Lib\\\\site-packages\\\\win32\\\\lib\", \"D:\\\\dev\\\\SDTD_032_dev\\\\StreamDiffusion\\\\venv\\\\Lib\\\\site-packages\\\\Pythonwin\"]", + "concise_description": "Cannot find module `diffusers.models.transformers.mm_dit`", + "severity": "error" + }, + { + "line": 100, + "column": 12, + "stop_line": 100, + "stop_column": 22, + "path": "src\\streamdiffusion\\model_detection.py", + "code": -2, + "name": "missing-attribute", + "description": "Object of class `Tensor` has no attribute `get`", + "concise_description": "Object of class `Tensor` has no attribute `get`", + "severity": "error" + }, + { + "line": 104, + "column": 16, + "stop_line": 104, + "stop_column": 26, + "path": "src\\streamdiffusion\\model_detection.py", + "code": -2, + "name": "missing-attribute", + "description": "Object of class `Tensor` has no attribute `get`", + "concise_description": "Object of class `Tensor` has no attribute `get`", + "severity": "error" + }, + { + "line": 107, + "column": 35, + "stop_line": 107, + "stop_column": 45, + "path": "src\\streamdiffusion\\model_detection.py", + "code": -2, + "name": "missing-attribute", + "description": "Object of class `Tensor` has no attribute `get`", + "concise_description": "Object of class `Tensor` has no attribute `get`", + "severity": "error" + }, + { + "line": 145, + "column": 30, + "stop_line": 145, + "stop_column": 40, + "path": "src\\streamdiffusion\\model_detection.py", + "code": -2, + "name": "missing-attribute", + "description": "Object of class `Tensor` has no attribute `get`", + "concise_description": "Object of class `Tensor` has no attribute `get`", + "severity": "error" + }, + { + "line": 281, + "column": 22, + "stop_line": 281, + "stop_column": 50, + "path": "src\\streamdiffusion\\model_detection.py", + "code": -2, + "name": "bad-index", + "description": "Cannot index into `object`\n Object of class `object` has no attribute `__getitem__`", + "concise_description": "Cannot index into `object`", + "severity": "error" + }, + { + "line": 281, + "column": 54, + "stop_line": 281, + "stop_column": 79, + "path": "src\\streamdiffusion\\model_detection.py", + "code": -2, + "name": "missing-attribute", + "description": "Object of class `dict` has no attribute `block_out_channels`", + "concise_description": "Object of class `dict` has no attribute `block_out_channels`", + "severity": "error" + }, + { + "line": 282, + "column": 32, + "stop_line": 282, + "stop_column": 57, + "path": "src\\streamdiffusion\\model_detection.py", + "code": -2, + "name": "bad-argument-type", + "description": "Argument `object` is not assignable to parameter `iterable` with type `Iterable[@_]` in function `tuple.__new__`\n Protocol `Iterable` requires attribute `__iter__`", + "concise_description": "Argument `object` is not assignable to parameter `iterable` with type `Iterable[@_]` in function `tuple.__new__`", + "severity": "error" + }, + { + "line": 295, + "column": 19, + "stop_line": 295, + "stop_column": 45, + "path": "src\\streamdiffusion\\model_detection.py", + "code": -2, + "name": "missing-attribute", + "description": "Object of class `dict` has no attribute `cross_attention_dim`", + "concise_description": "Object of class `dict` has no attribute `cross_attention_dim`", + "severity": "error" + }, + { + "line": 296, + "column": 19, + "stop_line": 296, + "stop_column": 37, + "path": "src\\streamdiffusion\\model_detection.py", + "code": -2, + "name": "missing-attribute", + "description": "Object of class `dict` has no attribute `in_channels`", + "concise_description": "Object of class `dict` has no attribute `in_channels`", + "severity": "error" + }, + { + "line": 162, + "column": 57, + "stop_line": 162, + "stop_column": 75, + "path": "src\\streamdiffusion\\modules\\controlnet_module.py", + "code": -2, + "name": "missing-attribute", + "description": "Object of class `NoneType` has no attribute `width`", + "concise_description": "Object of class `NoneType` has no attribute `width`", + "severity": "error" + }, + { + "line": 163, + "column": 58, + "stop_line": 163, + "stop_column": 77, + "path": "src\\streamdiffusion\\modules\\controlnet_module.py", + "code": -2, + "name": "missing-attribute", + "description": "Object of class `NoneType` has no attribute `height`", + "concise_description": "Object of class `NoneType` has no attribute `height`", + "severity": "error" + }, + { + "line": 165, + "column": 21, + "stop_line": 165, + "stop_column": 40, + "path": "src\\streamdiffusion\\modules\\controlnet_module.py", + "code": -2, + "name": "missing-attribute", + "description": "Object of class `BasePreprocessor` has no attribute `image_width`", + "concise_description": "Object of class `BasePreprocessor` has no attribute `image_width`", + "severity": "error" + }, + { + "line": 167, + "column": 21, + "stop_line": 167, + "stop_column": 41, + "path": "src\\streamdiffusion\\modules\\controlnet_module.py", + "code": -2, + "name": "missing-attribute", + "description": "Object of class `BasePreprocessor` has no attribute `image_height`", + "concise_description": "Object of class `BasePreprocessor` has no attribute `image_height`", + "severity": "error" + }, + { + "line": 212, + "column": 60, + "stop_line": 212, + "stop_column": 78, + "path": "src\\streamdiffusion\\modules\\controlnet_module.py", + "code": -2, + "name": "missing-attribute", + "description": "Object of class `NoneType` has no attribute `width`", + "concise_description": "Object of class `NoneType` has no attribute `width`", + "severity": "error" + }, + { + "line": 212, + "column": 80, + "stop_line": 212, + "stop_column": 99, + "path": "src\\streamdiffusion\\modules\\controlnet_module.py", + "code": -2, + "name": "missing-attribute", + "description": "Object of class `NoneType` has no attribute `height`", + "concise_description": "Object of class `NoneType` has no attribute `height`", + "severity": "error" + }, + { + "line": 217, + "column": 21, + "stop_line": 217, + "stop_column": 50, + "path": "src\\streamdiffusion\\modules\\controlnet_module.py", + "code": -2, + "name": "unsupported-operation", + "description": "Cannot set item in `list[Tensor | None]`\n No matching overload found for function `list.__setitem__` called with arguments: (int, Tensor | tuple[Tensor, Tensor])\n Possible overloads:\n (key: SupportsIndex, value: Tensor | None, /) -> None [closest match]\n (key: slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | Unknown | None], value: Iterable[Tensor | None], /) -> None", + "concise_description": "Cannot set item in `list[Tensor | None]`", + "severity": "error" + }, + { + "line": 223, + "column": 48, + "stop_line": 223, + "stop_column": 59, + "path": "src\\streamdiffusion\\modules\\controlnet_module.py", + "code": -2, + "name": "bad-argument-type", + "description": "Argument `str` is not assignable to parameter `device` with type `device` in function `ControlNetModule.prepare_frame_tensors`", + "concise_description": "Argument `str` is not assignable to parameter `device` with type `device` in function `ControlNetModule.prepare_frame_tensors`", + "severity": "error" + }, + { + "line": 228, + "column": 56, + "stop_line": 228, + "stop_column": 74, + "path": "src\\streamdiffusion\\modules\\controlnet_module.py", + "code": -2, + "name": "missing-attribute", + "description": "Object of class `NoneType` has no attribute `width`", + "concise_description": "Object of class `NoneType` has no attribute `width`", + "severity": "error" + }, + { + "line": 228, + "column": 76, + "stop_line": 228, + "stop_column": 95, + "path": "src\\streamdiffusion\\modules\\controlnet_module.py", + "code": -2, + "name": "missing-attribute", + "description": "Object of class `NoneType` has no attribute `height`", + "concise_description": "Object of class `NoneType` has no attribute `height`", + "severity": "error" + }, + { + "line": 245, + "column": 40, + "stop_line": 245, + "stop_column": 51, + "path": "src\\streamdiffusion\\modules\\controlnet_module.py", + "code": -2, + "name": "bad-argument-type", + "description": "Argument `str` is not assignable to parameter `device` with type `device` in function `ControlNetModule.prepare_frame_tensors`", + "concise_description": "Argument `str` is not assignable to parameter `device` with type `device` in function `ControlNetModule.prepare_frame_tensors`", + "severity": "error" + }, + { + "line": 512, + "column": 37, + "stop_line": 512, + "stop_column": 63, + "path": "src\\streamdiffusion\\modules\\controlnet_module.py", + "code": -2, + "name": "missing-attribute", + "description": "Object of class `NoneType` has no attribute `prompt_embeds`", + "concise_description": "Object of class `NoneType` has no attribute `prompt_embeds`", + "severity": "error" + }, + { + "line": 547, + "column": 49, + "stop_line": 547, + "stop_column": 58, + "path": "src\\streamdiffusion\\modules\\controlnet_module.py", + "code": -2, + "name": "unsupported-operation", + "description": "Cannot set item in `dict[str, bool]`\n Argument `int` is not assignable to parameter `key` with type `str` in function `dict.__setitem__`", + "concise_description": "Cannot set item in `dict[str, bool]`", + "severity": "error" + }, + { + "line": 647, + "column": 17, + "stop_line": 647, + "stop_column": 42, + "path": "src\\streamdiffusion\\modules\\controlnet_module.py", + "code": -2, + "name": "missing-attribute", + "description": "Object of class `NoneType` has no attribute `copy_`", + "concise_description": "Object of class `NoneType` has no attribute `copy_`", + "severity": "error" + }, + { + "line": 652, + "column": 21, + "stop_line": 652, + "stop_column": 45, + "path": "src\\streamdiffusion\\modules\\controlnet_module.py", + "code": -2, + "name": "missing-attribute", + "description": "Object of class `NoneType` has no attribute `add_`", + "concise_description": "Object of class `NoneType` has no attribute `add_`", + "severity": "error" + }, + { + "line": 676, + "column": 51, + "stop_line": 676, + "stop_column": 69, + "path": "src\\streamdiffusion\\modules\\controlnet_module.py", + "code": -2, + "name": "missing-attribute", + "description": "Object of class `NoneType` has no attribute `width`", + "concise_description": "Object of class `NoneType` has no attribute `width`", + "severity": "error" + }, + { + "line": 676, + "column": 71, + "stop_line": 676, + "stop_column": 90, + "path": "src\\streamdiffusion\\modules\\controlnet_module.py", + "code": -2, + "name": "missing-attribute", + "description": "Object of class `NoneType` has no attribute `height`", + "concise_description": "Object of class `NoneType` has no attribute `height`", + "severity": "error" + }, + { + "line": 679, + "column": 16, + "stop_line": 679, + "stop_column": 45, + "path": "src\\streamdiffusion\\modules\\controlnet_module.py", + "code": -2, + "name": "bad-return", + "description": "Returned type `Tensor | tuple[Tensor, Tensor] | None` is not assignable to declared return type `Tensor`", + "concise_description": "Returned type `Tensor | tuple[Tensor, Tensor] | None` is not assignable to declared return type `Tensor`", + "severity": "error" + }, + { + "line": 694, + "column": 56, + "stop_line": 694, + "stop_column": 77, + "path": "src\\streamdiffusion\\modules\\controlnet_module.py", + "code": -2, + "name": "bad-typed-dict-key", + "description": "`int` is not assignable to TypedDict key `conditioning_channels` with type `dtype`", + "concise_description": "`int` is not assignable to TypedDict key `conditioning_channels` with type `dtype`", + "severity": "error" + }, + { + "line": 717, + "column": 59, + "stop_line": 717, + "stop_column": 63, + "path": "src\\streamdiffusion\\modules\\controlnet_module.py", + "code": -2, + "name": "bad-typed-dict-key", + "description": "`Literal[True]` is not assignable to TypedDict key `local_files_only` with type `dtype`", + "concise_description": "`Literal[True]` is not assignable to TypedDict key `local_files_only` with type `dtype`", + "severity": "error" + }, + { + "line": 721, + "column": 55, + "stop_line": 721, + "stop_column": 59, + "path": "src\\streamdiffusion\\modules\\controlnet_module.py", + "code": -2, + "name": "bad-typed-dict-key", + "description": "`Literal[True]` is not assignable to TypedDict key `local_files_only` with type `dtype`", + "concise_description": "`Literal[True]` is not assignable to TypedDict key `local_files_only` with type `dtype`", + "severity": "error" + }, + { + "line": 726, + "column": 55, + "stop_line": 726, + "stop_column": 59, + "path": "src\\streamdiffusion\\modules\\controlnet_module.py", + "code": -2, + "name": "bad-typed-dict-key", + "description": "`Literal[True]` is not assignable to TypedDict key `local_files_only` with type `dtype`", + "concise_description": "`Literal[True]` is not assignable to TypedDict key `local_files_only` with type `dtype`", + "severity": "error" + }, + { + "line": 741, + "column": 39, + "stop_line": 741, + "stop_column": 47, + "path": "src\\streamdiffusion\\modules\\controlnet_module.py", + "code": -2, + "name": "bad-argument-type", + "description": "Argument `str` is not assignable to parameter `value` with type `Module | Tensor` in function `torch.nn.modules.module.Module.__setattr__`", + "concise_description": "Argument `str` is not assignable to parameter `value` with type `Module | Tensor` in function `torch.nn.modules.module.Module.__setattr__`", + "severity": "error" + }, + { + "line": 33, + "column": 16, + "stop_line": 33, + "stop_column": 71, + "path": "src\\streamdiffusion\\modules\\image_processing_module.py", + "code": -2, + "name": "missing-attribute", + "description": "Object of class `NoneType` has no attribute `execute_pipeline_chain`", + "concise_description": "Object of class `NoneType` has no attribute `execute_pipeline_chain`", + "severity": "error" + }, + { + "line": 68, + "column": 9, + "stop_line": 68, + "stop_column": 24, + "path": "src\\streamdiffusion\\modules\\image_processing_module.py", + "code": -2, + "name": "missing-attribute", + "description": "Object of class `BasePreprocessor` has no attribute `order`", + "concise_description": "Object of class `BasePreprocessor` has no attribute `order`", + "severity": "error" + }, + { + "line": 71, + "column": 9, + "stop_line": 71, + "stop_column": 26, + "path": "src\\streamdiffusion\\modules\\image_processing_module.py", + "code": -2, + "name": "missing-attribute", + "description": "Object of class `BasePreprocessor` has no attribute `enabled`", + "concise_description": "Object of class `BasePreprocessor` has no attribute `enabled`", + "severity": "error" + }, + { + "line": 80, + "column": 21, + "stop_line": 80, + "stop_column": 42, + "path": "src\\streamdiffusion\\modules\\image_processing_module.py", + "code": -2, + "name": "missing-attribute", + "description": "Object of class `BasePreprocessor` has no attribute `image_width`", + "concise_description": "Object of class `BasePreprocessor` has no attribute `image_width`", + "severity": "error" + }, + { + "line": 82, + "column": 21, + "stop_line": 82, + "stop_column": 43, + "path": "src\\streamdiffusion\\modules\\image_processing_module.py", + "code": -2, + "name": "missing-attribute", + "description": "Object of class `BasePreprocessor` has no attribute `image_height`", + "concise_description": "Object of class `BasePreprocessor` has no attribute `image_height`", + "severity": "error" + }, + { + "line": 131, + "column": 16, + "stop_line": 131, + "stop_column": 75, + "path": "src\\streamdiffusion\\modules\\image_processing_module.py", + "code": -2, + "name": "missing-attribute", + "description": "Object of class `NoneType` has no attribute `process_pipelined`", + "concise_description": "Object of class `NoneType` has no attribute `process_pipelined`", + "severity": "error" + }, + { + "line": 170, + "column": 16, + "stop_line": 170, + "stop_column": 67, + "path": "src\\streamdiffusion\\modules\\image_processing_module.py", + "code": -2, + "name": "missing-attribute", + "description": "Object of class `NoneType` has no attribute `process_pipelined`", + "concise_description": "Object of class `NoneType` has no attribute `process_pipelined`", + "severity": "error" + }, + { + "line": 369, + "column": 13, + "stop_line": 369, + "stop_column": 34, + "path": "src\\streamdiffusion\\modules\\ipadapter_module.py", + "code": -2, + "name": "missing-attribute", + "description": "Object of class `IPAdapter` has no attribute `weight_type`", + "concise_description": "Object of class `IPAdapter` has no attribute `weight_type`", + "severity": "error" + }, + { + "line": 370, + "column": 13, + "stop_line": 370, + "stop_column": 28, + "path": "src\\streamdiffusion\\modules\\ipadapter_module.py", + "code": -2, + "name": "missing-attribute", + "description": "Object of class `IPAdapter` has no attribute `scale`", + "concise_description": "Object of class `IPAdapter` has no attribute `scale`", + "severity": "error" + }, + { + "line": 371, + "column": 13, + "stop_line": 371, + "stop_column": 30, + "path": "src\\streamdiffusion\\modules\\ipadapter_module.py", + "code": -2, + "name": "missing-attribute", + "description": "Object of class `IPAdapter` has no attribute `enabled`", + "concise_description": "Object of class `IPAdapter` has no attribute `enabled`", + "severity": "error" + }, + { + "line": 534, + "column": 49, + "stop_line": 534, + "stop_column": 57, + "path": "src\\streamdiffusion\\modules\\ipadapter_module.py", + "code": -2, + "name": "bad-argument-type", + "description": "Argument `Any | None` is not assignable to parameter `x` with type `Buffer | SupportsFloat | SupportsIndex | str` in function `float.__new__`\n Protocol `Buffer` requires attribute `__buffer__`", + "concise_description": "Argument `Any | None` is not assignable to parameter `x` with type `Buffer | SupportsFloat | SupportsIndex | str` in function `float.__new__`", + "severity": "error" + }, + { + "line": 33, + "column": 16, + "stop_line": 33, + "stop_column": 71, + "path": "src\\streamdiffusion\\modules\\latent_processing_module.py", + "code": -2, + "name": "missing-attribute", + "description": "Object of class `NoneType` has no attribute `execute_pipeline_chain`", + "concise_description": "Object of class `NoneType` has no attribute `execute_pipeline_chain`", + "severity": "error" + }, + { + "line": 50, + "column": 67, + "stop_line": 50, + "stop_column": 79, + "path": "src\\streamdiffusion\\modules\\latent_processing_module.py", + "code": -2, + "name": "missing-attribute", + "description": "Object of class `LatentProcessingModule` has no attribute `_stream`", + "concise_description": "Object of class `LatentProcessingModule` has no attribute `_stream`", + "severity": "error" + }, + { + "line": 66, + "column": 9, + "stop_line": 66, + "stop_column": 24, + "path": "src\\streamdiffusion\\modules\\latent_processing_module.py", + "code": -2, + "name": "missing-attribute", + "description": "Object of class `BasePreprocessor` has no attribute `order`", + "concise_description": "Object of class `BasePreprocessor` has no attribute `order`", + "severity": "error" + }, + { + "line": 69, + "column": 9, + "stop_line": 69, + "stop_column": 26, + "path": "src\\streamdiffusion\\modules\\latent_processing_module.py", + "code": -2, + "name": "missing-attribute", + "description": "Object of class `BasePreprocessor` has no attribute `enabled`", + "concise_description": "Object of class `BasePreprocessor` has no attribute `enabled`", + "severity": "error" + }, + { + "line": 78, + "column": 44, + "stop_line": 78, + "stop_column": 65, + "path": "src\\streamdiffusion\\pipeline.py", + "code": -2, + "name": "missing-attribute", + "description": "Object of class `StableDiffusionPipeline` has no attribute `vae_scale_factor`", + "concise_description": "Object of class `StableDiffusionPipeline` has no attribute `vae_scale_factor`", + "severity": "error" + }, + { + "line": 79, + "column": 42, + "stop_line": 79, + "stop_column": 63, + "path": "src\\streamdiffusion\\pipeline.py", + "code": -2, + "name": "missing-attribute", + "description": "Object of class `StableDiffusionPipeline` has no attribute `vae_scale_factor`", + "concise_description": "Object of class `StableDiffusionPipeline` has no attribute `vae_scale_factor`", + "severity": "error" + }, + { + "line": 89, + "column": 41, + "stop_line": 89, + "stop_column": 50, + "path": "src\\streamdiffusion\\pipeline.py", + "code": -2, + "name": "missing-attribute", + "description": "Object of class `StableDiffusionPipeline` has no attribute `unet`", + "concise_description": "Object of class `StableDiffusionPipeline` has no attribute `unet`", + "severity": "error" + }, + { + "line": 137, + "column": 50, + "stop_line": 137, + "stop_column": 71, + "path": "src\\streamdiffusion\\pipeline.py", + "code": -2, + "name": "missing-attribute", + "description": "Object of class `StableDiffusionPipeline` has no attribute `vae_scale_factor`", + "concise_description": "Object of class `StableDiffusionPipeline` has no attribute `vae_scale_factor`", + "severity": "error" + }, + { + "line": 138, + "column": 73, + "stop_line": 138, + "stop_column": 87, + "path": "src\\streamdiffusion\\pipeline.py", + "code": -2, + "name": "missing-attribute", + "description": "Object of class `StableDiffusionPipeline` has no attribute `scheduler`", + "concise_description": "Object of class `StableDiffusionPipeline` has no attribute `scheduler`", + "severity": "error" + }, + { + "line": 140, + "column": 29, + "stop_line": 140, + "stop_column": 46, + "path": "src\\streamdiffusion\\pipeline.py", + "code": -2, + "name": "missing-attribute", + "description": "Object of class `StableDiffusionPipeline` has no attribute `text_encoder`", + "concise_description": "Object of class `StableDiffusionPipeline` has no attribute `text_encoder`", + "severity": "error" + }, + { + "line": 141, + "column": 21, + "stop_line": 141, + "stop_column": 30, + "path": "src\\streamdiffusion\\pipeline.py", + "code": -2, + "name": "missing-attribute", + "description": "Object of class `StableDiffusionPipeline` has no attribute `unet`", + "concise_description": "Object of class `StableDiffusionPipeline` has no attribute `unet`", + "severity": "error" + }, + { + "line": 142, + "column": 20, + "stop_line": 142, + "stop_column": 28, + "path": "src\\streamdiffusion\\pipeline.py", + "code": -2, + "name": "missing-attribute", + "description": "Object of class `StableDiffusionPipeline` has no attribute `vae`", + "concise_description": "Object of class `StableDiffusionPipeline` has no attribute `vae`", + "severity": "error" + }, + { + "line": 230, + "column": 54, + "stop_line": 230, + "stop_column": 57, + "path": "src\\streamdiffusion\\pipeline.py", + "code": -2, + "name": "bad-typed-dict-key", + "description": "`Literal[100]` is not assignable to TypedDict key `original_inference_steps` with type `str`", + "concise_description": "`Literal[100]` is not assignable to TypedDict key `original_inference_steps` with type `str`", + "severity": "error" + }, + { + "line": 230, + "column": 54, + "stop_line": 230, + "stop_column": 57, + "path": "src\\streamdiffusion\\pipeline.py", + "code": -2, + "name": "unsupported-operation", + "description": "Cannot set item in `dict[str, str]`\n Argument `Literal[100]` is not assignable to parameter `value` with type `str` in function `dict.__setitem__`", + "concise_description": "Cannot set item in `dict[str, str]`", + "severity": "error" + }, + { + "line": 277, + "column": 20, + "stop_line": 280, + "stop_column": 14, + "path": "src\\streamdiffusion\\pipeline.py", + "code": -2, + "name": "bad-return", + "description": "Returned type `dict[str, Tensor | None]` is not assignable to declared return type `dict[str, Tensor] | None`", + "concise_description": "Returned type `dict[str, Tensor | None]` is not assignable to declared return type `dict[str, Tensor] | None`", + "severity": "error" + }, + { + "line": 299, + "column": 27, + "stop_line": 299, + "stop_column": 52, + "path": "src\\streamdiffusion\\pipeline.py", + "code": -2, + "name": "unsupported-operation", + "description": "`None` is not subscriptable", + "concise_description": "`None` is not subscriptable", + "severity": "error" + }, + { + "line": 300, + "column": 25, + "stop_line": 300, + "stop_column": 50, + "path": "src\\streamdiffusion\\pipeline.py", + "code": -2, + "name": "unsupported-operation", + "description": "`None` is not subscriptable", + "concise_description": "`None` is not subscriptable", + "severity": "error" + }, + { + "line": 301, + "column": 27, + "stop_line": 301, + "stop_column": 49, + "path": "src\\streamdiffusion\\pipeline.py", + "code": -2, + "name": "unsupported-operation", + "description": "`None` is not subscriptable", + "concise_description": "`None` is not subscriptable", + "severity": "error" + }, + { + "line": 302, + "column": 25, + "stop_line": 302, + "stop_column": 47, + "path": "src\\streamdiffusion\\pipeline.py", + "code": -2, + "name": "unsupported-operation", + "description": "`None` is not subscriptable", + "concise_description": "`None` is not subscriptable", + "severity": "error" + }, + { + "line": 316, + "column": 31, + "stop_line": 316, + "stop_column": 58, + "path": "src\\streamdiffusion\\pipeline.py", + "code": -2, + "name": "missing-attribute", + "description": "Object of class `NoneType` has no attribute `expand`", + "concise_description": "Object of class `NoneType` has no attribute `expand`", + "severity": "error" + }, + { + "line": 317, + "column": 28, + "stop_line": 317, + "stop_column": 52, + "path": "src\\streamdiffusion\\pipeline.py", + "code": -2, + "name": "missing-attribute", + "description": "Object of class `NoneType` has no attribute `expand`", + "concise_description": "Object of class `NoneType` has no attribute `expand`", + "severity": "error" + }, + { + "line": 320, + "column": 27, + "stop_line": 320, + "stop_column": 52, + "path": "src\\streamdiffusion\\pipeline.py", + "code": -2, + "name": "unsupported-operation", + "description": "`None` is not subscriptable", + "concise_description": "`None` is not subscriptable", + "severity": "error" + }, + { + "line": 320, + "column": 56, + "stop_line": 320, + "stop_column": 82, + "path": "src\\streamdiffusion\\pipeline.py", + "code": -2, + "name": "missing-attribute", + "description": "Object of class `NoneType` has no attribute `shape`", + "concise_description": "Object of class `NoneType` has no attribute `shape`", + "severity": "error" + }, + { + "line": 321, + "column": 27, + "stop_line": 321, + "stop_column": 49, + "path": "src\\streamdiffusion\\pipeline.py", + "code": -2, + "name": "unsupported-operation", + "description": "`None` is not subscriptable", + "concise_description": "`None` is not subscriptable", + "severity": "error" + }, + { + "line": 321, + "column": 53, + "stop_line": 321, + "stop_column": 76, + "path": "src\\streamdiffusion\\pipeline.py", + "code": -2, + "name": "missing-attribute", + "description": "Object of class `NoneType` has no attribute `shape`", + "concise_description": "Object of class `NoneType` has no attribute `shape`", + "severity": "error" + }, + { + "line": 322, + "column": 31, + "stop_line": 322, + "stop_column": 49, + "path": "src\\streamdiffusion\\pipeline.py", + "code": -2, + "name": "missing-attribute", + "description": "Object of class `NoneType` has no attribute `expand`", + "concise_description": "Object of class `NoneType` has no attribute `expand`", + "severity": "error" + }, + { + "line": 323, + "column": 28, + "stop_line": 323, + "stop_column": 46, + "path": "src\\streamdiffusion\\pipeline.py", + "code": -2, + "name": "missing-attribute", + "description": "Object of class `NoneType` has no attribute `expand`", + "concise_description": "Object of class `NoneType` has no attribute `expand`", + "severity": "error" + }, + { + "line": 344, + "column": 13, + "stop_line": 344, + "stop_column": 40, + "path": "src\\streamdiffusion\\pipeline.py", + "code": -2, + "name": "missing-attribute", + "description": "Object of class `StableDiffusionPipeline` has no attribute `load_lora_weights`", + "concise_description": "Object of class `StableDiffusionPipeline` has no attribute `load_lora_weights`", + "severity": "error" + }, + { + "line": 363, + "column": 17, + "stop_line": 363, + "stop_column": 44, + "path": "src\\streamdiffusion\\pipeline.py", + "code": -2, + "name": "missing-attribute", + "description": "Object of class `StableDiffusionPipeline` has no attribute `load_lora_weights`", + "concise_description": "Object of class `StableDiffusionPipeline` has no attribute `load_lora_weights`", + "severity": "error" + }, + { + "line": 384, + "column": 9, + "stop_line": 384, + "stop_column": 28, + "path": "src\\streamdiffusion\\pipeline.py", + "code": -2, + "name": "missing-attribute", + "description": "Object of class `StableDiffusionPipeline` has no attribute `fuse_lora`", + "concise_description": "Object of class `StableDiffusionPipeline` has no attribute `fuse_lora`", + "severity": "error" + }, + { + "line": 435, + "column": 38, + "stop_line": 435, + "stop_column": 42, + "path": "src\\streamdiffusion\\pipeline.py", + "code": -2, + "name": "bad-assignment", + "description": "`None` is not assignable to attribute `x_t_latent_buffer` with type `Tensor`", + "concise_description": "`None` is not assignable to attribute `x_t_latent_buffer` with type `Tensor`", + "severity": "error" + }, + { + "line": 451, + "column": 30, + "stop_line": 451, + "stop_column": 53, + "path": "src\\streamdiffusion\\pipeline.py", + "code": -2, + "name": "missing-attribute", + "description": "Object of class `StableDiffusionPipeline` has no attribute `encode_prompt`", + "concise_description": "Object of class `StableDiffusionPipeline` has no attribute `encode_prompt`", + "severity": "error" + }, + { + "line": 482, + "column": 53, + "stop_line": 482, + "stop_column": 73, + "path": "src\\streamdiffusion\\pipeline.py", + "code": -2, + "name": "unbound-name", + "description": "`uncond_prompt_embeds` may be uninitialized", + "concise_description": "`uncond_prompt_embeds` may be uninitialized", + "severity": "error" + }, + { + "line": 515, + "column": 30, + "stop_line": 515, + "stop_column": 53, + "path": "src\\streamdiffusion\\pipeline.py", + "code": -2, + "name": "missing-attribute", + "description": "Object of class `StableDiffusionPipeline` has no attribute `encode_prompt`", + "concise_description": "Object of class `StableDiffusionPipeline` has no attribute `encode_prompt`", + "severity": "error" + }, + { + "line": 530, + "column": 49, + "stop_line": 530, + "stop_column": 69, + "path": "src\\streamdiffusion\\pipeline.py", + "code": -2, + "name": "unbound-name", + "description": "`uncond_prompt_embeds` may be uninitialized", + "concise_description": "`uncond_prompt_embeds` may be uninitialized", + "severity": "error" + }, + { + "line": 643, + "column": 44, + "stop_line": 643, + "stop_column": 48, + "path": "src\\streamdiffusion\\pipeline.py", + "code": -2, + "name": "bad-assignment", + "description": "`None` is not assignable to attribute `_sub_timesteps_expanded` with type `Tensor`", + "concise_description": "`None` is not assignable to attribute `_sub_timesteps_expanded` with type `Tensor`", + "severity": "error" + }, + { + "line": 739, + "column": 29, + "stop_line": 739, + "stop_column": 88, + "path": "src\\streamdiffusion\\pipeline.py", + "code": -2, + "name": "missing-attribute", + "description": "Object of class `LCMScheduler` has no attribute `get_scalings_for_boundary_condition_discrete`", + "concise_description": "Object of class `LCMScheduler` has no attribute `get_scalings_for_boundary_condition_discrete`", + "severity": "error" + }, + { + "line": 763, + "column": 44, + "stop_line": 763, + "stop_column": 48, + "path": "src\\streamdiffusion\\pipeline.py", + "code": -2, + "name": "bad-function-definition", + "description": "Default `None` is not assignable to parameter `scheduler` with type `Literal['lcm', 'tcd']`", + "concise_description": "Default `None` is not assignable to parameter `scheduler` with type `Literal['lcm', 'tcd']`", + "severity": "error" + }, + { + "line": 764, + "column": 89, + "stop_line": 764, + "stop_column": 93, + "path": "src\\streamdiffusion\\pipeline.py", + "code": -2, + "name": "bad-function-definition", + "description": "Default `None` is not assignable to parameter `sampler` with type `Literal['beta', 'ddim', 'karras', 'normal', 'sgm_uniform', 'simple']`", + "concise_description": "Default `None` is not assignable to parameter `sampler` with type `Literal['beta', 'ddim', 'karras', 'normal', 'sgm_uniform', 'simple']`", + "severity": "error" + }, + { + "line": 781, + "column": 93, + "stop_line": 781, + "stop_column": 112, + "path": "src\\streamdiffusion\\pipeline.py", + "code": -2, + "name": "missing-attribute", + "description": "Object of class `StableDiffusionPipeline` has no attribute `scheduler`", + "concise_description": "Object of class `StableDiffusionPipeline` has no attribute `scheduler`", + "severity": "error" + }, + { + "line": 829, + "column": 17, + "stop_line": 829, + "stop_column": 41, + "path": "src\\streamdiffusion\\pipeline.py", + "code": -2, + "name": "unsupported-operation", + "description": "`None` is not subscriptable", + "concise_description": "`None` is not subscriptable", + "severity": "error" + }, + { + "line": 830, + "column": 17, + "stop_line": 830, + "stop_column": 41, + "path": "src\\streamdiffusion\\pipeline.py", + "code": -2, + "name": "unsupported-operation", + "description": "`None` is not subscriptable", + "concise_description": "`None` is not subscriptable", + "severity": "error" + }, + { + "line": 832, + "column": 17, + "stop_line": 832, + "stop_column": 36, + "path": "src\\streamdiffusion\\pipeline.py", + "code": -2, + "name": "unsupported-operation", + "description": "`None` is not subscriptable", + "concise_description": "`None` is not subscriptable", + "severity": "error" + }, + { + "line": 833, + "column": 17, + "stop_line": 833, + "stop_column": 36, + "path": "src\\streamdiffusion\\pipeline.py", + "code": -2, + "name": "unsupported-operation", + "description": "`None` is not subscriptable", + "concise_description": "`None` is not subscriptable", + "severity": "error" + }, + { + "line": 834, + "column": 26, + "stop_line": 834, + "stop_column": 41, + "path": "src\\streamdiffusion\\pipeline.py", + "code": -2, + "name": "bad-assignment", + "description": "`Unknown | None` is not assignable to variable `t_list` with type `Tensor | list[int]`", + "concise_description": "`Unknown | None` is not assignable to variable `t_list` with type `Tensor | list[int]`", + "severity": "error" + }, + { + "line": 836, + "column": 17, + "stop_line": 836, + "stop_column": 56, + "path": "src\\streamdiffusion\\pipeline.py", + "code": -2, + "name": "unsupported-operation", + "description": "`None` is not subscriptable", + "concise_description": "`None` is not subscriptable", + "severity": "error" + }, + { + "line": 837, + "column": 17, + "stop_line": 837, + "stop_column": 56, + "path": "src\\streamdiffusion\\pipeline.py", + "code": -2, + "name": "unsupported-operation", + "description": "`None` is not subscriptable", + "concise_description": "`None` is not subscriptable", + "severity": "error" + }, + { + "line": 839, + "column": 17, + "stop_line": 839, + "stop_column": 47, + "path": "src\\streamdiffusion\\pipeline.py", + "code": -2, + "name": "unsupported-operation", + "description": "`None` is not subscriptable", + "concise_description": "`None` is not subscriptable", + "severity": "error" + }, + { + "line": 840, + "column": 17, + "stop_line": 840, + "stop_column": 47, + "path": "src\\streamdiffusion\\pipeline.py", + "code": -2, + "name": "unsupported-operation", + "description": "`None` is not subscriptable", + "concise_description": "`None` is not subscriptable", + "severity": "error" + }, + { + "line": 841, + "column": 26, + "stop_line": 841, + "stop_column": 41, + "path": "src\\streamdiffusion\\pipeline.py", + "code": -2, + "name": "bad-assignment", + "description": "`Unknown | None` is not assignable to variable `t_list` with type `Tensor | list[int]`", + "concise_description": "`Unknown | None` is not assignable to variable `t_list` with type `Tensor | list[int]`", + "severity": "error" + }, + { + "line": 856, + "column": 34, + "stop_line": 856, + "stop_column": 58, + "path": "src\\streamdiffusion\\pipeline.py", + "code": -2, + "name": "missing-attribute", + "description": "Object of class `NoneType` has no attribute `shape`", + "concise_description": "Object of class `NoneType` has no attribute `shape`", + "severity": "error" + }, + { + "line": 883, + "column": 36, + "stop_line": 883, + "stop_column": 54, + "path": "src\\streamdiffusion\\pipeline.py", + "code": -2, + "name": "bad-argument-type", + "description": "Argument `Tensor | Unknown | None` is not assignable to parameter `x_t_latent` with type `Tensor` in function `streamdiffusion.hooks.StepCtx.__init__`", + "concise_description": "Argument `Tensor | Unknown | None` is not assignable to parameter `x_t_latent` with type `Tensor` in function `streamdiffusion.hooks.StepCtx.__init__`", + "severity": "error" + }, + { + "line": 884, + "column": 32, + "stop_line": 884, + "stop_column": 38, + "path": "src\\streamdiffusion\\pipeline.py", + "code": -2, + "name": "bad-argument-type", + "description": "Argument `Tensor | list[int]` is not assignable to parameter `t_list` with type `Tensor` in function `streamdiffusion.hooks.StepCtx.__init__`", + "concise_description": "Argument `Tensor | list[int]` is not assignable to parameter `t_list` with type `Tensor` in function `streamdiffusion.hooks.StepCtx.__init__`", + "severity": "error" + }, + { + "line": 1029, + "column": 30, + "stop_line": 1029, + "stop_column": 47, + "path": "src\\streamdiffusion\\pipeline.py", + "code": -2, + "name": "unbound-name", + "description": "`noise_pred_uncond` may be uninitialized", + "concise_description": "`noise_pred_uncond` may be uninitialized", + "severity": "error" + }, + { + "line": 1040, + "column": 27, + "stop_line": 1040, + "stop_column": 53, + "path": "src\\streamdiffusion\\pipeline.py", + "code": -2, + "name": "unsupported-operation", + "description": "`*` is not supported between `None` and `Tensor`\n Argument `None` is not assignable to parameter `other` with type `Tensor | bool | complex | float | int` in function `torch._C.TensorBase.__rmul__`", + "concise_description": "`*` is not supported between `None` and `Tensor`", + "severity": "error" + }, + { + "line": 1041, + "column": 27, + "stop_line": 1041, + "stop_column": 52, + "path": "src\\streamdiffusion\\pipeline.py", + "code": -2, + "name": "unsupported-operation", + "description": "`/` is not supported between `Tensor` and `None`\n Argument `None` is not assignable to parameter `other` with type `Tensor | bool | complex | float | int` in function `torch._C.TensorBase.__truediv__`", + "concise_description": "`/` is not supported between `Tensor` and `None`", + "severity": "error" + }, + { + "line": 1042, + "column": 36, + "stop_line": 1042, + "stop_column": 70, + "path": "src\\streamdiffusion\\pipeline.py", + "code": -2, + "name": "unsupported-operation", + "description": "`+` is not supported between `None` and `Tensor`\n Argument `None` is not assignable to parameter `other` with type `Tensor | bool | complex | float | int` in function `torch._C.TensorBase.__radd__`", + "concise_description": "`+` is not supported between `None` and `Tensor`", + "severity": "error" + }, + { + "line": 1076, + "column": 61, + "stop_line": 1076, + "stop_column": 88, + "path": "src\\streamdiffusion\\pipeline.py", + "code": -2, + "name": "bad-argument-type", + "description": "Argument `Unknown | None` is not assignable to parameter `iterable` with type `Iterable[Unknown]` in function `enumerate.__new__`\n Protocol `Iterable` requires attribute `__iter__`", + "concise_description": "Argument `Unknown | None` is not assignable to parameter `iterable` with type `Iterable[Unknown]` in function `enumerate.__new__`", + "severity": "error" + }, + { + "line": 1098, + "column": 18, + "stop_line": 1098, + "stop_column": 58, + "path": "src\\streamdiffusion\\pipeline.py", + "code": -2, + "name": "bad-context-manager", + "description": "Cannot use `autocast` as a context manager\n Return type `Literal[False] | object | None` of function `autocast.__exit__` is not assignable to expected return type `bool | None`", + "concise_description": "Cannot use `autocast` as a context manager", + "severity": "error" + }, + { + "line": 1109, + "column": 18, + "stop_line": 1109, + "stop_column": 58, + "path": "src\\streamdiffusion\\pipeline.py", + "code": -2, + "name": "bad-context-manager", + "description": "Cannot use `autocast` as a context manager\n Return type `Literal[False] | object | None` of function `autocast.__exit__` is not assignable to expected return type `bool | None`", + "concise_description": "Cannot use `autocast` as a context manager", + "severity": "error" + }, + { + "line": 1123, + "column": 21, + "stop_line": 1123, + "stop_column": 69, + "path": "src\\streamdiffusion\\pipeline.py", + "code": -2, + "name": "unsupported-operation", + "description": "`None` is not subscriptable", + "concise_description": "`None` is not subscriptable", + "severity": "error" + }, + { + "line": 1124, + "column": 21, + "stop_line": 1124, + "stop_column": 69, + "path": "src\\streamdiffusion\\pipeline.py", + "code": -2, + "name": "unsupported-operation", + "description": "`None` is not subscriptable", + "concise_description": "`None` is not subscriptable", + "severity": "error" + }, + { + "line": 1125, + "column": 34, + "stop_line": 1125, + "stop_column": 59, + "path": "src\\streamdiffusion\\pipeline.py", + "code": -2, + "name": "bad-assignment", + "description": "`Unknown | None` is not assignable to variable `x_t_latent` with type `Tensor`", + "concise_description": "`Unknown | None` is not assignable to variable `x_t_latent` with type `Tensor`", + "severity": "error" + }, + { + "line": 1149, + "column": 46, + "stop_line": 1149, + "stop_column": 50, + "path": "src\\streamdiffusion\\pipeline.py", + "code": -2, + "name": "bad-assignment", + "description": "`None` is not assignable to attribute `x_t_latent_buffer` with type `Tensor`", + "concise_description": "`None` is not assignable to attribute `x_t_latent_buffer` with type `Tensor`", + "severity": "error" + }, + { + "line": 1171, + "column": 67, + "stop_line": 1171, + "stop_column": 73, + "path": "src\\streamdiffusion\\pipeline.py", + "code": -2, + "name": "bad-argument-type", + "description": "Argument `Tensor | Unknown | None` is not assignable to parameter `x_t_latent` with type `Tensor` in function `StreamDiffusion.unet_step`", + "concise_description": "Argument `Tensor | Unknown | None` is not assignable to parameter `x_t_latent` with type `Tensor` in function `StreamDiffusion.unet_step`", + "severity": "error" + }, + { + "line": 1175, + "column": 40, + "stop_line": 1175, + "stop_column": 59, + "path": "src\\streamdiffusion\\pipeline.py", + "code": -2, + "name": "missing-attribute", + "description": "Object of class `TCDScheduler` has no attribute `step`", + "concise_description": "Object of class `TCDScheduler` has no attribute `step`", + "severity": "error" + }, + { + "line": 1182, + "column": 67, + "stop_line": 1182, + "stop_column": 73, + "path": "src\\streamdiffusion\\pipeline.py", + "code": -2, + "name": "bad-argument-type", + "description": "Argument `Tensor | Unknown | None` is not assignable to parameter `x_t_latent` with type `Tensor` in function `StreamDiffusion.unet_step`", + "concise_description": "Argument `Tensor | Unknown | None` is not assignable to parameter `x_t_latent` with type `Tensor` in function `StreamDiffusion.unet_step`", + "severity": "error" + }, + { + "line": 1198, + "column": 20, + "stop_line": 1198, + "stop_column": 32, + "path": "src\\streamdiffusion\\pipeline.py", + "code": -2, + "name": "bad-return", + "description": "Returned type `Tensor | Unknown | None` is not assignable to declared return type `Tensor`", + "concise_description": "Returned type `Tensor | Unknown | None` is not assignable to declared return type `Tensor`", + "severity": "error" + }, + { + "line": 1232, + "column": 28, + "stop_line": 1232, + "stop_column": 50, + "path": "src\\streamdiffusion\\pipeline.py", + "code": -2, + "name": "bad-return", + "description": "Returned type `Unknown | None` is not assignable to declared return type `Tensor`", + "concise_description": "Returned type `Unknown | None` is not assignable to declared return type `Tensor`", + "severity": "error" + }, + { + "line": 1306, + "column": 43, + "stop_line": 1306, + "stop_column": 95, + "path": "src\\streamdiffusion\\pipeline.py", + "code": -2, + "name": "bad-assignment", + "description": "`float` is not assignable to attribute `inference_time_ema` with type `int`", + "concise_description": "`float` is not assignable to attribute `inference_time_ema` with type `int`", + "severity": "error" + }, + { + "line": 1441, + "column": 52, + "stop_line": 1441, + "stop_column": 110, + "path": "src\\streamdiffusion\\pipeline.py", + "code": -2, + "name": "bad-typed-dict-key", + "description": "`dict[str, Unknown]` is not assignable to TypedDict key `added_cond_kwargs` with type `Tensor | bool`", + "concise_description": "`dict[str, Unknown]` is not assignable to TypedDict key `added_cond_kwargs` with type `Tensor | bool`", + "severity": "error" + }, + { + "line": 133, + "column": 42, + "stop_line": 133, + "stop_column": 57, + "path": "src\\streamdiffusion\\preprocessing\\pipeline_preprocessing_orchestrator.py", + "code": -2, + "name": "unbound-name", + "description": "`original_stream` may be uninitialized", + "concise_description": "`original_stream` may be uninitialized", + "severity": "error" + }, + { + "line": 166, + "column": 42, + "stop_line": 166, + "stop_column": 57, + "path": "src\\streamdiffusion\\preprocessing\\postprocessing_orchestrator.py", + "code": -2, + "name": "unbound-name", + "description": "`original_stream` may be uninitialized", + "concise_description": "`original_stream` may be uninitialized", + "severity": "error" + }, + { + "line": 47, + "column": 9, + "stop_line": 47, + "stop_column": 21, + "path": "src\\streamdiffusion\\preprocessing\\preprocessing_orchestrator.py", + "code": -2, + "name": "bad-override", + "description": "Class member `PreprocessingOrchestrator.process_sync` overrides parent class `BaseOrchestrator` in an inconsistent manner\n `PreprocessingOrchestrator.process_sync` has type `(self: PreprocessingOrchestrator, control_image: ControlImage, preprocessors: list[Any | None], scales: list[float] = ..., stream_width: int = ..., stream_height: int = ..., index: int | None = None, processing_type: str = 'controlnet') -> list[Tensor | None] | list[tuple[Tensor, Tensor]]`, which is not assignable to `(self: PreprocessingOrchestrator, input_data: ControlImage, *args: Unknown, **kwargs: Unknown) -> list[Tensor | None]`, the type of `BaseOrchestrator.process_sync`\n Signature mismatch:\n ...r, input_data: ControlImage, *args: Unknown, **kwargs: Unknown) -> list[Tensor | None]: ...\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ parameters ^ return type\n ...r, control_image: ControlImage, preprocessors: list[Any | None], scales: list[float] = ..., stream_width: int = ..., stream_height: int = ..., index: int | None = None, processing_type: str = 'controlnet') -> list[Tensor | None] | list[tuple[Tensor, Tensor]]: ...\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ parameters ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ return type", + "concise_description": "Class member `PreprocessingOrchestrator.process_sync` overrides parent class `BaseOrchestrator` in an inconsistent manner", + "severity": "error" + }, + { + "line": 51, + "column": 31, + "stop_line": 51, + "stop_column": 35, + "path": "src\\streamdiffusion\\preprocessing\\preprocessing_orchestrator.py", + "code": -2, + "name": "bad-function-definition", + "description": "Default `None` is not assignable to parameter `scales` with type `list[float]`", + "concise_description": "Default `None` is not assignable to parameter `scales` with type `list[float]`", + "severity": "error" + }, + { + "line": 52, + "column": 29, + "stop_line": 52, + "stop_column": 33, + "path": "src\\streamdiffusion\\preprocessing\\preprocessing_orchestrator.py", + "code": -2, + "name": "bad-function-definition", + "description": "Default `None` is not assignable to parameter `stream_width` with type `int`", + "concise_description": "Default `None` is not assignable to parameter `stream_width` with type `int`", + "severity": "error" + }, + { + "line": 53, + "column": 30, + "stop_line": 53, + "stop_column": 34, + "path": "src\\streamdiffusion\\preprocessing\\preprocessing_orchestrator.py", + "code": -2, + "name": "bad-function-definition", + "description": "Default `None` is not assignable to parameter `stream_height` with type `int`", + "concise_description": "Default `None` is not assignable to parameter `stream_height` with type `int`", + "severity": "error" + }, + { + "line": 208, + "column": 42, + "stop_line": 208, + "stop_column": 57, + "path": "src\\streamdiffusion\\preprocessing\\preprocessing_orchestrator.py", + "code": -2, + "name": "unbound-name", + "description": "`original_stream` may be uninitialized", + "concise_description": "`original_stream` may be uninitialized", + "severity": "error" + }, + { + "line": 211, + "column": 52, + "stop_line": 211, + "stop_column": 56, + "path": "src\\streamdiffusion\\preprocessing\\preprocessing_orchestrator.py", + "code": -2, + "name": "bad-function-definition", + "description": "Default `None` is not assignable to parameter `preprocessors` with type `list[Any | None]`", + "concise_description": "Default `None` is not assignable to parameter `preprocessors` with type `list[Any | None]`", + "severity": "error" + }, + { + "line": 211, + "column": 80, + "stop_line": 211, + "stop_column": 84, + "path": "src\\streamdiffusion\\preprocessing\\preprocessing_orchestrator.py", + "code": -2, + "name": "bad-function-definition", + "description": "Default `None` is not assignable to parameter `scales` with type `list[float]`", + "concise_description": "Default `None` is not assignable to parameter `scales` with type `list[float]`", + "severity": "error" + }, + { + "line": 340, + "column": 9, + "stop_line": 340, + "stop_column": 32, + "path": "src\\streamdiffusion\\preprocessing\\preprocessing_orchestrator.py", + "code": -2, + "name": "unsupported-operation", + "description": "Cannot set item in `list[None]`\n No matching overload found for function `list.__setitem__` called with arguments: (int, Tensor)\n Possible overloads:\n (key: SupportsIndex, value: None, /) -> None [closest match]\n (key: slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | Unknown | None], value: Iterable[None], /) -> None", + "concise_description": "Cannot set item in `list[None]`", + "severity": "error" + }, + { + "line": 342, + "column": 16, + "stop_line": 342, + "stop_column": 32, + "path": "src\\streamdiffusion\\preprocessing\\preprocessing_orchestrator.py", + "code": -2, + "name": "bad-return", + "description": "Returned type `list[None]` is not assignable to declared return type `list[Tensor | None]`", + "concise_description": "Returned type `list[None]` is not assignable to declared return type `list[Tensor | None]`", + "severity": "error" + }, + { + "line": 375, + "column": 16, + "stop_line": 375, + "stop_column": 32, + "path": "src\\streamdiffusion\\preprocessing\\preprocessing_orchestrator.py", + "code": -2, + "name": "bad-return", + "description": "Returned type `list[None]` is not assignable to declared return type `list[Tensor | None]`", + "concise_description": "Returned type `list[None]` is not assignable to declared return type `list[Tensor | None]`", + "severity": "error" + }, + { + "line": 426, + "column": 16, + "stop_line": 426, + "stop_column": 23, + "path": "src\\streamdiffusion\\preprocessing\\preprocessing_orchestrator.py", + "code": -2, + "name": "bad-return", + "description": "Returned type `list[None]` is not assignable to declared return type `list[tuple[Tensor, Tensor]]`", + "concise_description": "Returned type `list[None]` is not assignable to declared return type `list[tuple[Tensor, Tensor]]`", + "severity": "error" + }, + { + "line": 477, + "column": 17, + "stop_line": 477, + "stop_column": 77, + "path": "src\\streamdiffusion\\preprocessing\\preprocessing_orchestrator.py", + "code": -2, + "name": "missing-import", + "description": "Cannot find module `streamdiffusion.preprocessing.processors.temporal_net`\n Looked in these locations (from config in `D:\\dev\\SDTD_032_dev\\StreamDiffusion\\pyproject.toml`):\n Search path (from config file): [\"D:\\\\dev\\\\SDTD_032_dev\\\\StreamDiffusion\\\\src\"]\n Import root (inferred from project layout): \"D:\\\\dev\\\\SDTD_032_dev\\\\StreamDiffusion\\\\src\"\n Site package path queried from interpreter: [\"C:\\\\Users\\\\Inter\\\\AppData\\\\Local\\\\Programs\\\\Python\\\\Python311\\\\DLLs\", \"C:\\\\Users\\\\Inter\\\\AppData\\\\Local\\\\Programs\\\\Python\\\\Python311\", \"D:\\\\dev\\\\SDTD_032_dev\\\\StreamDiffusion\\\\venv\", \"D:\\\\dev\\\\SDTD_032_dev\\\\StreamDiffusion\\\\venv\\\\Lib\\\\site-packages\", \"D:\\\\dev\\\\SDTD_032_dev\\\\StreamDiffusion\\\\src\", \"D:\\\\dev\\\\SDTD_032_dev\\\\StreamDiffusion\\\\venv\\\\Lib\\\\site-packages\\\\win32\", \"D:\\\\dev\\\\SDTD_032_dev\\\\StreamDiffusion\\\\venv\\\\Lib\\\\site-packages\\\\win32\\\\lib\", \"D:\\\\dev\\\\SDTD_032_dev\\\\StreamDiffusion\\\\venv\\\\Lib\\\\site-packages\\\\Pythonwin\"]", + "concise_description": "Cannot find module `streamdiffusion.preprocessing.processors.temporal_net`", + "severity": "error" + }, + { + "line": 564, + "column": 69, + "stop_line": 564, + "stop_column": 88, + "path": "src\\streamdiffusion\\preprocessing\\preprocessing_orchestrator.py", + "code": -2, + "name": "bad-argument-type", + "description": "Argument `device` is not assignable to parameter `device` with type `str` in function `PreprocessingOrchestrator._pil_to_tensor_safe`", + "concise_description": "Argument `device` is not assignable to parameter `device` with type `str` in function `PreprocessingOrchestrator._pil_to_tensor_safe`", + "severity": "error" + }, + { + "line": 705, + "column": 29, + "stop_line": 705, + "stop_column": 33, + "path": "src\\streamdiffusion\\preprocessing\\preprocessing_orchestrator.py", + "code": -2, + "name": "bad-function-definition", + "description": "Default `None` is not assignable to parameter `stream_width` with type `int`", + "concise_description": "Default `None` is not assignable to parameter `stream_width` with type `int`", + "severity": "error" + }, + { + "line": 706, + "column": 30, + "stop_line": 706, + "stop_column": 34, + "path": "src\\streamdiffusion\\preprocessing\\preprocessing_orchestrator.py", + "code": -2, + "name": "bad-function-definition", + "description": "Default `None` is not assignable to parameter `stream_height` with type `int`", + "concise_description": "Default `None` is not assignable to parameter `stream_height` with type `int`", + "severity": "error" + }, + { + "line": 110, + "column": 48, + "stop_line": 110, + "stop_column": 81, + "path": "src\\streamdiffusion\\preprocessing\\processors\\__init__.py", + "code": -2, + "name": "bad-typed-dict-key", + "description": "`type[DepthAnythingTensorrtPreprocessor] | None` is not assignable to TypedDict key `depth_tensorrt` with type `type[BlurPreprocessor] | type[CannyPreprocessor] | type[DepthPreprocessor] | type[ExternalPreprocessor] | type[FeedbackPreprocessor] | type[HEDPreprocessor] | type[LatentFeedbackPreprocessor] | type[LineartPreprocessor] | type[OpenPosePreprocessor] | type[PassthroughPreprocessor] | type[RealESRGANProcessor] | type[ScribblePreprocessor] | type[SharpenPreprocessor] | type[SoftEdgePreprocessor] | type[StandardLineartPreprocessor] | type[UpscalePreprocessor]`", + "concise_description": "`type[DepthAnythingTensorrtPreprocessor] | None` is not assignable to TypedDict key `depth_tensorrt` with type `type[BlurPreprocessor] | type[CannyPreprocessor] | type[DepthPreprocessor] | type[ExternalPreprocessor] | type[FeedbackPreprocessor] | type[HEDPreprocessor] | type[LatentFeedbackPreprocessor] | type[LineartPreprocessor] | type[OpenPosePreprocessor] | type[PassthroughPreprocessor] | type[RealESRGANProcessor] | type[ScribblePreprocessor] | type[SharpenPreprocessor] | type[SoftEdgePreprocessor] | type[StandardLineartPreprocessor] | type[UpscalePreprocessor]`", + "severity": "error" + }, + { + "line": 113, + "column": 47, + "stop_line": 113, + "stop_column": 78, + "path": "src\\streamdiffusion\\preprocessing\\processors\\__init__.py", + "code": -2, + "name": "bad-typed-dict-key", + "description": "`type[YoloNasPoseTensorrtPreprocessor] | None` is not assignable to TypedDict key `pose_tensorrt` with type `type[BlurPreprocessor] | type[CannyPreprocessor] | type[DepthPreprocessor] | type[ExternalPreprocessor] | type[FeedbackPreprocessor] | type[HEDPreprocessor] | type[LatentFeedbackPreprocessor] | type[LineartPreprocessor] | type[OpenPosePreprocessor] | type[PassthroughPreprocessor] | type[RealESRGANProcessor] | type[ScribblePreprocessor] | type[SharpenPreprocessor] | type[SoftEdgePreprocessor] | type[StandardLineartPreprocessor] | type[UpscalePreprocessor]`", + "concise_description": "`type[YoloNasPoseTensorrtPreprocessor] | None` is not assignable to TypedDict key `pose_tensorrt` with type `type[BlurPreprocessor] | type[CannyPreprocessor] | type[DepthPreprocessor] | type[ExternalPreprocessor] | type[FeedbackPreprocessor] | type[HEDPreprocessor] | type[LatentFeedbackPreprocessor] | type[LineartPreprocessor] | type[OpenPosePreprocessor] | type[PassthroughPreprocessor] | type[RealESRGANProcessor] | type[ScribblePreprocessor] | type[SharpenPreprocessor] | type[SoftEdgePreprocessor] | type[StandardLineartPreprocessor] | type[UpscalePreprocessor]`", + "severity": "error" + }, + { + "line": 116, + "column": 55, + "stop_line": 116, + "stop_column": 86, + "path": "src\\streamdiffusion\\preprocessing\\processors\\__init__.py", + "code": -2, + "name": "bad-typed-dict-key", + "description": "`type[TemporalNetTensorRTPreprocessor] | None` is not assignable to TypedDict key `temporal_net_tensorrt` with type `type[BlurPreprocessor] | type[CannyPreprocessor] | type[DepthPreprocessor] | type[ExternalPreprocessor] | type[FeedbackPreprocessor] | type[HEDPreprocessor] | type[LatentFeedbackPreprocessor] | type[LineartPreprocessor] | type[OpenPosePreprocessor] | type[PassthroughPreprocessor] | type[RealESRGANProcessor] | type[ScribblePreprocessor] | type[SharpenPreprocessor] | type[SoftEdgePreprocessor] | type[StandardLineartPreprocessor] | type[UpscalePreprocessor]`", + "concise_description": "`type[TemporalNetTensorRTPreprocessor] | None` is not assignable to TypedDict key `temporal_net_tensorrt` with type `type[BlurPreprocessor] | type[CannyPreprocessor] | type[DepthPreprocessor] | type[ExternalPreprocessor] | type[FeedbackPreprocessor] | type[HEDPreprocessor] | type[LatentFeedbackPreprocessor] | type[LineartPreprocessor] | type[OpenPosePreprocessor] | type[PassthroughPreprocessor] | type[RealESRGANProcessor] | type[ScribblePreprocessor] | type[SharpenPreprocessor] | type[SoftEdgePreprocessor] | type[StandardLineartPreprocessor] | type[UpscalePreprocessor]`", + "severity": "error" + }, + { + "line": 120, + "column": 48, + "stop_line": 120, + "stop_column": 73, + "path": "src\\streamdiffusion\\preprocessing\\processors\\__init__.py", + "code": -2, + "name": "bad-typed-dict-key", + "description": "`type[MediaPipePosePreprocessor] | None` is not assignable to TypedDict key `mediapipe_pose` with type `type[BlurPreprocessor] | type[CannyPreprocessor] | type[DepthPreprocessor] | type[ExternalPreprocessor] | type[FeedbackPreprocessor] | type[HEDPreprocessor] | type[LatentFeedbackPreprocessor] | type[LineartPreprocessor] | type[OpenPosePreprocessor] | type[PassthroughPreprocessor] | type[RealESRGANProcessor] | type[ScribblePreprocessor] | type[SharpenPreprocessor] | type[SoftEdgePreprocessor] | type[StandardLineartPreprocessor] | type[UpscalePreprocessor]`", + "concise_description": "`type[MediaPipePosePreprocessor] | None` is not assignable to TypedDict key `mediapipe_pose` with type `type[BlurPreprocessor] | type[CannyPreprocessor] | type[DepthPreprocessor] | type[ExternalPreprocessor] | type[FeedbackPreprocessor] | type[HEDPreprocessor] | type[LatentFeedbackPreprocessor] | type[LineartPreprocessor] | type[OpenPosePreprocessor] | type[PassthroughPreprocessor] | type[RealESRGANProcessor] | type[ScribblePreprocessor] | type[SharpenPreprocessor] | type[SoftEdgePreprocessor] | type[StandardLineartPreprocessor] | type[UpscalePreprocessor]`", + "severity": "error" + }, + { + "line": 123, + "column": 56, + "stop_line": 123, + "stop_column": 89, + "path": "src\\streamdiffusion\\preprocessing\\processors\\__init__.py", + "code": -2, + "name": "bad-typed-dict-key", + "description": "`type[MediaPipeSegmentationPreprocessor] | None` is not assignable to TypedDict key `mediapipe_segmentation` with type `type[BlurPreprocessor] | type[CannyPreprocessor] | type[DepthPreprocessor] | type[ExternalPreprocessor] | type[FeedbackPreprocessor] | type[HEDPreprocessor] | type[LatentFeedbackPreprocessor] | type[LineartPreprocessor] | type[OpenPosePreprocessor] | type[PassthroughPreprocessor] | type[RealESRGANProcessor] | type[ScribblePreprocessor] | type[SharpenPreprocessor] | type[SoftEdgePreprocessor] | type[StandardLineartPreprocessor] | type[UpscalePreprocessor]`", + "concise_description": "`type[MediaPipeSegmentationPreprocessor] | None` is not assignable to TypedDict key `mediapipe_segmentation` with type `type[BlurPreprocessor] | type[CannyPreprocessor] | type[DepthPreprocessor] | type[ExternalPreprocessor] | type[FeedbackPreprocessor] | type[HEDPreprocessor] | type[LatentFeedbackPreprocessor] | type[LineartPreprocessor] | type[OpenPosePreprocessor] | type[PassthroughPreprocessor] | type[RealESRGANProcessor] | type[ScribblePreprocessor] | type[SharpenPreprocessor] | type[SoftEdgePreprocessor] | type[StandardLineartPreprocessor] | type[UpscalePreprocessor]`", + "severity": "error" + }, + { + "line": 127, + "column": 46, + "stop_line": 127, + "stop_column": 69, + "path": "src\\streamdiffusion\\preprocessing\\processors\\__init__.py", + "code": -2, + "name": "bad-typed-dict-key", + "description": "`type[HEDTensorrtPreprocessor] | None` is not assignable to TypedDict key `hed_tensorrt` with type `type[BlurPreprocessor] | type[CannyPreprocessor] | type[DepthPreprocessor] | type[ExternalPreprocessor] | type[FeedbackPreprocessor] | type[HEDPreprocessor] | type[LatentFeedbackPreprocessor] | type[LineartPreprocessor] | type[OpenPosePreprocessor] | type[PassthroughPreprocessor] | type[RealESRGANProcessor] | type[ScribblePreprocessor] | type[SharpenPreprocessor] | type[SoftEdgePreprocessor] | type[StandardLineartPreprocessor] | type[UpscalePreprocessor]`", + "concise_description": "`type[HEDTensorrtPreprocessor] | None` is not assignable to TypedDict key `hed_tensorrt` with type `type[BlurPreprocessor] | type[CannyPreprocessor] | type[DepthPreprocessor] | type[ExternalPreprocessor] | type[FeedbackPreprocessor] | type[HEDPreprocessor] | type[LatentFeedbackPreprocessor] | type[LineartPreprocessor] | type[OpenPosePreprocessor] | type[PassthroughPreprocessor] | type[RealESRGANProcessor] | type[ScribblePreprocessor] | type[SharpenPreprocessor] | type[SoftEdgePreprocessor] | type[StandardLineartPreprocessor] | type[UpscalePreprocessor]`", + "severity": "error" + }, + { + "line": 130, + "column": 51, + "stop_line": 130, + "stop_column": 79, + "path": "src\\streamdiffusion\\preprocessing\\processors\\__init__.py", + "code": -2, + "name": "bad-typed-dict-key", + "description": "`type[ScribbleTensorrtPreprocessor] | None` is not assignable to TypedDict key `scribble_tensorrt` with type `type[BlurPreprocessor] | type[CannyPreprocessor] | type[DepthPreprocessor] | type[ExternalPreprocessor] | type[FeedbackPreprocessor] | type[HEDPreprocessor] | type[LatentFeedbackPreprocessor] | type[LineartPreprocessor] | type[OpenPosePreprocessor] | type[PassthroughPreprocessor] | type[RealESRGANProcessor] | type[ScribblePreprocessor] | type[SharpenPreprocessor] | type[SoftEdgePreprocessor] | type[StandardLineartPreprocessor] | type[UpscalePreprocessor]`", + "concise_description": "`type[ScribbleTensorrtPreprocessor] | None` is not assignable to TypedDict key `scribble_tensorrt` with type `type[BlurPreprocessor] | type[CannyPreprocessor] | type[DepthPreprocessor] | type[ExternalPreprocessor] | type[FeedbackPreprocessor] | type[HEDPreprocessor] | type[LatentFeedbackPreprocessor] | type[LineartPreprocessor] | type[OpenPosePreprocessor] | type[PassthroughPreprocessor] | type[RealESRGANProcessor] | type[ScribblePreprocessor] | type[SharpenPreprocessor] | type[SoftEdgePreprocessor] | type[StandardLineartPreprocessor] | type[UpscalePreprocessor]`", + "severity": "error" + }, + { + "line": 133, + "column": 53, + "stop_line": 133, + "stop_column": 82, + "path": "src\\streamdiffusion\\preprocessing\\processors\\__init__.py", + "code": -2, + "name": "bad-typed-dict-key", + "description": "`type[NormalBaeTensorrtPreprocessor] | None` is not assignable to TypedDict key `normal_bae_tensorrt` with type `type[BlurPreprocessor] | type[CannyPreprocessor] | type[DepthPreprocessor] | type[ExternalPreprocessor] | type[FeedbackPreprocessor] | type[HEDPreprocessor] | type[LatentFeedbackPreprocessor] | type[LineartPreprocessor] | type[OpenPosePreprocessor] | type[PassthroughPreprocessor] | type[RealESRGANProcessor] | type[ScribblePreprocessor] | type[SharpenPreprocessor] | type[SoftEdgePreprocessor] | type[StandardLineartPreprocessor] | type[UpscalePreprocessor]`", + "concise_description": "`type[NormalBaeTensorrtPreprocessor] | None` is not assignable to TypedDict key `normal_bae_tensorrt` with type `type[BlurPreprocessor] | type[CannyPreprocessor] | type[DepthPreprocessor] | type[ExternalPreprocessor] | type[FeedbackPreprocessor] | type[HEDPreprocessor] | type[LatentFeedbackPreprocessor] | type[LineartPreprocessor] | type[OpenPosePreprocessor] | type[PassthroughPreprocessor] | type[RealESRGANProcessor] | type[ScribblePreprocessor] | type[SharpenPreprocessor] | type[SoftEdgePreprocessor] | type[StandardLineartPreprocessor] | type[UpscalePreprocessor]`", + "severity": "error" + }, + { + "line": 333, + "column": 50, + "stop_line": 333, + "stop_column": 54, + "path": "src\\streamdiffusion\\preprocessing\\processors\\__init__.py", + "code": -2, + "name": "bad-argument-type", + "description": "Argument `ModuleSpec | None` is not assignable to parameter `spec` with type `ModuleSpec` in function `_frozen_importlib.module_from_spec`", + "concise_description": "Argument `ModuleSpec | None` is not assignable to parameter `spec` with type `ModuleSpec` in function `_frozen_importlib.module_from_spec`", + "severity": "error" + }, + { + "line": 334, + "column": 9, + "stop_line": 334, + "stop_column": 20, + "path": "src\\streamdiffusion\\preprocessing\\processors\\__init__.py", + "code": -2, + "name": "missing-attribute", + "description": "Object of class `NoneType` has no attribute `loader`", + "concise_description": "Object of class `NoneType` has no attribute `loader`", + "severity": "error" + }, + { + "line": 117, + "column": 64, + "stop_line": 117, + "stop_column": 77, + "path": "src\\streamdiffusion\\preprocessing\\processors\\base.py", + "code": -2, + "name": "missing-attribute", + "description": "No attribute `LANCZOS` in module `PIL.Image`", + "concise_description": "No attribute `LANCZOS` in module `PIL.Image`", + "severity": "error" + }, + { + "line": 113, + "column": 9, + "stop_line": 113, + "stop_column": 29, + "path": "src\\streamdiffusion\\preprocessing\\processors\\blur.py", + "code": -2, + "name": "bad-override-param-name", + "description": "Class member `BlurPreprocessor._process_tensor_core` overrides parent class `BasePreprocessor` in an inconsistent manner\n Got parameter name `image_tensor`, expected `tensor`", + "concise_description": "Class member `BlurPreprocessor._process_tensor_core` overrides parent class `BasePreprocessor` in an inconsistent manner", + "severity": "error" + }, + { + "line": 100, + "column": 9, + "stop_line": 100, + "stop_column": 29, + "path": "src\\streamdiffusion\\preprocessing\\processors\\canny.py", + "code": -2, + "name": "bad-override-param-name", + "description": "Class member `CannyPreprocessor._process_tensor_core` overrides parent class `BasePreprocessor` in an inconsistent manner\n Got parameter name `image_tensor`, expected `tensor`", + "concise_description": "Class member `CannyPreprocessor._process_tensor_core` overrides parent class `BasePreprocessor` in an inconsistent manner", + "severity": "error" + }, + { + "line": 123, + "column": 27, + "stop_line": 123, + "stop_column": 62, + "path": "src\\streamdiffusion\\preprocessing\\processors\\canny.py", + "code": -2, + "name": "no-matching-overload", + "description": "No matching overload found for function `torch._C._VariableFunctions.conv2d` called with arguments: (Tensor, Tensor | None, padding=Literal[2])\n Possible overloads:\n (input: Tensor, weight: Tensor, bias: Tensor | None = None, stride: Sequence[SymInt | int] | SymInt | int = 1, padding: Sequence[SymInt | int] | SymInt | int = 0, dilation: Sequence[SymInt | int] | SymInt | int = 1, groups: SymInt | int = 1) -> Tensor [closest match]\n (input: Tensor, weight: Tensor, bias: Tensor | None = None, stride: Sequence[SymInt | int] | SymInt | int = 1, padding: str = 'valid', dilation: Sequence[SymInt | int] | SymInt | int = 1, groups: SymInt | int = 1) -> Tensor", + "concise_description": "No matching overload found for function `torch._C._VariableFunctions.conv2d` called with arguments: (Tensor, Tensor | None, padding=Literal[2])", + "severity": "error" + }, + { + "line": 126, + "column": 22, + "stop_line": 126, + "stop_column": 57, + "path": "src\\streamdiffusion\\preprocessing\\processors\\canny.py", + "code": -2, + "name": "no-matching-overload", + "description": "No matching overload found for function `torch._C._VariableFunctions.conv2d` called with arguments: (Unknown, Tensor | None, padding=Literal[1])\n Possible overloads:\n (input: Tensor, weight: Tensor, bias: Tensor | None = None, stride: Sequence[SymInt | int] | SymInt | int = 1, padding: Sequence[SymInt | int] | SymInt | int = 0, dilation: Sequence[SymInt | int] | SymInt | int = 1, groups: SymInt | int = 1) -> Tensor [closest match]\n (input: Tensor, weight: Tensor, bias: Tensor | None = None, stride: Sequence[SymInt | int] | SymInt | int = 1, padding: str = 'valid', dilation: Sequence[SymInt | int] | SymInt | int = 1, groups: SymInt | int = 1) -> Tensor", + "concise_description": "No matching overload found for function `torch._C._VariableFunctions.conv2d` called with arguments: (Unknown, Tensor | None, padding=Literal[1])", + "severity": "error" + }, + { + "line": 127, + "column": 22, + "stop_line": 127, + "stop_column": 57, + "path": "src\\streamdiffusion\\preprocessing\\processors\\canny.py", + "code": -2, + "name": "no-matching-overload", + "description": "No matching overload found for function `torch._C._VariableFunctions.conv2d` called with arguments: (Unknown, Tensor | None, padding=Literal[1])\n Possible overloads:\n (input: Tensor, weight: Tensor, bias: Tensor | None = None, stride: Sequence[SymInt | int] | SymInt | int = 1, padding: Sequence[SymInt | int] | SymInt | int = 0, dilation: Sequence[SymInt | int] | SymInt | int = 1, groups: SymInt | int = 1) -> Tensor [closest match]\n (input: Tensor, weight: Tensor, bias: Tensor | None = None, stride: Sequence[SymInt | int] | SymInt | int = 1, padding: str = 'valid', dilation: Sequence[SymInt | int] | SymInt | int = 1, groups: SymInt | int = 1) -> Tensor", + "concise_description": "No matching overload found for function `torch._C._VariableFunctions.conv2d` called with arguments: (Unknown, Tensor | None, padding=Literal[1])", + "severity": "error" + }, + { + "line": 70, + "column": 78, + "stop_line": 70, + "stop_column": 91, + "path": "src\\streamdiffusion\\preprocessing\\processors\\depth.py", + "code": -2, + "name": "missing-attribute", + "description": "No attribute `LANCZOS` in module `PIL.Image`", + "concise_description": "No attribute `LANCZOS` in module `PIL.Image`", + "severity": "error" + }, + { + "line": 90, + "column": 9, + "stop_line": 90, + "stop_column": 29, + "path": "src\\streamdiffusion\\preprocessing\\processors\\depth.py", + "code": -2, + "name": "bad-override-param-name", + "description": "Class member `DepthPreprocessor._process_tensor_core` overrides parent class `BasePreprocessor` in an inconsistent manner\n Got parameter name `image_tensor`, expected `tensor`", + "concise_description": "Class member `DepthPreprocessor._process_tensor_core` overrides parent class `BasePreprocessor` in an inconsistent manner", + "severity": "error" + }, + { + "line": 35, + "column": 43, + "stop_line": 35, + "stop_column": 47, + "path": "src\\streamdiffusion\\preprocessing\\processors\\depth_tensorrt.py", + "code": -2, + "name": "bad-function-definition", + "description": "Default `None` is not assignable to parameter `engine_path` with type `str`", + "concise_description": "Default `None` is not assignable to parameter `engine_path` with type `str`", + "severity": "error" + }, + { + "line": 122, + "column": 9, + "stop_line": 122, + "stop_column": 29, + "path": "src\\streamdiffusion\\preprocessing\\processors\\depth_tensorrt.py", + "code": -2, + "name": "bad-override-param-name", + "description": "Class member `DepthAnythingTensorrtPreprocessor._process_tensor_core` overrides parent class `BasePreprocessor` in an inconsistent manner\n Got parameter name `image_tensor`, expected `tensor`", + "concise_description": "Class member `DepthAnythingTensorrtPreprocessor._process_tensor_core` overrides parent class `BasePreprocessor` in an inconsistent manner", + "severity": "error" + }, + { + "line": 75, + "column": 18, + "stop_line": 75, + "stop_column": 28, + "path": "src\\streamdiffusion\\preprocessing\\processors\\hed.py", + "code": -2, + "name": "not-callable", + "description": "Expected a callable, got `None`", + "concise_description": "Expected a callable, got `None`", + "severity": "error" + }, + { + "line": 86, + "column": 67, + "stop_line": 86, + "stop_column": 80, + "path": "src\\streamdiffusion\\preprocessing\\processors\\hed.py", + "code": -2, + "name": "missing-attribute", + "description": "No attribute `LANCZOS` in module `PIL.Image`", + "concise_description": "No attribute `LANCZOS` in module `PIL.Image`", + "severity": "error" + }, + { + "line": 90, + "column": 9, + "stop_line": 90, + "stop_column": 29, + "path": "src\\streamdiffusion\\preprocessing\\processors\\hed.py", + "code": -2, + "name": "bad-override-param-name", + "description": "Class member `HEDPreprocessor._process_tensor_core` overrides parent class `BasePreprocessor` in an inconsistent manner\n Got parameter name `image_tensor`, expected `tensor`", + "concise_description": "Class member `HEDPreprocessor._process_tensor_core` overrides parent class `BasePreprocessor` in an inconsistent manner", + "severity": "error" + }, + { + "line": 118, + "column": 17, + "stop_line": 118, + "stop_column": 22, + "path": "src\\streamdiffusion\\preprocessing\\processors\\hed_tensorrt.py", + "code": -2, + "name": "bad-argument-type", + "description": "Argument `Tensor` is not assignable to parameter `args` with type `tuple[Any, ...]` in function `torch.onnx.export`", + "concise_description": "Argument `Tensor` is not assignable to parameter `args` with type `tuple[Any, ...]` in function `torch.onnx.export`", + "severity": "error" + }, + { + "line": 45, + "column": 9, + "stop_line": 45, + "stop_column": 22, + "path": "src\\streamdiffusion\\preprocessing\\processors\\ipadapter_embedding.py", + "code": -2, + "name": "bad-override", + "description": "Class member `IPAdapterEmbeddingPreprocessor._process_core` overrides parent class `BasePreprocessor` in an inconsistent manner\n `IPAdapterEmbeddingPreprocessor._process_core` has type `(self: IPAdapterEmbeddingPreprocessor, image: Image) -> tuple[Tensor, Tensor]`, which is not assignable to `(self: IPAdapterEmbeddingPreprocessor, image: Image) -> Image`, the type of `BasePreprocessor._process_core`\n Signature mismatch:\n expected: def _process_core(self: IPAdapterEmbeddingPreprocessor, image: Image) -> Image: ...\n ^^^^^ return type\n found: def _process_core(self: IPAdapterEmbeddingPreprocessor, image: Image) -> tuple[Tensor, Tensor]: ...\n ^^^^^^^^^^^^^^^^^^^^^ return type", + "concise_description": "Class member `IPAdapterEmbeddingPreprocessor._process_core` overrides parent class `BasePreprocessor` in an inconsistent manner", + "severity": "error" + }, + { + "line": 77, + "column": 9, + "stop_line": 77, + "stop_column": 29, + "path": "src\\streamdiffusion\\preprocessing\\processors\\ipadapter_embedding.py", + "code": -2, + "name": "bad-override", + "description": "Class member `IPAdapterEmbeddingPreprocessor._process_tensor_core` overrides parent class `BasePreprocessor` in an inconsistent manner\n `IPAdapterEmbeddingPreprocessor._process_tensor_core` has type `(self: IPAdapterEmbeddingPreprocessor, tensor: Tensor) -> tuple[Tensor, Tensor]`, which is not assignable to `(self: IPAdapterEmbeddingPreprocessor, tensor: Tensor) -> Tensor`, the type of `BasePreprocessor._process_tensor_core`\n Signature mismatch:\n expected: def _process_tensor_core(self: IPAdapterEmbeddingPreprocessor, tensor: Tensor) -> Tensor: ...\n ^^^^^^ return type\n found: def _process_tensor_core(self: IPAdapterEmbeddingPreprocessor, tensor: Tensor) -> tuple[Tensor, Tensor]: ...\n ^^^^^^^^^^^^^^^^^^^^^ return type", + "concise_description": "Class member `IPAdapterEmbeddingPreprocessor._process_tensor_core` overrides parent class `BasePreprocessor` in an inconsistent manner", + "severity": "error" + }, + { + "line": 99, + "column": 9, + "stop_line": 99, + "stop_column": 16, + "path": "src\\streamdiffusion\\preprocessing\\processors\\ipadapter_embedding.py", + "code": -2, + "name": "bad-override", + "description": "Class member `IPAdapterEmbeddingPreprocessor.process` overrides parent class `BasePreprocessor` in an inconsistent manner\n `IPAdapterEmbeddingPreprocessor.process` has type `(self: IPAdapterEmbeddingPreprocessor, image: Image | Tensor) -> tuple[Tensor, Tensor]`, which is not assignable to `(self: IPAdapterEmbeddingPreprocessor, image: Image | Tensor | ndarray[Unknown, Unknown]) -> Image`, the type of `BasePreprocessor.process`\n Signature mismatch:\n expected: def process(self: IPAdapterEmbeddingPreprocessor, image: Image | Tensor | ndarray[Unknown, Unknown]) -> Image: ...\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^ return type\n |\n parameters\n found: def process(self: IPAdapterEmbeddingPreprocessor, image: Image | Tensor) -> tuple[Tensor, Tensor]: ...\n ^ ^^^^^^^^^^^^^^^^^^^^^ return type\n |\n parameters", + "concise_description": "Class member `IPAdapterEmbeddingPreprocessor.process` overrides parent class `BasePreprocessor` in an inconsistent manner", + "severity": "error" + }, + { + "line": 109, + "column": 9, + "stop_line": 109, + "stop_column": 23, + "path": "src\\streamdiffusion\\preprocessing\\processors\\ipadapter_embedding.py", + "code": -2, + "name": "bad-override", + "description": "Class member `IPAdapterEmbeddingPreprocessor.process_tensor` overrides parent class `BasePreprocessor` in an inconsistent manner\n `IPAdapterEmbeddingPreprocessor.process_tensor` has type `(self: IPAdapterEmbeddingPreprocessor, image_tensor: Tensor) -> tuple[Tensor, Tensor]`, which is not assignable to `(self: IPAdapterEmbeddingPreprocessor, image_tensor: Tensor) -> Tensor`, the type of `BasePreprocessor.process_tensor`\n Signature mismatch:\n expected: def process_tensor(self: IPAdapterEmbeddingPreprocessor, image_tensor: Tensor) -> Tensor: ...\n ^^^^^^ return type\n found: def process_tensor(self: IPAdapterEmbeddingPreprocessor, image_tensor: Tensor) -> tuple[Tensor, Tensor]: ...\n ^^^^^^^^^^^^^^^^^^^^^ return type", + "concise_description": "Class member `IPAdapterEmbeddingPreprocessor.process_tensor` overrides parent class `BasePreprocessor` in an inconsistent manner", + "severity": "error" + }, + { + "line": 84, + "column": 9, + "stop_line": 84, + "stop_column": 30, + "path": "src\\streamdiffusion\\preprocessing\\processors\\latent_feedback.py", + "code": -2, + "name": "bad-override-param-name", + "description": "Class member `LatentFeedbackPreprocessor.validate_tensor_input` overrides parent class `PipelineAwareProcessor` in an inconsistent manner\n Got parameter name `latent_tensor`, expected `image_tensor`", + "concise_description": "Class member `LatentFeedbackPreprocessor.validate_tensor_input` overrides parent class `PipelineAwareProcessor` in an inconsistent manner", + "severity": "error" + }, + { + "line": 104, + "column": 82, + "stop_line": 104, + "stop_column": 95, + "path": "src\\streamdiffusion\\preprocessing\\processors\\lineart.py", + "code": -2, + "name": "missing-attribute", + "description": "No attribute `LANCZOS` in module `PIL.Image`", + "concise_description": "No attribute `LANCZOS` in module `PIL.Image`", + "severity": "error" + }, + { + "line": 112, + "column": 16, + "stop_line": 112, + "stop_column": 29, + "path": "src\\streamdiffusion\\preprocessing\\processors\\lineart.py", + "code": -2, + "name": "bad-return", + "description": "Returned type `Image | int | ndarray[Any, dtype[signedinteger[Any]]] | Unknown` is not assignable to declared return type `Image`", + "concise_description": "Returned type `Image | int | ndarray[Any, dtype[signedinteger[Any]]] | Unknown` is not assignable to declared return type `Image`", + "severity": "error" + }, + { + "line": 558, + "column": 78, + "stop_line": 558, + "stop_column": 91, + "path": "src\\streamdiffusion\\preprocessing\\processors\\mediapipe_pose.py", + "code": -2, + "name": "missing-attribute", + "description": "No attribute `LANCZOS` in module `PIL.Image`", + "concise_description": "No attribute `LANCZOS` in module `PIL.Image`", + "severity": "error" + }, + { + "line": 566, + "column": 12, + "stop_line": 566, + "stop_column": 34, + "path": "src\\streamdiffusion\\preprocessing\\processors\\mediapipe_pose.py", + "code": -2, + "name": "missing-attribute", + "description": "Object of class `NamedTupleFallback` has no attribute `pose_landmarks`", + "concise_description": "Object of class `NamedTupleFallback` has no attribute `pose_landmarks`", + "severity": "error" + }, + { + "line": 568, + "column": 17, + "stop_line": 568, + "stop_column": 48, + "path": "src\\streamdiffusion\\preprocessing\\processors\\mediapipe_pose.py", + "code": -2, + "name": "missing-attribute", + "description": "Object of class `object` has no attribute `landmark`", + "concise_description": "Object of class `object` has no attribute `landmark`", + "severity": "error" + }, + { + "line": 577, + "column": 16, + "stop_line": 577, + "stop_column": 43, + "path": "src\\streamdiffusion\\preprocessing\\processors\\mediapipe_pose.py", + "code": -2, + "name": "missing-attribute", + "description": "Object of class `NamedTupleFallback` has no attribute `left_hand_landmarks`", + "concise_description": "Object of class `NamedTupleFallback` has no attribute `left_hand_landmarks`", + "severity": "error" + }, + { + "line": 579, + "column": 33, + "stop_line": 579, + "stop_column": 69, + "path": "src\\streamdiffusion\\preprocessing\\processors\\mediapipe_pose.py", + "code": -2, + "name": "missing-attribute", + "description": "Object of class `object` has no attribute `landmark`", + "concise_description": "Object of class `object` has no attribute `landmark`", + "severity": "error" + }, + { + "line": 582, + "column": 16, + "stop_line": 582, + "stop_column": 44, + "path": "src\\streamdiffusion\\preprocessing\\processors\\mediapipe_pose.py", + "code": -2, + "name": "missing-attribute", + "description": "Object of class `NamedTupleFallback` has no attribute `right_hand_landmarks`", + "concise_description": "Object of class `NamedTupleFallback` has no attribute `right_hand_landmarks`", + "severity": "error" + }, + { + "line": 584, + "column": 33, + "stop_line": 584, + "stop_column": 70, + "path": "src\\streamdiffusion\\preprocessing\\processors\\mediapipe_pose.py", + "code": -2, + "name": "missing-attribute", + "description": "Object of class `object` has no attribute `landmark`", + "concise_description": "Object of class `object` has no attribute `landmark`", + "severity": "error" + }, + { + "line": 591, + "column": 9, + "stop_line": 591, + "stop_column": 29, + "path": "src\\streamdiffusion\\preprocessing\\processors\\mediapipe_pose.py", + "code": -2, + "name": "bad-override-param-name", + "description": "Class member `MediaPipePosePreprocessor._process_tensor_core` overrides parent class `BasePreprocessor` in an inconsistent manner\n Got parameter name `image_tensor`, expected `tensor`", + "concise_description": "Class member `MediaPipePosePreprocessor._process_tensor_core` overrides parent class `BasePreprocessor` in an inconsistent manner", + "severity": "error" + }, + { + "line": 219, + "column": 78, + "stop_line": 219, + "stop_column": 91, + "path": "src\\streamdiffusion\\preprocessing\\processors\\mediapipe_segmentation.py", + "code": -2, + "name": "missing-attribute", + "description": "No attribute `LANCZOS` in module `PIL.Image`", + "concise_description": "No attribute `LANCZOS` in module `PIL.Image`", + "severity": "error" + }, + { + "line": 225, + "column": 12, + "stop_line": 225, + "stop_column": 37, + "path": "src\\streamdiffusion\\preprocessing\\processors\\mediapipe_segmentation.py", + "code": -2, + "name": "missing-attribute", + "description": "Object of class `NamedTupleFallback` has no attribute `segmentation_mask`", + "concise_description": "Object of class `NamedTupleFallback` has no attribute `segmentation_mask`", + "severity": "error" + }, + { + "line": 228, + "column": 47, + "stop_line": 228, + "stop_column": 51, + "path": "src\\streamdiffusion\\preprocessing\\processors\\mediapipe_segmentation.py", + "code": -2, + "name": "bad-argument-type", + "description": "Argument `object | Unknown` is not assignable to parameter `mask` with type `ndarray[Unknown, Unknown]` in function `MediaPipeSegmentationPreprocessor._apply_mask_smoothing`", + "concise_description": "Argument `object | Unknown` is not assignable to parameter `mask` with type `ndarray[Unknown, Unknown]` in function `MediaPipeSegmentationPreprocessor._apply_mask_smoothing`", + "severity": "error" + }, + { + "line": 245, + "column": 9, + "stop_line": 245, + "stop_column": 29, + "path": "src\\streamdiffusion\\preprocessing\\processors\\mediapipe_segmentation.py", + "code": -2, + "name": "bad-override-param-name", + "description": "Class member `MediaPipeSegmentationPreprocessor._process_tensor_core` overrides parent class `BasePreprocessor` in an inconsistent manner\n Got parameter name `image_tensor`, expected `tensor`", + "concise_description": "Class member `MediaPipeSegmentationPreprocessor._process_tensor_core` overrides parent class `BasePreprocessor` in an inconsistent manner", + "severity": "error" + }, + { + "line": 79, + "column": 17, + "stop_line": 79, + "stop_column": 22, + "path": "src\\streamdiffusion\\preprocessing\\processors\\normal_bae_tensorrt.py", + "code": -2, + "name": "bad-argument-type", + "description": "Argument `Tensor` is not assignable to parameter `args` with type `tuple[Any, ...]` in function `torch.onnx.export`", + "concise_description": "Argument `Tensor` is not assignable to parameter `args` with type `tuple[Any, ...]` in function `torch.onnx.export`", + "severity": "error" + }, + { + "line": 185, + "column": 9, + "stop_line": 185, + "stop_column": 29, + "path": "src\\streamdiffusion\\preprocessing\\processors\\normal_bae_tensorrt.py", + "code": -2, + "name": "bad-override-param-name", + "description": "Class member `_NormalBaeTorchGPU._process_tensor_core` overrides parent class `BasePreprocessor` in an inconsistent manner\n Got parameter name `image_tensor`, expected `tensor`", + "concise_description": "Class member `_NormalBaeTorchGPU._process_tensor_core` overrides parent class `BasePreprocessor` in an inconsistent manner", + "severity": "error" + }, + { + "line": 285, + "column": 17, + "stop_line": 285, + "stop_column": 22, + "path": "src\\streamdiffusion\\preprocessing\\processors\\normal_bae_tensorrt.py", + "code": -2, + "name": "bad-argument-type", + "description": "Argument `Tensor` is not assignable to parameter `args` with type `tuple[Any, ...]` in function `torch.onnx.export`", + "concise_description": "Argument `Tensor` is not assignable to parameter `args` with type `tuple[Any, ...]` in function `torch.onnx.export`", + "severity": "error" + }, + { + "line": 145, + "column": 78, + "stop_line": 145, + "stop_column": 91, + "path": "src\\streamdiffusion\\preprocessing\\processors\\openpose.py", + "code": -2, + "name": "missing-attribute", + "description": "No attribute `LANCZOS` in module `PIL.Image`", + "concise_description": "No attribute `LANCZOS` in module `PIL.Image`", + "severity": "error" + }, + { + "line": 152, + "column": 59, + "stop_line": 152, + "stop_column": 72, + "path": "src\\streamdiffusion\\preprocessing\\processors\\openpose.py", + "code": -2, + "name": "unexpected-keyword", + "description": "Unexpected keyword argument `hand_and_face` in function `FallbackDetector.__call__`", + "concise_description": "Unexpected keyword argument `hand_and_face` in function `FallbackDetector.__call__`", + "severity": "error" + }, + { + "line": 159, + "column": 16, + "stop_line": 159, + "stop_column": 26, + "path": "src\\streamdiffusion\\preprocessing\\processors\\openpose.py", + "code": -2, + "name": "bad-return", + "description": "Returned type `Image | object | Unknown` is not assignable to declared return type `Image`", + "concise_description": "Returned type `Image | object | Unknown` is not assignable to declared return type `Image`", + "severity": "error" + }, + { + "line": 215, + "column": 43, + "stop_line": 215, + "stop_column": 47, + "path": "src\\streamdiffusion\\preprocessing\\processors\\pose_tensorrt.py", + "code": -2, + "name": "bad-function-definition", + "description": "Default `None` is not assignable to parameter `engine_path` with type `str`", + "concise_description": "Default `None` is not assignable to parameter `engine_path` with type `str`", + "severity": "error" + }, + { + "line": 305, + "column": 9, + "stop_line": 305, + "stop_column": 29, + "path": "src\\streamdiffusion\\preprocessing\\processors\\pose_tensorrt.py", + "code": -2, + "name": "bad-override-param-name", + "description": "Class member `YoloNasPoseTensorrtPreprocessor._process_tensor_core` overrides parent class `BasePreprocessor` in an inconsistent manner\n Got parameter name `image_tensor`, expected `tensor`", + "concise_description": "Class member `YoloNasPoseTensorrtPreprocessor._process_tensor_core` overrides parent class `BasePreprocessor` in an inconsistent manner", + "severity": "error" + }, + { + "line": 20, + "column": 5, + "stop_line": 20, + "stop_column": 37, + "path": "src\\streamdiffusion\\preprocessing\\processors\\realesrgan_trt.py", + "code": -2, + "name": "missing-import", + "description": "Cannot find module `spandrel`\n Looked in these locations (from config in `D:\\dev\\SDTD_032_dev\\StreamDiffusion\\pyproject.toml`):\n Search path (from config file): [\"D:\\\\dev\\\\SDTD_032_dev\\\\StreamDiffusion\\\\src\"]\n Import root (inferred from project layout): \"D:\\\\dev\\\\SDTD_032_dev\\\\StreamDiffusion\\\\src\"\n Site package path queried from interpreter: [\"C:\\\\Users\\\\Inter\\\\AppData\\\\Local\\\\Programs\\\\Python\\\\Python311\\\\DLLs\", \"C:\\\\Users\\\\Inter\\\\AppData\\\\Local\\\\Programs\\\\Python\\\\Python311\", \"D:\\\\dev\\\\SDTD_032_dev\\\\StreamDiffusion\\\\venv\", \"D:\\\\dev\\\\SDTD_032_dev\\\\StreamDiffusion\\\\venv\\\\Lib\\\\site-packages\", \"D:\\\\dev\\\\SDTD_032_dev\\\\StreamDiffusion\\\\src\", \"D:\\\\dev\\\\SDTD_032_dev\\\\StreamDiffusion\\\\venv\\\\Lib\\\\site-packages\\\\win32\", \"D:\\\\dev\\\\SDTD_032_dev\\\\StreamDiffusion\\\\venv\\\\Lib\\\\site-packages\\\\win32\\\\lib\", \"D:\\\\dev\\\\SDTD_032_dev\\\\StreamDiffusion\\\\venv\\\\Lib\\\\site-packages\\\\Pythonwin\"]", + "concise_description": "Cannot find module `spandrel`", + "severity": "error" + }, + { + "line": 50, + "column": 35, + "stop_line": 50, + "stop_column": 43, + "path": "src\\streamdiffusion\\preprocessing\\processors\\realesrgan_trt.py", + "code": -2, + "name": "unsupported-operation", + "description": "Cannot set item in `dict[type[complex128] | type[complex64] | type[float16] | type[float32] | type[float64] | type[int16] | type[int32] | type[int64] | type[int8] | type[uint8], dtype]`\n Argument `type[bool_]` is not assignable to parameter `key` with type `type[complex128] | type[complex64] | type[float16] | type[float32] | type[float64] | type[int16] | type[int32] | type[int64] | type[int8] | type[uint8]` in function `dict.__setitem__`", + "concise_description": "Cannot set item in `dict[type[complex128] | type[complex64] | type[float16] | type[float32] | type[float64] | type[int16] | type[int32] | type[int64] | type[int8] | type[uint8], dtype]`", + "severity": "error" + }, + { + "line": 52, + "column": 35, + "stop_line": 52, + "stop_column": 42, + "path": "src\\streamdiffusion\\preprocessing\\processors\\realesrgan_trt.py", + "code": -2, + "name": "missing-attribute", + "description": "No attribute `bool` in module `numpy`", + "concise_description": "No attribute `bool` in module `numpy`", + "severity": "error" + }, + { + "line": 80, + "column": 24, + "stop_line": 80, + "stop_column": 60, + "path": "src\\streamdiffusion\\preprocessing\\processors\\realesrgan_trt.py", + "code": -2, + "name": "missing-attribute", + "description": "Object of class `NoneType` has no attribute `create_execution_context`", + "concise_description": "Object of class `NoneType` has no attribute `create_execution_context`", + "severity": "error" + }, + { + "line": 86, + "column": 9, + "stop_line": 86, + "stop_column": 37, + "path": "src\\streamdiffusion\\preprocessing\\processors\\realesrgan_trt.py", + "code": -2, + "name": "missing-attribute", + "description": "Object of class `NoneType` has no attribute `set_input_shape`", + "concise_description": "Object of class `NoneType` has no attribute `set_input_shape`", + "severity": "error" + }, + { + "line": 89, + "column": 26, + "stop_line": 89, + "stop_column": 52, + "path": "src\\streamdiffusion\\preprocessing\\processors\\realesrgan_trt.py", + "code": -2, + "name": "missing-attribute", + "description": "Object of class `NoneType` has no attribute `num_io_tensors`", + "concise_description": "Object of class `NoneType` has no attribute `num_io_tensors`", + "severity": "error" + }, + { + "line": 90, + "column": 20, + "stop_line": 90, + "stop_column": 47, + "path": "src\\streamdiffusion\\preprocessing\\processors\\realesrgan_trt.py", + "code": -2, + "name": "missing-attribute", + "description": "Object of class `NoneType` has no attribute `get_tensor_name`", + "concise_description": "Object of class `NoneType` has no attribute `get_tensor_name`", + "severity": "error" + }, + { + "line": 91, + "column": 21, + "stop_line": 91, + "stop_column": 50, + "path": "src\\streamdiffusion\\preprocessing\\processors\\realesrgan_trt.py", + "code": -2, + "name": "missing-attribute", + "description": "Object of class `NoneType` has no attribute `get_tensor_shape`", + "concise_description": "Object of class `NoneType` has no attribute `get_tensor_shape`", + "severity": "error" + }, + { + "line": 92, + "column": 32, + "stop_line": 92, + "stop_column": 60, + "path": "src\\streamdiffusion\\preprocessing\\processors\\realesrgan_trt.py", + "code": -2, + "name": "missing-attribute", + "description": "Object of class `NoneType` has no attribute `get_tensor_dtype`", + "concise_description": "Object of class `NoneType` has no attribute `get_tensor_dtype`", + "severity": "error" + }, + { + "line": 123, + "column": 17, + "stop_line": 123, + "stop_column": 48, + "path": "src\\streamdiffusion\\preprocessing\\processors\\realesrgan_trt.py", + "code": -2, + "name": "missing-attribute", + "description": "Object of class `NoneType` has no attribute `set_tensor_address`", + "concise_description": "Object of class `NoneType` has no attribute `set_tensor_address`", + "severity": "error" + }, + { + "line": 126, + "column": 27, + "stop_line": 126, + "stop_column": 56, + "path": "src\\streamdiffusion\\preprocessing\\processors\\realesrgan_trt.py", + "code": -2, + "name": "missing-attribute", + "description": "Object of class `NoneType` has no attribute `execute_async_v3`", + "concise_description": "Object of class `NoneType` has no attribute `execute_async_v3`", + "severity": "error" + }, + { + "line": 289, + "column": 17, + "stop_line": 289, + "stop_column": 27, + "path": "src\\streamdiffusion\\preprocessing\\processors\\realesrgan_trt.py", + "code": -2, + "name": "bad-argument-type", + "description": "Argument `Tensor` is not assignable to parameter `args` with type `tuple[Any, ...]` in function `torch.onnx.export`", + "concise_description": "Argument `Tensor` is not assignable to parameter `args` with type `tuple[Any, ...]` in function `torch.onnx.export`", + "severity": "error" + }, + { + "line": 331, + "column": 23, + "stop_line": 331, + "stop_column": 34, + "path": "src\\streamdiffusion\\preprocessing\\processors\\realesrgan_trt.py", + "code": -2, + "name": "missing-attribute", + "description": "No attribute `Builder` in module `tensorrt`", + "concise_description": "No attribute `Builder` in module `tensorrt`", + "severity": "error" + }, + { + "line": 331, + "column": 35, + "stop_line": 331, + "stop_column": 45, + "path": "src\\streamdiffusion\\preprocessing\\processors\\realesrgan_trt.py", + "code": -2, + "name": "missing-attribute", + "description": "No attribute `Logger` in module `tensorrt`", + "concise_description": "No attribute `Logger` in module `tensorrt`", + "severity": "error" + }, + { + "line": 331, + "column": 46, + "stop_line": 331, + "stop_column": 56, + "path": "src\\streamdiffusion\\preprocessing\\processors\\realesrgan_trt.py", + "code": -2, + "name": "missing-attribute", + "description": "No attribute `Logger` in module `tensorrt`", + "concise_description": "No attribute `Logger` in module `tensorrt`", + "severity": "error" + }, + { + "line": 333, + "column": 22, + "stop_line": 333, + "stop_column": 36, + "path": "src\\streamdiffusion\\preprocessing\\processors\\realesrgan_trt.py", + "code": -2, + "name": "missing-attribute", + "description": "No attribute `OnnxParser` in module `tensorrt`", + "concise_description": "No attribute `OnnxParser` in module `tensorrt`", + "severity": "error" + }, + { + "line": 333, + "column": 46, + "stop_line": 333, + "stop_column": 56, + "path": "src\\streamdiffusion\\preprocessing\\processors\\realesrgan_trt.py", + "code": -2, + "name": "missing-attribute", + "description": "No attribute `Logger` in module `tensorrt`", + "concise_description": "No attribute `Logger` in module `tensorrt`", + "severity": "error" + }, + { + "line": 333, + "column": 57, + "stop_line": 333, + "stop_column": 67, + "path": "src\\streamdiffusion\\preprocessing\\processors\\realesrgan_trt.py", + "code": -2, + "name": "missing-attribute", + "description": "No attribute `Logger` in module `tensorrt`", + "concise_description": "No attribute `Logger` in module `tensorrt`", + "severity": "error" + }, + { + "line": 344, + "column": 29, + "stop_line": 344, + "stop_column": 44, + "path": "src\\streamdiffusion\\preprocessing\\processors\\realesrgan_trt.py", + "code": -2, + "name": "missing-attribute", + "description": "No attribute `BuilderFlag` in module `tensorrt`", + "concise_description": "No attribute `BuilderFlag` in module `tensorrt`", + "severity": "error" + }, + { + "line": 442, + "column": 64, + "stop_line": 442, + "stop_column": 77, + "path": "src\\streamdiffusion\\preprocessing\\processors\\realesrgan_trt.py", + "code": -2, + "name": "missing-attribute", + "description": "No attribute `LANCZOS` in module `PIL.Image`", + "concise_description": "No attribute `LANCZOS` in module `PIL.Image`", + "severity": "error" + }, + { + "line": 34, + "column": 18, + "stop_line": 34, + "stop_column": 28, + "path": "src\\streamdiffusion\\preprocessing\\processors\\scribble.py", + "code": -2, + "name": "not-callable", + "description": "Expected a callable, got `None`", + "concise_description": "Expected a callable, got `None`", + "severity": "error" + }, + { + "line": 45, + "column": 67, + "stop_line": 45, + "stop_column": 80, + "path": "src\\streamdiffusion\\preprocessing\\processors\\scribble.py", + "code": -2, + "name": "missing-attribute", + "description": "No attribute `LANCZOS` in module `PIL.Image`", + "concise_description": "No attribute `LANCZOS` in module `PIL.Image`", + "severity": "error" + }, + { + "line": 246, + "column": 9, + "stop_line": 246, + "stop_column": 29, + "path": "src\\streamdiffusion\\preprocessing\\processors\\sharpen.py", + "code": -2, + "name": "bad-override-param-name", + "description": "Class member `SharpenPreprocessor._process_tensor_core` overrides parent class `BasePreprocessor` in an inconsistent manner\n Got parameter name `image_tensor`, expected `tensor`", + "concise_description": "Class member `SharpenPreprocessor._process_tensor_core` overrides parent class `BasePreprocessor` in an inconsistent manner", + "severity": "error" + }, + { + "line": 218, + "column": 9, + "stop_line": 218, + "stop_column": 29, + "path": "src\\streamdiffusion\\preprocessing\\processors\\soft_edge.py", + "code": -2, + "name": "bad-override-param-name", + "description": "Class member `SoftEdgePreprocessor._process_tensor_core` overrides parent class `BasePreprocessor` in an inconsistent manner\n Got parameter name `image_tensor`, expected `tensor`", + "concise_description": "Class member `SoftEdgePreprocessor._process_tensor_core` overrides parent class `BasePreprocessor` in an inconsistent manner", + "severity": "error" + }, + { + "line": 231, + "column": 24, + "stop_line": 231, + "stop_column": 34, + "path": "src\\streamdiffusion\\preprocessing\\processors\\soft_edge.py", + "code": -2, + "name": "not-callable", + "description": "Expected a callable, got `None`", + "concise_description": "Expected a callable, got `None`", + "severity": "error" + }, + { + "line": 17, + "column": 43, + "stop_line": 17, + "stop_column": 58, + "path": "src\\streamdiffusion\\preprocessing\\processors\\temporal_net_tensorrt.py", + "code": -2, + "name": "missing-module-attribute", + "description": "Could not import `bytes_from_path` from `polygraphy.backend.common`", + "concise_description": "Could not import `bytes_from_path` from `polygraphy.backend.common`", + "severity": "error" + }, + { + "line": 18, + "column": 40, + "stop_line": 18, + "stop_column": 57, + "path": "src\\streamdiffusion\\preprocessing\\processors\\temporal_net_tensorrt.py", + "code": -2, + "name": "missing-module-attribute", + "description": "Could not import `engine_from_bytes` from `polygraphy.backend.trt`", + "concise_description": "Could not import `engine_from_bytes` from `polygraphy.backend.trt`", + "severity": "error" + }, + { + "line": 52, + "column": 31, + "stop_line": 52, + "stop_column": 39, + "path": "src\\streamdiffusion\\preprocessing\\processors\\temporal_net_tensorrt.py", + "code": -2, + "name": "unsupported-operation", + "description": "Cannot set item in `dict[type[complex128] | type[complex64] | type[float16] | type[float32] | type[float64] | type[int16] | type[int32] | type[int64] | type[int8] | type[uint8], dtype]`\n Argument `type[bool_]` is not assignable to parameter `key` with type `type[complex128] | type[complex64] | type[float16] | type[float32] | type[float64] | type[int16] | type[int32] | type[int64] | type[int8] | type[uint8]` in function `dict.__setitem__`", + "concise_description": "Cannot set item in `dict[type[complex128] | type[complex64] | type[float16] | type[float32] | type[float64] | type[int16] | type[int32] | type[int64] | type[int8] | type[uint8], dtype]`", + "severity": "error" + }, + { + "line": 54, + "column": 31, + "stop_line": 54, + "stop_column": 38, + "path": "src\\streamdiffusion\\preprocessing\\processors\\temporal_net_tensorrt.py", + "code": -2, + "name": "missing-attribute", + "description": "No attribute `bool` in module `numpy`", + "concise_description": "No attribute `bool` in module `numpy`", + "severity": "error" + }, + { + "line": 74, + "column": 24, + "stop_line": 74, + "stop_column": 60, + "path": "src\\streamdiffusion\\preprocessing\\processors\\temporal_net_tensorrt.py", + "code": -2, + "name": "missing-attribute", + "description": "Object of class `NoneType` has no attribute `create_execution_context`", + "concise_description": "Object of class `NoneType` has no attribute `create_execution_context`", + "severity": "error" + }, + { + "line": 85, + "column": 26, + "stop_line": 85, + "stop_column": 52, + "path": "src\\streamdiffusion\\preprocessing\\processors\\temporal_net_tensorrt.py", + "code": -2, + "name": "missing-attribute", + "description": "Object of class `NoneType` has no attribute `num_io_tensors`", + "concise_description": "Object of class `NoneType` has no attribute `num_io_tensors`", + "severity": "error" + }, + { + "line": 86, + "column": 20, + "stop_line": 86, + "stop_column": 47, + "path": "src\\streamdiffusion\\preprocessing\\processors\\temporal_net_tensorrt.py", + "code": -2, + "name": "missing-attribute", + "description": "Object of class `NoneType` has no attribute `get_tensor_name`", + "concise_description": "Object of class `NoneType` has no attribute `get_tensor_name`", + "severity": "error" + }, + { + "line": 87, + "column": 21, + "stop_line": 87, + "stop_column": 50, + "path": "src\\streamdiffusion\\preprocessing\\processors\\temporal_net_tensorrt.py", + "code": -2, + "name": "missing-attribute", + "description": "Object of class `NoneType` has no attribute `get_tensor_shape`", + "concise_description": "Object of class `NoneType` has no attribute `get_tensor_shape`", + "severity": "error" + }, + { + "line": 88, + "column": 25, + "stop_line": 88, + "stop_column": 53, + "path": "src\\streamdiffusion\\preprocessing\\processors\\temporal_net_tensorrt.py", + "code": -2, + "name": "missing-attribute", + "description": "Object of class `NoneType` has no attribute `get_tensor_dtype`", + "concise_description": "Object of class `NoneType` has no attribute `get_tensor_dtype`", + "severity": "error" + }, + { + "line": 94, + "column": 33, + "stop_line": 94, + "stop_column": 45, + "path": "src\\streamdiffusion\\preprocessing\\processors\\temporal_net_tensorrt.py", + "code": -2, + "name": "missing-attribute", + "description": "No attribute `DataType` in module `tensorrt`", + "concise_description": "No attribute `DataType` in module `tensorrt`", + "severity": "error" + }, + { + "line": 99, + "column": 16, + "stop_line": 99, + "stop_column": 43, + "path": "src\\streamdiffusion\\preprocessing\\processors\\temporal_net_tensorrt.py", + "code": -2, + "name": "missing-attribute", + "description": "Object of class `NoneType` has no attribute `get_tensor_mode`", + "concise_description": "Object of class `NoneType` has no attribute `get_tensor_mode`", + "severity": "error" + }, + { + "line": 99, + "column": 53, + "stop_line": 99, + "stop_column": 69, + "path": "src\\streamdiffusion\\preprocessing\\processors\\temporal_net_tensorrt.py", + "code": -2, + "name": "missing-attribute", + "description": "No attribute `TensorIOMode` in module `tensorrt`", + "concise_description": "No attribute `TensorIOMode` in module `tensorrt`", + "severity": "error" + }, + { + "line": 103, + "column": 17, + "stop_line": 103, + "stop_column": 45, + "path": "src\\streamdiffusion\\preprocessing\\processors\\temporal_net_tensorrt.py", + "code": -2, + "name": "missing-attribute", + "description": "Object of class `NoneType` has no attribute `set_input_shape`", + "concise_description": "Object of class `NoneType` has no attribute `set_input_shape`", + "severity": "error" + }, + { + "line": 105, + "column": 25, + "stop_line": 105, + "stop_column": 54, + "path": "src\\streamdiffusion\\preprocessing\\processors\\temporal_net_tensorrt.py", + "code": -2, + "name": "missing-attribute", + "description": "Object of class `NoneType` has no attribute `get_tensor_shape`", + "concise_description": "Object of class `NoneType` has no attribute `get_tensor_shape`", + "severity": "error" + }, + { + "line": 108, + "column": 25, + "stop_line": 108, + "stop_column": 54, + "path": "src\\streamdiffusion\\preprocessing\\processors\\temporal_net_tensorrt.py", + "code": -2, + "name": "missing-attribute", + "description": "Object of class `NoneType` has no attribute `get_tensor_shape`", + "concise_description": "Object of class `NoneType` has no attribute `get_tensor_shape`", + "severity": "error" + }, + { + "line": 139, + "column": 24, + "stop_line": 139, + "stop_column": 51, + "path": "src\\streamdiffusion\\preprocessing\\processors\\temporal_net_tensorrt.py", + "code": -2, + "name": "missing-attribute", + "description": "Object of class `NoneType` has no attribute `get_tensor_mode`", + "concise_description": "Object of class `NoneType` has no attribute `get_tensor_mode`", + "severity": "error" + }, + { + "line": 139, + "column": 61, + "stop_line": 139, + "stop_column": 77, + "path": "src\\streamdiffusion\\preprocessing\\processors\\temporal_net_tensorrt.py", + "code": -2, + "name": "missing-attribute", + "description": "No attribute `TensorIOMode` in module `tensorrt`", + "concise_description": "No attribute `TensorIOMode` in module `tensorrt`", + "severity": "error" + }, + { + "line": 140, + "column": 25, + "stop_line": 140, + "stop_column": 53, + "path": "src\\streamdiffusion\\preprocessing\\processors\\temporal_net_tensorrt.py", + "code": -2, + "name": "missing-attribute", + "description": "Object of class `NoneType` has no attribute `set_input_shape`", + "concise_description": "Object of class `NoneType` has no attribute `set_input_shape`", + "severity": "error" + }, + { + "line": 146, + "column": 30, + "stop_line": 146, + "stop_column": 56, + "path": "src\\streamdiffusion\\preprocessing\\processors\\temporal_net_tensorrt.py", + "code": -2, + "name": "missing-attribute", + "description": "Object of class `NoneType` has no attribute `num_io_tensors`", + "concise_description": "Object of class `NoneType` has no attribute `num_io_tensors`", + "severity": "error" + }, + { + "line": 147, + "column": 24, + "stop_line": 147, + "stop_column": 51, + "path": "src\\streamdiffusion\\preprocessing\\processors\\temporal_net_tensorrt.py", + "code": -2, + "name": "missing-attribute", + "description": "Object of class `NoneType` has no attribute `get_tensor_name`", + "concise_description": "Object of class `NoneType` has no attribute `get_tensor_name`", + "severity": "error" + }, + { + "line": 148, + "column": 25, + "stop_line": 148, + "stop_column": 54, + "path": "src\\streamdiffusion\\preprocessing\\processors\\temporal_net_tensorrt.py", + "code": -2, + "name": "missing-attribute", + "description": "Object of class `NoneType` has no attribute `get_tensor_shape`", + "concise_description": "Object of class `NoneType` has no attribute `get_tensor_shape`", + "severity": "error" + }, + { + "line": 149, + "column": 36, + "stop_line": 149, + "stop_column": 64, + "path": "src\\streamdiffusion\\preprocessing\\processors\\temporal_net_tensorrt.py", + "code": -2, + "name": "missing-attribute", + "description": "Object of class `NoneType` has no attribute `get_tensor_dtype`", + "concise_description": "Object of class `NoneType` has no attribute `get_tensor_dtype`", + "severity": "error" + }, + { + "line": 162, + "column": 13, + "stop_line": 162, + "stop_column": 44, + "path": "src\\streamdiffusion\\preprocessing\\processors\\temporal_net_tensorrt.py", + "code": -2, + "name": "missing-attribute", + "description": "Object of class `NoneType` has no attribute `set_tensor_address`", + "concise_description": "Object of class `NoneType` has no attribute `set_tensor_address`", + "severity": "error" + }, + { + "line": 165, + "column": 19, + "stop_line": 165, + "stop_column": 48, + "path": "src\\streamdiffusion\\preprocessing\\processors\\temporal_net_tensorrt.py", + "code": -2, + "name": "missing-attribute", + "description": "Object of class `NoneType` has no attribute `execute_async_v3`", + "concise_description": "Object of class `NoneType` has no attribute `execute_async_v3`", + "severity": "error" + }, + { + "line": 232, + "column": 28, + "stop_line": 232, + "stop_column": 32, + "path": "src\\streamdiffusion\\preprocessing\\processors\\temporal_net_tensorrt.py", + "code": -2, + "name": "bad-function-definition", + "description": "Default `None` is not assignable to parameter `engine_path` with type `str`", + "concise_description": "Default `None` is not assignable to parameter `engine_path` with type `str`", + "severity": "error" + }, + { + "line": 39, + "column": 43, + "stop_line": 39, + "stop_column": 58, + "path": "src\\streamdiffusion\\preprocessing\\processors\\trt_base.py", + "code": -2, + "name": "missing-module-attribute", + "description": "Could not import `bytes_from_path` from `polygraphy.backend.common`", + "concise_description": "Could not import `bytes_from_path` from `polygraphy.backend.common`", + "severity": "error" + }, + { + "line": 40, + "column": 40, + "stop_line": 40, + "stop_column": 57, + "path": "src\\streamdiffusion\\preprocessing\\processors\\trt_base.py", + "code": -2, + "name": "missing-module-attribute", + "description": "Could not import `engine_from_bytes` from `polygraphy.backend.trt`", + "concise_description": "Could not import `engine_from_bytes` from `polygraphy.backend.trt`", + "severity": "error" + }, + { + "line": 100, + "column": 24, + "stop_line": 100, + "stop_column": 60, + "path": "src\\streamdiffusion\\preprocessing\\processors\\trt_base.py", + "code": -2, + "name": "missing-attribute", + "description": "Object of class `NoneType` has no attribute `create_execution_context`", + "concise_description": "Object of class `NoneType` has no attribute `create_execution_context`", + "severity": "error" + }, + { + "line": 113, + "column": 75, + "stop_line": 113, + "stop_column": 79, + "path": "src\\streamdiffusion\\preprocessing\\processors\\trt_base.py", + "code": -2, + "name": "bad-function-definition", + "description": "Default `None` is not assignable to parameter `input_shape` with type `tuple[Unknown, ...]`", + "concise_description": "Default `None` is not assignable to parameter `input_shape` with type `tuple[Unknown, ...]`", + "severity": "error" + }, + { + "line": 129, + "column": 26, + "stop_line": 129, + "stop_column": 52, + "path": "src\\streamdiffusion\\preprocessing\\processors\\trt_base.py", + "code": -2, + "name": "missing-attribute", + "description": "Object of class `NoneType` has no attribute `num_io_tensors`", + "concise_description": "Object of class `NoneType` has no attribute `num_io_tensors`", + "severity": "error" + }, + { + "line": 130, + "column": 20, + "stop_line": 130, + "stop_column": 47, + "path": "src\\streamdiffusion\\preprocessing\\processors\\trt_base.py", + "code": -2, + "name": "missing-attribute", + "description": "Object of class `NoneType` has no attribute `get_tensor_name`", + "concise_description": "Object of class `NoneType` has no attribute `get_tensor_name`", + "severity": "error" + }, + { + "line": 131, + "column": 16, + "stop_line": 131, + "stop_column": 43, + "path": "src\\streamdiffusion\\preprocessing\\processors\\trt_base.py", + "code": -2, + "name": "missing-attribute", + "description": "Object of class `NoneType` has no attribute `get_tensor_mode`", + "concise_description": "Object of class `NoneType` has no attribute `get_tensor_mode`", + "severity": "error" + }, + { + "line": 131, + "column": 53, + "stop_line": 131, + "stop_column": 69, + "path": "src\\streamdiffusion\\preprocessing\\processors\\trt_base.py", + "code": -2, + "name": "missing-attribute", + "description": "No attribute `TensorIOMode` in module `tensorrt`", + "concise_description": "No attribute `TensorIOMode` in module `tensorrt`", + "severity": "error" + }, + { + "line": 134, + "column": 24, + "stop_line": 134, + "stop_column": 52, + "path": "src\\streamdiffusion\\preprocessing\\processors\\trt_base.py", + "code": -2, + "name": "missing-attribute", + "description": "Object of class `NoneType` has no attribute `set_input_shape`", + "concise_description": "Object of class `NoneType` has no attribute `set_input_shape`", + "severity": "error" + }, + { + "line": 142, + "column": 38, + "stop_line": 142, + "stop_column": 67, + "path": "src\\streamdiffusion\\preprocessing\\processors\\trt_base.py", + "code": -2, + "name": "missing-attribute", + "description": "Object of class `NoneType` has no attribute `get_tensor_shape`", + "concise_description": "Object of class `NoneType` has no attribute `get_tensor_shape`", + "severity": "error" + }, + { + "line": 149, + "column": 24, + "stop_line": 149, + "stop_column": 52, + "path": "src\\streamdiffusion\\preprocessing\\processors\\trt_base.py", + "code": -2, + "name": "missing-attribute", + "description": "Object of class `NoneType` has no attribute `set_input_shape`", + "concise_description": "Object of class `NoneType` has no attribute `set_input_shape`", + "severity": "error" + }, + { + "line": 156, + "column": 26, + "stop_line": 156, + "stop_column": 52, + "path": "src\\streamdiffusion\\preprocessing\\processors\\trt_base.py", + "code": -2, + "name": "missing-attribute", + "description": "Object of class `NoneType` has no attribute `num_io_tensors`", + "concise_description": "Object of class `NoneType` has no attribute `num_io_tensors`", + "severity": "error" + }, + { + "line": 157, + "column": 20, + "stop_line": 157, + "stop_column": 47, + "path": "src\\streamdiffusion\\preprocessing\\processors\\trt_base.py", + "code": -2, + "name": "missing-attribute", + "description": "Object of class `NoneType` has no attribute `get_tensor_name`", + "concise_description": "Object of class `NoneType` has no attribute `get_tensor_name`", + "severity": "error" + }, + { + "line": 158, + "column": 32, + "stop_line": 158, + "stop_column": 60, + "path": "src\\streamdiffusion\\preprocessing\\processors\\trt_base.py", + "code": -2, + "name": "missing-attribute", + "description": "Object of class `NoneType` has no attribute `get_tensor_dtype`", + "concise_description": "Object of class `NoneType` has no attribute `get_tensor_dtype`", + "severity": "error" + }, + { + "line": 159, + "column": 24, + "stop_line": 159, + "stop_column": 51, + "path": "src\\streamdiffusion\\preprocessing\\processors\\trt_base.py", + "code": -2, + "name": "missing-attribute", + "description": "Object of class `NoneType` has no attribute `get_tensor_mode`", + "concise_description": "Object of class `NoneType` has no attribute `get_tensor_mode`", + "severity": "error" + }, + { + "line": 159, + "column": 61, + "stop_line": 159, + "stop_column": 77, + "path": "src\\streamdiffusion\\preprocessing\\processors\\trt_base.py", + "code": -2, + "name": "missing-attribute", + "description": "No attribute `TensorIOMode` in module `tensorrt`", + "concise_description": "No attribute `TensorIOMode` in module `tensorrt`", + "severity": "error" + }, + { + "line": 164, + "column": 31, + "stop_line": 164, + "stop_column": 60, + "path": "src\\streamdiffusion\\preprocessing\\processors\\trt_base.py", + "code": -2, + "name": "missing-attribute", + "description": "Object of class `NoneType` has no attribute `get_tensor_shape`", + "concise_description": "Object of class `NoneType` has no attribute `get_tensor_shape`", + "severity": "error" + }, + { + "line": 204, + "column": 28, + "stop_line": 204, + "stop_column": 56, + "path": "src\\streamdiffusion\\preprocessing\\processors\\trt_base.py", + "code": -2, + "name": "missing-attribute", + "description": "Object of class `NoneType` has no attribute `set_input_shape`", + "concise_description": "Object of class `NoneType` has no attribute `set_input_shape`", + "severity": "error" + }, + { + "line": 212, + "column": 32, + "stop_line": 212, + "stop_column": 60, + "path": "src\\streamdiffusion\\preprocessing\\processors\\trt_base.py", + "code": -2, + "name": "missing-attribute", + "description": "Object of class `NoneType` has no attribute `set_input_shape`", + "concise_description": "Object of class `NoneType` has no attribute `set_input_shape`", + "severity": "error" + }, + { + "line": 223, + "column": 38, + "stop_line": 223, + "stop_column": 64, + "path": "src\\streamdiffusion\\preprocessing\\processors\\trt_base.py", + "code": -2, + "name": "missing-attribute", + "description": "Object of class `NoneType` has no attribute `num_io_tensors`", + "concise_description": "Object of class `NoneType` has no attribute `num_io_tensors`", + "severity": "error" + }, + { + "line": 224, + "column": 32, + "stop_line": 224, + "stop_column": 59, + "path": "src\\streamdiffusion\\preprocessing\\processors\\trt_base.py", + "code": -2, + "name": "missing-attribute", + "description": "Object of class `NoneType` has no attribute `get_tensor_name`", + "concise_description": "Object of class `NoneType` has no attribute `get_tensor_name`", + "severity": "error" + }, + { + "line": 225, + "column": 24, + "stop_line": 225, + "stop_column": 51, + "path": "src\\streamdiffusion\\preprocessing\\processors\\trt_base.py", + "code": -2, + "name": "missing-attribute", + "description": "Object of class `NoneType` has no attribute `get_tensor_mode`", + "concise_description": "Object of class `NoneType` has no attribute `get_tensor_mode`", + "severity": "error" + }, + { + "line": 225, + "column": 65, + "stop_line": 225, + "stop_column": 81, + "path": "src\\streamdiffusion\\preprocessing\\processors\\trt_base.py", + "code": -2, + "name": "missing-attribute", + "description": "No attribute `TensorIOMode` in module `tensorrt`", + "concise_description": "No attribute `TensorIOMode` in module `tensorrt`", + "severity": "error" + }, + { + "line": 226, + "column": 47, + "stop_line": 226, + "stop_column": 76, + "path": "src\\streamdiffusion\\preprocessing\\processors\\trt_base.py", + "code": -2, + "name": "missing-attribute", + "description": "Object of class `NoneType` has no attribute `get_tensor_shape`", + "concise_description": "Object of class `NoneType` has no attribute `get_tensor_shape`", + "severity": "error" + }, + { + "line": 250, + "column": 20, + "stop_line": 250, + "stop_column": 51, + "path": "src\\streamdiffusion\\preprocessing\\processors\\trt_base.py", + "code": -2, + "name": "missing-attribute", + "description": "Object of class `NoneType` has no attribute `set_tensor_address`", + "concise_description": "Object of class `NoneType` has no attribute `set_tensor_address`", + "severity": "error" + }, + { + "line": 266, + "column": 19, + "stop_line": 266, + "stop_column": 48, + "path": "src\\streamdiffusion\\preprocessing\\processors\\trt_base.py", + "code": -2, + "name": "missing-attribute", + "description": "Object of class `NoneType` has no attribute `execute_async_v3`", + "concise_description": "Object of class `NoneType` has no attribute `execute_async_v3`", + "severity": "error" + }, + { + "line": 462, + "column": 19, + "stop_line": 462, + "stop_column": 30, + "path": "src\\streamdiffusion\\preprocessing\\processors\\trt_base.py", + "code": -2, + "name": "missing-attribute", + "description": "No attribute `Builder` in module `tensorrt`", + "concise_description": "No attribute `Builder` in module `tensorrt`", + "severity": "error" + }, + { + "line": 462, + "column": 31, + "stop_line": 462, + "stop_column": 41, + "path": "src\\streamdiffusion\\preprocessing\\processors\\trt_base.py", + "code": -2, + "name": "missing-attribute", + "description": "No attribute `Logger` in module `tensorrt`", + "concise_description": "No attribute `Logger` in module `tensorrt`", + "severity": "error" + }, + { + "line": 462, + "column": 42, + "stop_line": 462, + "stop_column": 52, + "path": "src\\streamdiffusion\\preprocessing\\processors\\trt_base.py", + "code": -2, + "name": "missing-attribute", + "description": "No attribute `Logger` in module `tensorrt`", + "concise_description": "No attribute `Logger` in module `tensorrt`", + "severity": "error" + }, + { + "line": 464, + "column": 18, + "stop_line": 464, + "stop_column": 32, + "path": "src\\streamdiffusion\\preprocessing\\processors\\trt_base.py", + "code": -2, + "name": "missing-attribute", + "description": "No attribute `OnnxParser` in module `tensorrt`", + "concise_description": "No attribute `OnnxParser` in module `tensorrt`", + "severity": "error" + }, + { + "line": 464, + "column": 42, + "stop_line": 464, + "stop_column": 52, + "path": "src\\streamdiffusion\\preprocessing\\processors\\trt_base.py", + "code": -2, + "name": "missing-attribute", + "description": "No attribute `Logger` in module `tensorrt`", + "concise_description": "No attribute `Logger` in module `tensorrt`", + "severity": "error" + }, + { + "line": 464, + "column": 53, + "stop_line": 464, + "stop_column": 63, + "path": "src\\streamdiffusion\\preprocessing\\processors\\trt_base.py", + "code": -2, + "name": "missing-attribute", + "description": "No attribute `Logger` in module `tensorrt`", + "concise_description": "No attribute `Logger` in module `tensorrt`", + "severity": "error" + }, + { + "line": 472, + "column": 25, + "stop_line": 472, + "stop_column": 40, + "path": "src\\streamdiffusion\\preprocessing\\processors\\trt_base.py", + "code": -2, + "name": "missing-attribute", + "description": "No attribute `BuilderFlag` in module `tensorrt`", + "concise_description": "No attribute `BuilderFlag` in module `tensorrt`", + "severity": "error" + }, + { + "line": 555, + "column": 9, + "stop_line": 555, + "stop_column": 29, + "path": "src\\streamdiffusion\\preprocessing\\processors\\trt_base.py", + "code": -2, + "name": "bad-override-param-name", + "description": "Class member `SelfBuildingTRTPreprocessor._process_tensor_core` overrides parent class `BasePreprocessor` in an inconsistent manner\n Got parameter name `image_tensor`, expected `tensor`", + "concise_description": "Class member `SelfBuildingTRTPreprocessor._process_tensor_core` overrides parent class `BasePreprocessor` in an inconsistent manner", + "severity": "error" + }, + { + "line": 50, + "column": 25, + "stop_line": 50, + "stop_column": 39, + "path": "src\\streamdiffusion\\preprocessing\\processors\\upscale.py", + "code": -2, + "name": "missing-attribute", + "description": "No attribute `BILINEAR` in module `PIL.Image`", + "concise_description": "No attribute `BILINEAR` in module `PIL.Image`", + "severity": "error" + }, + { + "line": 51, + "column": 24, + "stop_line": 51, + "stop_column": 37, + "path": "src\\streamdiffusion\\preprocessing\\processors\\upscale.py", + "code": -2, + "name": "missing-attribute", + "description": "No attribute `LANCZOS` in module `PIL.Image`", + "concise_description": "No attribute `LANCZOS` in module `PIL.Image`", + "severity": "error" + }, + { + "line": 52, + "column": 24, + "stop_line": 52, + "stop_column": 37, + "path": "src\\streamdiffusion\\preprocessing\\processors\\upscale.py", + "code": -2, + "name": "missing-attribute", + "description": "No attribute `BICUBIC` in module `PIL.Image`", + "concise_description": "No attribute `BICUBIC` in module `PIL.Image`", + "severity": "error" + }, + { + "line": 53, + "column": 24, + "stop_line": 53, + "stop_column": 37, + "path": "src\\streamdiffusion\\preprocessing\\processors\\upscale.py", + "code": -2, + "name": "missing-attribute", + "description": "No attribute `NEAREST` in module `PIL.Image`", + "concise_description": "No attribute `NEAREST` in module `PIL.Image`", + "severity": "error" + }, + { + "line": 66, + "column": 69, + "stop_line": 66, + "stop_column": 83, + "path": "src\\streamdiffusion\\preprocessing\\processors\\upscale.py", + "code": -2, + "name": "missing-attribute", + "description": "No attribute `BILINEAR` in module `PIL.Image`", + "concise_description": "No attribute `BILINEAR` in module `PIL.Image`", + "severity": "error" + }, + { + "line": 197, + "column": 58, + "stop_line": 197, + "stop_column": 62, + "path": "src\\streamdiffusion\\stream_parameter_updater.py", + "code": -2, + "name": "bad-argument-type", + "description": "Argument `None` is not assignable to parameter `scales` with type `list[float]` in function `streamdiffusion.preprocessing.preprocessing_orchestrator.PreprocessingOrchestrator.process_sync`", + "concise_description": "Argument `None` is not assignable to parameter `scales` with type `list[float]` in function `streamdiffusion.preprocessing.preprocessing_orchestrator.PreprocessingOrchestrator.process_sync`", + "severity": "error" + }, + { + "line": 202, + "column": 58, + "stop_line": 202, + "stop_column": 78, + "path": "src\\streamdiffusion\\stream_parameter_updater.py", + "code": -2, + "name": "unsupported-operation", + "description": "Cannot set item in `dict[str, tuple[Tensor, Tensor]]`\n Argument `Tensor | tuple[Tensor, Tensor]` is not assignable to parameter `value` with type `tuple[Tensor, Tensor]` in function `dict.__setitem__`", + "concise_description": "Cannot set item in `dict[str, tuple[Tensor, Tensor]]`", + "severity": "error" + }, + { + "line": 900, + "column": 29, + "stop_line": 900, + "stop_column": 95, + "path": "src\\streamdiffusion\\stream_parameter_updater.py", + "code": -2, + "name": "missing-attribute", + "description": "Object of class `LCMScheduler` has no attribute `get_scalings_for_boundary_condition_discrete`", + "concise_description": "Object of class `LCMScheduler` has no attribute `get_scalings_for_boundary_condition_discrete`", + "severity": "error" + }, + { + "line": 1382, + "column": 34, + "stop_line": 1382, + "stop_column": 61, + "path": "src\\streamdiffusion\\stream_parameter_updater.py", + "code": -2, + "name": "bad-argument-type", + "description": "Argument `Any | None` is not assignable to parameter `model_id` with type `str` in function `streamdiffusion.modules.controlnet_module.ControlNetConfig.__init__`", + "concise_description": "Argument `Any | None` is not assignable to parameter `model_id` with type `str` in function `streamdiffusion.modules.controlnet_module.ControlNetConfig.__init__`", + "severity": "error" + }, + { + "line": 1785, + "column": 25, + "stop_line": 1785, + "stop_column": 44, + "path": "src\\streamdiffusion\\stream_parameter_updater.py", + "code": -2, + "name": "missing-attribute", + "description": "Object of class `BasePreprocessor` has no attribute `order`", + "concise_description": "Object of class `BasePreprocessor` has no attribute `order`", + "severity": "error" + }, + { + "line": 1786, + "column": 25, + "stop_line": 1786, + "stop_column": 46, + "path": "src\\streamdiffusion\\stream_parameter_updater.py", + "code": -2, + "name": "missing-attribute", + "description": "Object of class `BasePreprocessor` has no attribute `enabled`", + "concise_description": "Object of class `BasePreprocessor` has no attribute `enabled`", + "severity": "error" + }, + { + "line": 84, + "column": 13, + "stop_line": 84, + "stop_column": 24, + "path": "src\\streamdiffusion\\tools\\compile_depth_anything_tensorrt.py", + "code": -2, + "name": "bad-argument-type", + "description": "Argument `Tensor` is not assignable to parameter `args` with type `tuple[Any, ...]` in function `torch.onnx.export`", + "concise_description": "Argument `Tensor` is not assignable to parameter `args` with type `tuple[Any, ...]` in function `torch.onnx.export`", + "severity": "error" + }, + { + "line": 121, + "column": 19, + "stop_line": 121, + "stop_column": 30, + "path": "src\\streamdiffusion\\tools\\compile_depth_anything_tensorrt.py", + "code": -2, + "name": "missing-attribute", + "description": "No attribute `Builder` in module `tensorrt`", + "concise_description": "No attribute `Builder` in module `tensorrt`", + "severity": "error" + }, + { + "line": 123, + "column": 18, + "stop_line": 123, + "stop_column": 32, + "path": "src\\streamdiffusion\\tools\\compile_depth_anything_tensorrt.py", + "code": -2, + "name": "missing-attribute", + "description": "No attribute `OnnxParser` in module `tensorrt`", + "concise_description": "No attribute `OnnxParser` in module `tensorrt`", + "severity": "error" + }, + { + "line": 134, + "column": 38, + "stop_line": 134, + "stop_column": 56, + "path": "src\\streamdiffusion\\tools\\compile_depth_anything_tensorrt.py", + "code": -2, + "name": "missing-attribute", + "description": "No attribute `MemoryPoolType` in module `tensorrt`", + "concise_description": "No attribute `MemoryPoolType` in module `tensorrt`", + "severity": "error" + }, + { + "line": 137, + "column": 29, + "stop_line": 137, + "stop_column": 44, + "path": "src\\streamdiffusion\\tools\\compile_depth_anything_tensorrt.py", + "code": -2, + "name": "missing-attribute", + "description": "No attribute `BuilderFlag` in module `tensorrt`", + "concise_description": "No attribute `BuilderFlag` in module `tensorrt`", + "severity": "error" + }, + { + "line": 152, + "column": 19, + "stop_line": 152, + "stop_column": 30, + "path": "src\\streamdiffusion\\tools\\compile_raft_tensorrt.py", + "code": -2, + "name": "missing-attribute", + "description": "No attribute `Builder` in module `tensorrt`", + "concise_description": "No attribute `Builder` in module `tensorrt`", + "severity": "error" + }, + { + "line": 154, + "column": 18, + "stop_line": 154, + "stop_column": 32, + "path": "src\\streamdiffusion\\tools\\compile_raft_tensorrt.py", + "code": -2, + "name": "missing-attribute", + "description": "No attribute `OnnxParser` in module `tensorrt`", + "concise_description": "No attribute `OnnxParser` in module `tensorrt`", + "severity": "error" + }, + { + "line": 167, + "column": 38, + "stop_line": 167, + "stop_column": 56, + "path": "src\\streamdiffusion\\tools\\compile_raft_tensorrt.py", + "code": -2, + "name": "missing-attribute", + "description": "No attribute `MemoryPoolType` in module `tensorrt`", + "concise_description": "No attribute `MemoryPoolType` in module `tensorrt`", + "severity": "error" + }, + { + "line": 170, + "column": 29, + "stop_line": 170, + "stop_column": 44, + "path": "src\\streamdiffusion\\tools\\compile_raft_tensorrt.py", + "code": -2, + "name": "missing-attribute", + "description": "No attribute `BuilderFlag` in module `tensorrt`", + "concise_description": "No attribute `BuilderFlag` in module `tensorrt`", + "severity": "error" + }, + { + "line": 137, + "column": 13, + "stop_line": 137, + "stop_column": 26, + "path": "src\\streamdiffusion\\tools\\gpu_profiler.py", + "code": -2, + "name": "missing-attribute", + "description": "Object of class `NoneType` has no attribute `cuda`", + "concise_description": "Object of class `NoneType` has no attribute `cuda`", + "severity": "error" + }, + { + "line": 139, + "column": 31, + "stop_line": 139, + "stop_column": 44, + "path": "src\\streamdiffusion\\tools\\gpu_profiler.py", + "code": -2, + "name": "missing-attribute", + "description": "Object of class `NoneType` has no attribute `cuda`", + "concise_description": "Object of class `NoneType` has no attribute `cuda`", + "severity": "error" + }, + { + "line": 140, + "column": 29, + "stop_line": 140, + "stop_column": 42, + "path": "src\\streamdiffusion\\tools\\gpu_profiler.py", + "code": -2, + "name": "missing-attribute", + "description": "Object of class `NoneType` has no attribute `cuda`", + "concise_description": "Object of class `NoneType` has no attribute `cuda`", + "severity": "error" + }, + { + "line": 147, + "column": 13, + "stop_line": 147, + "stop_column": 33, + "path": "src\\streamdiffusion\\tools\\gpu_profiler.py", + "code": -2, + "name": "missing-attribute", + "description": "Object of class `NoneType` has no attribute `record`", + "concise_description": "Object of class `NoneType` has no attribute `record`", + "severity": "error" + }, + { + "line": 152, + "column": 13, + "stop_line": 152, + "stop_column": 26, + "path": "src\\streamdiffusion\\tools\\gpu_profiler.py", + "code": -2, + "name": "missing-attribute", + "description": "Object of class `NoneType` has no attribute `cuda`", + "concise_description": "Object of class `NoneType` has no attribute `cuda`", + "severity": "error" + }, + { + "line": 393, + "column": 26, + "stop_line": 393, + "stop_column": 38, + "path": "src\\streamdiffusion\\wrapper.py", + "code": -2, + "name": "bad-argument-type", + "description": "Argument `bool | None` is not assignable to parameter `use_lcm_lora` with type `bool` in function `StreamDiffusionWrapper._load_model`", + "concise_description": "Argument `bool | None` is not assignable to parameter `use_lcm_lora` with type `bool` in function `StreamDiffusionWrapper._load_model`", + "severity": "error" + }, + { + "line": 579, + "column": 17, + "stop_line": 579, + "stop_column": 34, + "path": "src\\streamdiffusion\\wrapper.py", + "code": -2, + "name": "missing-attribute", + "description": "Object of class `StableDiffusionPipeline` has no attribute `text_encoder`", + "concise_description": "Object of class `StableDiffusionPipeline` has no attribute `text_encoder`", + "severity": "error" + }, + { + "line": 582, + "column": 17, + "stop_line": 582, + "stop_column": 36, + "path": "src\\streamdiffusion\\wrapper.py", + "code": -2, + "name": "missing-attribute", + "description": "Object of class `StableDiffusionPipeline` has no attribute `text_encoder_2`", + "concise_description": "Object of class `StableDiffusionPipeline` has no attribute `text_encoder_2`", + "severity": "error" + }, + { + "line": 596, + "column": 13, + "stop_line": 596, + "stop_column": 30, + "path": "src\\streamdiffusion\\wrapper.py", + "code": -2, + "name": "missing-attribute", + "description": "Object of class `StableDiffusionPipeline` has no attribute `text_encoder`", + "concise_description": "Object of class `StableDiffusionPipeline` has no attribute `text_encoder`", + "severity": "error" + }, + { + "line": 598, + "column": 13, + "stop_line": 598, + "stop_column": 32, + "path": "src\\streamdiffusion\\wrapper.py", + "code": -2, + "name": "missing-attribute", + "description": "Object of class `StableDiffusionPipeline` has no attribute `text_encoder_2`", + "concise_description": "Object of class `StableDiffusionPipeline` has no attribute `text_encoder_2`", + "severity": "error" + }, + { + "line": 829, + "column": 20, + "stop_line": 829, + "stop_column": 63, + "path": "src\\streamdiffusion\\wrapper.py", + "code": -2, + "name": "bad-return", + "description": "Returned type `Image | Tensor | list[Image] | ndarray[Unknown, Unknown]` is not assignable to declared return type `Tensor | list[Tensor]`", + "concise_description": "Returned type `Image | Tensor | list[Image] | ndarray[Unknown, Unknown]` is not assignable to declared return type `Tensor | list[Tensor]`", + "severity": "error" + }, + { + "line": 832, + "column": 20, + "stop_line": 832, + "stop_column": 47, + "path": "src\\streamdiffusion\\wrapper.py", + "code": -2, + "name": "bad-return", + "description": "Returned type `Image | Tensor | list[Image] | ndarray[Unknown, Unknown]` is not assignable to declared return type `Tensor | list[Tensor]`", + "concise_description": "Returned type `Image | Tensor | list[Image] | ndarray[Unknown, Unknown]` is not assignable to declared return type `Tensor | list[Tensor]`", + "severity": "error" + }, + { + "line": 832, + "column": 33, + "stop_line": 832, + "stop_column": 38, + "path": "src\\streamdiffusion\\wrapper.py", + "code": -2, + "name": "bad-argument-type", + "description": "Argument `Image | Tensor | str | None` is not assignable to parameter `image` with type `Image | Tensor | str` in function `StreamDiffusionWrapper.img2img`", + "concise_description": "Argument `Image | Tensor | str | None` is not assignable to parameter `image` with type `Image | Tensor | str` in function `StreamDiffusionWrapper.img2img`", + "severity": "error" + }, + { + "line": 834, + "column": 20, + "stop_line": 834, + "stop_column": 40, + "path": "src\\streamdiffusion\\wrapper.py", + "code": -2, + "name": "bad-return", + "description": "Returned type `Image | Tensor | list[Image] | ndarray[Unknown, Unknown]` is not assignable to declared return type `Tensor | list[Tensor]`", + "concise_description": "Returned type `Image | Tensor | list[Image] | ndarray[Unknown, Unknown]` is not assignable to declared return type `Tensor | list[Tensor]`", + "severity": "error" + }, + { + "line": 946, + "column": 17, + "stop_line": 946, + "stop_column": 83, + "path": "src\\streamdiffusion\\wrapper.py", + "code": -2, + "name": "bad-assignment", + "description": "`Image | Tensor | list[Image] | ndarray[Unknown, Unknown]` is not assignable to variable `image` with type `Image | Tensor | str`", + "concise_description": "`Image | Tensor | list[Image] | ndarray[Unknown, Unknown]` is not assignable to variable `image` with type `Image | Tensor | str`", + "severity": "error" + }, + { + "line": 948, + "column": 16, + "stop_line": 948, + "stop_column": 21, + "path": "src\\streamdiffusion\\wrapper.py", + "code": -2, + "name": "bad-return", + "description": "Returned type `Image | Tensor | str` is not assignable to declared return type `Image | Tensor | list[Image] | ndarray[Unknown, Unknown]`", + "concise_description": "Returned type `Image | Tensor | str` is not assignable to declared return type `Image | Tensor | list[Image] | ndarray[Unknown, Unknown]`", + "severity": "error" + }, + { + "line": 1029, + "column": 20, + "stop_line": 1029, + "stop_column": 24, + "path": "src\\streamdiffusion\\wrapper.py", + "code": -2, + "name": "bad-return", + "description": "Returned type `None` is not assignable to declared return type `Image | Tensor | list[Image] | ndarray[Unknown, Unknown]`", + "concise_description": "Returned type `None` is not assignable to declared return type `Image | Tensor | list[Image] | ndarray[Unknown, Unknown]`", + "severity": "error" + }, + { + "line": 1056, + "column": 17, + "stop_line": 1056, + "stop_column": 39, + "path": "src\\streamdiffusion\\wrapper.py", + "code": -2, + "name": "missing-attribute", + "description": "Object of class `NoneType` has no attribute `record`", + "concise_description": "Object of class `NoneType` has no attribute `record`", + "severity": "error" + }, + { + "line": 1057, + "column": 17, + "stop_line": 1057, + "stop_column": 44, + "path": "src\\streamdiffusion\\wrapper.py", + "code": -2, + "name": "missing-attribute", + "description": "Object of class `NoneType` has no attribute `synchronize`", + "concise_description": "Object of class `NoneType` has no attribute `synchronize`", + "severity": "error" + }, + { + "line": 1075, + "column": 20, + "stop_line": 1075, + "stop_column": 85, + "path": "src\\streamdiffusion\\wrapper.py", + "code": -2, + "name": "bad-index", + "description": "Cannot index into `Image`\n Object of class `Image` has no attribute `__getitem__`", + "concise_description": "Cannot index into `Image`", + "severity": "error" + }, + { + "line": 1127, + "column": 26, + "stop_line": 1127, + "stop_column": 49, + "path": "src\\streamdiffusion\\wrapper.py", + "code": -2, + "name": "bad-argument-type", + "description": "Argument `str | None` is not assignable to parameter `shm_name` with type `str` in function `cuda_link._exporter_port.FrameSpec.__init__`", + "concise_description": "Argument `str | None` is not assignable to parameter `shm_name` with type `str` in function `cuda_link._exporter_port.FrameSpec.__init__`", + "severity": "error" + }, + { + "line": 1185, + "column": 26, + "stop_line": 1185, + "stop_column": 62, + "path": "src\\streamdiffusion\\wrapper.py", + "code": -2, + "name": "bad-argument-type", + "description": "Argument `str | None` is not assignable to parameter `shm_name` with type `str` in function `cuda_link._exporter_port.FrameSpec.__init__`", + "concise_description": "Argument `str | None` is not assignable to parameter `shm_name` with type `str` in function `cuda_link._exporter_port.FrameSpec.__init__`", + "severity": "error" + }, + { + "line": 1332, + "column": 13, + "stop_line": 1332, + "stop_column": 35, + "path": "src\\streamdiffusion\\wrapper.py", + "code": -2, + "name": "missing-attribute", + "description": "Object of class `NoneType` has no attribute `record`", + "concise_description": "Object of class `NoneType` has no attribute `record`", + "severity": "error" + }, + { + "line": 1333, + "column": 13, + "stop_line": 1333, + "stop_column": 40, + "path": "src\\streamdiffusion\\wrapper.py", + "code": -2, + "name": "missing-attribute", + "description": "Object of class `NoneType` has no attribute `synchronize`", + "concise_description": "Object of class `NoneType` has no attribute `synchronize`", + "severity": "error" + }, + { + "line": 1601, + "column": 24, + "stop_line": 1601, + "stop_column": 30, + "path": "src\\streamdiffusion\\wrapper.py", + "code": -2, + "name": "not-callable", + "description": "Expected a callable, got `None`", + "concise_description": "Expected a callable, got `None`", + "severity": "error" + }, + { + "line": 1601, + "column": 24, + "stop_line": 1601, + "stop_column": 51, + "path": "src\\streamdiffusion\\wrapper.py", + "code": -2, + "name": "missing-attribute", + "description": "Object of class `NoneType` has no attribute `to`", + "concise_description": "Object of class `NoneType` has no attribute `to`", + "severity": "error" + }, + { + "line": 1610, + "column": 32, + "stop_line": 1610, + "stop_column": 74, + "path": "src\\streamdiffusion\\wrapper.py", + "code": -2, + "name": "not-callable", + "description": "Expected a callable, got `None`", + "concise_description": "Expected a callable, got `None`", + "severity": "error" + }, + { + "line": 1640, + "column": 17, + "stop_line": 1640, + "stop_column": 34, + "path": "src\\streamdiffusion\\wrapper.py", + "code": -2, + "name": "missing-attribute", + "description": "Object of class `StableDiffusionXLPipeline` has no attribute `text_encoder`", + "concise_description": "Object of class `StableDiffusionXLPipeline` has no attribute `text_encoder`", + "severity": "error" + }, + { + "line": 1642, + "column": 17, + "stop_line": 1642, + "stop_column": 36, + "path": "src\\streamdiffusion\\wrapper.py", + "code": -2, + "name": "missing-attribute", + "description": "Object of class `StableDiffusionXLPipeline` has no attribute `text_encoder_2`", + "concise_description": "Object of class `StableDiffusionXLPipeline` has no attribute `text_encoder_2`", + "severity": "error" + }, + { + "line": 1645, + "column": 17, + "stop_line": 1645, + "stop_column": 26, + "path": "src\\streamdiffusion\\wrapper.py", + "code": -2, + "name": "missing-attribute", + "description": "Object of class `StableDiffusionXLPipeline` has no attribute `unet`", + "concise_description": "Object of class `StableDiffusionXLPipeline` has no attribute `unet`", + "severity": "error" + }, + { + "line": 1647, + "column": 17, + "stop_line": 1647, + "stop_column": 25, + "path": "src\\streamdiffusion\\wrapper.py", + "code": -2, + "name": "missing-attribute", + "description": "Object of class `StableDiffusionXLPipeline` has no attribute `vae`", + "concise_description": "Object of class `StableDiffusionXLPipeline` has no attribute `vae`", + "severity": "error" + }, + { + "line": 1653, + "column": 41, + "stop_line": 1653, + "stop_column": 50, + "path": "src\\streamdiffusion\\wrapper.py", + "code": -2, + "name": "missing-attribute", + "description": "Object of class `StableDiffusionXLPipeline` has no attribute `unet`", + "concise_description": "Object of class `StableDiffusionXLPipeline` has no attribute `unet`", + "severity": "error" + }, + { + "line": 1708, + "column": 60, + "stop_line": 1708, + "stop_column": 69, + "path": "src\\streamdiffusion\\wrapper.py", + "code": -2, + "name": "missing-attribute", + "description": "Object of class `StableDiffusionXLPipeline` has no attribute `unet`", + "concise_description": "Object of class `StableDiffusionXLPipeline` has no attribute `unet`", + "severity": "error" + }, + { + "line": 1713, + "column": 18, + "stop_line": 1713, + "stop_column": 22, + "path": "src\\streamdiffusion\\wrapper.py", + "code": -2, + "name": "bad-argument-type", + "description": "Argument `diffusers.pipelines.stable_diffusion_xl.pipeline_stable_diffusion_xl.StableDiffusionXLPipeline | diffusers.utils.dummy_torch_and_transformers_objects.StableDiffusionXLPipeline | Unknown` is not assignable to parameter `pipe` with type `diffusers.pipelines.stable_diffusion.pipeline_stable_diffusion.StableDiffusionPipeline | diffusers.utils.dummy_torch_and_transformers_objects.StableDiffusionPipeline` in function `streamdiffusion.pipeline.StreamDiffusion.__init__`", + "concise_description": "Argument `diffusers.pipelines.stable_diffusion_xl.pipeline_stable_diffusion_xl.StableDiffusionXLPipeline | diffusers.utils.dummy_torch_and_transformers_objects.StableDiffusionXLPipeline | Unknown` is not assignable to parameter `pipe` with type `diffusers.pipelines.stable_diffusion.pipeline_stable_diffusion.StableDiffusionPipeline | diffusers.utils.dummy_torch_and_transformers_objects.StableDiffusionPipeline` in function `streamdiffusion.pipeline.StreamDiffusion.__init__`", + "severity": "error" + }, + { + "line": 1742, + "column": 17, + "stop_line": 1742, + "stop_column": 26, + "path": "src\\streamdiffusion\\wrapper.py", + "code": -2, + "name": "missing-attribute", + "description": "Object of class `StableDiffusionXLPipeline` has no attribute `unet`", + "concise_description": "Object of class `StableDiffusionXLPipeline` has no attribute `unet`", + "severity": "error" + }, + { + "line": 1760, + "column": 17, + "stop_line": 1760, + "stop_column": 26, + "path": "src\\streamdiffusion\\wrapper.py", + "code": -2, + "name": "missing-attribute", + "description": "Object of class `StableDiffusionXLPipeline` has no attribute `unet`", + "concise_description": "Object of class `StableDiffusionXLPipeline` has no attribute `unet`", + "severity": "error" + }, + { + "line": 1820, + "column": 21, + "stop_line": 1820, + "stop_column": 42, + "path": "src\\streamdiffusion\\wrapper.py", + "code": -2, + "name": "missing-attribute", + "description": "Object of class `StableDiffusionPipeline` has no attribute `fuse_lora`", + "concise_description": "Object of class `StableDiffusionPipeline` has no attribute `fuse_lora`", + "severity": "error" + }, + { + "line": 1823, + "column": 17, + "stop_line": 1823, + "stop_column": 48, + "path": "src\\streamdiffusion\\wrapper.py", + "code": -2, + "name": "missing-attribute", + "description": "Object of class `StableDiffusionPipeline` has no attribute `unload_lora_weights`", + "concise_description": "Object of class `StableDiffusionPipeline` has no attribute `unload_lora_weights`", + "severity": "error" + }, + { + "line": 1830, + "column": 21, + "stop_line": 1830, + "stop_column": 52, + "path": "src\\streamdiffusion\\wrapper.py", + "code": -2, + "name": "missing-attribute", + "description": "Object of class `StableDiffusionPipeline` has no attribute `unload_lora_weights`", + "concise_description": "Object of class `StableDiffusionPipeline` has no attribute `unload_lora_weights`", + "severity": "error" + }, + { + "line": 1849, + "column": 30, + "stop_line": 1849, + "stop_column": 72, + "path": "src\\streamdiffusion\\wrapper.py", + "code": -2, + "name": "missing-attribute", + "description": "Object of class `NoneType` has no attribute `to`", + "concise_description": "Object of class `NoneType` has no attribute `to`", + "severity": "error" + }, + { + "line": 1853, + "column": 30, + "stop_line": 1853, + "stop_column": 77, + "path": "src\\streamdiffusion\\wrapper.py", + "code": -2, + "name": "missing-attribute", + "description": "Object of class `NoneType` has no attribute `to`", + "concise_description": "Object of class `NoneType` has no attribute `to`", + "severity": "error" + }, + { + "line": 1857, + "column": 17, + "stop_line": 1857, + "stop_column": 25, + "path": "src\\streamdiffusion\\wrapper.py", + "code": -2, + "name": "missing-attribute", + "description": "Object of class `StableDiffusionXLPipeline` has no attribute `vae`", + "concise_description": "Object of class `StableDiffusionXLPipeline` has no attribute `vae`", + "severity": "error" + }, + { + "line": 1861, + "column": 17, + "stop_line": 1861, + "stop_column": 71, + "path": "src\\streamdiffusion\\wrapper.py", + "code": -2, + "name": "missing-attribute", + "description": "Object of class `StableDiffusionPipeline` has no attribute `enable_xformers_memory_efficient_attention`", + "concise_description": "Object of class `StableDiffusionPipeline` has no attribute `enable_xformers_memory_efficient_attention`", + "severity": "error" + }, + { + "line": 1883, + "column": 48, + "stop_line": 1883, + "stop_column": 58, + "path": "src\\streamdiffusion\\wrapper.py", + "code": -2, + "name": "bad-argument-type", + "description": "Argument `Path | str | None` is not assignable to parameter `engine_dir` with type `str` in function `streamdiffusion.acceleration.tensorrt.engine_manager.EngineManager.__init__`", + "concise_description": "Argument `Path | str | None` is not assignable to parameter `engine_dir` with type `str` in function `streamdiffusion.acceleration.tensorrt.engine_manager.EngineManager.__init__`", + "severity": "error" + }, + { + "line": 1990, + "column": 31, + "stop_line": 1990, + "stop_column": 40, + "path": "src\\streamdiffusion\\wrapper.py", + "code": -2, + "name": "unbound-name", + "description": "`is_faceid` may be uninitialized", + "concise_description": "`is_faceid` may be uninitialized", + "severity": "error" + }, + { + "line": 2124, + "column": 29, + "stop_line": 2124, + "stop_column": 53, + "path": "src\\streamdiffusion\\wrapper.py", + "code": -2, + "name": "missing-attribute", + "description": "Object of class `StreamDiffusion` has no attribute `_ipadapter_module`", + "concise_description": "Object of class `StreamDiffusion` has no attribute `_ipadapter_module`", + "severity": "error" + }, + { + "line": 2158, + "column": 68, + "stop_line": 2158, + "stop_column": 90, + "path": "src\\streamdiffusion\\wrapper.py", + "code": -2, + "name": "unbound-name", + "description": "`_saved_unet_processors` is uninitialized", + "concise_description": "`_saved_unet_processors` is uninitialized", + "severity": "error" + }, + { + "line": 2178, + "column": 64, + "stop_line": 2178, + "stop_column": 86, + "path": "src\\streamdiffusion\\wrapper.py", + "code": -2, + "name": "unbound-name", + "description": "`_saved_unet_processors` is uninitialized", + "concise_description": "`_saved_unet_processors` is uninitialized", + "severity": "error" + }, + { + "line": 2222, + "column": 35, + "stop_line": 2222, + "stop_column": 79, + "path": "src\\streamdiffusion\\wrapper.py", + "code": -2, + "name": "bad-argument-type", + "description": "Argument `int | None` is not assignable to parameter `num_ip_layers` with type `int` in function `streamdiffusion.acceleration.tensorrt.models.models.UNet.__init__`", + "concise_description": "Argument `int | None` is not assignable to parameter `num_ip_layers` with type `int` in function `streamdiffusion.acceleration.tensorrt.models.models.UNet.__init__`", + "severity": "error" + }, + { + "line": 2246, + "column": 41, + "stop_line": 2246, + "stop_column": 60, + "path": "src\\streamdiffusion\\wrapper.py", + "code": -2, + "name": "bad-argument-type", + "description": "Argument `list[list[Unknown]] | list[Unknown]` is not assignable to parameter `kvo_cache_structure` with type `list[int] | None` in function `streamdiffusion.acceleration.tensorrt.export_wrappers.unet_unified_export.UnifiedExportWrapper.__init__`", + "concise_description": "Argument `list[list[Unknown]] | list[Unknown]` is not assignable to parameter `kvo_cache_structure` with type `list[int] | None` in function `streamdiffusion.acceleration.tensorrt.export_wrappers.unet_unified_export.UnifiedExportWrapper.__init__`", + "severity": "error" + }, + { + "line": 2393, + "column": 56, + "stop_line": 2393, + "stop_column": 67, + "path": "src\\streamdiffusion\\wrapper.py", + "code": -2, + "name": "bad-typed-dict-key", + "description": "`diffusers.pipelines.stable_diffusion.pipeline_stable_diffusion.StableDiffusionPipeline | diffusers.utils.dummy_torch_and_transformers_objects.StableDiffusionPipeline` is not assignable to TypedDict key `pipe_ref` with type `bool | int`", + "concise_description": "`diffusers.pipelines.stable_diffusion.pipeline_stable_diffusion.StableDiffusionPipeline | diffusers.utils.dummy_torch_and_transformers_objects.StableDiffusionPipeline` is not assignable to TypedDict key `pipe_ref` with type `bool | int`", + "severity": "error" + }, + { + "line": 2398, + "column": 66, + "stop_line": 2398, + "stop_column": 91, + "path": "src\\streamdiffusion\\wrapper.py", + "code": -2, + "name": "bad-typed-dict-key", + "description": "`float` is not assignable to TypedDict key `fp8_guidance_scale` with type `bool | int`", + "concise_description": "`float` is not assignable to TypedDict key `fp8_guidance_scale` with type `bool | int`", + "severity": "error" + }, + { + "line": 2403, + "column": 65, + "stop_line": 2403, + "stop_column": 106, + "path": "src\\streamdiffusion\\wrapper.py", + "code": -2, + "name": "bad-typed-dict-key", + "description": "`int | None` is not assignable to TypedDict key `fp8_num_ip_layers` with type `bool | int`", + "concise_description": "`int | None` is not assignable to TypedDict key `fp8_num_ip_layers` with type `bool | int`", + "severity": "error" + }, + { + "line": 2489, + "column": 29, + "stop_line": 2489, + "stop_column": 57, + "path": "src\\streamdiffusion\\wrapper.py", + "code": -2, + "name": "missing-attribute", + "description": "Object of class `StableDiffusionPipeline` has no attribute `vae_scale_factor`", + "concise_description": "Object of class `StableDiffusionPipeline` has no attribute `vae_scale_factor`", + "severity": "error" + }, + { + "line": 2492, + "column": 25, + "stop_line": 2492, + "stop_column": 42, + "path": "src\\streamdiffusion\\wrapper.py", + "code": -2, + "name": "missing-attribute", + "description": "Object of class `AutoencoderKLEngine` has no attribute `config`", + "concise_description": "Object of class `AutoencoderKLEngine` has no attribute `config`", + "severity": "error" + }, + { + "line": 2493, + "column": 25, + "stop_line": 2493, + "stop_column": 41, + "path": "src\\streamdiffusion\\wrapper.py", + "code": -2, + "name": "missing-attribute", + "description": "Object of class `AutoencoderKLEngine` has no attribute `dtype`", + "concise_description": "Object of class `AutoencoderKLEngine` has no attribute `dtype`", + "severity": "error" + }, + { + "line": 2535, + "column": 38, + "stop_line": 2535, + "stop_column": 61, + "path": "src\\streamdiffusion\\wrapper.py", + "code": -2, + "name": "bad-argument-type", + "description": "Argument `str | None` is not assignable to parameter `model_id_or_path` with type `str` in function `streamdiffusion.acceleration.tensorrt.engine_manager.EngineManager.get_engine_path`", + "concise_description": "Argument `str | None` is not assignable to parameter `model_id_or_path` with type `str` in function `streamdiffusion.acceleration.tensorrt.engine_manager.EngineManager.get_engine_path`", + "severity": "error" + }, + { + "line": 2568, + "column": 29, + "stop_line": 2568, + "stop_column": 48, + "path": "src\\streamdiffusion\\wrapper.py", + "code": -2, + "name": "bad-argument-type", + "description": "Argument `Path` is not assignable to parameter `filepath` with type `str` in function `streamdiffusion.acceleration.tensorrt.runtime_engines.unet_engine.NSFWDetectorEngine.__init__`", + "concise_description": "Argument `Path` is not assignable to parameter `filepath` with type `str` in function `streamdiffusion.acceleration.tensorrt.runtime_engines.unet_engine.NSFWDetectorEngine.__init__`", + "severity": "error" + }, + { + "line": 2614, + "column": 17, + "stop_line": 2614, + "stop_column": 42, + "path": "src\\streamdiffusion\\wrapper.py", + "code": -2, + "name": "missing-attribute", + "description": "Object of class `StreamDiffusion` has no attribute `_controlnet_module`", + "concise_description": "Object of class `StreamDiffusion` has no attribute `_controlnet_module`", + "severity": "error" + }, + { + "line": 2630, + "column": 42, + "stop_line": 2630, + "stop_column": 56, + "path": "src\\streamdiffusion\\wrapper.py", + "code": -2, + "name": "unbound-name", + "description": "`engine_manager` may be uninitialized", + "concise_description": "`engine_manager` may be uninitialized", + "severity": "error" + }, + { + "line": 2637, + "column": 49, + "stop_line": 2637, + "stop_column": 60, + "path": "src\\streamdiffusion\\wrapper.py", + "code": -2, + "name": "unbound-name", + "description": "`cuda_stream` may be uninitialized", + "concise_description": "`cuda_stream` may be uninitialized", + "severity": "error" + }, + { + "line": 2643, + "column": 49, + "stop_line": 2643, + "stop_column": 60, + "path": "src\\streamdiffusion\\wrapper.py", + "code": -2, + "name": "unbound-name", + "description": "`load_engine` may be uninitialized", + "concise_description": "`load_engine` may be uninitialized", + "severity": "error" + }, + { + "line": 2658, + "column": 29, + "stop_line": 2658, + "stop_column": 54, + "path": "src\\streamdiffusion\\wrapper.py", + "code": -2, + "name": "missing-attribute", + "description": "Object of class `StreamDiffusion` has no attribute `controlnet_engines`", + "concise_description": "Object of class `StreamDiffusion` has no attribute `controlnet_engines`", + "severity": "error" + }, + { + "line": 2712, + "column": 17, + "stop_line": 2712, + "stop_column": 41, + "path": "src\\streamdiffusion\\wrapper.py", + "code": -2, + "name": "missing-attribute", + "description": "Object of class `StreamDiffusion` has no attribute `_ipadapter_module`", + "concise_description": "Object of class `StreamDiffusion` has no attribute `_ipadapter_module`", + "severity": "error" + }, + { + "line": 2724, + "column": 56, + "stop_line": 2724, + "stop_column": 83, + "path": "src\\streamdiffusion\\wrapper.py", + "code": -2, + "name": "unbound-name", + "description": "`_saved_unet_processors_post` is uninitialized", + "concise_description": "`_saved_unet_processors_post` is uninitialized", + "severity": "error" + }, + { + "line": 2752, + "column": 17, + "stop_line": 2752, + "stop_column": 51, + "path": "src\\streamdiffusion\\wrapper.py", + "code": -2, + "name": "missing-attribute", + "description": "Object of class `StreamDiffusion` has no attribute `_image_preprocessing_module`", + "concise_description": "Object of class `StreamDiffusion` has no attribute `_image_preprocessing_module`", + "severity": "error" + }, + { + "line": 2764, + "column": 17, + "stop_line": 2764, + "stop_column": 52, + "path": "src\\streamdiffusion\\wrapper.py", + "code": -2, + "name": "missing-attribute", + "description": "Object of class `StreamDiffusion` has no attribute `_image_postprocessing_module`", + "concise_description": "Object of class `StreamDiffusion` has no attribute `_image_postprocessing_module`", + "severity": "error" + }, + { + "line": 2776, + "column": 17, + "stop_line": 2776, + "stop_column": 52, + "path": "src\\streamdiffusion\\wrapper.py", + "code": -2, + "name": "missing-attribute", + "description": "Object of class `StreamDiffusion` has no attribute `_latent_preprocessing_module`", + "concise_description": "Object of class `StreamDiffusion` has no attribute `_latent_preprocessing_module`", + "severity": "error" + }, + { + "line": 2788, + "column": 17, + "stop_line": 2788, + "stop_column": 53, + "path": "src\\streamdiffusion\\wrapper.py", + "code": -2, + "name": "missing-attribute", + "description": "Object of class `StreamDiffusion` has no attribute `_latent_postprocessing_module`", + "concise_description": "Object of class `StreamDiffusion` has no attribute `_latent_postprocessing_module`", + "severity": "error" + }, + { + "line": 2811, + "column": 16, + "stop_line": 2811, + "stop_column": 52, + "path": "src\\streamdiffusion\\wrapper.py", + "code": -2, + "name": "missing-attribute", + "description": "Object of class `StreamDiffusion` has no attribute `get_last_processed_image`", + "concise_description": "Object of class `StreamDiffusion` has no attribute `get_last_processed_image`", + "severity": "error" + }, + { + "line": 2819, + "column": 13, + "stop_line": 2819, + "stop_column": 44, + "path": "src\\streamdiffusion\\wrapper.py", + "code": -2, + "name": "missing-attribute", + "description": "Object of class `StreamDiffusion` has no attribute `cleanup_controlnets`", + "concise_description": "Object of class `StreamDiffusion` has no attribute `cleanup_controlnets`", + "severity": "error" + }, + { + "line": 2828, + "column": 13, + "stop_line": 2828, + "stop_column": 43, + "path": "src\\streamdiffusion\\wrapper.py", + "code": -2, + "name": "missing-attribute", + "description": "Object of class `StreamDiffusion` has no attribute `_controlnet_module`", + "concise_description": "Object of class `StreamDiffusion` has no attribute `_controlnet_module`", + "severity": "error" + }, + { + "line": 2889, + "column": 23, + "stop_line": 2889, + "stop_column": 59, + "path": "src\\streamdiffusion\\wrapper.py", + "code": -2, + "name": "missing-attribute", + "description": "Object of class `NoneType` has no attribute `type`", + "concise_description": "Object of class `NoneType` has no attribute `type`", + "severity": "error" + }, + { + "line": 3044, + "column": 29, + "stop_line": 3044, + "stop_column": 63, + "path": "src\\streamdiffusion\\wrapper.py", + "code": -2, + "name": "missing-attribute", + "description": "Object of class `StreamDiffusion` has no attribute `controlnet_engine_pool`", + "concise_description": "Object of class `StreamDiffusion` has no attribute `controlnet_engine_pool`", + "severity": "error" + }, + { + "line": 3059, + "column": 27, + "stop_line": 3059, + "stop_column": 31, + "path": "src\\streamdiffusion\\wrapper.py", + "code": -2, + "name": "bad-assignment", + "description": "`None` is not assignable to attribute `stream` with type `StreamDiffusion`", + "concise_description": "`None` is not assignable to attribute `stream` with type `StreamDiffusion`", + "severity": "error" + }, + { + "line": 51, + "column": 26, + "stop_line": 51, + "stop_column": 38, + "path": "tests\\unit\\test_controlnet_residual_merge.py", + "code": -2, + "name": "bad-assignment", + "description": "`list[_FakeCN]` is not assignable to attribute `controlnets` with type `list[ControlNetModel | None]`", + "concise_description": "`list[_FakeCN]` is not assignable to attribute `controlnets` with type `list[ControlNetModel | None]`", + "severity": "error" + }, + { + "line": 155, + "column": 30, + "stop_line": 155, + "stop_column": 36, + "path": "tests\\unit\\test_controlnet_residual_merge.py", + "code": -2, + "name": "bad-assignment", + "description": "`list[_FakeCN]` is not assignable to attribute `controlnets` with type `list[ControlNetModel | None]`", + "concise_description": "`list[_FakeCN]` is not assignable to attribute `controlnets` with type `list[ControlNetModel | None]`", + "severity": "error" + }, + { + "line": 33, + "column": 5, + "stop_line": 33, + "stop_column": 25, + "path": "tests\\unit\\test_derived_tensor_sync.py", + "code": -2, + "name": "missing-attribute", + "description": "Object of class `LCMScheduler` has no attribute `alphas_cumprod`", + "concise_description": "Object of class `LCMScheduler` has no attribute `alphas_cumprod`", + "severity": "error" + }, + { + "line": 43, + "column": 5, + "stop_line": 43, + "stop_column": 55, + "path": "tests\\unit\\test_derived_tensor_sync.py", + "code": -2, + "name": "missing-attribute", + "description": "Object of class `LCMScheduler` has no attribute `get_scalings_for_boundary_condition_discrete`", + "concise_description": "Object of class `LCMScheduler` has no attribute `get_scalings_for_boundary_condition_discrete`", + "severity": "error" + }, + { + "line": 125, + "column": 5, + "stop_line": 125, + "stop_column": 18, + "path": "tests\\unit\\test_derived_tensor_sync.py", + "code": -2, + "name": "missing-attribute", + "description": "Object of class `StreamParameterUpdater` has no attribute `_lock`", + "concise_description": "Object of class `StreamParameterUpdater` has no attribute `_lock`", + "severity": "error" + }, + { + "line": 56, + "column": 9, + "stop_line": 56, + "stop_column": 26, + "path": "tests\\unit\\test_ipc_producer_stream.py", + "code": -2, + "name": "missing-attribute", + "description": "Object of class `ModuleType` has no attribute `Tensor`", + "concise_description": "Object of class `ModuleType` has no attribute `Tensor`", + "severity": "error" + }, + { + "line": 61, + "column": 9, + "stop_line": 61, + "stop_column": 33, + "path": "tests\\unit\\test_ipc_producer_stream.py", + "code": -2, + "name": "missing-attribute", + "description": "Object of class `ModuleType` has no attribute `current_stream`", + "concise_description": "Object of class `ModuleType` has no attribute `current_stream`", + "severity": "error" + }, + { + "line": 62, + "column": 9, + "stop_line": 62, + "stop_column": 24, + "path": "tests\\unit\\test_ipc_producer_stream.py", + "code": -2, + "name": "missing-attribute", + "description": "Object of class `ModuleType` has no attribute `Event`", + "concise_description": "Object of class `ModuleType` has no attribute `Event`", + "severity": "error" + }, + { + "line": 63, + "column": 9, + "stop_line": 63, + "stop_column": 25, + "path": "tests\\unit\\test_ipc_producer_stream.py", + "code": -2, + "name": "missing-attribute", + "description": "Object of class `ModuleType` has no attribute `Stream`", + "concise_description": "Object of class `ModuleType` has no attribute `Stream`", + "severity": "error" + }, + { + "line": 64, + "column": 9, + "stop_line": 64, + "stop_column": 24, + "path": "tests\\unit\\test_ipc_producer_stream.py", + "code": -2, + "name": "missing-attribute", + "description": "Object of class `ModuleType` has no attribute `cuda`", + "concise_description": "Object of class `ModuleType` has no attribute `cuda`", + "severity": "error" + }, + { + "line": 77, + "column": 9, + "stop_line": 77, + "stop_column": 32, + "path": "tests\\unit\\test_ipc_producer_stream.py", + "code": -2, + "name": "missing-attribute", + "description": "Object of class `ModuleType` has no attribute `GpuFrame`", + "concise_description": "Object of class `ModuleType` has no attribute `GpuFrame`", + "severity": "error" + }, + { + "line": 78, + "column": 9, + "stop_line": 78, + "stop_column": 36, + "path": "tests\\unit\\test_ipc_producer_stream.py", + "code": -2, + "name": "missing-attribute", + "description": "Object of class `ModuleType` has no attribute `FrameOutcome`", + "concise_description": "Object of class `ModuleType` has no attribute `FrameOutcome`", + "severity": "error" + }, + { + "line": 124, + "column": 30, + "stop_line": 124, + "stop_column": 48, + "path": "tests\\unit\\test_ipc_producer_stream.py", + "code": -2, + "name": "missing-attribute", + "description": "Class `FakeGpuFrame` has no class attribute `calls`", + "concise_description": "Class `FakeGpuFrame` has no class attribute `calls`", + "severity": "error" + }, + { + "line": 125, + "column": 16, + "stop_line": 125, + "stop_column": 34, + "path": "tests\\unit\\test_ipc_producer_stream.py", + "code": -2, + "name": "missing-attribute", + "description": "Class `FakeGpuFrame` has no class attribute `calls`", + "concise_description": "Class `FakeGpuFrame` has no class attribute `calls`", + "severity": "error" + }, + { + "line": 63, + "column": 20, + "stop_line": 63, + "stop_column": 36, + "path": "tests\\unit\\test_l2tc_dynamic_shapes.py", + "code": -2, + "name": "bad-argument-type", + "description": "Argument `_FakeModelData` is not assignable to parameter `model_data` with type `BaseModel` in function `streamdiffusion.acceleration.tensorrt.utilities.build_engine`", + "concise_description": "Argument `_FakeModelData` is not assignable to parameter `model_data` with type `BaseModel` in function `streamdiffusion.acceleration.tensorrt.utilities.build_engine`", + "severity": "error" + }, + { + "line": 56, + "column": 50, + "stop_line": 56, + "stop_column": 62, + "path": "tests\\unit\\test_param_updater_binding.py", + "code": -2, + "name": "bad-assignment", + "description": "`(self: Unknown, s: Unknown) -> None` is not assignable to attribute `attach_orchestrator` with type `(self: StreamParameterUpdater, stream: Unknown) -> None`\n Positional parameter name mismatch: got `s`, want `stream`", + "concise_description": "`(self: Unknown, s: Unknown) -> None` is not assignable to attribute `attach_orchestrator` with type `(self: StreamParameterUpdater, stream: Unknown) -> None`", + "severity": "error" + }, + { + "line": 97, + "column": 40, + "stop_line": 97, + "stop_column": 45, + "path": "tests\\unit\\test_param_updater_binding.py", + "code": -2, + "name": "bad-argument-count", + "description": "Expected 1 positional argument, got 3 in function `streamdiffusion.stream_parameter_updater.StreamParameterUpdater.__init__`", + "concise_description": "Expected 1 positional argument, got 3 in function `streamdiffusion.stream_parameter_updater.StreamParameterUpdater.__init__`", + "severity": "error" + }, + { + "line": 76, + "column": 16, + "stop_line": 76, + "stop_column": 41, + "path": "tests\\unit\\test_phase3_correctness.py", + "code": -2, + "name": "bad-assignment", + "description": "`_FakeStream` is not assignable to attribute `stream` with type `StreamDiffusion`", + "concise_description": "`_FakeStream` is not assignable to attribute `stream` with type `StreamDiffusion`", + "severity": "error" + }, + { + "line": 91, + "column": 16, + "stop_line": 91, + "stop_column": 40, + "path": "tests\\unit\\test_phase3_correctness.py", + "code": -2, + "name": "missing-attribute", + "description": "Object of class `StreamDiffusion` has no attribute `captured_kwargs`", + "concise_description": "Object of class `StreamDiffusion` has no attribute `captured_kwargs`", + "severity": "error" + }, + { + "line": 92, + "column": 16, + "stop_line": 92, + "stop_column": 44, + "path": "tests\\unit\\test_phase3_correctness.py", + "code": -2, + "name": "missing-attribute", + "description": "Object of class `object` has no attribute `get`", + "concise_description": "Object of class `object` has no attribute `get`", + "severity": "error" + }, + { + "line": 97, + "column": 34, + "stop_line": 97, + "stop_column": 55, + "path": "tests\\unit\\test_phase3_correctness.py", + "code": -2, + "name": "bad-assignment", + "description": "`(**kwargs: Unknown) -> None` is not assignable to attribute `update_stream_params` with type `(self: StreamDiffusionWrapper, num_inference_steps: int | None = None, guidance_scale: float | None = None, delta: float | None = None, t_index_list: list[int] | None = None, seed: int | None = None, prompt_list: list[tuple[str, float]] | None = None, negative_prompt: str | None = None, prompt_interpolation_method: PromptInterpolationMethod = 'slerp', normalize_prompt_weights: bool | None = None, seed_list: list[tuple[int, float]] | None = None, seed_interpolation_method: SeedInterpolationMethod = 'linear', normalize_seed_weights: bool | None = None, controlnet_config: list[dict[str, Any]] | None = None, ipadapter_config: dict[str, Any] | None = None, image_preprocessing_config: list[dict[str, Any]] | None = None, image_postprocessing_config: list[dict[str, Any]] | None = None, latent_preprocessing_config: list[dict[str, Any]] | None = None, latent_postprocessing_config: list[dict[str, Any]] | None = None, use_safety_checker: bool | None = None, safety_checker_threshold: float | None = None, cache_maxframes: int | None = None, cache_interval: int | None = None, cn_cache_interval: int | None = None, fi_strength: float | None = None, fi_threshold: float | None = None) -> None`", + "concise_description": "`(**kwargs: Unknown) -> None` is not assignable to attribute `update_stream_params` with type `(self: StreamDiffusionWrapper, num_inference_steps: int | None = None, guidance_scale: float | None = None, delta: float | None = None, t_index_list: list[int] | None = None, seed: int | None = None, prompt_list: list[tuple[str, float]] | None = None, negative_prompt: str | None = None, prompt_interpolation_method: PromptInterpolationMethod = 'slerp', normalize_prompt_weights: bool | None = None, seed_list: list[tuple[int, float]] | None = None, seed_interpolation_method: SeedInterpolationMethod = 'linear', normalize_seed_weights: bool | None = None, controlnet_config: list[dict[str, Any]] | None = None, ipadapter_config: dict[str, Any] | None = None, image_preprocessing_config: list[dict[str, Any]] | None = None, image_postprocessing_config: list[dict[str, Any]] | None = None, latent_preprocessing_config: list[dict[str, Any]] | None = None, latent_postprocessing_config: list[dict[str, Any]] | None = None, use_safety_checker: bool | None = None, safety_checker_threshold: float | None = None, cache_maxframes: int | None = None, cache_interval: int | None = None, cn_cache_interval: int | None = None, fi_strength: float | None = None, fi_threshold: float | None = None) -> None`", + "severity": "error" + }, + { + "line": 99, + "column": 16, + "stop_line": 99, + "stop_column": 40, + "path": "tests\\unit\\test_phase3_correctness.py", + "code": -2, + "name": "missing-attribute", + "description": "Object of class `StreamDiffusion` has no attribute `captured_kwargs`", + "concise_description": "Object of class `StreamDiffusion` has no attribute `captured_kwargs`", + "severity": "error" + }, + { + "line": 100, + "column": 16, + "stop_line": 100, + "stop_column": 44, + "path": "tests\\unit\\test_phase3_correctness.py", + "code": -2, + "name": "missing-attribute", + "description": "Object of class `object` has no attribute `get`", + "concise_description": "Object of class `object` has no attribute `get`", + "severity": "error" + }, + { + "line": 107, + "column": 20, + "stop_line": 107, + "stop_column": 31, + "path": "tests\\unit\\test_phase3_correctness.py", + "code": -2, + "name": "bad-assignment", + "description": "`_FakeStream` is not assignable to attribute `stream` with type `StreamDiffusion`", + "concise_description": "`_FakeStream` is not assignable to attribute `stream` with type `StreamDiffusion`", + "severity": "error" + }, + { + "line": 111, + "column": 16, + "stop_line": 111, + "stop_column": 40, + "path": "tests\\unit\\test_phase3_correctness.py", + "code": -2, + "name": "missing-attribute", + "description": "Object of class `StreamDiffusion` has no attribute `captured_kwargs`", + "concise_description": "Object of class `StreamDiffusion` has no attribute `captured_kwargs`", + "severity": "error" + }, + { + "line": 139, + "column": 16, + "stop_line": 139, + "stop_column": 28, + "path": "tests\\unit\\test_phase3_correctness.py", + "code": -2, + "name": "missing-attribute", + "description": "Object of class `Image` has no attribute `data_ptr`\nObject of class `list` has no attribute `data_ptr`\nObject of class `ndarray` has no attribute `data_ptr`", + "concise_description": "Object of class `Image` has no attribute `data_ptr`\nObject of class `list` has no attribute `data_ptr`\nObject of class `ndarray` has no attribute `data_ptr`", + "severity": "error" + }, + { + "line": 140, + "column": 28, + "stop_line": 140, + "stop_column": 31, + "path": "tests\\unit\\test_phase3_correctness.py", + "code": -2, + "name": "bad-argument-type", + "description": "Argument `Image | Tensor | list[Image] | ndarray[Unknown, Unknown]` is not assignable to parameter `input` with type `Tensor` in function `torch._C._VariableFunctions.equal`", + "concise_description": "Argument `Image | Tensor | list[Image] | ndarray[Unknown, Unknown]` is not assignable to parameter `input` with type `Tensor` in function `torch._C._VariableFunctions.equal`", + "severity": "error" + }, + { + "line": 145, + "column": 32, + "stop_line": 145, + "stop_column": 35, + "path": "tests\\unit\\test_phase3_correctness.py", + "code": -2, + "name": "bad-argument-type", + "description": "Argument `Image | Tensor | list[Image] | ndarray[Unknown, Unknown]` is not assignable to parameter `input` with type `Tensor` in function `torch._C._VariableFunctions.equal`", + "concise_description": "Argument `Image | Tensor | list[Image] | ndarray[Unknown, Unknown]` is not assignable to parameter `input` with type `Tensor` in function `torch._C._VariableFunctions.equal`", + "severity": "error" + }, + { + "line": 51, + "column": 50, + "stop_line": 51, + "stop_column": 62, + "path": "tests\\unit\\test_prompt_interpolation.py", + "code": -2, + "name": "bad-assignment", + "description": "`(self: Unknown, s: Unknown) -> None` is not assignable to attribute `attach_orchestrator` with type `(self: StreamParameterUpdater, stream: Unknown) -> None`\n Positional parameter name mismatch: got `s`, want `stream`", + "concise_description": "`(self: Unknown, s: Unknown) -> None` is not assignable to attribute `attach_orchestrator` with type `(self: StreamParameterUpdater, stream: Unknown) -> None`", + "severity": "error" + }, + { + "line": 283, + "column": 41, + "stop_line": 283, + "stop_column": 58, + "path": "tests\\unit\\test_prompt_interpolation.py", + "code": -2, + "name": "bad-argument-type", + "description": "Argument `Literal['cosine_weignted']` is not assignable to parameter `prompt_interpolation_method` with type `Literal['cosine_weighted', 'linear', 'slerp']` in function `streamdiffusion.stream_parameter_updater.StreamParameterUpdater._apply_prompt_blending`", + "concise_description": "Argument `Literal['cosine_weignted']` is not assignable to parameter `prompt_interpolation_method` with type `Literal['cosine_weighted', 'linear', 'slerp']` in function `streamdiffusion.stream_parameter_updater.StreamParameterUpdater._apply_prompt_blending`", + "severity": "error" + }, + { + "line": 296, + "column": 45, + "stop_line": 296, + "stop_column": 62, + "path": "tests\\unit\\test_prompt_interpolation.py", + "code": -2, + "name": "bad-argument-type", + "description": "Argument `Literal['cosine_weignted']` is not assignable to parameter `prompt_interpolation_method` with type `Literal['cosine_weighted', 'linear', 'slerp']` in function `streamdiffusion.stream_parameter_updater.StreamParameterUpdater._apply_prompt_blending`", + "concise_description": "Argument `Literal['cosine_weignted']` is not assignable to parameter `prompt_interpolation_method` with type `Literal['cosine_weighted', 'linear', 'slerp']` in function `streamdiffusion.stream_parameter_updater.StreamParameterUpdater._apply_prompt_blending`", + "severity": "error" + }, + { + "line": 297, + "column": 45, + "stop_line": 297, + "stop_column": 62, + "path": "tests\\unit\\test_prompt_interpolation.py", + "code": -2, + "name": "bad-argument-type", + "description": "Argument `Literal['cosine_weignted']` is not assignable to parameter `prompt_interpolation_method` with type `Literal['cosine_weighted', 'linear', 'slerp']` in function `streamdiffusion.stream_parameter_updater.StreamParameterUpdater._apply_prompt_blending`", + "concise_description": "Argument `Literal['cosine_weignted']` is not assignable to parameter `prompt_interpolation_method` with type `Literal['cosine_weighted', 'linear', 'slerp']` in function `streamdiffusion.stream_parameter_updater.StreamParameterUpdater._apply_prompt_blending`", + "severity": "error" + }, + { + "line": 47, + "column": 38, + "stop_line": 47, + "stop_column": 51, + "path": "tests\\unit\\test_safety_checker.py", + "code": -2, + "name": "bad-assignment", + "description": "`str` is not assignable to attribute `safety_checker_fallback_type` with type `Literal['blank', 'previous']`", + "concise_description": "`str` is not assignable to attribute `safety_checker_fallback_type` with type `Literal['blank', 'previous']`", + "severity": "error" + }, + { + "line": 127, + "column": 28, + "stop_line": 127, + "stop_column": 48, + "path": "tests\\unit\\test_safety_checker.py", + "code": -2, + "name": "bad-argument-type", + "description": "Argument `Tensor | None` is not assignable to parameter `input` with type `Tensor` in function `torch._C._VariableFunctions.equal`", + "concise_description": "Argument `Tensor | None` is not assignable to parameter `input` with type `Tensor` in function `torch._C._VariableFunctions.equal`", + "severity": "error" + }, + { + "line": 239, + "column": 20, + "stop_line": 239, + "stop_column": 39, + "path": "tests\\unit\\test_safety_checker.py", + "code": -2, + "name": "bad-assignment", + "description": "`device` is not assignable to attribute `device` with type `Literal['cpu', 'cuda']`", + "concise_description": "`device` is not assignable to attribute `device` with type `Literal['cpu', 'cuda']`", + "severity": "error" + }, + { + "line": 250, + "column": 20, + "stop_line": 250, + "stop_column": 33, + "path": "tests\\unit\\test_safety_checker.py", + "code": -2, + "name": "bad-assignment", + "description": "`TestApplySafetyChecker.test_skip_diffusion_routes_through_safety_checker._FakeStream` is not assignable to attribute `stream` with type `StreamDiffusion`", + "concise_description": "`TestApplySafetyChecker.test_skip_diffusion_routes_through_safety_checker._FakeStream` is not assignable to attribute `stream` with type `StreamDiffusion`", + "severity": "error" + }, + { + "line": 253, + "column": 31, + "stop_line": 253, + "stop_column": 42, + "path": "tests\\unit\\test_safety_checker.py", + "code": -2, + "name": "bad-assignment", + "description": "`(t: Unknown) -> Unknown` is not assignable to attribute `_normalize_on_gpu` with type `(self: StreamDiffusionWrapper, image_tensor: Tensor) -> Tensor`\n Positional parameter name mismatch: got `t`, want `image_tensor`", + "concise_description": "`(t: Unknown) -> Unknown` is not assignable to attribute `_normalize_on_gpu` with type `(self: StreamDiffusionWrapper, image_tensor: Tensor) -> Tensor`", + "severity": "error" + }, + { + "line": 254, + "column": 33, + "stop_line": 254, + "stop_column": 44, + "path": "tests\\unit\\test_safety_checker.py", + "code": -2, + "name": "bad-assignment", + "description": "`(t: Unknown) -> Unknown` is not assignable to attribute `_denormalize_on_gpu` with type `(self: StreamDiffusionWrapper, image_tensor: Tensor) -> Tensor`\n Positional parameter name mismatch: got `t`, want `image_tensor`", + "concise_description": "`(t: Unknown) -> Unknown` is not assignable to attribute `_denormalize_on_gpu` with type `(self: StreamDiffusionWrapper, image_tensor: Tensor) -> Tensor`", + "severity": "error" + }, + { + "line": 257, + "column": 31, + "stop_line": 257, + "stop_column": 60, + "path": "tests\\unit\\test_safety_checker.py", + "code": -2, + "name": "bad-assignment", + "description": "`(t: Unknown, output_type: Unknown = ...) -> Unknown` is not assignable to attribute `postprocess_image` with type `(self: StreamDiffusionWrapper, image_tensor: Tensor, output_type: str = 'pil') -> Image | Tensor | list[Image] | ndarray[Unknown, Unknown]`\n Positional parameter name mismatch: got `t`, want `image_tensor`", + "concise_description": "`(t: Unknown, output_type: Unknown = ...) -> Unknown` is not assignable to attribute `postprocess_image` with type `(self: StreamDiffusionWrapper, image_tensor: Tensor, output_type: str = 'pil') -> Image | Tensor | list[Image] | ndarray[Unknown, Unknown]`", + "severity": "error" + }, + { + "line": 268, + "column": 18, + "stop_line": 268, + "stop_column": 42, + "path": "tests\\unit\\test_safety_checker.py", + "code": -2, + "name": "missing-attribute", + "description": "Object of class `float` has no attribute `clamp`\nObject of class `ndarray` has no attribute `clamp`", + "concise_description": "Object of class `float` has no attribute `clamp`\nObject of class `ndarray` has no attribute `clamp`", + "severity": "error" + }, + { + "line": 268, + "column": 19, + "stop_line": 268, + "stop_column": 29, + "path": "tests\\unit\\test_safety_checker.py", + "code": -2, + "name": "unsupported-operation", + "description": "`/` is not supported between `Image` and `Literal[2]`\n Argument `Image` is not assignable to parameter `value` with type `int` in function `int.__rtruediv__`", + "concise_description": "`/` is not supported between `Image` and `Literal[2]`", + "severity": "error" + }, + { + "line": 268, + "column": 19, + "stop_line": 268, + "stop_column": 29, + "path": "tests\\unit\\test_safety_checker.py", + "code": -2, + "name": "unsupported-operation", + "description": "`/` is not supported between `list[Image]` and `Literal[2]`\n Argument `list[Image]` is not assignable to parameter `value` with type `int` in function `int.__rtruediv__`", + "concise_description": "`/` is not supported between `list[Image]` and `Literal[2]`", + "severity": "error" + }, + { + "line": 193, + "column": 21, + "stop_line": 193, + "stop_column": 53, + "path": "tests\\unit\\test_sync_free_output_5_2.py", + "code": -2, + "name": "missing-attribute", + "description": "Object of class `NoneType` has no attribute `data_ptr`", + "concise_description": "Object of class `NoneType` has no attribute `data_ptr`", + "severity": "error" + }, + { + "line": 195, + "column": 21, + "stop_line": 195, + "stop_column": 53, + "path": "tests\\unit\\test_sync_free_output_5_2.py", + "code": -2, + "name": "missing-attribute", + "description": "Object of class `NoneType` has no attribute `data_ptr`", + "concise_description": "Object of class `NoneType` has no attribute `data_ptr`", + "severity": "error" + }, + { + "line": 74, + "column": 14, + "stop_line": 74, + "stop_column": 30, + "path": "tests\\unit\\test_trt_engine_guards.py", + "code": -2, + "name": "missing-attribute", + "description": "No attribute `TensorIOMode` in module `tensorrt`", + "concise_description": "No attribute `TensorIOMode` in module `tensorrt`", + "severity": "error" + }, + { + "line": 74, + "column": 38, + "stop_line": 74, + "stop_column": 54, + "path": "tests\\unit\\test_trt_engine_guards.py", + "code": -2, + "name": "missing-attribute", + "description": "No attribute `TensorIOMode` in module `tensorrt`", + "concise_description": "No attribute `TensorIOMode` in module `tensorrt`", + "severity": "error" + }, + { + "line": 162, + "column": 9, + "stop_line": 162, + "stop_column": 37, + "path": "tests\\unit\\test_trt_engine_guards.py", + "code": -2, + "name": "missing-attribute", + "description": "Object of class `NoneType` has no attribute `get_tensor_shape`", + "concise_description": "Object of class `NoneType` has no attribute `get_tensor_shape`", + "severity": "error" + }, + { + "line": 180, + "column": 9, + "stop_line": 180, + "stop_column": 36, + "path": "tests\\unit\\test_trt_engine_guards.py", + "code": -2, + "name": "missing-attribute", + "description": "Object of class `NoneType` has no attribute `set_input_shape`", + "concise_description": "Object of class `NoneType` has no attribute `set_input_shape`", + "severity": "error" + }, + { + "line": 205, + "column": 9, + "stop_line": 205, + "stop_column": 34, + "path": "tests\\unit\\test_trt_engine_guards.py", + "code": -2, + "name": "missing-attribute", + "description": "Object of class `NoneType` has no attribute `num_io_tensors`", + "concise_description": "Object of class `NoneType` has no attribute `num_io_tensors`", + "severity": "error" + }, + { + "line": 206, + "column": 9, + "stop_line": 206, + "stop_column": 35, + "path": "tests\\unit\\test_trt_engine_guards.py", + "code": -2, + "name": "missing-attribute", + "description": "Object of class `NoneType` has no attribute `get_tensor_name`", + "concise_description": "Object of class `NoneType` has no attribute `get_tensor_name`", + "severity": "error" + }, + { + "line": 207, + "column": 9, + "stop_line": 207, + "stop_column": 35, + "path": "tests\\unit\\test_trt_engine_guards.py", + "code": -2, + "name": "missing-attribute", + "description": "Object of class `NoneType` has no attribute `get_tensor_mode`", + "concise_description": "Object of class `NoneType` has no attribute `get_tensor_mode`", + "severity": "error" + }, + { + "line": 207, + "column": 60, + "stop_line": 207, + "stop_column": 76, + "path": "tests\\unit\\test_trt_engine_guards.py", + "code": -2, + "name": "missing-attribute", + "description": "No attribute `TensorIOMode` in module `tensorrt`", + "concise_description": "No attribute `TensorIOMode` in module `tensorrt`", + "severity": "error" + }, + { + "line": 209, + "column": 9, + "stop_line": 209, + "stop_column": 37, + "path": "tests\\unit\\test_trt_engine_guards.py", + "code": -2, + "name": "missing-attribute", + "description": "Object of class `NoneType` has no attribute `get_tensor_shape`", + "concise_description": "Object of class `NoneType` has no attribute `get_tensor_shape`", + "severity": "error" + }, + { + "line": 227, + "column": 9, + "stop_line": 227, + "stop_column": 34, + "path": "tests\\unit\\test_trt_engine_guards.py", + "code": -2, + "name": "missing-attribute", + "description": "Object of class `NoneType` has no attribute `num_io_tensors`", + "concise_description": "Object of class `NoneType` has no attribute `num_io_tensors`", + "severity": "error" + }, + { + "line": 228, + "column": 9, + "stop_line": 228, + "stop_column": 35, + "path": "tests\\unit\\test_trt_engine_guards.py", + "code": -2, + "name": "missing-attribute", + "description": "Object of class `NoneType` has no attribute `get_tensor_name`", + "concise_description": "Object of class `NoneType` has no attribute `get_tensor_name`", + "severity": "error" + }, + { + "line": 229, + "column": 9, + "stop_line": 229, + "stop_column": 35, + "path": "tests\\unit\\test_trt_engine_guards.py", + "code": -2, + "name": "missing-attribute", + "description": "Object of class `NoneType` has no attribute `get_tensor_mode`", + "concise_description": "Object of class `NoneType` has no attribute `get_tensor_mode`", + "severity": "error" + }, + { + "line": 229, + "column": 60, + "stop_line": 229, + "stop_column": 76, + "path": "tests\\unit\\test_trt_engine_guards.py", + "code": -2, + "name": "missing-attribute", + "description": "No attribute `TensorIOMode` in module `tensorrt`", + "concise_description": "No attribute `TensorIOMode` in module `tensorrt`", + "severity": "error" + }, + { + "line": 230, + "column": 9, + "stop_line": 230, + "stop_column": 36, + "path": "tests\\unit\\test_trt_engine_guards.py", + "code": -2, + "name": "missing-attribute", + "description": "Object of class `NoneType` has no attribute `get_tensor_dtype`", + "concise_description": "Object of class `NoneType` has no attribute `get_tensor_dtype`", + "severity": "error" + }, + { + "line": 230, + "column": 61, + "stop_line": 230, + "stop_column": 73, + "path": "tests\\unit\\test_trt_engine_guards.py", + "code": -2, + "name": "missing-attribute", + "description": "No attribute `DataType` in module `tensorrt`", + "concise_description": "No attribute `DataType` in module `tensorrt`", + "severity": "error" + }, + { + "line": 233, + "column": 9, + "stop_line": 233, + "stop_column": 37, + "path": "tests\\unit\\test_trt_engine_guards.py", + "code": -2, + "name": "missing-attribute", + "description": "Object of class `NoneType` has no attribute `get_tensor_shape`", + "concise_description": "Object of class `NoneType` has no attribute `get_tensor_shape`", + "severity": "error" + }, + { + "line": 240, + "column": 39, + "stop_line": 240, + "stop_column": 59, + "path": "tests\\unit\\test_trt_engine_guards.py", + "code": -2, + "name": "bad-assignment", + "description": "`(_: Unknown) -> type[float32]` is not assignable to attribute `nptype` with type `(trt_type: Unknown) -> Unknown`\n Positional parameter name mismatch: got `_`, want `trt_type`", + "concise_description": "`(_: Unknown) -> type[float32]` is not assignable to attribute `nptype` with type `(trt_type: Unknown) -> Unknown`", + "severity": "error" + }, + { + "line": 79, + "column": 16, + "stop_line": 79, + "stop_column": 35, + "path": "tests\\unit\\test_wrapper_exception_hygiene.py", + "code": -2, + "name": "bad-assignment", + "description": "`device` is not assignable to attribute `device` with type `Literal['cpu', 'cuda']`", + "concise_description": "`device` is not assignable to attribute `device` with type `Literal['cpu', 'cuda']`", + "severity": "error" + }, + { + "line": 1464, + "column": 74, + "stop_line": 1464, + "stop_column": 86, + "path": "tools\\summarize_audit.py", + "code": -2, + "name": "unbound-name", + "description": "`project_name` may be uninitialized", + "concise_description": "`project_name` may be uninitialized", + "severity": "error" + }, + { + "line": 1491, + "column": 21, + "stop_line": 1491, + "stop_column": 31, + "path": "tools\\summarize_audit.py", + "code": -2, + "name": "unbound-name", + "description": "`categories` may be uninitialized", + "concise_description": "`categories` may be uninitialized", + "severity": "error" + }, + { + "line": 1690, + "column": 31, + "stop_line": 1690, + "stop_column": 40, + "path": "tools\\summarize_audit.py", + "code": -2, + "name": "bad-argument-type", + "description": "Argument `list[Unknown] | None` is not assignable to parameter `tree_data` with type `list[Unknown]` in function `print_dependency_analysis`", + "concise_description": "Argument `list[Unknown] | None` is not assignable to parameter `tree_data` with type `list[Unknown]` in function `print_dependency_analysis`", + "severity": "error" + }, + { + "line": 28, + "column": 52, + "stop_line": 28, + "stop_column": 57, + "path": "utils\\viewer.py", + "code": -2, + "name": "bad-argument-type", + "description": "Argument `Literal[512]` is not assignable to parameter `size` with type `tuple[int, int] | None` in function `PIL.ImageTk.PhotoImage.__init__`", + "concise_description": "Argument `Literal[512]` is not assignable to parameter `size` with type `tuple[int, int] | None` in function `PIL.ImageTk.PhotoImage.__init__`", + "severity": "error" + }, + { + "line": 30, + "column": 5, + "stop_line": 30, + "stop_column": 16, + "path": "utils\\viewer.py", + "code": -2, + "name": "missing-attribute", + "description": "Object of class `Label` has no attribute `image`", + "concise_description": "Object of class `Label` has no attribute `image`", + "severity": "error" + }, + { + "line": 51, + "column": 28, + "stop_line": 56, + "stop_column": 18, + "path": "utils\\viewer.py", + "code": -2, + "name": "bad-argument-type", + "description": "Unpacked argument `tuple[Tensor | Unknown, Label]` is not assignable to parameter `*args` with type `tuple[Image, Label]` in function `tkinter.Misc.after`", + "concise_description": "Unpacked argument `tuple[Tensor | Unknown, Label]` is not assignable to parameter `*args` with type `tuple[Image, Label]` in function `tkinter.Misc.after`", + "severity": "error" + }, + { + "line": 54, + "column": 21, + "stop_line": 54, + "stop_column": 84, + "path": "utils\\viewer.py", + "code": -2, + "name": "bad-index", + "description": "Cannot index into `Image`\n Object of class `Image` has no attribute `__getitem__`", + "concise_description": "Cannot index into `Image`", + "severity": "error" + } + ] +} \ No newline at end of file diff --git a/scripts/profiling/profile_ncu.py b/scripts/profiling/profile_ncu.py index 11b6622a0..079734417 100644 --- a/scripts/profiling/profile_ncu.py +++ b/scripts/profiling/profile_ncu.py @@ -43,7 +43,6 @@ import sys import time - # ── CLI args ─────────────────────────────────────────────────────────────────── parser = argparse.ArgumentParser(description="StreamDiffusion Nsight Compute launcher") parser.add_argument( diff --git a/scripts/profiling/profile_nsys.py b/scripts/profiling/profile_nsys.py index 7fe1b1aca..fbaca7251 100644 --- a/scripts/profiling/profile_nsys.py +++ b/scripts/profiling/profile_nsys.py @@ -50,7 +50,6 @@ import sys import time - # ── CLI args ─────────────────────────────────────────────────────────────────── parser = argparse.ArgumentParser(description="StreamDiffusion Nsight Systems profiling launcher") parser.add_argument( @@ -214,7 +213,6 @@ from streamdiffusion.tools.gpu_profiler import profiler - os.environ.setdefault("GPU_PROFILER", "1") # wrapper.__init__ reads this to activate WARMUP_RUNS = 3 # extra warmup before torch.profiler + nsys capture window @@ -272,7 +270,6 @@ # ── Dummy input image ────────────────────────────────────────────────────────── import PIL.Image - dummy_img = PIL.Image.new("RGB", (_WIDTH, _HEIGHT), (128, 128, 128)) # ── ControlNet activation (--cn-scale > 0) ──────────────────────────────────── @@ -297,7 +294,9 @@ print(f"[profile] ControlNet[0] enabled: scale={args.cn_scale}, image=dummy gray tensor {_WIDTH}x{_HEIGHT}") if args.cn_cache_interval > 1: cn_mod.set_cn_cache_interval(args.cn_cache_interval) - print(f"[profile] ControlNet residual cache: interval={args.cn_cache_interval} (CN forward every {args.cn_cache_interval} frames)") + print( + f"[profile] ControlNet residual cache: interval={args.cn_cache_interval} (CN forward every {args.cn_cache_interval} frames)" + ) except Exception as _cn_err: print(f"[profile] WARNING: Could not activate ControlNet — {_cn_err}") print(" Make sure the config includes a ControlNet and its engine is built.") diff --git a/scripts/test_lora_sanity.py b/scripts/test_lora_sanity.py index 8d01ddeba..fe9755af8 100644 --- a/scripts/test_lora_sanity.py +++ b/scripts/test_lora_sanity.py @@ -21,7 +21,6 @@ import sys from pathlib import Path - # --------------------------------------------------------------------------- # Repo root on sys.path so `from streamdiffusion` works without install # --------------------------------------------------------------------------- @@ -29,10 +28,9 @@ if str(_REPO_ROOT / "src") not in sys.path: sys.path.insert(0, str(_REPO_ROOT / "src")) -from PIL import Image # noqa: E402 - -from streamdiffusion import StreamDiffusionWrapper # noqa: E402 +from PIL import Image +from streamdiffusion import StreamDiffusionWrapper logging.basicConfig( level=logging.INFO, diff --git a/setup.py b/setup.py index 99bb758f3..d9188f984 100644 --- a/setup.py +++ b/setup.py @@ -16,7 +16,7 @@ def _check_torch_installed(): " pip install --index-url https://download.pytorch.org/whl/cu12x torch torchvision\n" "Replace the index URL and versions to match your CUDA runtime." ) - raise RuntimeError(msg) + raise RuntimeError(msg) from None if not torch.version.cuda: raise RuntimeError( @@ -120,7 +120,7 @@ def deps_list(*pkgs): name="streamdiffusion", version="0.1.1", description="real-time interactive image generation pipeline", - long_description=open("README.md", "r", encoding="utf-8").read(), + long_description=open("README.md", encoding="utf-8").read(), long_description_content_type="text/markdown", keywords="deep learning diffusion pytorch stable diffusion audioldm streamdiffusion real-time", license="Apache 2.0 License", diff --git a/src/streamdiffusion/__init__.py b/src/streamdiffusion/__init__.py index 2941f504e..b8fe7363e 100644 --- a/src/streamdiffusion/__init__.py +++ b/src/streamdiffusion/__init__.py @@ -1,15 +1,14 @@ -from . import _patches # noqa: F401 — applies kvo_cache patch before any diffusers import +from . import _patches from .config import create_wrapper_from_config, load_config, save_config from .pipeline import StreamDiffusion from .preprocessing.processors import list_preprocessors from .wrapper import StreamDiffusionWrapper - __all__ = [ "StreamDiffusion", "StreamDiffusionWrapper", - "load_config", + "create_wrapper_from_config", "list_preprocessors", + "load_config", "save_config", - "create_wrapper_from_config", ] diff --git a/src/streamdiffusion/_patches/__init__.py b/src/streamdiffusion/_patches/__init__.py index 23f44fa02..234e7716d 100644 --- a/src/streamdiffusion/_patches/__init__.py +++ b/src/streamdiffusion/_patches/__init__.py @@ -1,4 +1,3 @@ from .diffusers_kvo_patch import apply as _apply_kvo_patch - _apply_kvo_patch() diff --git a/src/streamdiffusion/_patches/diffusers_kvo_patch.py b/src/streamdiffusion/_patches/diffusers_kvo_patch.py index 2ee5da1c7..b813ef059 100644 --- a/src/streamdiffusion/_patches/diffusers_kvo_patch.py +++ b/src/streamdiffusion/_patches/diffusers_kvo_patch.py @@ -16,7 +16,6 @@ import inspect import logging - logger = logging.getLogger(__name__) _PATCHED = False @@ -87,10 +86,10 @@ def _call( self, attn, hidden_states, + *args, encoder_hidden_states=encoder_hidden_states, attention_mask=attention_mask, temb=temb, - *args, **kwargs, ) return result, kvo_cache diff --git a/src/streamdiffusion/_patches/hf_tracing_patches.py b/src/streamdiffusion/_patches/hf_tracing_patches.py index 422b6bf65..a563d221f 100644 --- a/src/streamdiffusion/_patches/hf_tracing_patches.py +++ b/src/streamdiffusion/_patches/hf_tracing_patches.py @@ -5,7 +5,6 @@ import torch - _ALREADY = False # idempotence guard diff --git a/src/streamdiffusion/acceleration/tensorrt/__init__.py b/src/streamdiffusion/acceleration/tensorrt/__init__.py index b4c7a7ca2..2688a68f7 100644 --- a/src/streamdiffusion/acceleration/tensorrt/__init__.py +++ b/src/streamdiffusion/acceleration/tensorrt/__init__.py @@ -5,7 +5,6 @@ import torch import torch.nn as nn - os.environ.setdefault("CUDA_MODULE_LOADING", "LAZY") from diffusers import AutoencoderKL, ControlNetModel, UNet2DConditionModel from diffusers.pipelines.stable_diffusion.pipeline_stable_diffusion_img2img import ( diff --git a/src/streamdiffusion/acceleration/tensorrt/builder.py b/src/streamdiffusion/acceleration/tensorrt/builder.py index 1e767aba4..945db1f73 100644 --- a/src/streamdiffusion/acceleration/tensorrt/builder.py +++ b/src/streamdiffusion/acceleration/tensorrt/builder.py @@ -18,7 +18,6 @@ optimize_onnx, ) - _build_logger = logging.getLogger(__name__) diff --git a/src/streamdiffusion/acceleration/tensorrt/engine_manager.py b/src/streamdiffusion/acceleration/tensorrt/engine_manager.py index 6ed4ad645..81cadf4c4 100644 --- a/src/streamdiffusion/acceleration/tensorrt/engine_manager.py +++ b/src/streamdiffusion/acceleration/tensorrt/engine_manager.py @@ -4,7 +4,6 @@ from pathlib import Path from typing import Any, Dict, Optional - logger = logging.getLogger(__name__) @@ -360,17 +359,17 @@ def load_engine(self, engine_type: EngineType, engine_path: Path, **kwargs: Dict def _set_unet_metadata(self, loaded_engine, kwargs: Dict) -> None: """Set metadata on UNet engine for runtime use.""" - setattr(loaded_engine, "use_control", kwargs.get("use_controlnet_trt", False)) - setattr(loaded_engine, "use_ipadapter", kwargs.get("use_ipadapter_trt", False)) + loaded_engine.use_control = kwargs.get("use_controlnet_trt", False) + loaded_engine.use_ipadapter = kwargs.get("use_ipadapter_trt", False) if kwargs.get("use_controlnet_trt", False): - setattr(loaded_engine, "unet_arch", kwargs.get("unet_arch", {})) + loaded_engine.unet_arch = kwargs.get("unet_arch", {}) if kwargs.get("use_ipadapter_trt", False): - setattr(loaded_engine, "ipadapter_arch", kwargs.get("unet_arch", {})) + loaded_engine.ipadapter_arch = kwargs.get("unet_arch", {}) # number of IP-attention layers for runtime vector sizing if "num_ip_layers" in kwargs and kwargs["num_ip_layers"] is not None: - setattr(loaded_engine, "num_ip_layers", kwargs["num_ip_layers"]) + loaded_engine.num_ip_layers = kwargs["num_ip_layers"] def get_or_load_controlnet_engine( self, diff --git a/src/streamdiffusion/acceleration/tensorrt/export_wrappers/__init__.py b/src/streamdiffusion/acceleration/tensorrt/export_wrappers/__init__.py index be5408075..bb0c7ceb6 100644 --- a/src/streamdiffusion/acceleration/tensorrt/export_wrappers/__init__.py +++ b/src/streamdiffusion/acceleration/tensorrt/export_wrappers/__init__.py @@ -4,13 +4,12 @@ from .unet_sdxl_export import SDXLConditioningHandler, SDXLExportWrapper from .unet_unified_export import UnifiedExportWrapper - __all__ = [ - "SDXLControlNetExportWrapper", "ControlNetUNetExportWrapper", - "MultiControlNetUNetExportWrapper", "IPAdapterUNetExportWrapper", - "SDXLExportWrapper", + "MultiControlNetUNetExportWrapper", "SDXLConditioningHandler", + "SDXLControlNetExportWrapper", + "SDXLExportWrapper", "UnifiedExportWrapper", ] diff --git a/src/streamdiffusion/acceleration/tensorrt/export_wrappers/unet_ipadapter_export.py b/src/streamdiffusion/acceleration/tensorrt/export_wrappers/unet_ipadapter_export.py index 93310ad87..943bf5003 100644 --- a/src/streamdiffusion/acceleration/tensorrt/export_wrappers/unet_ipadapter_export.py +++ b/src/streamdiffusion/acceleration/tensorrt/export_wrappers/unet_ipadapter_export.py @@ -281,7 +281,7 @@ def create_ipadapter_wrapper( # Check if UNet already has IPAdapter processors installed existing_processors = unet.attn_processors - has_ipadapter = any( + has_ipadapter = any( # noqa: F841 # TODO: pre-existing, untouched by this refactor "IPAttn" in proc.__class__.__name__ or "IPAttnProcessor" in proc.__class__.__name__ for proc in existing_processors.values() ) @@ -289,7 +289,7 @@ def create_ipadapter_wrapper( # Validate expected dimensions expected_dims = {"SD15": 768, "SDXL": 2048, "SD21": 1024} - expected_dim = expected_dims.get(model_type) + expected_dim = expected_dims.get(model_type) # noqa: F841 # TODO: pre-existing, untouched by this refactor return IPAdapterUNetExportWrapper(unet, cross_attention_dim, num_tokens, install_processors) diff --git a/src/streamdiffusion/acceleration/tensorrt/export_wrappers/unet_sdxl_export.py b/src/streamdiffusion/acceleration/tensorrt/export_wrappers/unet_sdxl_export.py index 078b1f913..2cade0644 100644 --- a/src/streamdiffusion/acceleration/tensorrt/export_wrappers/unet_sdxl_export.py +++ b/src/streamdiffusion/acceleration/tensorrt/export_wrappers/unet_sdxl_export.py @@ -14,7 +14,6 @@ detect_model, ) - logger = logging.getLogger(__name__) # Handle different diffusers versions for CLIPTextModel import @@ -107,10 +106,7 @@ def forward(self, *args, **kwargs): } # If model supports added conditioning and we have the kwargs, use them - if self.supports_added_cond and "added_cond_kwargs" in kwargs: - result = self.unet(*args, **kwargs) - return result - elif len(args) >= 3: + if (self.supports_added_cond and "added_cond_kwargs" in kwargs) or len(args) >= 3: result = self.unet(*args, **kwargs) return result else: diff --git a/src/streamdiffusion/acceleration/tensorrt/export_wrappers/unet_unified_export.py b/src/streamdiffusion/acceleration/tensorrt/export_wrappers/unet_unified_export.py index faeba0191..8117e1ab8 100644 --- a/src/streamdiffusion/acceleration/tensorrt/export_wrappers/unet_unified_export.py +++ b/src/streamdiffusion/acceleration/tensorrt/export_wrappers/unet_unified_export.py @@ -5,13 +5,13 @@ from streamdiffusion._patches.diffusers_kvo_patch import apply as _apply_kvo_patch - _apply_kvo_patch() # ensure kvo_cache patch is present even if diffusers was imported first from ..models.utils import convert_list_to_structure from .unet_controlnet_export import create_controlnet_wrapper from .unet_ipadapter_export import create_ipadapter_wrapper + def _collect_fi_processors(unet: UNet2DConditionModel) -> List: """Walk the UNet in kvo-cache walk order (down→mid→up) and return all ``CachedSTAttnProcessor2_0`` instances that have ``fi_eligible=True``. @@ -111,7 +111,6 @@ def __init__( self.unet, control_input_names, kvo_cache_structure, **controlnet_kwargs ) - # Best-effort collection at construction time — may return [] if processors are # not yet installed (e.g. when wrapper.py constructs UnifiedExportWrapper before # the if-use_cached_attn block installs CachedSTAttnProcessor2_0). diff --git a/src/streamdiffusion/acceleration/tensorrt/fp8_quantize.py b/src/streamdiffusion/acceleration/tensorrt/fp8_quantize.py index 53f8ba28d..2593adcfd 100644 --- a/src/streamdiffusion/acceleration/tensorrt/fp8_quantize.py +++ b/src/streamdiffusion/acceleration/tensorrt/fp8_quantize.py @@ -29,7 +29,6 @@ import numpy as np - logger = logging.getLogger(__name__) _BUNDLED_PROMPTS_PATH = Path(__file__).parent / "calibration_prompts_sdxl.txt" @@ -45,7 +44,7 @@ def _load_calibration_prompts(user_path: Optional[str] = None) -> List[str]: "abstract colorful geometric pattern", "landscape photography at golden hour", ] - with open(path, "r", encoding="utf-8") as f: + with open(path, encoding="utf-8") as f: prompts = [line.strip() for line in f if line.strip() and not line.startswith("#")] logger.info(f"[FP8] Loaded {len(prompts)} calibration prompts from {path.name}") return prompts @@ -126,7 +125,7 @@ def _hook(module, args, kwargs): for i, batch in enumerate(batches): logger.info(f"[FP8] Capture batch {i + 1}/{len(batches)}: {batch[0][:60]}") try: - pipe( + _ = pipe( prompt=batch if len(batch) > 1 else batch[0], num_inference_steps=num_inference_steps, output_type="latent", @@ -585,7 +584,6 @@ def quantize_onnx_fp8( f"(n_itr={_n_itr} × resolved_dim0={_resolved_dim0[_k]})" ) - import inspect as _inspect _params = set(_inspect.signature(modelopt_quantize).parameters.keys()) diff --git a/src/streamdiffusion/acceleration/tensorrt/runtime_engines/__init__.py b/src/streamdiffusion/acceleration/tensorrt/runtime_engines/__init__.py index 7fa98f855..d6868339c 100644 --- a/src/streamdiffusion/acceleration/tensorrt/runtime_engines/__init__.py +++ b/src/streamdiffusion/acceleration/tensorrt/runtime_engines/__init__.py @@ -4,10 +4,9 @@ from .controlnet_engine import ControlNetModelEngine from .unet_engine import AutoencoderKLEngine, UNet2DConditionModelEngine - __all__ = [ - "UNet2DConditionModelEngine", "AutoencoderKLEngine", "ControlNetModelEngine", "EngineManager", + "UNet2DConditionModelEngine", ] diff --git a/src/streamdiffusion/acceleration/tensorrt/runtime_engines/controlnet_engine.py b/src/streamdiffusion/acceleration/tensorrt/runtime_engines/controlnet_engine.py index 7d1ce77c2..041ee56ac 100644 --- a/src/streamdiffusion/acceleration/tensorrt/runtime_engines/controlnet_engine.py +++ b/src/streamdiffusion/acceleration/tensorrt/runtime_engines/controlnet_engine.py @@ -8,7 +8,6 @@ from ..utilities import Engine - # Set up logger for this module logger = logging.getLogger(__name__) diff --git a/src/streamdiffusion/acceleration/tensorrt/runtime_engines/unet_engine.py b/src/streamdiffusion/acceleration/tensorrt/runtime_engines/unet_engine.py index 85d081c7a..350722a25 100644 --- a/src/streamdiffusion/acceleration/tensorrt/runtime_engines/unet_engine.py +++ b/src/streamdiffusion/acceleration/tensorrt/runtime_engines/unet_engine.py @@ -12,7 +12,6 @@ from ..utilities import Engine - # Set up logger for this module logger = logging.getLogger(__name__) diff --git a/src/streamdiffusion/acceleration/tensorrt/utilities.py b/src/streamdiffusion/acceleration/tensorrt/utilities.py index caea2daa2..7e269df77 100644 --- a/src/streamdiffusion/acceleration/tensorrt/utilities.py +++ b/src/streamdiffusion/acceleration/tensorrt/utilities.py @@ -33,7 +33,6 @@ from streamdiffusion.tools.gpu_profiler import profiler as _gpu_profiler - # cuda-python 13.x renamed 'cudart' to 'cuda.bindings.runtime' try: from cuda.bindings import runtime as cudart @@ -47,7 +46,6 @@ from .models.models import CLIP, VAE, BaseModel, UNet, VAEEncoder - logger = logging.getLogger(__name__) TRT_LOGGER = get_trt_logger() # polygraphy singleton — shared with engine_from_bytes() @@ -125,7 +123,6 @@ def _ensure_build_logger_registered() -> None: from ...model_detection import detect_model # noqa: E402 - # --------------------------------------------------------------------------- # GPU Hardware Profile — hardware-aware TRT builder configuration # --------------------------------------------------------------------------- @@ -504,7 +501,7 @@ def __init__(self, name: str = ""): self._runs: deque = deque(maxlen=500) # rolling window; prevents unbounded growth at 30 fps self._current: list = [] # accumulator for the in-progress inference - def report_layer_time(self, layer_name: str, ms: float) -> None: # noqa: N802 + def report_layer_time(self, layer_name: str, ms: float) -> None: self._current.append((layer_name, ms)) def start_run(self) -> None: diff --git a/src/streamdiffusion/config.py b/src/streamdiffusion/config.py index bd97afcf6..716632927 100644 --- a/src/streamdiffusion/config.py +++ b/src/streamdiffusion/config.py @@ -7,7 +7,6 @@ from .param_schema import DEFAULTS - logger = logging.getLogger(__name__) @@ -17,7 +16,7 @@ def load_config(config_path: Union[str, Path]) -> Dict[str, Any]: if not config_path.exists(): raise FileNotFoundError(f"load_config: Configuration file not found: {config_path}") - with open(config_path, "r", encoding="utf-8") as f: + with open(config_path, encoding="utf-8") as f: if config_path.suffix.lower() in [".yaml", ".yml"]: config_data = yaml.safe_load(f) elif config_path.suffix.lower() == ".json": @@ -144,7 +143,7 @@ def _extract_wrapper_params(config: Dict[str, Any]) -> Dict[str, Any]: "build_engines_if_missing": config.get("build_engines_if_missing", True), "fp8_allow_fp16_fallback": config.get("fp8_allow_fp16_fallback", False), } - if "controlnets" in config and config["controlnets"]: + if config.get("controlnets"): param_map["use_controlnet"] = True param_map["controlnet_config"] = _prepare_controlnet_configs(config) else: @@ -152,7 +151,7 @@ def _extract_wrapper_params(config: Dict[str, Any]) -> Dict[str, Any]: param_map["controlnet_config"] = config.get("controlnet_config") # Set IPAdapter usage if IPAdapters are configured - if "ipadapters" in config and config["ipadapters"]: + if config.get("ipadapters"): param_map["use_ipadapter"] = True param_map["ipadapter_config"] = _prepare_ipadapter_configs(config) else: @@ -296,28 +295,28 @@ def _prepare_pipeline_hook_configs(config: Dict[str, Any]) -> Dict[str, Any]: hook_configs = {} # Image preprocessing hooks - if "image_preprocessing" in config and config["image_preprocessing"]: + if config.get("image_preprocessing"): if config["image_preprocessing"].get("enabled", True): hook_configs["image_preprocessing_config"] = _prepare_single_hook_config( config["image_preprocessing"], "image_preprocessing" ) # Image postprocessing hooks - if "image_postprocessing" in config and config["image_postprocessing"]: + if config.get("image_postprocessing"): if config["image_postprocessing"].get("enabled", True): hook_configs["image_postprocessing_config"] = _prepare_single_hook_config( config["image_postprocessing"], "image_postprocessing" ) # Latent preprocessing hooks - if "latent_preprocessing" in config and config["latent_preprocessing"]: + if config.get("latent_preprocessing"): if config["latent_preprocessing"].get("enabled", True): hook_configs["latent_preprocessing_config"] = _prepare_single_hook_config( config["latent_preprocessing"], "latent_preprocessing" ) # Latent postprocessing hooks - if "latent_postprocessing" in config and config["latent_postprocessing"]: + if config.get("latent_postprocessing"): if config["latent_postprocessing"].get("enabled", True): hook_configs["latent_postprocessing_config"] = _prepare_single_hook_config( config["latent_postprocessing"], "latent_postprocessing" diff --git a/src/streamdiffusion/model_detection.py b/src/streamdiffusion/model_detection.py index e98d8e9be..d55e7bcfa 100644 --- a/src/streamdiffusion/model_detection.py +++ b/src/streamdiffusion/model_detection.py @@ -5,7 +5,6 @@ import torch from diffusers.models.unets.unet_2d_condition import UNet2DConditionModel - # Gracefully import the SD3 model class; it might not exist in older diffusers versions. try: from diffusers.models.transformers.mm_dit import MMDiTTransformer2DModel @@ -18,7 +17,6 @@ import logging - logger = logging.getLogger(__name__) diff --git a/src/streamdiffusion/modules/__init__.py b/src/streamdiffusion/modules/__init__.py index f3242ca59..b8d0686fb 100644 --- a/src/streamdiffusion/modules/__init__.py +++ b/src/streamdiffusion/modules/__init__.py @@ -5,7 +5,6 @@ from .ipadapter_module import IPAdapterModule from .latent_processing_module import LatentPostprocessingModule, LatentPreprocessingModule, LatentProcessingModule - __all__ = [ # Existing modules "ControlNetModule", diff --git a/src/streamdiffusion/modules/controlnet_module.py b/src/streamdiffusion/modules/controlnet_module.py index 03c57345d..8b487ad1e 100644 --- a/src/streamdiffusion/modules/controlnet_module.py +++ b/src/streamdiffusion/modules/controlnet_module.py @@ -15,7 +15,6 @@ ) from streamdiffusion.tools.gpu_profiler import profiler - logger = logging.getLogger(__name__) @@ -106,9 +105,9 @@ def install(self, stream) -> None: # Register UNet hook stream.unet_hooks.append(self.build_unet_hook()) # Expose controlnet collections so existing updater can find them - setattr(stream, "controlnets", self.controlnets) - setattr(stream, "controlnet_scales", self.controlnet_scales) - setattr(stream, "preprocessors", self.preprocessors) + stream.controlnets = self.controlnets + stream.controlnet_scales = self.controlnet_scales + stream.preprocessors = self.preprocessors # Reset prepared tensors on install self._prepared_tensors = [] self._prepared_device = None @@ -147,7 +146,7 @@ def add_controlnet( if cfg.preprocessor_params: params = cfg.preprocessor_params or {} # If the preprocessor exposes a 'params' dict, update it - if hasattr(preproc, "params") and isinstance(getattr(preproc, "params"), dict): + if hasattr(preproc, "params") and isinstance(preproc.params, dict): preproc.params.update(params) # Also set attributes directly when they exist for name, value in params.items(): @@ -159,13 +158,13 @@ def add_controlnet( # Align preprocessor target size with stream resolution once (avoid double-resize later) try: - if hasattr(preproc, "params") and isinstance(getattr(preproc, "params"), dict): + if hasattr(preproc, "params") and isinstance(preproc.params, dict): preproc.params["image_width"] = int(self._stream.width) preproc.params["image_height"] = int(self._stream.height) if hasattr(preproc, "image_width"): - setattr(preproc, "image_width", int(self._stream.width)) + preproc.image_width = int(self._stream.width) if hasattr(preproc, "image_height"): - setattr(preproc, "image_height", int(self._stream.height)) + preproc.image_height = int(self._stream.height) except Exception as e: logger.debug(f"Failed to align preprocessor target size with stream resolution: {e}", exc_info=True) @@ -396,7 +395,7 @@ def prepare_frame_tensors(self, device: torch.device, dtype: torch.dtype, batch_ self._prepared_dtype = dtype self._prepared_batch = batch_size - def _get_cached_sdxl_conditioning(self, ctx: "StepCtx") -> Optional[Dict[str, torch.Tensor]]: + def _get_cached_sdxl_conditioning(self, ctx: StepCtx) -> Optional[Dict[str, torch.Tensor]]: """Get cached SDXL conditioning to avoid repeated preparation""" if not self._is_sdxl or ctx.sdxl_cond is None: return None @@ -739,7 +738,7 @@ def _load_pytorch_controlnet_model( controlnet = controlnet.to(device=self.device, dtype=self.dtype) # Track model_id for updater diffing try: - setattr(controlnet, "model_id", model_id) + controlnet.model_id = model_id except Exception as e: logger.debug(f"Failed to set model_id attribute on controlnet: {e}", exc_info=True) return controlnet diff --git a/src/streamdiffusion/modules/image_processing_module.py b/src/streamdiffusion/modules/image_processing_module.py index 58ea6a166..20955be82 100644 --- a/src/streamdiffusion/modules/image_processing_module.py +++ b/src/streamdiffusion/modules/image_processing_module.py @@ -54,7 +54,7 @@ def add_processor(self, proc_config: Dict[str, Any]) -> None: # Apply parameters (same pattern as ControlNet) processor_params = proc_config.get("params", {}) if processor_params: - if hasattr(processor, "params") and isinstance(getattr(processor, "params"), dict): + if hasattr(processor, "params") and isinstance(processor.params, dict): processor.params.update(processor_params) for name, value in processor_params.items(): try: @@ -65,21 +65,21 @@ def add_processor(self, proc_config: Dict[str, Any]) -> None: # Set order for sequential execution order = proc_config.get("order", len(self.processors)) - setattr(processor, "order", order) + processor.order = order # Set enabled state - setattr(processor, "enabled", enabled) + processor.enabled = enabled # Align preprocessor target size with stream resolution (same as ControlNet) if hasattr(self, "_stream"): try: - if hasattr(processor, "params") and isinstance(getattr(processor, "params"), dict): + if hasattr(processor, "params") and isinstance(processor.params, dict): processor.params["image_width"] = int(self._stream.width) processor.params["image_height"] = int(self._stream.height) if hasattr(processor, "image_width"): - setattr(processor, "image_width", int(self._stream.width)) + processor.image_width = int(self._stream.width) if hasattr(processor, "image_height"): - setattr(processor, "image_height", int(self._stream.height)) + processor.image_height = int(self._stream.height) except Exception as e: logger.debug(f"Failed to align processor target size with stream resolution: {e}", exc_info=True) diff --git a/src/streamdiffusion/modules/ipadapter_module.py b/src/streamdiffusion/modules/ipadapter_module.py index caca6c3c1..4a7a23d27 100644 --- a/src/streamdiffusion/modules/ipadapter_module.py +++ b/src/streamdiffusion/modules/ipadapter_module.py @@ -12,7 +12,6 @@ from streamdiffusion.preprocessing.orchestrator_user import OrchestratorUser from streamdiffusion.utils.reporting import report_error - logger = logging.getLogger(__name__) @@ -365,11 +364,11 @@ def install(self, stream) -> None: # Expose IPAdapter instance as single source of truth try: - setattr(stream, "ipadapter", ipadapter) + stream.ipadapter = ipadapter # Extend IPAdapter with our custom attributes since diffusers IPAdapter doesn't expose current state - setattr(ipadapter, "weight_type", self.config.weight_type) # For build_layer_weights - setattr(ipadapter, "scale", float(self.config.scale)) # Track current scale - setattr(ipadapter, "enabled", bool(self.config.enabled)) # Track enabled state + ipadapter.weight_type = self.config.weight_type # For build_layer_weights + ipadapter.scale = float(self.config.scale) # Track current scale + ipadapter.enabled = bool(self.config.enabled) # Track enabled state except Exception as e: logger.debug(f"Failed to attach custom attributes to ipadapter instance: {e}", exc_info=True) diff --git a/src/streamdiffusion/modules/latent_processing_module.py b/src/streamdiffusion/modules/latent_processing_module.py index 67ce0f9b0..d71f2039c 100644 --- a/src/streamdiffusion/modules/latent_processing_module.py +++ b/src/streamdiffusion/modules/latent_processing_module.py @@ -52,7 +52,7 @@ def add_processor(self, proc_config: Dict[str, Any]) -> None: # Apply parameters (same pattern as ControlNet) processor_params = proc_config.get("params", {}) if processor_params: - if hasattr(processor, "params") and isinstance(getattr(processor, "params"), dict): + if hasattr(processor, "params") and isinstance(processor.params, dict): processor.params.update(processor_params) for name, value in processor_params.items(): try: @@ -63,10 +63,10 @@ def add_processor(self, proc_config: Dict[str, Any]) -> None: # Set order for sequential execution order = proc_config.get("order", len(self.processors)) - setattr(processor, "order", order) + processor.order = order # Set enabled state - setattr(processor, "enabled", enabled) + processor.enabled = enabled # Pipeline reference is now automatically handled by the factory function diff --git a/src/streamdiffusion/param_schema.py b/src/streamdiffusion/param_schema.py index 6ecaa222a..3f60bd3e5 100644 --- a/src/streamdiffusion/param_schema.py +++ b/src/streamdiffusion/param_schema.py @@ -33,7 +33,6 @@ from dataclasses import dataclass from typing import Any, Dict, List, Literal, Tuple - # Interpolation-method aliases shared by the wrapper and updater signatures. PromptInterpolationMethod = Literal["linear", "slerp", "cosine_weighted"] SeedInterpolationMethod = Literal["linear", "slerp"] diff --git a/src/streamdiffusion/pip_utils.py b/src/streamdiffusion/pip_utils.py index 4a28c0a0e..36d58faa5 100644 --- a/src/streamdiffusion/pip_utils.py +++ b/src/streamdiffusion/pip_utils.py @@ -8,7 +8,6 @@ from packaging.version import Version - python = sys.executable index_url = os.environ.get("INDEX_URL", "") uv = shutil.which("uv") @@ -24,7 +23,7 @@ def _check_torch_installed(): " pip install --index-url https://download.pytorch.org/whl/cu12x torch torchvision\n" "Replace the index URL and versions to match your CUDA runtime." ) - raise RuntimeError(msg) + raise RuntimeError(msg) from None if not torch.version.cuda: raise RuntimeError( diff --git a/src/streamdiffusion/pipeline.py b/src/streamdiffusion/pipeline.py index 7ebe828dc..432ceeddf 100644 --- a/src/streamdiffusion/pipeline.py +++ b/src/streamdiffusion/pipeline.py @@ -27,7 +27,6 @@ from streamdiffusion.stream_parameter_updater import StreamParameterUpdater from streamdiffusion.tools.gpu_profiler import profiler - logging.basicConfig(level=logging.INFO) logger = logging.getLogger(__name__) diff --git a/src/streamdiffusion/preprocessing/__init__.py b/src/streamdiffusion/preprocessing/__init__.py index c52a8a2ed..2850365db 100644 --- a/src/streamdiffusion/preprocessing/__init__.py +++ b/src/streamdiffusion/preprocessing/__init__.py @@ -4,11 +4,10 @@ from .postprocessing_orchestrator import PostprocessingOrchestrator from .preprocessing_orchestrator import PreprocessingOrchestrator - __all__ = [ - "PreprocessingOrchestrator", - "PostprocessingOrchestrator", - "PipelinePreprocessingOrchestrator", "BaseOrchestrator", "OrchestratorUser", + "PipelinePreprocessingOrchestrator", + "PostprocessingOrchestrator", + "PreprocessingOrchestrator", ] diff --git a/src/streamdiffusion/preprocessing/base_orchestrator.py b/src/streamdiffusion/preprocessing/base_orchestrator.py index 85db7b488..41b21146c 100644 --- a/src/streamdiffusion/preprocessing/base_orchestrator.py +++ b/src/streamdiffusion/preprocessing/base_orchestrator.py @@ -5,7 +5,6 @@ import torch - logger = logging.getLogger(__name__) # Type variables for generic orchestrator diff --git a/src/streamdiffusion/preprocessing/orchestrator_user.py b/src/streamdiffusion/preprocessing/orchestrator_user.py index e731540b9..5955f6fe1 100644 --- a/src/streamdiffusion/preprocessing/orchestrator_user.py +++ b/src/streamdiffusion/preprocessing/orchestrator_user.py @@ -29,7 +29,7 @@ def attach_preprocessing_orchestrator(self, stream) -> None: orchestrator = PreprocessingOrchestrator( device=stream.device, dtype=stream.dtype, max_workers=4, pipeline_ref=stream ) - setattr(stream, "preprocessing_orchestrator", orchestrator) + stream.preprocessing_orchestrator = orchestrator self._preprocessing_orchestrator = orchestrator def attach_postprocessing_orchestrator(self, stream) -> None: @@ -40,7 +40,7 @@ def attach_postprocessing_orchestrator(self, stream) -> None: orchestrator = PostprocessingOrchestrator( device=stream.device, dtype=stream.dtype, max_workers=4, pipeline_ref=stream ) - setattr(stream, "postprocessing_orchestrator", orchestrator) + stream.postprocessing_orchestrator = orchestrator self._postprocessing_orchestrator = orchestrator def attach_pipeline_preprocessing_orchestrator(self, stream) -> None: @@ -51,5 +51,5 @@ def attach_pipeline_preprocessing_orchestrator(self, stream) -> None: orchestrator = PipelinePreprocessingOrchestrator( device=stream.device, dtype=stream.dtype, max_workers=4, pipeline_ref=stream ) - setattr(stream, "pipeline_preprocessing_orchestrator", orchestrator) + stream.pipeline_preprocessing_orchestrator = orchestrator self._pipeline_preprocessing_orchestrator = orchestrator diff --git a/src/streamdiffusion/preprocessing/pipeline_preprocessing_orchestrator.py b/src/streamdiffusion/preprocessing/pipeline_preprocessing_orchestrator.py index 382e874fb..51b9e2d33 100644 --- a/src/streamdiffusion/preprocessing/pipeline_preprocessing_orchestrator.py +++ b/src/streamdiffusion/preprocessing/pipeline_preprocessing_orchestrator.py @@ -5,7 +5,6 @@ from .base_orchestrator import BaseOrchestrator - logger = logging.getLogger(__name__) diff --git a/src/streamdiffusion/preprocessing/postprocessing_orchestrator.py b/src/streamdiffusion/preprocessing/postprocessing_orchestrator.py index ef5dceb32..e9c8c847e 100644 --- a/src/streamdiffusion/preprocessing/postprocessing_orchestrator.py +++ b/src/streamdiffusion/preprocessing/postprocessing_orchestrator.py @@ -5,7 +5,6 @@ from .base_orchestrator import BaseOrchestrator - logger = logging.getLogger(__name__) diff --git a/src/streamdiffusion/preprocessing/preprocessing_orchestrator.py b/src/streamdiffusion/preprocessing/preprocessing_orchestrator.py index 577678bd6..6957a2f14 100644 --- a/src/streamdiffusion/preprocessing/preprocessing_orchestrator.py +++ b/src/streamdiffusion/preprocessing/preprocessing_orchestrator.py @@ -9,7 +9,6 @@ from .base_orchestrator import BaseOrchestrator - logger = logging.getLogger(__name__) # Type alias for control image input diff --git a/src/streamdiffusion/preprocessing/processors/__init__.py b/src/streamdiffusion/preprocessing/processors/__init__.py index adf53e158..be4601aad 100644 --- a/src/streamdiffusion/preprocessing/processors/__init__.py +++ b/src/streamdiffusion/preprocessing/processors/__init__.py @@ -1,27 +1,29 @@ -from .base import BasePreprocessor, PipelineAwareProcessor from typing import Any + +from .base import BasePreprocessor, PipelineAwareProcessor +from .blur import BlurPreprocessor from .canny import CannyPreprocessor from .depth import DepthPreprocessor -from .openpose import OpenPosePreprocessor -from .lineart import LineartPreprocessor -from .standard_lineart import StandardLineartPreprocessor -from .passthrough import PassthroughPreprocessor from .external import ExternalPreprocessor -from .soft_edge import SoftEdgePreprocessor -from .hed import HEDPreprocessor -from .ipadapter_embedding import IPAdapterEmbeddingPreprocessor from .faceid_embedding import FaceIDEmbeddingPreprocessor from .feedback import FeedbackPreprocessor +from .hed import HEDPreprocessor +from .ipadapter_embedding import IPAdapterEmbeddingPreprocessor from .latent_feedback import LatentFeedbackPreprocessor +from .lineart import LineartPreprocessor +from .openpose import OpenPosePreprocessor +from .passthrough import PassthroughPreprocessor +from .realesrgan_trt import RealESRGANProcessor from .scribble import ScribblePreprocessor from .sharpen import SharpenPreprocessor +from .soft_edge import SoftEdgePreprocessor +from .standard_lineart import StandardLineartPreprocessor from .upscale import UpscalePreprocessor -from .blur import BlurPreprocessor -from .realesrgan_trt import RealESRGANProcessor # Try to import TensorRT preprocessors - might not be available on all systems try: from .depth_tensorrt import DepthAnythingTensorrtPreprocessor + DEPTH_TENSORRT_AVAILABLE = True except ImportError: DepthAnythingTensorrtPreprocessor = None @@ -29,6 +31,7 @@ try: from .pose_tensorrt import YoloNasPoseTensorrtPreprocessor + POSE_TENSORRT_AVAILABLE = True except ImportError: YoloNasPoseTensorrtPreprocessor = None @@ -60,6 +63,7 @@ try: from .temporal_net_tensorrt import TemporalNetTensorRTPreprocessor + TEMPORAL_NET_TENSORRT_AVAILABLE = True except ImportError: TemporalNetTensorRTPreprocessor = None @@ -67,6 +71,7 @@ try: from .mediapipe_pose import MediaPipePosePreprocessor + MEDIAPIPE_POSE_AVAILABLE = True except ImportError: MediaPipePosePreprocessor = None @@ -74,6 +79,7 @@ try: from .mediapipe_segmentation import MediaPipeSegmentationPreprocessor + MEDIAPIPE_SEGMENTATION_AVAILABLE = True except ImportError: MediaPipeSegmentationPreprocessor = None @@ -97,7 +103,7 @@ "upscale": UpscalePreprocessor, "blur": BlurPreprocessor, "realesrgan_trt": RealESRGANProcessor, -} +} # Add TensorRT preprocessors if available if DEPTH_TENSORRT_AVAILABLE: @@ -130,27 +136,29 @@ def get_preprocessor_class(name: str) -> type: """ Get a preprocessor class by name - + Args: name: Name of the preprocessor - + Returns: Preprocessor class - + Raises: ValueError: If preprocessor name is not found """ if name not in _preprocessor_registry: available = ", ".join(_preprocessor_registry.keys()) raise ValueError(f"Unknown preprocessor '{name}'. Available: {available}") - + return _preprocessor_registry[name] -def get_preprocessor(name: str, pipeline_ref: Any = None, normalization_context: str = 'controlnet', params: Any = None) -> BasePreprocessor: +def get_preprocessor( + name: str, pipeline_ref: Any = None, normalization_context: str = "controlnet", params: Any = None +) -> BasePreprocessor: """ Get a preprocessor by name - + Args: name: Name of the preprocessor pipeline_ref: Pipeline reference for pipeline-aware processors (required for some processors) @@ -158,20 +166,25 @@ def get_preprocessor(name: str, pipeline_ref: Any = None, normalization_context: - 'controlnet': Expects/produces [0,1] range for ControlNet conditioning - 'pipeline': Expects/produces [-1,1] range for pipeline image processing - 'latent': Works in latent space (no normalization needed) - + Returns: Preprocessor instance - + Raises: ValueError: If preprocessor name is not found or pipeline_ref missing for pipeline-aware processor """ processor_class = get_preprocessor_class(name) - + # Check if this is a pipeline-aware processor - if hasattr(processor_class, 'requires_sync_processing') and processor_class.requires_sync_processing: + if hasattr(processor_class, "requires_sync_processing") and processor_class.requires_sync_processing: if pipeline_ref is None: raise ValueError(f"Processor '{name}' requires a pipeline_ref") - return processor_class(pipeline_ref=pipeline_ref, normalization_context=normalization_context, _registry_name=name, **(params or {})) + return processor_class( + pipeline_ref=pipeline_ref, + normalization_context=normalization_context, + _registry_name=name, + **(params or {}), + ) else: return processor_class(normalization_context=normalization_context, _registry_name=name, **(params or {})) @@ -179,7 +192,7 @@ def get_preprocessor(name: str, pipeline_ref: Any = None, normalization_context: def register_preprocessor(name: str, preprocessor_class): """ Register a new preprocessor - + Args: name: Name to register under preprocessor_class: Preprocessor class @@ -194,25 +207,25 @@ def list_preprocessors(): __all__ = [ "BasePreprocessor", - "PipelineAwareProcessor", "CannyPreprocessor", - "DepthPreprocessor", - "OpenPosePreprocessor", - "LineartPreprocessor", - "StandardLineartPreprocessor", - "PassthroughPreprocessor", + "DepthPreprocessor", "ExternalPreprocessor", - "SoftEdgePreprocessor", - "HEDPreprocessor", - "ScribblePreprocessor", - "IPAdapterEmbeddingPreprocessor", "FaceIDEmbeddingPreprocessor", "FeedbackPreprocessor", + "HEDPreprocessor", + "IPAdapterEmbeddingPreprocessor", "LatentFeedbackPreprocessor", + "LineartPreprocessor", + "OpenPosePreprocessor", + "PassthroughPreprocessor", + "PipelineAwareProcessor", + "ScribblePreprocessor", + "SoftEdgePreprocessor", + "StandardLineartPreprocessor", "get_preprocessor", "get_preprocessor_class", - "register_preprocessor", "list_preprocessors", + "register_preprocessor", ] if DEPTH_TENSORRT_AVAILABLE: @@ -241,14 +254,15 @@ def list_preprocessors(): # region Custom Processor Discovery -import logging -import os import importlib.util import inspect +import logging +import os from pathlib import Path _logger = logging.getLogger(__name__) + def _discover_custom_processors(): """Auto-discover custom processors from repo_root/custom_processors/ folder.""" if os.getenv("STREAMDIFFUSION_DISABLE_CUSTOM_PROCESSORS") == "1": @@ -262,7 +276,7 @@ def _discover_custom_processors(): return _logger.info("Scanning custom_processors/ for custom processors...") for item in custom_dir.iterdir(): - if not item.is_dir() or item.name.startswith(('.', '_')): + if not item.is_dir() or item.name.startswith((".", "_")): continue manifest_file = item / "processors.yaml" if manifest_file.exists(): @@ -272,20 +286,22 @@ def _discover_custom_processors(): except Exception as e: _logger.error(f"Custom processor discovery failed: {e}") + def _load_processor_collection(collection_dir, manifest_file): """Load processors from a collection with processors.yaml manifest.""" import yaml + try: - with open(manifest_file, 'r') as f: + with open(manifest_file) as f: manifest = yaml.safe_load(f) - processor_files = manifest.get('processors', []) + processor_files = manifest.get("processors", []) if not processor_files: _logger.warning(f"Collection '{collection_dir.name}' has empty processors list") return _logger.info(f"Loading collection '{collection_dir.name}' ({len(processor_files)} processors)") for proc_file in processor_files: if isinstance(proc_file, dict): - filename, enabled = proc_file.get('file'), proc_file.get('enabled', True) + filename, enabled = proc_file.get("file"), proc_file.get("enabled", True) if not enabled: continue else: @@ -298,24 +314,28 @@ def _load_processor_collection(collection_dir, manifest_file): except Exception as e: _logger.error(f"Failed to load collection {collection_dir.name}: {e}") + def _load_processor_folder_auto(folder): """Auto-discover processors by scanning for .py files (no manifest).""" _logger.info(f"Auto-scanning folder: {folder.name}") for py_file in folder.glob("*.py"): - if py_file.name.startswith('_') or py_file.name in ['base.py', 'setup.py']: + if py_file.name.startswith("_") or py_file.name in ["base.py", "setup.py"]: continue _load_processor_from_file(py_file, py_file.stem) + def _load_processor_from_file(file_path, proc_name): """Load and register a processor class from a Python file.""" try: spec = importlib.util.spec_from_file_location( - f"custom_processors.{file_path.parent.name}.{file_path.stem}", file_path) + f"custom_processors.{file_path.parent.name}.{file_path.stem}", file_path + ) module = importlib.util.module_from_spec(spec) spec.loader.exec_module(module) found_classes = [ - (name, obj) for name, obj in inspect.getmembers(module, inspect.isclass) + (name, obj) + for name, obj in inspect.getmembers(module, inspect.isclass) if issubclass(obj, (BasePreprocessor, PipelineAwareProcessor)) and obj not in [BasePreprocessor, PipelineAwareProcessor] ] @@ -330,5 +350,6 @@ def _load_processor_from_file(file_path, proc_name): except Exception as e: _logger.error(f" Failed to load {file_path.name}: {e}") + _discover_custom_processors() -# endregion \ No newline at end of file +# endregion diff --git a/src/streamdiffusion/preprocessing/processors/base.py b/src/streamdiffusion/preprocessing/processors/base.py index 71fdcf9f1..d7644cab7 100644 --- a/src/streamdiffusion/preprocessing/processors/base.py +++ b/src/streamdiffusion/preprocessing/processors/base.py @@ -1,14 +1,14 @@ import logging from abc import ABC, abstractmethod -from typing import Any, Dict, Optional, Set, Tuple, Union +from typing import Any, Dict, Set, Tuple, Union + +import numpy as np import torch import torch.nn.functional as F -import numpy as np from PIL import Image from streamdiffusion.tools.gpu_profiler import profiler - _pil_fallback_warned: Set[str] = set() # per-class warning dedup _base_logger = logging.getLogger(__name__) @@ -23,10 +23,10 @@ class BasePreprocessor(ABC): # Used by the residency guard test and the one-time PIL-fallback warning below. gpu_native: bool = False - def __init__(self, normalization_context: str = 'controlnet', **kwargs): + def __init__(self, normalization_context: str = "controlnet", **kwargs): """ Initialize the preprocessor - + Args: normalization_context: Context for normalization handling. - 'controlnet': Expects/produces [0,1] range for ControlNet conditioning @@ -36,15 +36,15 @@ def __init__(self, normalization_context: str = 'controlnet', **kwargs): """ self.params = kwargs self.normalization_context = normalization_context - self.device = kwargs.get('device', 'cuda' if torch.cuda.is_available() else 'cpu') - self.dtype = kwargs.get('dtype', torch.float16) - + self.device = kwargs.get("device", "cuda" if torch.cuda.is_available() else "cpu") + self.dtype = kwargs.get("dtype", torch.float16) + @classmethod def get_preprocessor_metadata(cls) -> Dict[str, Any]: """ Get comprehensive metadata for this preprocessor. Subclasses should override this to define their specific metadata. - + Returns: Dictionary containing: - display_name: Human-readable name @@ -56,9 +56,9 @@ def get_preprocessor_metadata(cls) -> Dict[str, Any]: "display_name": cls.__name__.replace("Preprocessor", ""), "description": f"Preprocessor for {cls.__name__.replace('Preprocessor', '').lower()}", "parameters": {}, - "use_cases": [] + "use_cases": [], } - + def process(self, image: Union[Image.Image, np.ndarray, torch.Tensor]) -> Image.Image: """ Template method - handles all common operations @@ -67,7 +67,7 @@ def process(self, image: Union[Image.Image, np.ndarray, torch.Tensor]) -> Image. with profiler.region("proc.core"): processed = self._process_core(image) return self._ensure_target_size(processed) - + def process_tensor(self, image_tensor: torch.Tensor) -> torch.Tensor: """ Template method for GPU tensor processing @@ -76,14 +76,14 @@ def process_tensor(self, image_tensor: torch.Tensor) -> torch.Tensor: with profiler.region("proc.core"): processed = self._process_tensor_core(tensor) return self._ensure_target_size_tensor(processed) - + @abstractmethod def _process_core(self, image: Image.Image) -> Image.Image: """ Subclasses implement ONLY their specific algorithm """ pass - + def _process_tensor_core(self, tensor: torch.Tensor) -> torch.Tensor: """ Optional GPU processing (fallback to PIL if not overridden). @@ -108,7 +108,6 @@ def _process_tensor_core(self, tensor: torch.Tensor) -> torch.Tensor: with profiler.region("proc.pil_to_tensor"): return self.pil_to_tensor(processed_pil) - def _ensure_target_size(self, image: Image.Image) -> Image.Image: """ Centralized PIL resize logic @@ -117,7 +116,7 @@ def _ensure_target_size(self, image: Image.Image) -> Image.Image: if image.size != (target_width, target_height): return image.resize((target_width, target_height), Image.LANCZOS) return image - + def _ensure_target_size_tensor(self, tensor: torch.Tensor) -> torch.Tensor: """ Centralized tensor resize logic @@ -125,7 +124,7 @@ def _ensure_target_size_tensor(self, tensor: torch.Tensor) -> torch.Tensor: target_width, target_height = self.get_target_dimensions() current_size = tensor.shape[-2:] target_size = (target_height, target_width) - + if current_size != target_size: if tensor.dim() == 3: tensor = tensor.unsqueeze(0) @@ -135,24 +134,24 @@ def _ensure_target_size_tensor(self, tensor: torch.Tensor) -> torch.Tensor: if tensor.shape[0] == 1: tensor = tensor.squeeze(0) return tensor - + def validate_tensor_input(self, image_tensor: torch.Tensor) -> torch.Tensor: """ Validate and normalize tensor input for processing - + Args: image_tensor: Input tensor - + Returns: Tensor in CHW format, on correct device Range: [0,1] if input was [0,255], otherwise preserves input range - + Note: This preserves [-1,1] tensors (from pipeline) since max() <= 1.0 """ # Handle batch dimension if image_tensor.dim() == 4: image_tensor = image_tensor[0] # Take first image from batch - + # Convert to CHW format if needed if image_tensor.dim() == 3 and image_tensor.shape[0] not in [1, 3]: # Likely HWC format, convert to CHW @@ -169,16 +168,16 @@ def validate_tensor_input(self, image_tensor: torch.Tensor) -> torch.Tensor: if _was_uint8: image_tensor = image_tensor / 255.0 - + return image_tensor - + def tensor_to_pil(self, tensor: torch.Tensor) -> Image.Image: """ Convert tensor to PIL Image (minimize CPU transfers) - + Args: tensor: Input tensor - + Returns: PIL Image """ @@ -187,39 +186,39 @@ def tensor_to_pil(self, tensor: torch.Tensor) -> Image.Image: tensor = tensor[0] if tensor.dim() == 3 and tensor.shape[0] in [1, 3]: tensor = tensor.permute(1, 2, 0) - + # Convert to numpy (unavoidable for PIL) if tensor.is_cuda: tensor = tensor.cpu() - + # Convert to uint8 if tensor.max() <= 1.0: tensor = (tensor * 255).clamp(0, 255).to(torch.uint8) else: tensor = tensor.clamp(0, 255).to(torch.uint8) - + array = tensor.numpy() - + if array.shape[-1] == 3: - return Image.fromarray(array, 'RGB') + return Image.fromarray(array, "RGB") elif array.shape[-1] == 1: - return Image.fromarray(array.squeeze(-1), 'L') + return Image.fromarray(array.squeeze(-1), "L") else: return Image.fromarray(array) - + def pil_to_tensor(self, image: Image.Image) -> torch.Tensor: """ Convert PIL Image to tensor on GPU - + Args: image: PIL Image - + Returns: Tensor on correct device """ # Convert to numpy first array = np.array(image) - + # Convert to tensor if len(array.shape) == 2: # Grayscale tensor = torch.from_numpy(array).float() / 255.0 @@ -227,25 +226,25 @@ def pil_to_tensor(self, image: Image.Image) -> torch.Tensor: else: # RGB tensor = torch.from_numpy(array).float() / 255.0 tensor = tensor.permute(2, 0, 1) # HWC to CHW - + # Move to device tensor = tensor.to(device=self.device, dtype=self.dtype) return tensor.unsqueeze(0) # Add batch dimension - + def validate_input(self, image: Union[Image.Image, np.ndarray, torch.Tensor]) -> Image.Image: """ Convert input to PIL Image for processing - + Args: image: Input image in various formats - + Returns: PIL Image """ if isinstance(image, torch.Tensor): # Use tensor_to_pil method for better handling return self.tensor_to_pil(image) - + if isinstance(image, np.ndarray): # Ensure uint8 format if image.dtype != np.uint8: @@ -253,83 +252,83 @@ def validate_input(self, image: Union[Image.Image, np.ndarray, torch.Tensor]) -> image = (image * 255).astype(np.uint8) else: image = image.astype(np.uint8) - + # Convert to PIL Image if len(image.shape) == 3: - image = Image.fromarray(image, 'RGB') + image = Image.fromarray(image, "RGB") else: - image = Image.fromarray(image, 'L') - + image = Image.fromarray(image, "L") + if not isinstance(image, Image.Image): raise ValueError(f"Unsupported image type: {type(image)}") - + return image - + def get_target_dimensions(self) -> Tuple[int, int]: """ Get target output dimensions (width, height) """ # Check for explicit width/height parameters first - width = self.params.get('image_width') - height = self.params.get('image_height') - + width = self.params.get("image_width") + height = self.params.get("image_height") + if width is not None and height is not None: return (width, height) - + # Fallback to square resolution for backwards compatibility - resolution = self.params.get('image_resolution', 512) + resolution = self.params.get("image_resolution", 512) return (resolution, resolution) - + def __call__(self, image: Union[Image.Image, np.ndarray, torch.Tensor], **kwargs) -> Image.Image: """ Process an image (convenience method) - + Args: image: Input image **kwargs: Additional parameters to override defaults - + Returns: Processed PIL Image """ # Update parameters for this call params = {**self.params, **kwargs} - + # Store original params and update original_params = self.params self.params = params - + try: result = self.process(image) finally: # Restore original params self.params = original_params - + return result class PipelineAwareProcessor(BasePreprocessor): """ Abstract base class for processors that need access to pipeline state (previous outputs). - - This base class marks processors as requiring synchronous processing to avoid + + This base class marks processors as requiring synchronous processing to avoid temporal artifacts and ensures they have access to pipeline references. - + Usage: class MyProcessor(PipelineAwareProcessor): pass - + Examples: - FeedbackPreprocessor: Needs previous diffusion output - TemporalNetPreprocessor: Needs previous frame for optical flow """ - + # Class attribute to mark processors as requiring sync processing requires_sync_processing = True - - def __init__(self, pipeline_ref: Any, normalization_context: str = 'controlnet', **kwargs): + + def __init__(self, pipeline_ref: Any, normalization_context: str = "controlnet", **kwargs): """ Initialize pipeline-aware functionality - + Args: pipeline_ref: Reference to the StreamDiffusion pipeline instance (required) normalization_context: Context for normalization handling @@ -338,4 +337,4 @@ def __init__(self, pipeline_ref: Any, normalization_context: str = 'controlnet', if pipeline_ref is None: raise ValueError(f"{self.__class__.__name__} requires a pipeline_ref") super().__init__(normalization_context=normalization_context, **kwargs) - self.pipeline_ref = pipeline_ref \ No newline at end of file + self.pipeline_ref = pipeline_ref diff --git a/src/streamdiffusion/preprocessing/processors/canny.py b/src/streamdiffusion/preprocessing/processors/canny.py index e51c04437..366960b85 100644 --- a/src/streamdiffusion/preprocessing/processors/canny.py +++ b/src/streamdiffusion/preprocessing/processors/canny.py @@ -5,7 +5,7 @@ from PIL import Image from .base import BasePreprocessor -from .category_params import EDGE_SMOOTHNESS_PARAM, apply_edge_smoothness +from .category_params import EDGE_SMOOTHNESS_PARAM class CannyPreprocessor(BasePreprocessor): @@ -17,7 +17,6 @@ class CannyPreprocessor(BasePreprocessor): gpu_native = True # _process_tensor_core uses conv2d — no CPU/PIL round-trip - @classmethod def get_preprocessor_metadata(cls): return { @@ -72,7 +71,6 @@ def _process_core(self, image: Image.Image) -> Image.Image: low_threshold = self.params.get("low_threshold", 100) high_threshold = self.params.get("high_threshold", 200) - edges = cv2.Canny(gray, low_threshold, high_threshold) edges_rgb = cv2.cvtColor(edges, cv2.COLOR_GRAY2RGB) diff --git a/src/streamdiffusion/preprocessing/processors/category_params.py b/src/streamdiffusion/preprocessing/processors/category_params.py index 49e4c5875..7ea69c5a9 100644 --- a/src/streamdiffusion/preprocessing/processors/category_params.py +++ b/src/streamdiffusion/preprocessing/processors/category_params.py @@ -23,7 +23,6 @@ import torch import torch.nn.functional as F - # --------------------------------------------------------------------------- # Canonical metadata fragments # --------------------------------------------------------------------------- diff --git a/src/streamdiffusion/preprocessing/processors/depth.py b/src/streamdiffusion/preprocessing/processors/depth.py index c940d7189..b2abad32e 100644 --- a/src/streamdiffusion/preprocessing/processors/depth.py +++ b/src/streamdiffusion/preprocessing/processors/depth.py @@ -6,6 +6,7 @@ try: import torch from transformers import pipeline + TRANSFORMERS_AVAILABLE = True except ImportError: TRANSFORMERS_AVAILABLE = False @@ -14,29 +15,25 @@ class DepthPreprocessor(BasePreprocessor): """ Depth estimation preprocessor for ControlNet using MiDaS - + Estimates depth maps from input images using the MiDaS depth estimation model. """ - + @classmethod def get_preprocessor_metadata(cls): return { "display_name": "Depth Estimation", "description": "Estimates depth from the input image using MiDaS. Good for adding depth-based control to generation.", - "parameters": { - - }, - "use_cases": ["3D-aware generation", "Depth preservation", "Scene understanding"] + "parameters": {}, + "use_cases": ["3D-aware generation", "Depth preservation", "Scene understanding"], } - - def __init__(self, - model_name: str = "Intel/dpt-large", - detect_resolution: int = 512, - image_resolution: int = 512, - **kwargs): + + def __init__( + self, model_name: str = "Intel/dpt-large", detect_resolution: int = 512, image_resolution: int = 512, **kwargs + ): """ Initialize depth preprocessor - + Args: model_name: Name of the depth estimation model to use detect_resolution: Resolution for depth detection @@ -45,57 +42,51 @@ def __init__(self, """ if not TRANSFORMERS_AVAILABLE: raise ImportError( - "transformers library is required for depth preprocessing. " - "Install it with: pip install transformers" + "transformers library is required for depth preprocessing. Install it with: pip install transformers" ) - + super().__init__( - model_name=model_name, - detect_resolution=detect_resolution, - image_resolution=image_resolution, - **kwargs + model_name=model_name, detect_resolution=detect_resolution, image_resolution=image_resolution, **kwargs ) - + self._depth_estimator = None - + @property def depth_estimator(self): """Lazy loading of the depth estimation model""" if self._depth_estimator is None: - model_name = self.params.get('model_name', 'Intel/dpt-large') + model_name = self.params.get("model_name", "Intel/dpt-large") print(f"Loading depth estimation model: {model_name}") self._depth_estimator = pipeline( - 'depth-estimation', - model=model_name, - device=0 if torch.cuda.is_available() else -1 + "depth-estimation", model=model_name, device=0 if torch.cuda.is_available() else -1 ) return self._depth_estimator - + def _process_core(self, image: Image.Image) -> Image.Image: """ Apply depth estimation to the input image """ - detect_resolution = self.params.get('detect_resolution', 512) + detect_resolution = self.params.get("detect_resolution", 512) image_resized = image.resize((detect_resolution, detect_resolution), Image.LANCZOS) - + depth_result = self.depth_estimator(image_resized) - depth_map = depth_result['depth'] - - if hasattr(depth_map, 'cpu'): + depth_map = depth_result["depth"] + + if hasattr(depth_map, "cpu"): depth_np = depth_map.cpu().numpy() else: depth_np = np.array(depth_map) - + depth_min = depth_np.min() depth_max = depth_np.max() if depth_max > depth_min: depth_normalized = ((depth_np - depth_min) / (depth_max - depth_min) * 255).astype(np.uint8) else: depth_normalized = np.zeros_like(depth_np, dtype=np.uint8) - + depth_rgb = np.stack([depth_normalized] * 3, axis=-1) return Image.fromarray(depth_rgb) - + def _process_tensor_core(self, image_tensor: torch.Tensor) -> torch.Tensor: """ Process tensor directly on GPU for depth estimation. @@ -114,45 +105,43 @@ def _process_tensor_core(self, image_tensor: torch.Tensor) -> torch.Tensor: ) detect_resolution = self.params.get("detect_resolution", 512) current_size = image_tensor.shape[-2:] - + if current_size != (detect_resolution, detect_resolution): import torch.nn.functional as F + if image_tensor.dim() == 3: image_tensor = image_tensor.unsqueeze(0) - + resized_tensor = F.interpolate( - image_tensor, - size=(detect_resolution, detect_resolution), - mode='bilinear', - align_corners=False + image_tensor, size=(detect_resolution, detect_resolution), mode="bilinear", align_corners=False ) - + if image_tensor.shape[0] == 1: resized_tensor = resized_tensor.squeeze(0) else: resized_tensor = image_tensor - + pil_image = self.tensor_to_pil(resized_tensor) - + depth_result = self.depth_estimator(pil_image) - depth_map = depth_result['depth'] - - if hasattr(depth_map, 'to'): + depth_map = depth_result["depth"] + + if hasattr(depth_map, "to"): depth_tensor = depth_map.to(device=self.device, dtype=self.dtype) else: depth_np = np.array(depth_map) depth_tensor = torch.from_numpy(depth_np).to(device=self.device, dtype=self.dtype) - + depth_min = depth_tensor.min() depth_max = depth_tensor.max() if depth_max > depth_min: depth_normalized = (depth_tensor - depth_min) / (depth_max - depth_min) else: depth_normalized = torch.zeros_like(depth_tensor) - + if depth_normalized.dim() == 2: depth_rgb = depth_normalized.unsqueeze(0).repeat(3, 1, 1) else: depth_rgb = depth_normalized - - return depth_rgb \ No newline at end of file + + return depth_rgb diff --git a/src/streamdiffusion/preprocessing/processors/depth_tensorrt.py b/src/streamdiffusion/preprocessing/processors/depth_tensorrt.py index a41667f26..81efa5d7f 100644 --- a/src/streamdiffusion/preprocessing/processors/depth_tensorrt.py +++ b/src/streamdiffusion/preprocessing/processors/depth_tensorrt.py @@ -1,12 +1,13 @@ -#NOTE: ported from https://github.com/yuvraj108c/ComfyUI-Depth-Anything-Tensorrt +# NOTE: ported from https://github.com/yuvraj108c/ComfyUI-Depth-Anything-Tensorrt import os + +import cv2 import numpy as np import torch import torch.nn.functional as F -import cv2 from PIL import Image -from typing import Union, Optional + from .base import BasePreprocessor from .category_params import DEPTH_GRADE_PARAMS, apply_depth_grade, apply_depth_grade_numpy from .trt_base import TENSORRT_AVAILABLE, TensorRTEngine # shared engine wrapper @@ -19,6 +20,7 @@ class DepthAnythingTensorrtPreprocessor(BasePreprocessor): Uses TensorRT-optimized Depth Anything model for fast depth estimation. """ + @classmethod def get_preprocessor_metadata(cls): return { @@ -29,11 +31,8 @@ def get_preprocessor_metadata(cls): }, "use_cases": ["High-performance depth estimation", "Real-time applications", "3D-aware generation"], } - def __init__(self, - engine_path: str = None, - detect_resolution: int = 518, - image_resolution: int = 512, - **kwargs): + + def __init__(self, engine_path: str = None, detect_resolution: int = 518, image_resolution: int = 512, **kwargs): """ Initialize TensorRT depth preprocessor @@ -50,10 +49,7 @@ def __init__(self, ) super().__init__( - engine_path=engine_path, - detect_resolution=detect_resolution, - image_resolution=image_resolution, - **kwargs + engine_path=engine_path, detect_resolution=detect_resolution, image_resolution=image_resolution, **kwargs ) self._engine = None @@ -62,7 +58,7 @@ def __init__(self, def engine(self): """Lazy loading of the TensorRT engine""" if self._engine is None: - engine_path = self.params.get('engine_path') + engine_path = self.params.get("engine_path") if engine_path is None: raise ValueError( "engine_path is required for TensorRT depth preprocessing. " @@ -85,16 +81,13 @@ def _process_core(self, image: Image.Image) -> Image.Image: """ Apply TensorRT depth estimation to the input image """ - detect_resolution = self.params.get('detect_resolution', 518) + detect_resolution = self.params.get("detect_resolution", 518) image_tensor = torch.from_numpy(np.array(image)).float() / 255.0 image_tensor = image_tensor.permute(2, 0, 1).unsqueeze(0) image_resized = F.interpolate( - image_tensor, - size=(detect_resolution, detect_resolution), - mode='bilinear', - align_corners=False + image_tensor, size=(detect_resolution, detect_resolution), mode="bilinear", align_corners=False ) if torch.cuda.is_available(): @@ -102,7 +95,7 @@ def _process_core(self, image: Image.Image) -> Image.Image: cuda_stream = torch.cuda.current_stream().cuda_stream result = self.engine.infer({"input": image_resized}, cuda_stream) - depth = result['output'] + depth = result["output"] depth = np.reshape(depth.cpu().numpy(), (detect_resolution, detect_resolution)) @@ -135,16 +128,15 @@ def _process_tensor_core(self, image_tensor: torch.Tensor) -> torch.Tensor: if not image_tensor.is_cuda: image_tensor = image_tensor.cuda() - detect_resolution = self.params.get('detect_resolution', 518) + detect_resolution = self.params.get("detect_resolution", 518) image_resized = torch.nn.functional.interpolate( - image_tensor, size=(detect_resolution, detect_resolution), - mode='bilinear', align_corners=False + image_tensor, size=(detect_resolution, detect_resolution), mode="bilinear", align_corners=False ) cuda_stream = torch.cuda.current_stream().cuda_stream result = self.engine.infer({"input": image_resized}, cuda_stream) - depth_tensor = result['output'] + depth_tensor = result["output"] depth_tensor = depth_tensor.squeeze() if depth_tensor.dim() > 2 else depth_tensor diff --git a/src/streamdiffusion/preprocessing/processors/faceid_embedding.py b/src/streamdiffusion/preprocessing/processors/faceid_embedding.py index 31bb042ae..1629a2e92 100644 --- a/src/streamdiffusion/preprocessing/processors/faceid_embedding.py +++ b/src/streamdiffusion/preprocessing/processors/faceid_embedding.py @@ -75,7 +75,7 @@ def _process_core(self, image: Image.Image) -> Tuple[torch.Tensor, torch.Tensor] except Exception as e: msg = f"FaceIDEmbeddingPreprocessor: Failed to extract face embeddings: {e}" report_error(msg) - raise RuntimeError(msg) + raise RuntimeError(msg) from e def update_faceid_v2_weight(self, weight: float) -> None: self.faceid_v2_weight = float(weight) diff --git a/src/streamdiffusion/preprocessing/processors/feedback.py b/src/streamdiffusion/preprocessing/processors/feedback.py index 01461b703..fac7e56e6 100644 --- a/src/streamdiffusion/preprocessing/processors/feedback.py +++ b/src/streamdiffusion/preprocessing/processors/feedback.py @@ -1,31 +1,32 @@ +from typing import Any + import torch from PIL import Image -from typing import Union, Optional, Any + from .base import PipelineAwareProcessor class FeedbackPreprocessor(PipelineAwareProcessor): """ Feedback preprocessor for ControlNet - + Creates a configurable blend between the current input image and the previous frame's diffusion output. This creates a feedback loop where each generated frame influences the next generation, while allowing control over the blend strength for stability and creative effects. - + Formula: output = (1 - feedback_strength) * input_image + feedback_strength * previous_output - + Examples: - feedback_strength = 0.0: Pure passthrough (input only) - feedback_strength = 0.5: 50/50 blend (default) - feedback_strength = 1.0: Pure feedback (previous output only) - + The preprocessor accesses the pipeline's prev_image_result to get the previous output. For the first frame (when no previous output exists), it falls back to the input image. """ gpu_native = True # _process_tensor_core blends tensors on GPU — no CPU/PIL round-trip - @classmethod def get_preprocessor_metadata(cls): return { @@ -37,21 +38,29 @@ def get_preprocessor_metadata(cls): "default": 0.5, "range": [0.0, 1.0], "step": 0.01, - "description": "Strength of feedback blend (0.0 = pure input, 1.0 = pure feedback)" + "description": "Strength of feedback blend (0.0 = pure input, 1.0 = pure feedback)", } }, - "use_cases": ["Temporal consistency", "Video-like generation", "Smooth transitions", "Deforum", "Blast off"] + "use_cases": [ + "Temporal consistency", + "Video-like generation", + "Smooth transitions", + "Deforum", + "Blast off", + ], } - - def __init__(self, - pipeline_ref: Any, - normalization_context: str = 'controlnet', - image_resolution: int = 512, - feedback_strength: float = 0.5, - **kwargs): + + def __init__( + self, + pipeline_ref: Any, + normalization_context: str = "controlnet", + image_resolution: int = 512, + feedback_strength: float = 0.5, + **kwargs, + ): """ Initialize feedback preprocessor - + Args: pipeline_ref: Reference to the StreamDiffusion pipeline instance (required) normalization_context: Context for normalization handling @@ -64,41 +73,42 @@ def __init__(self, normalization_context=normalization_context, image_resolution=image_resolution, feedback_strength=feedback_strength, - **kwargs + **kwargs, ) self.feedback_strength = max(0.0, min(1.0, feedback_strength)) # Clamp to [0, 1] self._first_frame = True - + def reset(self): """Reset the processor state (useful for new sequences)""" self._first_frame = True - + def _process_core(self, image: Image.Image) -> Image.Image: """ Process using configurable blend of input image + previous frame output - + Args: image: Current input image - + Returns: Blended PIL Image (blend strength controlled by feedback_strength), or input image for first frame """ # Check if we have a pipeline reference and previous output - if (self.pipeline_ref is not None and - hasattr(self.pipeline_ref, 'prev_image_result') and - self.pipeline_ref.prev_image_result is not None and - not self._first_frame): - + if ( + self.pipeline_ref is not None + and hasattr(self.pipeline_ref, "prev_image_result") + and self.pipeline_ref.prev_image_result is not None + and not self._first_frame + ): prev_output_tensor = self.pipeline_ref.prev_image_result # Convert previous output tensor to PIL Image if prev_output_tensor.dim() == 4: prev_output_tensor = prev_output_tensor[0] # Remove batch dimension - + # Context-aware normalization handling - if self.normalization_context == 'controlnet': + if self.normalization_context == "controlnet": # ControlNet context: Convert from [-1, 1] (VAE output) to [0, 1] (ControlNet input) prev_output_tensor = (prev_output_tensor / 2.0 + 0.5).clamp(0, 1) - elif self.normalization_context == 'pipeline': + elif self.normalization_context == "pipeline": # Pipeline context: prev_output is already [-1, 1], but pil_to_tensor produces [0, 1] # So we need to convert input to [-1, 1] to match prev_output # Convert prev_output to [0, 1] for blending in standard image space @@ -106,15 +116,15 @@ def _process_core(self, image: Image.Image) -> Image.Image: else: # Unknown context - assume controlnet for backward compatibility prev_output_tensor = (prev_output_tensor / 2.0 + 0.5).clamp(0, 1) - + # Convert both to tensors for blending prev_output_pil = self.tensor_to_pil(prev_output_tensor) input_tensor = self.pil_to_tensor(image).squeeze(0) # Remove batch dim for blending prev_tensor = self.pil_to_tensor(prev_output_pil).squeeze(0) - + # Blend with configurable strength (both tensors now in [0, 1] range) blended_tensor = (1 - self.feedback_strength) * input_tensor + self.feedback_strength * prev_tensor - + # Convert back to PIL blended_pil = self.tensor_to_pil(blended_tensor) return blended_pil @@ -122,35 +132,36 @@ def _process_core(self, image: Image.Image) -> Image.Image: # First frame, no pipeline ref, or no previous output available - use input image self._first_frame = False return image - + def _process_tensor_core(self, tensor: torch.Tensor) -> torch.Tensor: """ Process using configurable blend of input tensor + previous frame output (GPU-optimized path) - + Args: tensor: Current input tensor - + Returns: Blended tensor (blend strength controlled by feedback_strength), or input tensor for first frame """ # Check if we have a pipeline reference and previous output - if (self.pipeline_ref is not None and - hasattr(self.pipeline_ref, 'prev_image_result') and - self.pipeline_ref.prev_image_result is not None and - not self._first_frame): - + if ( + self.pipeline_ref is not None + and hasattr(self.pipeline_ref, "prev_image_result") + and self.pipeline_ref.prev_image_result is not None + and not self._first_frame + ): prev_output = self.pipeline_ref.prev_image_result input_tensor = tensor - + # Context-aware normalization handling - if self.normalization_context == 'controlnet': + if self.normalization_context == "controlnet": # ControlNet context: prev_output is [-1, 1] from VAE, input is [0, 1] # Convert prev_output from [-1, 1] to [0, 1] to match input prev_output = (prev_output / 2.0 + 0.5).clamp(0, 1) # Normalize input tensor to [0, 1] if needed if input_tensor.max() > 1.0: input_tensor = input_tensor / 255.0 - elif self.normalization_context == 'pipeline': + elif self.normalization_context == "pipeline": # Pipeline context: both prev_output and input_tensor are in [-1, 1] range # - prev_output comes from VAE decode (always [-1, 1]) # - input_tensor arrives as [-1, 1] from image_processor.preprocess() @@ -160,17 +171,20 @@ def _process_tensor_core(self, tensor: torch.Tensor) -> torch.Tensor: else: # Unknown context - log warning and assume controlnet behavior for backward compatibility import logging - logging.warning(f"FeedbackPreprocessor: Unknown normalization_context '{self.normalization_context}', using controlnet behavior") + + logging.warning( + f"FeedbackPreprocessor: Unknown normalization_context '{self.normalization_context}', using controlnet behavior" + ) prev_output = (prev_output / 2.0 + 0.5).clamp(0, 1) if input_tensor.max() > 1.0: input_tensor = input_tensor / 255.0 - + # Ensure both tensors have same format for blending if prev_output.dim() == 4 and prev_output.shape[0] == 1: prev_output = prev_output[0] # Remove batch dimension if input_tensor.dim() == 4 and input_tensor.shape[0] == 1: input_tensor = input_tensor[0] # Remove batch dimension - + # Resize if dimensions don't match if prev_output.shape != input_tensor.shape: # Use the input tensor's shape as target @@ -179,18 +193,18 @@ def _process_tensor_core(self, tensor: torch.Tensor) -> torch.Tensor: if prev_output.dim() == 3: prev_output = prev_output.unsqueeze(0) prev_output = torch.nn.functional.interpolate( - prev_output, size=target_size, mode='bilinear', align_corners=False + prev_output, size=target_size, mode="bilinear", align_corners=False ) if prev_output.shape[0] == 1: prev_output = prev_output.squeeze(0) - + # Blend with configurable strength blended_tensor = (1 - self.feedback_strength) * input_tensor + self.feedback_strength * prev_output - + # Ensure correct output format if blended_tensor.dim() == 3: blended_tensor = blended_tensor.unsqueeze(0) # Add batch dimension back - + # Ensure correct device and dtype blended_tensor = blended_tensor.to(device=self.device, dtype=self.dtype) return blended_tensor diff --git a/src/streamdiffusion/preprocessing/processors/hed.py b/src/streamdiffusion/preprocessing/processors/hed.py index db32f6282..bef030edc 100644 --- a/src/streamdiffusion/preprocessing/processors/hed.py +++ b/src/streamdiffusion/preprocessing/processors/hed.py @@ -1,11 +1,12 @@ -import torch import numpy as np +import torch from PIL import Image from .base import BasePreprocessor, _base_logger, _pil_fallback_warned try: from controlnet_aux import HEDdetector + CONTROLNET_AUX_AVAILABLE = True except ImportError: CONTROLNET_AUX_AVAILABLE = False @@ -15,79 +16,77 @@ class HEDPreprocessor(BasePreprocessor): """ HED (Holistically-Nested Edge Detection) preprocessor - + Uses controlnet_aux HEDdetector for high-quality edge detection. """ - + _model_cache = {} - + @classmethod def get_preprocessor_metadata(cls): return { "display_name": "HED Edge Detection", "description": "Holistically-Nested Edge Detection for clean, structured edge maps.", "parameters": { - "safe": { - "type": "bool", - "default": True, - "description": "Whether to use safe mode for edge detection" - } + "safe": {"type": "bool", "default": True, "description": "Whether to use safe mode for edge detection"} }, - "use_cases": ["Structured edge detection", "Clean architectural edges", "Line art generation"] + "use_cases": ["Structured edge detection", "Clean architectural edges", "Line art generation"], } - + def __init__(self, safe: bool = True, **kwargs): if not CONTROLNET_AUX_AVAILABLE: - raise ImportError("controlnet_aux is required for HED preprocessor. Install with: pip install controlnet_aux") - + raise ImportError( + "controlnet_aux is required for HED preprocessor. Install with: pip install controlnet_aux" + ) + super().__init__(**kwargs) self.safe = safe self.model = None self._load_model() - + def _load_model(self): """Load controlnet_aux HED model with caching""" cache_key = f"hed_{self.device}" - + if cache_key in self._model_cache: self.model = self._model_cache[cache_key] return - + print("HEDPreprocessor: Loading controlnet_aux HED model") try: # Initialize HED detector self.model = HEDdetector.from_pretrained("lllyasviel/Annotators") - if hasattr(self.model, 'to'): + if hasattr(self.model, "to"): self.model = self.model.to(self.device) - + # Cache the model self._model_cache[cache_key] = self.model print(f"HEDPreprocessor: Successfully loaded model on {self.device}") - + except Exception as e: raise RuntimeError(f"Failed to load HED model: {e}") from e - + def _process_core(self, image: Image.Image) -> Image.Image: """Apply HED edge detection to the input image""" # Get target dimensions target_width, target_height = self.get_target_dimensions() - + # Process with controlnet_aux result = self.model(image, output_type="pil") - + # Ensure result is PIL Image if not isinstance(result, Image.Image): if isinstance(result, np.ndarray): result = Image.fromarray(result) else: raise ValueError(f"Unexpected result type: {type(result)}") - + # Resize to target size if needed if result.size != (target_width, target_height): result = result.resize((target_width, target_height), Image.LANCZOS) - + return result - + def _process_tensor_core(self, image_tensor: torch.Tensor) -> torch.Tensor: """ HED processing via tensor I/O. @@ -108,24 +107,18 @@ def _process_tensor_core(self, image_tensor: torch.Tensor) -> torch.Tensor: pil_image = self.tensor_to_pil(image_tensor) processed_pil = self._process_core(pil_image) return self.pil_to_tensor(processed_pil) - - + @classmethod - def create_optimized(cls, device: str = 'cuda', dtype: torch.dtype = torch.float16, **kwargs): + def create_optimized(cls, device: str = "cuda", dtype: torch.dtype = torch.float16, **kwargs): """ Create an optimized HED preprocessor - + Args: device: Target device ('cuda' or 'cpu') dtype: Data type for inference **kwargs: Additional parameters - + Returns: Optimized HEDPreprocessor instance """ - return cls( - device=device, - dtype=dtype, - safe=True, - **kwargs - ) \ No newline at end of file + return cls(device=device, dtype=dtype, safe=True, **kwargs) diff --git a/src/streamdiffusion/preprocessing/processors/hed_tensorrt.py b/src/streamdiffusion/preprocessing/processors/hed_tensorrt.py index 783921ea2..f572aabec 100644 --- a/src/streamdiffusion/preprocessing/processors/hed_tensorrt.py +++ b/src/streamdiffusion/preprocessing/processors/hed_tensorrt.py @@ -16,7 +16,6 @@ from .trt_base import SelfBuildingTRTPreprocessor, _first_output - logger = logging.getLogger(__name__) try: diff --git a/src/streamdiffusion/preprocessing/processors/ipadapter_embedding.py b/src/streamdiffusion/preprocessing/processors/ipadapter_embedding.py index 896d11e5e..cb2106c17 100644 --- a/src/streamdiffusion/preprocessing/processors/ipadapter_embedding.py +++ b/src/streamdiffusion/preprocessing/processors/ipadapter_embedding.py @@ -2,32 +2,34 @@ import torch from PIL import Image -from .base import BasePreprocessor + from streamdiffusion.tools.gpu_profiler import profiler +from .base import BasePreprocessor + class IPAdapterEmbeddingPreprocessor(BasePreprocessor): """ Preprocessor that generates IPAdapter embeddings instead of spatial conditioning. Leverages existing preprocessing infrastructure for parallel IPAdapter embedding generation. """ - + @classmethod def get_preprocessor_metadata(cls): return { "display_name": "IPAdapter Embedding", "description": "Generates IPAdapter embeddings for style transfer and image conditioning instead of spatial control maps.", "parameters": {}, - "use_cases": ["Style transfer", "Image conditioning", "Semantic control", "Content-aware generation"] + "use_cases": ["Style transfer", "Image conditioning", "Semantic control", "Content-aware generation"], } - + def __init__(self, ipadapter: Any, **kwargs): super().__init__(**kwargs) self.ipadapter = ipadapter # Verify the ipadapter has the required method - if not hasattr(ipadapter, 'get_image_embeds'): + if not hasattr(ipadapter, "get_image_embeds"): raise ValueError("IPAdapterEmbeddingPreprocessor: ipadapter must have 'get_image_embeds' method") - + # Create dedicated CUDA stream for IPAdapter processing to avoid TensorRT conflicts self._ipadapter_stream = torch.cuda.Stream() if torch.cuda.is_available() else None # CUDA event for GPU-side stream sync — CPU thread NOT blocked (vs .synchronize()). @@ -40,7 +42,6 @@ def __init__(self, ipadapter: Any, **kwargs): self._last_input_ptr: int = -1 self._cached_embeds: Optional[Tuple[torch.Tensor, torch.Tensor]] = None - def _process_core(self, image: Image.Image) -> Tuple[torch.Tensor, torch.Tensor]: """Returns (positive_embeds, negative_embeds) instead of processed image""" if self._ipadapter_stream is not None: @@ -64,16 +65,15 @@ def _process_core(self, image: Image.Image) -> Tuple[torch.Tensor, torch.Tensor] # Mark tensors as owned by the default stream (cross-stream memory safety) if hasattr(image_embeds, "record_stream"): image_embeds.record_stream(torch.cuda.current_stream()) - if hasattr(negative_embeds, 'record_stream'): + if hasattr(negative_embeds, "record_stream"): negative_embeds.record_stream(torch.cuda.current_stream()) else: # Fallback for non-CUDA environments with profiler.region("ipa.clip_encode"): image_embeds, negative_embeds = self.ipadapter.get_image_embeds(images=[image]) - return image_embeds, negative_embeds - + def _process_tensor_core(self, tensor: torch.Tensor) -> Tuple[torch.Tensor, torch.Tensor]: """GPU-optimized path for tensor inputs. @@ -96,7 +96,6 @@ def _process_tensor_core(self, tensor: torch.Tensor) -> Tuple[torch.Tensor, torc self._cached_embeds = result return result - def process(self, image: Union[Image.Image, torch.Tensor]) -> Tuple[torch.Tensor, torch.Tensor]: """Override base process to return embeddings tuple instead of PIL Image""" if isinstance(image, torch.Tensor): @@ -104,9 +103,9 @@ def process(self, image: Union[Image.Image, torch.Tensor]) -> Tuple[torch.Tensor else: image = self.validate_input(image) result = self._process_core(image) - + return result - + def process_tensor(self, image_tensor: torch.Tensor) -> Tuple[torch.Tensor, torch.Tensor]: """Override base process_tensor to return embeddings tuple""" tensor = self.validate_tensor_input(image_tensor) diff --git a/src/streamdiffusion/preprocessing/processors/lineart.py b/src/streamdiffusion/preprocessing/processors/lineart.py index 030043c4d..01ffe3ec0 100644 --- a/src/streamdiffusion/preprocessing/processors/lineart.py +++ b/src/streamdiffusion/preprocessing/processors/lineart.py @@ -5,7 +5,6 @@ from .base import BasePreprocessor - logger = logging.getLogger(__name__) try: @@ -16,7 +15,7 @@ CONTROLNET_AUX_AVAILABLE = False raise ImportError( "LineartPreprocessor: controlnet_aux is required for real-time optimization. Install with: pip install controlnet_aux" - ) + ) from None # TODO provide gpu native lineart detection diff --git a/src/streamdiffusion/preprocessing/processors/mediapipe_pose.py b/src/streamdiffusion/preprocessing/processors/mediapipe_pose.py index 3d7c72093..f6984998d 100644 --- a/src/streamdiffusion/preprocessing/processors/mediapipe_pose.py +++ b/src/streamdiffusion/preprocessing/processors/mediapipe_pose.py @@ -7,7 +7,6 @@ from .base import BasePreprocessor - try: import mediapipe as mp @@ -293,7 +292,7 @@ def detector(self): print("MediaPipePosePreprocessor.detector: GPU delegate available") except Exception as gpu_error: print(f"MediaPipePosePreprocessor.detector: GPU delegate failed ({gpu_error}), using CPU") - base_options = mp.tasks.BaseOptions(delegate=mp.tasks.BaseOptions.Delegate.CPU) + base_options = mp.tasks.BaseOptions(delegate=mp.tasks.BaseOptions.Delegate.CPU) # noqa: F841 # TODO: pre-existing, untouched by this refactor # Create detector with optimized settings print( @@ -398,7 +397,7 @@ def _mediapipe_to_openpose( # OPTIMIZATION: Vectorized mapping using advanced indexing # Only map valid indices that exist in landmarks_data - valid_mask = MEDIAPIPE_INDICES < len(landmarks_data) + valid_mask = len(landmarks_data) > MEDIAPIPE_INDICES valid_mp_indices = MEDIAPIPE_INDICES[valid_mask] valid_op_indices = OPENPOSE_INDICES[valid_mask] @@ -498,7 +497,7 @@ def _draw_hand_keypoints(self, image: np.ndarray, hand_landmarks: List, is_left_ return image h, w = image.shape[:2] - confidence_threshold = self.params.get("confidence_threshold", 0.3) + confidence_threshold = self.params.get("confidence_threshold", 0.3) # noqa: F841 # TODO: pre-existing, untouched by this refactor # Standard hand connections (21 landmarks per hand) hand_connections = [ diff --git a/src/streamdiffusion/preprocessing/processors/mediapipe_segmentation.py b/src/streamdiffusion/preprocessing/processors/mediapipe_segmentation.py index 0f4893f23..64ef04706 100644 --- a/src/streamdiffusion/preprocessing/processors/mediapipe_segmentation.py +++ b/src/streamdiffusion/preprocessing/processors/mediapipe_segmentation.py @@ -7,7 +7,6 @@ from .base import BasePreprocessor - try: import mediapipe as mp diff --git a/src/streamdiffusion/preprocessing/processors/normal_bae_tensorrt.py b/src/streamdiffusion/preprocessing/processors/normal_bae_tensorrt.py index 7558da481..ebb0577dc 100644 --- a/src/streamdiffusion/preprocessing/processors/normal_bae_tensorrt.py +++ b/src/streamdiffusion/preprocessing/processors/normal_bae_tensorrt.py @@ -34,7 +34,6 @@ from .base import BasePreprocessor from .trt_base import TENSORRT_AVAILABLE, SelfBuildingTRTPreprocessor, _first_output - logger = logging.getLogger(__name__) try: diff --git a/src/streamdiffusion/preprocessing/processors/openpose.py b/src/streamdiffusion/preprocessing/processors/openpose.py index 53ac8afe2..d489c2ddb 100644 --- a/src/streamdiffusion/preprocessing/processors/openpose.py +++ b/src/streamdiffusion/preprocessing/processors/openpose.py @@ -2,9 +2,8 @@ from .base import BasePreprocessor - try: - import cv2 + import cv2 # noqa: F401 # TODO: pre-existing, untouched by this refactor OPENCV_AVAILABLE = True except ImportError: @@ -148,7 +147,7 @@ def _process_core(self, image: Image.Image) -> Image.Image: include_hands = self.params.get("include_hands", False) include_face = self.params.get("include_face", False) - if CONTROLNET_AUX_AVAILABLE and hasattr(self.detector, "__call__"): + if CONTROLNET_AUX_AVAILABLE and callable(self.detector): try: pose_image = self.detector(image_resized, hand_and_face=include_hands or include_face) except Exception as e: diff --git a/src/streamdiffusion/preprocessing/processors/passthrough.py b/src/streamdiffusion/preprocessing/processors/passthrough.py index 5fd9e8d90..cd128f4cb 100644 --- a/src/streamdiffusion/preprocessing/processors/passthrough.py +++ b/src/streamdiffusion/preprocessing/processors/passthrough.py @@ -1,14 +1,13 @@ -import numpy as np -from PIL import Image import torch -from typing import Union, Optional +from PIL import Image + from .base import BasePreprocessor class PassthroughPreprocessor(BasePreprocessor): """ Passthrough preprocessor for ControlNet - + Simply passes the input image through without any processing. Useful for ControlNets that expect the raw input image, such as: - Tile ControlNet @@ -18,7 +17,6 @@ class PassthroughPreprocessor(BasePreprocessor): gpu_native = True # _process_tensor_core is a no-op identity — no CPU/PIL round-trip - @classmethod def get_preprocessor_metadata(cls): return { @@ -36,30 +34,25 @@ def get_preprocessor_metadata(cls): "Image-to-image with structure preservation", ], } - - def __init__(self, - image_resolution: int = 512, - **kwargs): + + def __init__(self, image_resolution: int = 512, **kwargs): """ Initialize passthrough preprocessor - + Args: image_resolution: Output image resolution **kwargs: Additional parameters (ignored for passthrough) """ - super().__init__( - image_resolution=image_resolution, - **kwargs - ) - + super().__init__(image_resolution=image_resolution, **kwargs) + def _process_core(self, image: Image.Image) -> Image.Image: """ Pass through the input image with no processing """ return image - + def _process_tensor_core(self, tensor: torch.Tensor) -> torch.Tensor: """ Pass through tensor with no processing """ - return tensor \ No newline at end of file + return tensor diff --git a/src/streamdiffusion/preprocessing/processors/pose_tensorrt.py b/src/streamdiffusion/preprocessing/processors/pose_tensorrt.py index 1688a1131..d57d86f7f 100644 --- a/src/streamdiffusion/preprocessing/processors/pose_tensorrt.py +++ b/src/streamdiffusion/preprocessing/processors/pose_tensorrt.py @@ -1,12 +1,13 @@ -#NOTE: ported from https://github.com/yuvraj108c/ComfyUI-YoloNasPose-Tensorrt +# NOTE: ported from https://github.com/yuvraj108c/ComfyUI-YoloNasPose-Tensorrt import os + +import cv2 import numpy as np import torch import torch.nn.functional as F -import cv2 from PIL import Image -from typing import Union, Optional, List, Tuple + from .base import BasePreprocessor from .category_params import POSE_DRAW_PARAMS from .trt_base import TENSORRT_AVAILABLE, TensorRTEngine # shared engine wrapper @@ -89,20 +90,48 @@ def iterate_over_batch_predictions(predictions, batch_size): else: pred_scores = batch_scores[image_index, :num_detection_in_image] pred_boxes = batch_boxes[image_index, :num_detection_in_image] - pred_joints = batch_joints[image_index, :num_detection_in_image].reshape( - (num_detection_in_image, -1, 3)) + pred_joints = batch_joints[image_index, :num_detection_in_image].reshape((num_detection_in_image, -1, 3)) yield image_index, pred_boxes, pred_scores, pred_joints + # precompute edge links define skeleton connections (COCO format) -edge_links = [[0, 17], [13, 15], [14, 16], [12, 14], [12, 17], [5, 6], - [11, 13], [7, 9], [5, 7], [17, 11], [6, 8], [8, 10], - [1, 3], [0, 1], [0, 2], [2, 4]] +edge_links = [ + [0, 17], + [13, 15], + [14, 16], + [12, 14], + [12, 17], + [5, 6], + [11, 13], + [7, 9], + [5, 7], + [17, 11], + [6, 8], + [8, 10], + [1, 3], + [0, 1], + [0, 2], + [2, 4], +] edge_colors = [ - [255, 0, 0], [255, 85, 0], [170, 255, 0], [85, 255, 0], [85, 255, 0], - [85, 0, 255], [255, 170, 0], [0, 177, 58], [0, 179, 119], [179, 179, 0], - [0, 119, 179], [0, 179, 179], [119, 0, 179], [179, 0, 179], [178, 0, 118], [178, 0, 118] + [255, 0, 0], + [255, 85, 0], + [170, 255, 0], + [85, 255, 0], + [85, 255, 0], + [85, 0, 255], + [255, 170, 0], + [0, 177, 58], + [0, 179, 119], + [179, 179, 0], + [0, 119, 179], + [0, 179, 179], + [119, 0, 179], + [179, 0, 179], + [178, 0, 118], + [178, 0, 118], ] @@ -121,8 +150,7 @@ def show_predictions_from_batch_format( keypoint_radius: Keypoint dot radius in pixels. """ try: - image_index, pred_boxes, pred_scores, pred_joints = next( - iter(iterate_over_batch_predictions(predictions, 1))) + image_index, pred_boxes, pred_scores, pred_joints = next(iter(iterate_over_batch_predictions(predictions, 1))) except Exception as e: raise RuntimeError(f"show_predictions_from_batch_format: Error in iterate_over_batch_predictions: {e}") from e @@ -184,11 +212,7 @@ def get_preprocessor_metadata(cls): ], } - def __init__(self, - engine_path: str = None, - detect_resolution: int = 640, - image_resolution: int = 512, - **kwargs): + def __init__(self, engine_path: str = None, detect_resolution: int = 640, image_resolution: int = 512, **kwargs): """ Initialize TensorRT pose preprocessor @@ -205,10 +229,7 @@ def __init__(self, ) super().__init__( - engine_path=engine_path, - detect_resolution=detect_resolution, - image_resolution=image_resolution, - **kwargs + engine_path=engine_path, detect_resolution=detect_resolution, image_resolution=image_resolution, **kwargs ) self._engine = None @@ -219,7 +240,7 @@ def __init__(self, def engine(self): """Lazy loading of the TensorRT engine""" if self._engine is None: - engine_path = self.params.get('engine_path') + engine_path = self.params.get("engine_path") if engine_path is None: raise ValueError( "engine_path is required for TensorRT pose preprocessing. " @@ -240,16 +261,13 @@ def _process_core(self, image: Image.Image) -> Image.Image: """ Apply TensorRT pose estimation to the input image """ - detect_resolution = self.params.get('detect_resolution', 640) + detect_resolution = self.params.get("detect_resolution", 640) image_tensor = torch.from_numpy(np.array(image)).float() / 255.0 image_tensor = image_tensor.permute(2, 0, 1).unsqueeze(0) image_resized = F.interpolate( - image_tensor, - size=(detect_resolution, detect_resolution), - mode='bilinear', - align_corners=False + image_tensor, size=(detect_resolution, detect_resolution), mode="bilinear", align_corners=False ) image_resized_uint8 = (image_resized * 255.0).type(torch.uint8) @@ -293,11 +311,10 @@ def _process_tensor_core(self, image_tensor: torch.Tensor) -> torch.Tensor: if not image_tensor.is_cuda: image_tensor = image_tensor.cuda() - detect_resolution = self.params.get('detect_resolution', 640) + detect_resolution = self.params.get("detect_resolution", 640) image_resized = torch.nn.functional.interpolate( - image_tensor, size=(detect_resolution, detect_resolution), - mode='bilinear', align_corners=False + image_tensor, size=(detect_resolution, detect_resolution), mode="bilinear", align_corners=False ) image_resized_uint8 = (image_resized * 255.0).type(torch.uint8) diff --git a/src/streamdiffusion/preprocessing/processors/realesrgan_trt.py b/src/streamdiffusion/preprocessing/processors/realesrgan_trt.py index 151b5ca77..74514abcc 100644 --- a/src/streamdiffusion/preprocessing/processors/realesrgan_trt.py +++ b/src/streamdiffusion/preprocessing/processors/realesrgan_trt.py @@ -1,23 +1,24 @@ # NOTE: ported from https://github.com/yuvraj108c/ComfyUI-Upscaler-Tensorrt -import os -import torch +import logging +from collections import OrderedDict +from pathlib import Path +from typing import Tuple + import numpy as np -from PIL import Image -from typing import Optional, Tuple import requests +import torch +from PIL import Image from tqdm import tqdm -import hashlib -import logging -from pathlib import Path -from collections import OrderedDict -from .base import BasePreprocessor from streamdiffusion.tools.gpu_profiler import profiler +from .base import BasePreprocessor + # Try to import spandrel for model loading try: from spandrel import ModelLoader + SPANDREL_AVAILABLE = True except ImportError: SPANDREL_AVAILABLE = False @@ -25,9 +26,11 @@ # Try to import TensorRT dependencies try: import tensorrt as trt - from streamdiffusion.acceleration.tensorrt.utilities import engine_from_bytes, bytes_from_path + + from streamdiffusion.acceleration.tensorrt.utilities import bytes_from_path, engine_from_bytes + TRT_AVAILABLE = True - + # Numpy to PyTorch dtype mapping (same as depth_tensorrt.py) numpy_to_torch_dtype_dict = { np.uint8: torch.uint8, @@ -41,27 +44,28 @@ np.complex64: torch.complex64, np.complex128: torch.complex128, } - + # Handle bool type for numpy compatibility (same as depth_tensorrt.py) if np.version.full_version >= "1.24.0": numpy_to_torch_dtype_dict[np.bool_] = torch.bool else: numpy_to_torch_dtype_dict[np.bool] = torch.bool - + except ImportError: TRT_AVAILABLE = False class RealESRGANEngine: """TensorRT engine wrapper for RealESRGAN inference (following depth_tensorrt pattern)""" - + def __init__(self, engine_path): self.engine_path = engine_path self.engine = None self.context = None self.tensors = OrderedDict() - + import threading + self._inference_lock = threading.Lock() def load(self): @@ -80,13 +84,13 @@ def allocate_buffers(self, input_shape, device="cuda"): # Set input shape for dynamic sizing input_name = "input" self.context.set_input_shape(input_name, input_shape) - + # Allocate tensors for all bindings for idx in range(self.engine.num_io_tensors): name = self.engine.get_tensor_name(idx) shape = self.context.get_tensor_shape(name) dtype = trt.nptype(self.engine.get_tensor_dtype(name)) - + # Convert numpy dtype to torch dtype if dtype == np.float32: torch_dtype = torch.float32 @@ -94,7 +98,7 @@ def allocate_buffers(self, input_shape, device="cuda"): torch_dtype = torch.float16 else: torch_dtype = torch.float32 - + tensor = torch.empty(tuple(shape), dtype=torch_dtype, device=device) self.tensors[name] = tensor @@ -124,19 +128,20 @@ def infer(self, feed_dict, stream=None): if not success: raise RuntimeError("RealESRGANEngine: TensorRT inference failed") - return self.tensors + logger = logging.getLogger(__name__) + class RealESRGANProcessor(BasePreprocessor): """ RealESRGAN 2x upscaling processor with automatic model download, ONNX export, and TensorRT acceleration. """ - + MODEL_URL = "https://huggingface.co/ai-forever/Real-ESRGAN/resolve/main/RealESRGAN_x2.pth?download=true" - - @classmethod + + @classmethod def get_preprocessor_metadata(cls): return { "display_name": "RealESRGAN 2x", @@ -145,30 +150,30 @@ def get_preprocessor_metadata(cls): "enable_tensorrt": { "type": "bool", "default": True, - "description": "Use TensorRT acceleration for faster inference" + "description": "Use TensorRT acceleration for faster inference", }, "force_rebuild": { - "type": "bool", + "type": "bool", "default": False, - "description": "Force rebuild TensorRT engine even if it exists" - } + "description": "Force rebuild TensorRT engine even if it exists", + }, }, - "use_cases": ["High-quality upscaling", "Real-time 2x enlargement", "Image enhancement"] + "use_cases": ["High-quality upscaling", "Real-time 2x enlargement", "Image enhancement"], } - + def __init__(self, enable_tensorrt: bool = True, force_rebuild: bool = False, **kwargs): super().__init__(enable_tensorrt=enable_tensorrt, force_rebuild=force_rebuild, **kwargs) self.enable_tensorrt = enable_tensorrt and TRT_AVAILABLE self.force_rebuild = force_rebuild self.scale_factor = 2 # RealESRGAN 2x model - + # Model paths self.models_dir = Path("models") / "realesrgan" self.models_dir.mkdir(parents=True, exist_ok=True) self.model_path = self.models_dir / "RealESRGAN_x2.pth" self.onnx_path = self.models_dir / "RealESRGAN_x2.onnx" self.engine_path = self.models_dir / f"RealESRGAN_x2_{trt.__version__ if TRT_AVAILABLE else 'notrt'}.trt" - + # Model state self.pytorch_model = None self._engine = None # Lazy loading like depth processor @@ -176,6 +181,7 @@ def __init__(self, enable_tensorrt: bool = True, force_rebuild: bool = False, ** # Thread safety for engine initialization import threading + self._engine_lock = threading.Lock() @property @@ -184,35 +190,38 @@ def engine(self): if self._engine is None: if not self.engine_path.exists(): raise FileNotFoundError(f"TensorRT engine not found: {self.engine_path}") - + self._engine = RealESRGANEngine(str(self.engine_path)) self._engine.load() self._engine.activate() - + # Allocate buffers for standard input size (will be reallocated as needed) standard_shape = (1, 3, 512, 512) self._engine.allocate_buffers(standard_shape, device=self.device) - + return self._engine - + def _download_file(self, url: str, save_path: Path): """Download file with progress bar""" if save_path.exists(): return - + response = requests.get(url, stream=True) response.raise_for_status() - - total_size = int(response.headers.get('content-length', 0)) - - with open(save_path, 'wb') as file, tqdm( - desc=f"Downloading {save_path.name}", - total=total_size, - unit='iB', - unit_scale=True, - unit_divisor=1024, - colour='green' - ) as progress_bar: + + total_size = int(response.headers.get("content-length", 0)) + + with ( + open(save_path, "wb") as file, + tqdm( + desc=f"Downloading {save_path.name}", + total=total_size, + unit="iB", + unit_scale=True, + unit_divisor=1024, + colour="green", + ) as progress_bar, + ): for data in response.iter_content(chunk_size=1024): size = file.write(data) progress_bar.update(size) @@ -232,108 +241,108 @@ def _ensure_model_ready(self): # Download model if needed if not self.model_path.exists(): self._download_file(self.MODEL_URL, self.model_path) - + # Load PyTorch model if self.pytorch_model is None: self._load_pytorch_model() - + # Setup TensorRT if enabled if self.enable_tensorrt: self._setup_tensorrt() - + def _load_pytorch_model(self): """Load PyTorch model from file""" if not SPANDREL_AVAILABLE: # Fallback loading without spandrel - state_dict = torch.load(self.model_path, map_location=self.device) + state_dict = torch.load(self.model_path, map_location=self.device, weights_only=True) # noqa: F841 # TODO: pre-existing, untouched by this refactor # This is a simplified approach - real implementation would need model architecture return - + model_descriptor = ModelLoader().load_from_file(str(self.model_path)) # Don't force dtype conversion as it can cause type mismatches # Let the model keep its native dtype and convert inputs as needed self.pytorch_model = model_descriptor.model.eval().to(device=self.device) - model_dtype = next(self.pytorch_model.parameters()).dtype - + model_dtype = next(self.pytorch_model.parameters()).dtype # noqa: F841 # TODO: pre-existing, untouched by this refactor + def _export_to_onnx(self): """Export PyTorch model to ONNX format""" if self.onnx_path.exists() and not self.force_rebuild: return - + if self.pytorch_model is None: self._load_pytorch_model() - + if self.pytorch_model is None: return - + # Test with small input for export test_input = torch.randn(1, 3, 256, 256).to(self.device) - + dynamic_axes = { "input": {0: "batch_size", 2: "height", 3: "width"}, "output": {0: "batch_size", 2: "height", 3: "width"}, } - + with torch.no_grad(): torch.onnx.export( self.pytorch_model, test_input, str(self.onnx_path), verbose=False, - input_names=['input'], - output_names=['output'], + input_names=["input"], + output_names=["output"], opset_version=17, export_params=True, dynamic_axes=dynamic_axes, ) - + def _setup_tensorrt(self): """Setup TensorRT engine""" if not TRT_AVAILABLE: return - + # Export to ONNX first if needed if not self.onnx_path.exists(): self._export_to_onnx() - + # Build/load TensorRT engine self._load_tensorrt_engine() - + def _load_tensorrt_engine(self): """Load or build TensorRT engine""" if self.engine_path.exists() and not self.force_rebuild: self._load_existing_engine() else: self._build_tensorrt_engine() - + def _load_existing_engine(self): """Load existing TensorRT engine (now handled by lazy loading property)""" # Engine loading is now handled by the lazy loading 'engine' property # This method is kept for compatibility but does nothing pass - + def _build_tensorrt_engine(self): """Build TensorRT engine from ONNX model""" if not self.onnx_path.exists(): return - + try: # Create builder and network builder = trt.Builder(trt.Logger(trt.Logger.WARNING)) network = builder.create_network() # EXPLICIT_BATCH deprecated/ignored in TRT 10.x parser = trt.OnnxParser(network, trt.Logger(trt.Logger.WARNING)) - + # Parse ONNX model - with open(self.onnx_path, 'rb') as model: + with open(self.onnx_path, "rb") as model: if not parser.parse(model.read()): for error in range(parser.num_errors): pass return - + # Configure builder config = builder.create_builder_config() config.set_flag(trt.BuilderFlag.FP16) # Enable FP16 for better performance - + # Set optimization profile for dynamic shapes profile = builder.create_optimization_profile() min_shape = (1, 3, 256, 256) @@ -341,20 +350,20 @@ def _build_tensorrt_engine(self): max_shape = (1, 3, 1024, 1024) profile.set_shape("input", min_shape, opt_shape, max_shape) config.add_optimization_profile(profile) - + # Build engine engine = builder.build_serialized_network(network, config) - + if engine is None: return - + # Save engine - with open(self.engine_path, 'wb') as f: + with open(self.engine_path, "wb") as f: f.write(engine) - + # Load the built engine self._load_existing_engine() - + except Exception as e: logger.error(f"RealESRGAN TensorRT engine build failed: {e}") raise RuntimeError(f"RealESRGAN TensorRT engine build failed: {e}") from e @@ -363,54 +372,54 @@ def _process_with_tensorrt(self, tensor: torch.Tensor) -> torch.Tensor: """Process tensor using TensorRT engine (following depth_tensorrt pattern)""" batch_size, channels, height, width = tensor.shape input_shape = (batch_size, channels, height, width) - + # Ensure buffers are allocated for this input shape - if not hasattr(self.engine, 'tensors') or len(self.engine.tensors) == 0: + if not hasattr(self.engine, "tensors") or len(self.engine.tensors) == 0: self.engine.allocate_buffers(input_shape, device=self.device) else: # Check if we need to reallocate for different input shape input_tensor_shape = self.engine.tensors.get("input", torch.empty(0)).shape if input_tensor_shape != input_shape: self.engine.allocate_buffers(input_shape, device=self.device) - + # Prepare input tensor input_tensor = tensor.contiguous() if input_tensor.dtype != self.engine.tensors["input"].dtype: input_tensor = input_tensor.to(dtype=self.engine.tensors["input"].dtype) - + # Use engine inference with current stream context for proper synchronization cuda_stream = torch.cuda.current_stream().cuda_stream result = self.engine.infer({"input": input_tensor}, cuda_stream) - output_tensor = result['output'] - + output_tensor = result["output"] + # Ensure output is properly clamped to [0, 1] range for RealESRGAN output_tensor = torch.clamp(output_tensor, 0.0, 1.0) - + return output_tensor.clone() - + def _process_with_pytorch(self, tensor: torch.Tensor) -> torch.Tensor: """Process tensor using PyTorch model""" if self.pytorch_model is None: raise RuntimeError("_process_with_pytorch: PyTorch model not loaded") - + # Ensure model and input tensor have compatible dtypes model_dtype = next(self.pytorch_model.parameters()).dtype - original_dtype = tensor.dtype + original_dtype = tensor.dtype # noqa: F841 # TODO: pre-existing, untouched by this refactor if tensor.dtype != model_dtype: tensor = tensor.to(dtype=model_dtype) - + with torch.no_grad(): result = self.pytorch_model(tensor) - + # Ensure output is properly clamped to [0, 1] range for RealESRGAN result = torch.clamp(result, 0.0, 1.0) - + # Convert result to the desired output dtype (self.dtype) if result.dtype != self.dtype: result = result.to(dtype=self.dtype) - + return result - + def _process_core(self, image: Image.Image) -> Image.Image: """Core processing using PIL Image""" self._ensure_loaded_once() @@ -418,12 +427,12 @@ def _process_core(self, image: Image.Image) -> Image.Image: tensor = self.pil_to_tensor(image) if tensor.dim() == 3: tensor = tensor.unsqueeze(0) - + # Process with available backend if self.enable_tensorrt and TRT_AVAILABLE and self.engine_path.exists(): try: output_tensor = self._process_with_tensorrt(tensor) - except Exception as e: + except Exception: output_tensor = self._process_with_pytorch(tensor) elif self.pytorch_model is not None: output_tensor = self._process_with_pytorch(tensor) @@ -431,29 +440,29 @@ def _process_core(self, image: Image.Image) -> Image.Image: # Fallback to simple upscaling if no model is available target_width, target_height = self.get_target_dimensions() return image.resize((target_width, target_height), Image.LANCZOS) - + # Convert back to PIL if output_tensor.dim() == 4: output_tensor = output_tensor.squeeze(0) - + result_image = self.tensor_to_pil(output_tensor) - + return result_image - + def _ensure_target_size(self, image: Image.Image) -> Image.Image: """ Override base class method - for upscaling, we want to keep the upscaled size Don't resize back to original dimensions """ return image - + def _ensure_target_size_tensor(self, tensor: torch.Tensor) -> torch.Tensor: """ Override base class method - for upscaling, we want to keep the upscaled size Don't resize back to original dimensions """ return tensor - + def _process_tensor_core(self, tensor: torch.Tensor) -> torch.Tensor: """Core tensor processing""" self._ensure_loaded_once() @@ -462,49 +471,46 @@ def _process_tensor_core(self, tensor: torch.Tensor) -> torch.Tensor: squeeze_output = True else: squeeze_output = False - + # Process with available backend if self.enable_tensorrt and TRT_AVAILABLE and self.engine_path.exists(): try: output_tensor = self._process_with_tensorrt(tensor) - except Exception as e: + except Exception: output_tensor = self._process_with_pytorch(tensor) elif self.pytorch_model is not None: output_tensor = self._process_with_pytorch(tensor) else: # Fallback using interpolation output_tensor = torch.nn.functional.interpolate( - tensor, - scale_factor=self.scale_factor, - mode='bicubic', - align_corners=False + tensor, scale_factor=self.scale_factor, mode="bicubic", align_corners=False ) - + if squeeze_output: output_tensor = output_tensor.squeeze(0) - + return output_tensor - + def get_target_dimensions(self) -> Tuple[int, int]: """Get target output dimensions (width, height) - 2x upscaled""" - width = self.params.get('image_width') - height = self.params.get('image_height') - + width = self.params.get("image_width") + height = self.params.get("image_height") + if width is not None and height is not None: target_dims = (width * self.scale_factor, height * self.scale_factor) return target_dims - + # Fallback to square resolution - resolution = self.params.get('image_resolution', 512) + resolution = self.params.get("image_resolution", 512) target_resolution = resolution * self.scale_factor target_dims = (target_resolution, target_resolution) return target_dims - + def __del__(self): """Cleanup resources""" - if hasattr(self, '_engine') and self._engine is not None: + if hasattr(self, "_engine") and self._engine is not None: # Cleanup dedicated stream if it exists - if hasattr(self._engine, '_dedicated_stream'): + if hasattr(self._engine, "_dedicated_stream"): torch.cuda.synchronize() del self._engine._dedicated_stream del self._engine diff --git a/src/streamdiffusion/preprocessing/processors/scribble_tensorrt.py b/src/streamdiffusion/preprocessing/processors/scribble_tensorrt.py index 1a4774a11..2371bdfca 100644 --- a/src/streamdiffusion/preprocessing/processors/scribble_tensorrt.py +++ b/src/streamdiffusion/preprocessing/processors/scribble_tensorrt.py @@ -19,7 +19,6 @@ from .hed_tensorrt import HEDTensorrtPreprocessor from .trt_base import _first_output - logger = logging.getLogger(__name__) diff --git a/src/streamdiffusion/preprocessing/processors/soft_edge.py b/src/streamdiffusion/preprocessing/processors/soft_edge.py index 63db56adb..a7aa5de7d 100644 --- a/src/streamdiffusion/preprocessing/processors/soft_edge.py +++ b/src/streamdiffusion/preprocessing/processors/soft_edge.py @@ -1,9 +1,7 @@ import torch import torch.nn as nn -import torch.nn.functional as F -import numpy as np from PIL import Image -from typing import Union, Optional + from .base import BasePreprocessor @@ -12,95 +10,100 @@ class MultiScaleSobelOperator(nn.Module): Real-time multi-scale Sobel edge detector optimized for soft HED-like edges Based on the existing SobelOperator but enhanced for soft edge detection """ - + def __init__(self, device="cuda", dtype=torch.float16): super(MultiScaleSobelOperator, self).__init__() self.device = device self.dtype = dtype - + # Multi-scale edge detection (3 scales) self.edge_conv_x_1 = nn.Conv2d(1, 1, kernel_size=3, padding=1, bias=False).to(device) self.edge_conv_y_1 = nn.Conv2d(1, 1, kernel_size=3, padding=1, bias=False).to(device) - + self.edge_conv_x_2 = nn.Conv2d(1, 1, kernel_size=5, padding=2, bias=False).to(device) self.edge_conv_y_2 = nn.Conv2d(1, 1, kernel_size=5, padding=2, bias=False).to(device) - + self.edge_conv_x_3 = nn.Conv2d(1, 1, kernel_size=7, padding=3, bias=False).to(device) self.edge_conv_y_3 = nn.Conv2d(1, 1, kernel_size=7, padding=3, bias=False).to(device) - + # Gaussian blur for soft edges self.blur = nn.Conv2d(1, 1, kernel_size=5, padding=2, bias=False).to(device) - + self._setup_kernels() - + def _setup_kernels(self): """Setup Sobel kernels for different scales""" # Scale 1: Standard 3x3 Sobel - sobel_x_3 = torch.tensor([ - [-1.0, 0.0, 1.0], - [-2.0, 0.0, 2.0], - [-1.0, 0.0, 1.0] - ], device=self.device, dtype=self.dtype) - - sobel_y_3 = torch.tensor([ - [-1.0, -2.0, -1.0], - [0.0, 0.0, 0.0], - [1.0, 2.0, 1.0] - ], device=self.device, dtype=self.dtype) - + sobel_x_3 = torch.tensor( + [[-1.0, 0.0, 1.0], [-2.0, 0.0, 2.0], [-1.0, 0.0, 1.0]], device=self.device, dtype=self.dtype + ) + + sobel_y_3 = torch.tensor( + [[-1.0, -2.0, -1.0], [0.0, 0.0, 0.0], [1.0, 2.0, 1.0]], device=self.device, dtype=self.dtype + ) + # Scale 2: 5x5 Sobel - sobel_x_5 = torch.tensor([ - [-1, -2, 0, 2, 1], - [-2, -3, 0, 3, 2], - [-3, -5, 0, 5, 3], - [-2, -3, 0, 3, 2], - [-1, -2, 0, 2, 1] - ], device=self.device, dtype=self.dtype) / 16.0 - + sobel_x_5 = ( + torch.tensor( + [[-1, -2, 0, 2, 1], [-2, -3, 0, 3, 2], [-3, -5, 0, 5, 3], [-2, -3, 0, 3, 2], [-1, -2, 0, 2, 1]], + device=self.device, + dtype=self.dtype, + ) + / 16.0 + ) + sobel_y_5 = sobel_x_5.T - + # Scale 3: 7x7 Sobel (smoothed) - sobel_x_7 = torch.tensor([ - [-1, -2, -3, 0, 3, 2, 1], - [-2, -3, -4, 0, 4, 3, 2], - [-3, -4, -5, 0, 5, 4, 3], - [-4, -5, -6, 0, 6, 5, 4], - [-3, -4, -5, 0, 5, 4, 3], - [-2, -3, -4, 0, 4, 3, 2], - [-1, -2, -3, 0, 3, 2, 1] - ], device=self.device, dtype=self.dtype) / 32.0 - + sobel_x_7 = ( + torch.tensor( + [ + [-1, -2, -3, 0, 3, 2, 1], + [-2, -3, -4, 0, 4, 3, 2], + [-3, -4, -5, 0, 5, 4, 3], + [-4, -5, -6, 0, 6, 5, 4], + [-3, -4, -5, 0, 5, 4, 3], + [-2, -3, -4, 0, 4, 3, 2], + [-1, -2, -3, 0, 3, 2, 1], + ], + device=self.device, + dtype=self.dtype, + ) + / 32.0 + ) + sobel_y_7 = sobel_x_7.T - + # Gaussian kernel for smoothing - gaussian_5 = torch.tensor([ - [1, 4, 6, 4, 1], - [4, 16, 24, 16, 4], - [6, 24, 36, 24, 6], - [4, 16, 24, 16, 4], - [1, 4, 6, 4, 1] - ], device=self.device, dtype=self.dtype) / 256.0 - + gaussian_5 = ( + torch.tensor( + [[1, 4, 6, 4, 1], [4, 16, 24, 16, 4], [6, 24, 36, 24, 6], [4, 16, 24, 16, 4], [1, 4, 6, 4, 1]], + device=self.device, + dtype=self.dtype, + ) + / 256.0 + ) + # Set kernel weights self.edge_conv_x_1.weight = nn.Parameter(sobel_x_3.view(1, 1, 3, 3)) self.edge_conv_y_1.weight = nn.Parameter(sobel_y_3.view(1, 1, 3, 3)) - + self.edge_conv_x_2.weight = nn.Parameter(sobel_x_5.view(1, 1, 5, 5)) self.edge_conv_y_2.weight = nn.Parameter(sobel_y_5.view(1, 1, 5, 5)) - + self.edge_conv_x_3.weight = nn.Parameter(sobel_x_7.view(1, 1, 7, 7)) self.edge_conv_y_3.weight = nn.Parameter(sobel_y_7.view(1, 1, 7, 7)) - + self.blur.weight = nn.Parameter(gaussian_5.view(1, 1, 5, 5)) @torch.no_grad() def forward(self, image_tensor: torch.Tensor) -> torch.Tensor: """ Fast multi-scale soft edge detection - + Args: image_tensor: Input tensor [B, C, H, W] or [C, H, W] - + Returns: Soft edge map tensor [B, 1, H, W] or [1, H, W] """ @@ -109,109 +112,109 @@ def forward(self, image_tensor: torch.Tensor) -> torch.Tensor: if image_tensor.dim() == 3: image_tensor = image_tensor.unsqueeze(0) squeeze_output = True - + # Convert to grayscale if needed if image_tensor.shape[1] == 3: # RGB to grayscale gray = 0.299 * image_tensor[:, 0:1] + 0.587 * image_tensor[:, 1:2] + 0.114 * image_tensor[:, 2:3] else: gray = image_tensor[:, 0:1] - + # Multi-scale edge detection # Scale 1 (fine details) edge_x1 = self.edge_conv_x_1(gray) edge_y1 = self.edge_conv_y_1(gray) edge1 = torch.sqrt(edge_x1**2 + edge_y1**2) - + # Scale 2 (medium details) edge_x2 = self.edge_conv_x_2(gray) edge_y2 = self.edge_conv_y_2(gray) edge2 = torch.sqrt(edge_x2**2 + edge_y2**2) - + # Scale 3 (coarse details) edge_x3 = self.edge_conv_x_3(gray) edge_y3 = self.edge_conv_y_3(gray) edge3 = torch.sqrt(edge_x3**2 + edge_y3**2) - + # Combine scales with weights (like HED side outputs) combined_edge = 0.5 * edge1 + 0.3 * edge2 + 0.2 * edge3 - + # Apply Gaussian smoothing for soft edges soft_edge = self.blur(combined_edge) - + # Normalize to [0, 1] range soft_edge = soft_edge / (soft_edge.max() + 1e-8) - + # Apply soft sigmoid activation for smooth transitions soft_edge = torch.sigmoid(soft_edge * 6.0 - 3.0) # Soft S-curve - + if squeeze_output: soft_edge = soft_edge.squeeze(0) - + return soft_edge class SoftEdgePreprocessor(BasePreprocessor): """ Real-time soft edge detection preprocessor - HED alternative - + Uses multi-scale Sobel operations for extremely fast soft edge detection that mimics HED output quality at 50x+ the speed. """ gpu_native = True # _process_tensor_core uses torch ops under no_grad — no PIL round-trip _model_cache = {} - + @classmethod def get_preprocessor_metadata(cls): return { "display_name": "Soft Edge Detection", "description": "Real-time soft edge detection optimized for smooth, artistic edge maps using multi-scale Sobel operations.", "parameters": {}, - "use_cases": ["Artistic edge maps", "Soft stylistic control", "Real-time edge detection"] + "use_cases": ["Artistic edge maps", "Soft stylistic control", "Real-time edge detection"], } - + def __init__(self, **kwargs): """ Initialize soft edge preprocessor - + Args: **kwargs: Additional parameters """ super().__init__(**kwargs) self.model = None self._load_model() - + def _load_model(self): """ Load multi-scale Sobel operator with caching """ cache_key = f"soft_edge_{self.device}_{self.dtype}" - + if cache_key in self._model_cache: self.model = self._model_cache[cache_key] return - + print("SoftEdgePreprocessor: Loading real-time multi-scale edge detector") self.model = MultiScaleSobelOperator(device=self.device, dtype=self.dtype) self.model.eval() - + # Cache the model self._model_cache[cache_key] = self.model - + def _process_core(self, image: Image.Image) -> Image.Image: """ Apply soft edge detection to the input image """ # Convert PIL to tensor for GPU processing image_tensor = self.pil_to_tensor(image).squeeze(0) # Remove batch dim - + # Process with GPU-accelerated tensor method processed_tensor = self._process_tensor_core(image_tensor) - + # Convert back to PIL return self.tensor_to_pil(processed_tensor) - + def _process_tensor_core(self, image_tensor: torch.Tensor) -> torch.Tensor: """ GPU-optimized soft edge processing using tensors @@ -219,25 +222,25 @@ def _process_tensor_core(self, image_tensor: torch.Tensor) -> torch.Tensor: with torch.no_grad(): # Ensure correct input format and device image_tensor = image_tensor.to(device=self.device, dtype=self.dtype) - + # Normalize to [0, 1] if needed if image_tensor.max() > 1.0: image_tensor = image_tensor / 255.0 - + # Multi-scale edge detection edge_map = self.model(image_tensor) - + # Convert to 3-channel RGB format if edge_map.dim() == 3: edge_map = edge_map.repeat(3, 1, 1) else: edge_map = edge_map.repeat(1, 3, 1, 1).squeeze(0) - + # Ensure output is in [0, 1] range edge_map = torch.clamp(edge_map, 0.0, 1.0) - + return edge_map - + def get_model_info(self) -> dict: """ Get information about the loaded model @@ -249,24 +252,20 @@ def get_model_info(self) -> dict: "device": str(self.device), "dtype": str(self.dtype), "description": "Real-time multi-scale soft edge detection, HED quality at 50x+ speed", - "expected_fps": "100+ FPS at 512x512" + "expected_fps": "100+ FPS at 512x512", } - + @classmethod - def create_optimized(cls, device: str = 'cuda', dtype: torch.dtype = torch.float16, **kwargs): + def create_optimized(cls, device: str = "cuda", dtype: torch.dtype = torch.float16, **kwargs): """ Create an optimized soft edge preprocessor for real-time use - + Args: device: Target device ('cuda' or 'cpu') dtype: Data type for inference **kwargs: Additional parameters - + Returns: Optimized SoftEdgePreprocessor instance """ - return cls( - device=device, - dtype=dtype, - **kwargs - ) \ No newline at end of file + return cls(device=device, dtype=dtype, **kwargs) diff --git a/src/streamdiffusion/preprocessing/processors/standard_lineart.py b/src/streamdiffusion/preprocessing/processors/standard_lineart.py index ad2bdff1f..98b98cb83 100644 --- a/src/streamdiffusion/preprocessing/processors/standard_lineart.py +++ b/src/streamdiffusion/preprocessing/processors/standard_lineart.py @@ -1,17 +1,17 @@ -import numpy as np -import cv2 -from PIL import Image -from typing import Union, Optional import time -from .base import BasePreprocessor + +import numpy as np import torch import torch.nn.functional as F +from PIL import Image + +from .base import BasePreprocessor class StandardLineartPreprocessor(BasePreprocessor): """ Real-time optimized Standard Lineart detection preprocessor for ControlNet - + Extracts line art from input images using traditional computer vision techniques. Uses Gaussian blur and intensity calculations to detect lines without requiring pre-trained models. GPU-accelerated with PyTorch for optimal real-time performance. @@ -19,7 +19,6 @@ class StandardLineartPreprocessor(BasePreprocessor): gpu_native = True # _process_tensor_core uses torch ops — no CPU/PIL round-trip - @classmethod def get_preprocessor_metadata(cls): return { @@ -31,27 +30,29 @@ def get_preprocessor_metadata(cls): "default": 6.0, "range": [1.0, 20.0], "step": 0.1, - "description": "Standard deviation for Gaussian blur (higher = smoother lines)" + "description": "Standard deviation for Gaussian blur (higher = smoother lines)", }, "intensity_threshold": { "type": "int", "default": 8, "range": [1, 50], - "description": "Threshold for intensity calculation (lower = more sensitive)" - } + "description": "Threshold for intensity calculation (lower = more sensitive)", + }, }, - "use_cases": ["Traditional line art", "Simple edge detection", "No AI model required"] + "use_cases": ["Traditional line art", "Simple edge detection", "No AI model required"], } - - def __init__(self, - detect_resolution: int = 512, - image_resolution: int = 512, - gaussian_sigma: float = 6.0, - intensity_threshold: int = 8, - **kwargs): + + def __init__( + self, + detect_resolution: int = 512, + image_resolution: int = 512, + gaussian_sigma: float = 6.0, + intensity_threshold: int = 8, + **kwargs, + ): """ Initialize Standard Lineart preprocessor - + Args: detect_resolution: Resolution for line art detection image_resolution: Output image resolution @@ -59,39 +60,39 @@ def __init__(self, intensity_threshold: Threshold for intensity calculation **kwargs: Additional parameters """ - + super().__init__( detect_resolution=detect_resolution, image_resolution=image_resolution, gaussian_sigma=gaussian_sigma, intensity_threshold=intensity_threshold, - **kwargs + **kwargs, ) - + # Initialize GPU device self.device = torch.device("cuda" if torch.cuda.is_available() else "cpu") - + def _gaussian_kernel(self, kernel_size: int, sigma: float, device=None) -> torch.Tensor: """Create 2D Gaussian kernel - based on existing codebase pattern""" x, y = torch.meshgrid( - torch.linspace(-1, 1, kernel_size, device=device), - torch.linspace(-1, 1, kernel_size, device=device), - indexing="ij" + torch.linspace(-1, 1, kernel_size, device=device), + torch.linspace(-1, 1, kernel_size, device=device), + indexing="ij", ) d = torch.sqrt(x * x + y * y) g = torch.exp(-(d * d) / (2.0 * sigma * sigma)) return g / g.sum() - + def _gaussian_blur_torch(self, image: torch.Tensor, sigma: float) -> torch.Tensor: """Apply Gaussian blur using PyTorch - GPU accelerated""" # Calculate kernel size from sigma (odd number) kernel_size = int(2 * torch.ceil(torch.tensor(3 * sigma)) + 1) if kernel_size % 2 == 0: kernel_size += 1 - + # Create Gaussian kernel kernel = self._gaussian_kernel(kernel_size, sigma, device=image.device) - + # Handle different input shapes if image.dim() == 3: # HWC format H, W, C = image.shape @@ -103,31 +104,31 @@ def _gaussian_blur_torch(self, image: torch.Tensor, sigma: float) -> torch.Tenso needs_reshape = False else: raise ValueError(f"standardlineart_gaussian_blur_torch: Unsupported image shape: {image.shape}") - + # Expand kernel for all channels kernel = kernel.repeat(image.shape[1], 1, 1).unsqueeze(1) - + # Apply blur with reflection padding padding = kernel_size // 2 - padded_image = F.pad(image, (padding, padding, padding, padding), 'reflect') + padded_image = F.pad(image, (padding, padding, padding, padding), "reflect") blurred = F.conv2d(padded_image, kernel, padding=0, groups=image.shape[1]) - + # Convert back to original format if needed if needs_reshape: blurred = blurred.squeeze(0).permute(1, 2, 0) # BCHW -> HWC - + return blurred - + def _ensure_hwc3_torch(self, x: torch.Tensor) -> torch.Tensor: """Ensure image has 3 channels (HWC3 format) - PyTorch version""" if x.dim() == 2: x = x.unsqueeze(-1) # Add channel dimension - + if x.dim() != 3: raise ValueError(f"standardlineart_ensure_hwc3_torch: Expected 2D or 3D tensor, got {x.dim()}D") - + H, W, C = x.shape - + if C == 3: return x elif C == 1: @@ -139,41 +140,38 @@ def _ensure_hwc3_torch(self, x: torch.Tensor) -> torch.Tensor: return torch.clamp(y, 0, 255) else: raise ValueError(f"standardlineart_ensure_hwc3_torch: Unsupported channel count: {C}") - + def _pad64(self, x: int) -> int: """Pad to nearest multiple of 64""" return int(torch.ceil(torch.tensor(float(x) / 64.0)) * 64 - x) - + def _resize_image_with_pad_torch(self, input_image: torch.Tensor, resolution: int) -> tuple: """Resize image with padding to target resolution - PyTorch GPU accelerated""" img = self._ensure_hwc3_torch(input_image) H_raw, W_raw, _ = img.shape - + if resolution == 0: return img, lambda x: x - + k = float(resolution) / float(min(H_raw, W_raw)) H_target = int(torch.round(torch.tensor(float(H_raw) * k))) W_target = int(torch.round(torch.tensor(float(W_raw) * k))) - + # Convert to BCHW for interpolation img_bchw = img.permute(2, 0, 1).unsqueeze(0) # HWC -> BCHW - + # Use PyTorch's interpolate for GPU-accelerated resize - mode = 'bicubic' if k > 1 else 'area' + mode = "bicubic" if k > 1 else "area" img_resized_bchw = F.interpolate( - img_bchw, - size=(H_target, W_target), - mode=mode, - align_corners=False if mode == 'bicubic' else None + img_bchw, size=(H_target, W_target), mode=mode, align_corners=False if mode == "bicubic" else None ) - + # Convert back to HWC img_resized = img_resized_bchw.squeeze(0).permute(1, 2, 0) - + # Apply padding H_pad, W_pad = self._pad64(H_target), self._pad64(W_target) - img_padded = F.pad(img_resized.permute(2, 0, 1), (0, W_pad, 0, H_pad), mode='replicate').permute(1, 2, 0) + img_padded = F.pad(img_resized.permute(2, 0, 1), (0, W_pad, 0, H_pad), mode="replicate").permute(1, 2, 0) def remove_pad(x): return x[:H_target, :W_target, ...] @@ -198,7 +196,7 @@ def _compute_lineart_hwc(self, input_image: torch.Tensor) -> torch.Tensor: intensity = torch.min(g - input_image, dim=2)[0] intensity = torch.clamp(intensity, 0, 255) - + threshold_mask = intensity > intensity_threshold # Sync-free: nanmedian over thresholded pixels equals median(intensity[threshold_mask]). # All-False mask → every element is nan → nan_to_num floors to 16. @@ -207,10 +205,9 @@ def _compute_lineart_hwc(self, input_image: torch.Tensor) -> torch.Tensor: median_val = torch.nanmedian(masked) normalization_factor = torch.clamp_min(torch.nan_to_num(median_val, nan=16.0), 16.0) - intensity = intensity / normalization_factor intensity = intensity * 127 - + detected_map = torch.clamp(intensity, 0, 255).byte() detected_map = detected_map.unsqueeze(-1) detected_map = self._ensure_hwc3_torch(detected_map.float()) @@ -234,7 +231,7 @@ def _process_core(self, image: Image.Image) -> Image.Image: detected_map = self._compute_lineart_hwc(input_image) detected_map = remove_pad(detected_map) - + detected_map_cpu = detected_map.byte().cpu().numpy() return Image.fromarray(detected_map_cpu) diff --git a/src/streamdiffusion/preprocessing/processors/temporal_net_tensorrt.py b/src/streamdiffusion/preprocessing/processors/temporal_net_tensorrt.py index db41ea476..9cefbc0e5 100644 --- a/src/streamdiffusion/preprocessing/processors/temporal_net_tensorrt.py +++ b/src/streamdiffusion/preprocessing/processors/temporal_net_tensorrt.py @@ -9,7 +9,6 @@ from .base import PipelineAwareProcessor - # Try to import TensorRT dependencies try: from collections import OrderedDict @@ -24,7 +23,10 @@ # Try to import torchvision for RAFT model try: - from torchvision.models.optical_flow import Raft_Small_Weights, raft_small + from torchvision.models.optical_flow import ( # noqa: F401 # TODO: pre-existing, untouched by this refactor + Raft_Small_Weights, + raft_small, + ) from torchvision.utils import flow_to_image TORCHVISION_AVAILABLE = True @@ -324,7 +326,7 @@ def _load_tensorrt_engine(self): f"Failed to load TensorRT engine from {self.engine_path}: {e}\n" f"Make sure the engine was built with a resolution range that includes {self.height}x{self.width}.\n" f"For example: python -m streamdiffusion.tools.compile_raft_tensorrt --min_resolution 512x512 --max_resolution 1024x1024" - ) + ) from e def _process_core(self, image: Image.Image) -> Image.Image: """ diff --git a/src/streamdiffusion/preprocessing/processors/trt_base.py b/src/streamdiffusion/preprocessing/processors/trt_base.py index b97778b21..11b376bab 100644 --- a/src/streamdiffusion/preprocessing/processors/trt_base.py +++ b/src/streamdiffusion/preprocessing/processors/trt_base.py @@ -28,7 +28,6 @@ from .base import BasePreprocessor - logger = logging.getLogger(__name__) # --------------------------------------------------------------------------- diff --git a/src/streamdiffusion/stream_parameter_updater.py b/src/streamdiffusion/stream_parameter_updater.py index 42b9c20da..8355dbc46 100644 --- a/src/streamdiffusion/stream_parameter_updater.py +++ b/src/streamdiffusion/stream_parameter_updater.py @@ -13,7 +13,6 @@ ) from .preprocessing.orchestrator_user import OrchestratorUser - logger = logging.getLogger(__name__) @@ -1529,7 +1528,7 @@ def _update_ipadapter_config(self, desired_config: Dict[str, Any]) -> None: else: self.stream.ipadapter.set_scale(desired_scale) # Update our tracking attribute - setattr(self.stream.ipadapter, "scale", desired_scale) + self.stream.ipadapter.scale = desired_scale except Exception: # Do not add fallback mechanisms raise @@ -1539,7 +1538,7 @@ def _update_ipadapter_config(self, desired_config: Dict[str, Any]) -> None: # Tell diffusers_ipadapter to set the scale self.stream.ipadapter.set_scale(desired_scale) # Update our tracking attribute - setattr(self.stream.ipadapter, "scale", desired_scale) + self.stream.ipadapter.scale = desired_scale # Update enabled state if provided if "enabled" in desired_config and desired_config["enabled"] is not None: @@ -1551,14 +1550,14 @@ def _update_ipadapter_config(self, desired_config: Dict[str, Any]) -> None: logger.info( f"_update_ipadapter_config: Updating enabled state: {current_enabled} → {enabled_state}" ) - setattr(self.stream.ipadapter, "enabled", enabled_state) + self.stream.ipadapter.enabled = enabled_state # Update weight type if provided (affects per-layer distribution and/or per-step factor) if "weight_type" in desired_config and desired_config["weight_type"] is not None: weight_type = desired_config["weight_type"] # Update IPAdapter instance if hasattr(self.stream, "ipadapter"): - setattr(self.stream.ipadapter, "weight_type", weight_type) + self.stream.ipadapter.weight_type = weight_type # For PyTorch UNet, immediately apply a per-layer scale vector so layers reflect selection types try: @@ -1581,7 +1580,7 @@ def _update_ipadapter_config(self, desired_config: Dict[str, Any]) -> None: else: self.stream.ipadapter.set_scale(base_weight) # Keep our tracking attribute in sync - setattr(self.stream.ipadapter, "scale", base_weight) + self.stream.ipadapter.scale = base_weight except Exception: # Do not add fallback mechanisms raise @@ -1673,7 +1672,7 @@ def _get_current_hook_config(self, hook_type: str) -> List[Dict[str, Any]]: config = [] for i, processor in enumerate(processors): proc_config = { - "type": getattr(processor, "__class__").__name__, + "type": processor.__class__.__name__, "order": getattr(processor, "order", i), "enabled": getattr(processor, "enabled", True), } @@ -1783,8 +1782,8 @@ def _update_hook_config(self, hook_type: str, desired_config: List[Dict[str, Any ) # Copy attributes from old processor - setattr(new_processor, "order", getattr(existing_processor, "order", i)) - setattr(new_processor, "enabled", enabled) + new_processor.order = getattr(existing_processor, "order", i) + new_processor.enabled = enabled # Set parameters if hasattr(new_processor, "params"): @@ -1797,7 +1796,7 @@ def _update_hook_config(self, hook_type: str, desired_config: List[Dict[str, Any else: # Same type, just update attributes logger.info(f"_update_hook_config: Same type, updating attributes for processor {i}") - setattr(existing_processor, "enabled", enabled) + existing_processor.enabled = enabled # Update parameters if hasattr(existing_processor, "params"): diff --git a/src/streamdiffusion/tools/compile_depth_anything_tensorrt.py b/src/streamdiffusion/tools/compile_depth_anything_tensorrt.py index b842ec101..222b55412 100644 --- a/src/streamdiffusion/tools/compile_depth_anything_tensorrt.py +++ b/src/streamdiffusion/tools/compile_depth_anything_tensorrt.py @@ -16,12 +16,11 @@ import fire import torch - logging.basicConfig(level=logging.INFO, format="%(asctime)s - %(levelname)s - %(message)s") logger = logging.getLogger(__name__) try: - import tensorrt as trt # noqa: E402 + import tensorrt as trt from streamdiffusion.acceleration.tensorrt.utilities import BUILD_TRT_LOGGER diff --git a/src/streamdiffusion/tools/compile_raft_tensorrt.py b/src/streamdiffusion/tools/compile_raft_tensorrt.py index 30ff70b91..5d4de5899 100644 --- a/src/streamdiffusion/tools/compile_raft_tensorrt.py +++ b/src/streamdiffusion/tools/compile_raft_tensorrt.py @@ -1,10 +1,10 @@ -import torch import logging from pathlib import Path -from typing import Optional + import fire +import torch -logging.basicConfig(level=logging.INFO, format='%(asctime)s - %(levelname)s - %(message)s') +logging.basicConfig(level=logging.INFO, format="%(asctime)s - %(levelname)s - %(message)s") logger = logging.getLogger(__name__) try: @@ -12,7 +12,6 @@ from streamdiffusion.acceleration.tensorrt.utilities import BUILD_TRT_LOGGER - TENSORRT_AVAILABLE = True except ImportError: TENSORRT_AVAILABLE = False @@ -20,7 +19,8 @@ logger.error("TensorRT not available. Please install it first.") try: - from torchvision.models.optical_flow import raft_small, Raft_Small_Weights + from torchvision.models.optical_flow import Raft_Small_Weights, raft_small + TORCHVISION_AVAILABLE = True except ImportError: TORCHVISION_AVAILABLE = False @@ -33,11 +33,11 @@ def export_raft_to_onnx( min_width: int = 512, max_height: int = 512, max_width: int = 512, - device: str = "cuda" + device: str = "cuda", ) -> bool: """ Export RAFT model to ONNX format - + Args: onnx_path: Path to save the ONNX model min_height: Minimum input height for the model @@ -45,41 +45,41 @@ def export_raft_to_onnx( max_height: Maximum input height for the model max_width: Maximum input width for the model device: Device to use for export - + Returns: True if successful, False otherwise """ if not TORCHVISION_AVAILABLE: logger.error("torchvision is required but not installed") return False - + logger.info(f"Exporting RAFT model to ONNX: {onnx_path}") logger.info(f"Resolution range: {min_height}x{min_width} - {max_height}x{max_width}") - + try: # Load RAFT model logger.info("Loading RAFT Small model...") raft_model = raft_small(weights=Raft_Small_Weights.DEFAULT, progress=True) raft_model = raft_model.to(device=device) raft_model.eval() - + # Create dummy inputs using max resolution for export dummy_frame1 = torch.randn(1, 3, max_height, max_width).to(device) dummy_frame2 = torch.randn(1, 3, max_height, max_width).to(device) - + # Apply RAFT preprocessing if available weights = Raft_Small_Weights.DEFAULT - if hasattr(weights, 'transforms') and weights.transforms is not None: + if hasattr(weights, "transforms") and weights.transforms is not None: transforms = weights.transforms() dummy_frame1, dummy_frame2 = transforms(dummy_frame1, dummy_frame2) - + # Make batch, height, and width dimensions dynamic dynamic_axes = { "frame1": {0: "batch_size", 2: "height", 3: "width"}, "frame2": {0: "batch_size", 2: "height", 3: "width"}, "flow": {0: "batch_size", 2: "height", 3: "width"}, } - + logger.info("Exporting to ONNX...") with torch.no_grad(): torch.onnx.export( @@ -87,22 +87,23 @@ def export_raft_to_onnx( (dummy_frame1, dummy_frame2), str(onnx_path), verbose=False, - input_names=['frame1', 'frame2'], - output_names=['flow'], + input_names=["frame1", "frame2"], + output_names=["flow"], opset_version=17, export_params=True, dynamic_axes=dynamic_axes, ) - + del raft_model torch.cuda.empty_cache() - + logger.info(f"Successfully exported ONNX model to {onnx_path}") return True - + except Exception as e: logger.error(f"Failed to export ONNX model: {e}") import traceback + traceback.print_exc() return False @@ -115,11 +116,11 @@ def build_tensorrt_engine( max_height: int = 512, max_width: int = 512, fp16: bool = True, - workspace_size_gb: int = 4 + workspace_size_gb: int = 4, ) -> bool: """ Build TensorRT engine from ONNX model - + Args: onnx_path: Path to the ONNX model engine_path: Path to save the TensorRT engine @@ -129,75 +130,74 @@ def build_tensorrt_engine( max_width: Maximum input width for optimization fp16: Enable FP16 precision mode workspace_size_gb: Maximum workspace size in GB - + Returns: True if successful, False otherwise """ if not TENSORRT_AVAILABLE: logger.error("TensorRT is required but not installed") return False - + if not onnx_path.exists(): logger.error(f"ONNX model not found: {onnx_path}") return False - + logger.info(f"Building TensorRT engine from ONNX model: {onnx_path}") logger.info(f"Output path: {engine_path}") logger.info(f"Resolution range: {min_height}x{min_width} - {max_height}x{max_width}") logger.info(f"FP16 mode: {fp16}") logger.info("This may take several minutes...") - + try: builder = trt.Builder(BUILD_TRT_LOGGER) network = builder.create_network() # EXPLICIT_BATCH deprecated/ignored in TRT 10.x parser = trt.OnnxParser(network, BUILD_TRT_LOGGER) - logger.info("Parsing ONNX model...") - with open(onnx_path, 'rb') as model: + with open(onnx_path, "rb") as model: if not parser.parse(model.read()): logger.error("Failed to parse ONNX model") for error in range(parser.num_errors): logger.error(f"Parser error: {parser.get_error(error)}") return False - + logger.info("Configuring TensorRT builder...") config = builder.create_builder_config() - + config.set_memory_pool_limit(trt.MemoryPoolType.WORKSPACE, workspace_size_gb * (1 << 30)) - + if fp16: config.set_flag(trt.BuilderFlag.FP16) logger.info("FP16 mode enabled") - + # Calculate optimal resolution (middle point) opt_height = (min_height + max_height) // 2 opt_width = (min_width + max_width) // 2 - + profile = builder.create_optimization_profile() min_shape = (1, 3, min_height, min_width) opt_shape = (1, 3, opt_height, opt_width) max_shape = (1, 3, max_height, max_width) - + profile.set_shape("frame1", min_shape, opt_shape, max_shape) profile.set_shape("frame2", min_shape, opt_shape, max_shape) config.add_optimization_profile(profile) - + logger.info("Building TensorRT engine... (this will take a while)") engine = builder.build_serialized_network(network, config) - + if engine is None: logger.error("Failed to build TensorRT engine") return False - + logger.info(f"Saving engine to {engine_path}") engine_path.parent.mkdir(parents=True, exist_ok=True) - with open(engine_path, 'wb') as f: + with open(engine_path, "wb") as f: f.write(engine) - + logger.info(f"Successfully built and saved TensorRT engine: {engine_path}") - logger.info(f"Engine size: {engine_path.stat().st_size / (1024*1024):.2f} MB") - + logger.info(f"Engine size: {engine_path.stat().st_size / (1024 * 1024):.2f} MB") + # Delete ONNX file after successful engine creation try: if onnx_path.exists(): @@ -205,12 +205,13 @@ def build_tensorrt_engine( logger.info(f"Deleted ONNX file: {onnx_path}") except Exception as e: logger.warning(f"Failed to delete ONNX file: {e}") - + return True - + except Exception as e: logger.error(f"Failed to build TensorRT engine: {e}") import traceback + traceback.print_exc() return False @@ -222,11 +223,11 @@ def compile_raft( device: str = "cuda", fp16: bool = True, workspace_size_gb: int = 4, - force_rebuild: bool = False + force_rebuild: bool = False, ): """ Main function to compile RAFT model to TensorRT engine - + Args: min_resolution: Minimum input resolution as "HxW" (e.g., "512x512") (default: "512x512") max_resolution: Maximum input resolution as "HxW" (e.g., "1024x1024") (default: "512x512") @@ -240,46 +241,46 @@ def compile_raft( logger.error("TensorRT is not available. Please install it first using:") logger.error(" python -m streamdiffusion.tools.install-tensorrt") return - + if not TORCHVISION_AVAILABLE: logger.error("torchvision is not available. Please install it first using:") logger.error(" pip install torchvision") return - + # Parse resolution strings try: - min_height, min_width = map(int, min_resolution.split('x')) + min_height, min_width = map(int, min_resolution.split("x")) except ValueError: logger.error(f"Invalid min_resolution format: {min_resolution}. Expected format: HxW (e.g., 512x512)") return - + try: - max_height, max_width = map(int, max_resolution.split('x')) + max_height, max_width = map(int, max_resolution.split("x")) except ValueError: logger.error(f"Invalid max_resolution format: {max_resolution}. Expected format: HxW (e.g., 1024x1024)") return - + output_path = Path(output_dir) output_path.mkdir(parents=True, exist_ok=True) - + # Add resolution suffix to filenames onnx_path = output_path / f"raft_small_min_{min_resolution}_max_{max_resolution}.onnx" engine_path = output_path / f"raft_small_min_{min_resolution}_max_{max_resolution}.engine" - - logger.info("="*80) + + logger.info("=" * 80) logger.info("RAFT TensorRT Compilation") - logger.info("="*80) + logger.info("=" * 80) logger.info(f"Output directory: {output_path.absolute()}") logger.info(f"Resolution range: {min_resolution} - {max_resolution}") logger.info(f"ONNX path: {onnx_path}") logger.info(f"Engine path: {engine_path}") - logger.info("="*80) - + logger.info("=" * 80) + if engine_path.exists() and not force_rebuild: logger.info(f"TensorRT engine already exists: {engine_path}") logger.info("Use --force_rebuild to rebuild it") return - + if not onnx_path.exists() or force_rebuild: logger.info("\n[Step 1/2] Exporting RAFT to ONNX...") if not export_raft_to_onnx(onnx_path, min_height, min_width, max_height, max_width, device): @@ -287,21 +288,22 @@ def compile_raft( return else: logger.info(f"\n[Step 1/2] ONNX model already exists: {onnx_path}") - + logger.info("\n[Step 2/2] Building TensorRT engine...") - if not build_tensorrt_engine(onnx_path, engine_path, min_height, min_width, max_height, max_width, fp16, workspace_size_gb): + if not build_tensorrt_engine( + onnx_path, engine_path, min_height, min_width, max_height, max_width, fp16, workspace_size_gb + ): logger.error("Failed to build TensorRT engine") return - - logger.info("\n" + "="*80) + + logger.info("\n" + "=" * 80) logger.info("✓ Compilation completed successfully!") - logger.info("="*80) + logger.info("=" * 80) logger.info(f"Engine path: {engine_path.absolute()}") logger.info("\nYou can now use this engine in TemporalNetTensorRTPreprocessor:") logger.info(f' engine_path="{engine_path.absolute()}"') - logger.info("="*80) + logger.info("=" * 80) if __name__ == "__main__": fire.Fire(compile_raft) - diff --git a/src/streamdiffusion/tools/cuda_l2_cache.py b/src/streamdiffusion/tools/cuda_l2_cache.py index 176a158d5..d9858bb40 100644 --- a/src/streamdiffusion/tools/cuda_l2_cache.py +++ b/src/streamdiffusion/tools/cuda_l2_cache.py @@ -24,7 +24,6 @@ import torch - # ============================================================================= # Environment Controls # ============================================================================= diff --git a/src/streamdiffusion/tools/gpu_profiler.py b/src/streamdiffusion/tools/gpu_profiler.py index 3f4efbbd4..8fa33975e 100644 --- a/src/streamdiffusion/tools/gpu_profiler.py +++ b/src/streamdiffusion/tools/gpu_profiler.py @@ -41,7 +41,6 @@ from functools import wraps from typing import Any, Callable, Dict, Generator, List, Optional - # ───────────────────────────────────────────────────────────────────────────── # RegionStats — per-region histogram with percentile support # ───────────────────────────────────────────────────────────────────────────── @@ -50,7 +49,7 @@ class RegionStats: """Histogram-based timing statistics for a named profiling region.""" - __slots__ = ("name", "samples", "count", "total_ms") + __slots__ = ("count", "name", "samples", "total_ms") MAX_SAMPLES = 10_000 # cap to avoid unbounded memory @@ -123,16 +122,16 @@ class _RegionCtx: On exit: optional NVTX range_pop + CUDA event elapsed_time -> RegionStats. """ - __slots__ = ("_profiler", "_name", "_nvtx", "_start_evt", "_end_evt") + __slots__ = ("_end_evt", "_name", "_nvtx", "_profiler", "_start_evt") - def __init__(self, profiler: "GPUProfiler", name: str) -> None: + def __init__(self, profiler: GPUProfiler, name: str) -> None: self._profiler = profiler self._name = name self._nvtx = profiler._nvtx_enabled self._start_evt = None self._end_evt = None - def __enter__(self) -> "_RegionCtx": + def __enter__(self) -> _RegionCtx: p = self._profiler if self._nvtx: p._torch.cuda.nvtx.range_push(self._name) @@ -158,7 +157,7 @@ class _NullCtx: __slots__ = () - def __enter__(self) -> "_NullCtx": + def __enter__(self) -> _NullCtx: return self def __exit__(self, *_: object) -> None: @@ -471,10 +470,10 @@ class _NullProfiler: __slots__ = () - def region(self, name: str) -> _NullCtx: # noqa: ARG002 + def region(self, name: str) -> _NullCtx: return _NULL_CTX - def trace(self, name: str) -> Callable: # noqa: ARG002 + def trace(self, name: str) -> Callable: """Return identity decorator — function is NOT wrapped.""" def decorator(fn: Callable) -> Callable: @@ -483,45 +482,45 @@ def decorator(fn: Callable) -> Callable: return decorator def mark(self, name: str) -> None: - pass # noqa: E704 + pass def begin(self, name: str) -> None: - pass # noqa: E704 + pass def end(self, name: str) -> None: - pass # noqa: E704 + pass def nsys_start(self) -> None: - pass # noqa: E704 + pass def nsys_stop(self) -> None: - pass # noqa: E704 + pass def step(self) -> None: - pass # noqa: E704 + pass def flush(self) -> None: - pass # noqa: E704 + pass def report(self, top_n: int = 30) -> None: - pass # noqa: E704, ARG002 + pass def reset(self) -> None: - pass # noqa: E704 + pass @contextmanager - def torch_trace(self, path: Optional[str] = None, warmup: int = 1, active: int = 5) -> Generator[None, None, None]: # noqa: ARG002 + def torch_trace(self, path: Optional[str] = None, warmup: int = 1, active: int = 5) -> Generator[None, None, None]: yield @contextmanager - def memory_trace(self, path: str = "mem_snapshot.pkl") -> Generator[None, None, None]: # noqa: ARG002 + def memory_trace(self, path: str = "mem_snapshot.pkl") -> Generator[None, None, None]: yield - def export_stats(self, path: str = "gpu_profile_stats.json") -> None: # noqa: ARG002 + def export_stats(self, path: str = "gpu_profile_stats.json") -> None: pass def configure(self, **kwargs: Any) -> None: - pass # noqa: E704, ARG002 + pass # ───────────────────────────────────────────────────────────────────────────── @@ -616,7 +615,7 @@ def configure_from_dict(cfg: Dict[str, Any]) -> None: "nvtx": true, "events": true, "memory": false, - "trace_path": "profiler_logs/trace.json" + "trace_path": "profiler_logs/trace.json", } } """ diff --git a/src/streamdiffusion/utils/__init__.py b/src/streamdiffusion/utils/__init__.py index eaa6df9b9..26938c217 100644 --- a/src/streamdiffusion/utils/__init__.py +++ b/src/streamdiffusion/utils/__init__.py @@ -1,7 +1,6 @@ from .diagnostics import collect_diagnostics, format_report_text, write_error_report from .reporting import report_error - __all__ = [ "collect_diagnostics", "format_report_text", diff --git a/src/streamdiffusion/utils/diagnostics.py b/src/streamdiffusion/utils/diagnostics.py index 398be09e6..feeb328c4 100644 --- a/src/streamdiffusion/utils/diagnostics.py +++ b/src/streamdiffusion/utils/diagnostics.py @@ -27,7 +27,6 @@ from pathlib import Path from typing import Any, Dict, Optional - SCHEMA_VERSION = "v1" # Only these env-var prefixes are dumped -- never the full os.environ (avoids leaking secrets). ENV_ALLOWLIST_PREFIXES = ("CUDALINK_", "HF_", "SD_", "SDTD_") diff --git a/src/streamdiffusion/wrapper.py b/src/streamdiffusion/wrapper.py index e8b00ed58..e7c705cdb 100644 --- a/src/streamdiffusion/wrapper.py +++ b/src/streamdiffusion/wrapper.py @@ -16,7 +16,6 @@ from .tools.gpu_profiler import profiler from .utils.diagnostics import write_error_report as _write_error_report_util - logger = logging.getLogger(__name__) @@ -59,10 +58,7 @@ class StreamDiffusionWrapper: wrapper.prepare([("cat", 0.7), ("dog", 0.3)]) # Prompt + seed blending - wrapper.prepare( - prompt=[("style1", 0.6), ("style2", 0.4)], - seed_list=[(123, 0.8), (456, 0.2)] - ) + wrapper.prepare(prompt=[("style1", 0.6), ("style2", 0.4)], seed_list=[(123, 0.8), (456, 0.2)]) ``` ## Runtime Updates: @@ -74,10 +70,7 @@ class StreamDiffusionWrapper: wrapper.update_prompt([("new1", 0.5), ("new2", 0.5)]) # Update combined parameters - wrapper.update_stream_params( - prompt_list=[("bird", 0.6), ("fish", 0.4)], - seed_list=[(789, 0.3), (101, 0.7)] - ) + wrapper.update_stream_params(prompt_list=[("bird", 0.6), ("fish", 0.4)], seed_list=[(789, 0.3), (101, 0.7)]) ``` ## Weight Management: @@ -439,7 +432,7 @@ def __init__( return if seed < 0: # Random seed - seed = np.random.randint(0, 1000000) + seed = int(np.random.default_rng().integers(0, 1000000)) self.stream.prepare( "", @@ -2691,7 +2684,7 @@ def _install_cached_proc(attn_module): fp8=fp8 or bool(cfg.get("fp8", False)), ) try: - setattr(engine, "model_id", cfg["model_id"]) + engine.model_id = cfg["model_id"] except Exception: pass compiled_cn_engines.append(engine) @@ -2700,7 +2693,7 @@ def _install_cached_proc(attn_module): f"Failed to compile/load ControlNet engine for {cfg.get('model_id')}: {e}" ) if compiled_cn_engines: - setattr(stream, "controlnet_engines", compiled_cn_engines) + stream.controlnet_engines = compiled_cn_engines try: logger.info( f"Compiled/loaded {len(compiled_cn_engines)} ControlNet TensorRT engine(s)" @@ -2921,7 +2914,7 @@ def get_stream_state(self, include_caches: bool = False) -> Dict[str, Any]: num_inference_steps = None try: if hasattr(stream, "timesteps") and stream.timesteps is not None: - num_inference_steps = int(len(stream.timesteps)) + num_inference_steps = len(stream.timesteps) except Exception as e: logger.debug(f"Failed to derive num_inference_steps from stream.timesteps: {e}", exc_info=True) diff --git a/tests/manual/smoke_self_build_preprocessors.py b/tests/manual/smoke_self_build_preprocessors.py index c761d8239..f6086b2f5 100644 --- a/tests/manual/smoke_self_build_preprocessors.py +++ b/tests/manual/smoke_self_build_preprocessors.py @@ -27,7 +27,6 @@ import torch - logging.basicConfig( level=logging.INFO, format="%(asctime)s %(levelname)s %(name)s — %(message)s", @@ -209,7 +208,7 @@ def main() -> None: logger.info(f"GPU: {torch.cuda.get_device_name(0)}") try: - import tensorrt as trt # noqa: F401 + import tensorrt as trt logger.info(f"TensorRT: {trt.__version__}") except ImportError: diff --git a/tests/quality/regenerate_golden.py b/tests/quality/regenerate_golden.py index 7c86fd449..18c6592cf 100644 --- a/tests/quality/regenerate_golden.py +++ b/tests/quality/regenerate_golden.py @@ -19,12 +19,10 @@ import os import sys - sys.path.insert(0, os.path.join(os.path.dirname(__file__), "..", "..")) from streamdiffusion import StreamDiffusionWrapper - logger = logging.getLogger("quality.regenerate") TESTS_QUALITY_DIR = os.path.dirname(os.path.abspath(__file__)) diff --git a/tests/quality/run_compare.py b/tests/quality/run_compare.py index cdaba96c8..64f116f4d 100644 --- a/tests/quality/run_compare.py +++ b/tests/quality/run_compare.py @@ -22,7 +22,6 @@ import yaml - sys.path.insert(0, os.path.join(os.path.dirname(__file__), "..", "..")) logger = logging.getLogger("quality.run_compare") diff --git a/tests/unit/test_cn_preprocessor_residency.py b/tests/unit/test_cn_preprocessor_residency.py index fe142e97f..a2d69c90c 100644 --- a/tests/unit/test_cn_preprocessor_residency.py +++ b/tests/unit/test_cn_preprocessor_residency.py @@ -11,7 +11,6 @@ import pytest - # --------------------------------------------------------------------------- # CN-coupled type → expected preprocessor mappings # (matches the plan table and the updated CN_MODEL_REGISTRY 'preprocessor' fields) diff --git a/tests/unit/test_config_extraction_golden.py b/tests/unit/test_config_extraction_golden.py index b4b8f749a..459ab245e 100644 --- a/tests/unit/test_config_extraction_golden.py +++ b/tests/unit/test_config_extraction_golden.py @@ -15,7 +15,6 @@ from streamdiffusion.config import _extract_prepare_params, _extract_wrapper_params - MINIMAL_CONFIG = {"model_id": "stabilityai/sd-turbo"} EXPECTED_WRAPPER_PARAMS = { diff --git a/tests/unit/test_derived_tensor_sync.py b/tests/unit/test_derived_tensor_sync.py index c89575847..d4a6abc06 100644 --- a/tests/unit/test_derived_tensor_sync.py +++ b/tests/unit/test_derived_tensor_sync.py @@ -13,18 +13,16 @@ """ import torch -import pytest from streamdiffusion.stream_parameter_updater import StreamParameterUpdater - # --------------------------------------------------------------------------- # helpers # --------------------------------------------------------------------------- + def _make_mock_lcm_scheduler(num_steps=50, device="cpu"): """Minimal scheduler shell with alphas_cumprod and get_scalings_for_boundary_condition_discrete.""" - import types from diffusers import LCMScheduler sched = object.__new__(LCMScheduler) @@ -46,12 +44,17 @@ def _scalings(timestep): return sched -def _make_stream_shell(t_index_list, device="cpu", dtype=torch.float32, - frame_bff_size=1, use_denoising_batch=True, - cfg_type="self", do_add_noise=True): +def _make_stream_shell( + t_index_list, + device="cpu", + dtype=torch.float32, + frame_bff_size=1, + use_denoising_batch=True, + cfg_type="self", + do_add_noise=True, +): """Minimal StreamDiffusion pipeline shell for updater testing.""" import types - from diffusers import LCMScheduler stream = types.SimpleNamespace() stream.device = device @@ -106,9 +109,7 @@ def _make_stream_shell(t_index_list, device="cpu", dtype=torch.float32, stream._beta_next = torch.cat( [stream.beta_prod_t_sqrt[1:], torch.ones_like(stream.beta_prod_t_sqrt[0:1])], dim=0 ) - stream._init_noise_rotated = torch.cat( - [stream.init_noise[1:], stream.init_noise[0:1]], dim=0 - ) + stream._init_noise_rotated = torch.cat([stream.init_noise[1:], stream.init_noise[0:1]], dim=0) else: stream._alpha_next = None stream._beta_next = None @@ -129,6 +130,7 @@ def _make_updater(stream): # tests # --------------------------------------------------------------------------- + class TestDerivedTensorSync: """F2: _update_timestep_calculations must keep _alpha_next/_beta_next in sync.""" @@ -144,13 +146,11 @@ def test_alpha_next_updated_after_t_index_change(self): # Change t_index values (same length, different values) updater._update_timestep_values_only([14, 28]) - expected = torch.cat( - [stream.alpha_prod_t_sqrt[1:], torch.ones_like(stream.alpha_prod_t_sqrt[0:1])], dim=0 + expected = torch.cat([stream.alpha_prod_t_sqrt[1:], torch.ones_like(stream.alpha_prod_t_sqrt[0:1])], dim=0) + assert not torch.allclose(old_alpha_next, stream._alpha_next), "_alpha_next was not updated (stale)" + assert torch.allclose(stream._alpha_next, expected, atol=1e-5), ( + f"_alpha_next mismatch: max_diff={(stream._alpha_next - expected).abs().max().item():.6f}" ) - assert not torch.allclose(old_alpha_next, stream._alpha_next), \ - "_alpha_next was not updated (stale)" - assert torch.allclose(stream._alpha_next, expected, atol=1e-5), \ - f"_alpha_next mismatch: max_diff={( stream._alpha_next - expected).abs().max().item():.6f}" def test_beta_next_updated_after_t_index_change(self): """After a same-length value-only t_index change, _beta_next must equal @@ -161,13 +161,11 @@ def test_beta_next_updated_after_t_index_change(self): updater._update_timestep_values_only([14, 28]) - expected = torch.cat( - [stream.beta_prod_t_sqrt[1:], torch.ones_like(stream.beta_prod_t_sqrt[0:1])], dim=0 - ) - assert not torch.allclose(old_beta_next, stream._beta_next), \ - "_beta_next was not updated (stale)" - assert torch.allclose(stream._beta_next, expected, atol=1e-5), \ + expected = torch.cat([stream.beta_prod_t_sqrt[1:], torch.ones_like(stream.beta_prod_t_sqrt[0:1])], dim=0) + assert not torch.allclose(old_beta_next, stream._beta_next), "_beta_next was not updated (stale)" + assert torch.allclose(stream._beta_next, expected, atol=1e-5), ( f"_beta_next mismatch: max_diff={(stream._beta_next - expected).abs().max().item():.6f}" + ) def test_init_noise_rotated_stays_consistent_after_t_index_change(self): """_init_noise_rotated must equal cat([init_noise[1:], init_noise[0:1]]) @@ -179,14 +177,14 @@ def test_init_noise_rotated_stays_consistent_after_t_index_change(self): updater._update_timestep_values_only([14, 28]) # init_noise should be unchanged - assert torch.allclose(stream.init_noise, saved_init_noise), \ + assert torch.allclose(stream.init_noise, saved_init_noise), ( "init_noise was unexpectedly mutated by _update_timestep_values_only" - - expected_rotated = torch.cat( - [stream.init_noise[1:], stream.init_noise[0:1]], dim=0 ) - assert torch.allclose(stream._init_noise_rotated, expected_rotated, atol=1e-6), \ + + expected_rotated = torch.cat([stream.init_noise[1:], stream.init_noise[0:1]], dim=0) + assert torch.allclose(stream._init_noise_rotated, expected_rotated, atol=1e-6), ( "_init_noise_rotated out of sync with init_noise after t_index update" + ) def test_no_update_when_derived_tensors_not_initialized(self): """When _alpha_next is None (non-batched or non-RCFG-self), updater must @@ -201,18 +199,21 @@ def test_no_update_when_derived_tensors_not_initialized(self): def test_warn_on_do_add_noise_false_high_beta(self, caplog): """When do_add_noise=False and inter-step beta_sqrt > 0.75, a warning must be logged.""" import logging + stream = _make_stream_shell([14, 28], do_add_noise=False) updater = _make_updater(stream) with caplog.at_level(logging.WARNING, logger="streamdiffusion.stream_parameter_updater"): updater._update_timestep_values_only([14, 28]) - assert any("do_add_noise=False" in r.message for r in caplog.records), \ + assert any("do_add_noise=False" in r.message for r in caplog.records), ( "Expected do_add_noise bleed-risk warning not emitted" + ) def test_no_warn_when_do_add_noise_true(self, caplog): """When do_add_noise=True, no bleed-risk warning should be logged.""" import logging + stream = _make_stream_shell([14, 28], do_add_noise=True) updater = _make_updater(stream) diff --git a/tests/unit/test_diagnostics.py b/tests/unit/test_diagnostics.py index d7ac5d6be..3720382f3 100644 --- a/tests/unit/test_diagnostics.py +++ b/tests/unit/test_diagnostics.py @@ -15,7 +15,6 @@ from streamdiffusion.utils import diagnostics - # --------------------------------------------------------------------------- # format_report_text # --------------------------------------------------------------------------- diff --git a/tests/unit/test_ipc_producer_stream.py b/tests/unit/test_ipc_producer_stream.py index 1b4059cbb..6238ab475 100644 --- a/tests/unit/test_ipc_producer_stream.py +++ b/tests/unit/test_ipc_producer_stream.py @@ -21,7 +21,6 @@ import unittest from unittest.mock import MagicMock - # --------------------------------------------------------------------------- # Helpers: minimal stubs so wrapper.py can be imported without CUDA / diffusers # --------------------------------------------------------------------------- diff --git a/tests/unit/test_l2tc_dynamic_shapes.py b/tests/unit/test_l2tc_dynamic_shapes.py index 1d3d3ca79..c778d9ab7 100644 --- a/tests/unit/test_l2tc_dynamic_shapes.py +++ b/tests/unit/test_l2tc_dynamic_shapes.py @@ -26,7 +26,6 @@ import pytest - try: from streamdiffusion.acceleration.tensorrt import utilities as trt_utilities diff --git a/tests/unit/test_normal_bae_fallback.py b/tests/unit/test_normal_bae_fallback.py index 3478315d2..a5c33adb5 100644 --- a/tests/unit/test_normal_bae_fallback.py +++ b/tests/unit/test_normal_bae_fallback.py @@ -20,7 +20,6 @@ import pytest - # --------------------------------------------------------------------------- # Skip guard — controlnet_aux must be importable # --------------------------------------------------------------------------- diff --git a/tests/unit/test_param_schema.py b/tests/unit/test_param_schema.py index cb5271044..6488baf8f 100644 --- a/tests/unit/test_param_schema.py +++ b/tests/unit/test_param_schema.py @@ -26,7 +26,6 @@ from streamdiffusion.stream_parameter_updater import StreamParameterUpdater from streamdiffusion.wrapper import StreamDiffusionWrapper - WRAPPER_ONLY_PARAMS = {"use_safety_checker", "safety_checker_threshold"} @@ -45,7 +44,7 @@ def test_updater_param_names_is_ordered_subsequence_of_param_names(self): def test_wrapper_only_params_excluded_from_updater(self): assert not (WRAPPER_ONLY_PARAMS & set(UPDATER_PARAM_NAMES)) - assert WRAPPER_ONLY_PARAMS <= set(PARAM_NAMES) + assert set(PARAM_NAMES) >= WRAPPER_ONLY_PARAMS def test_no_duplicate_names(self): assert len(PARAM_NAMES) == len(set(PARAM_NAMES)) diff --git a/tests/unit/test_param_updater_binding.py b/tests/unit/test_param_updater_binding.py index a87630a9c..b08412a31 100644 --- a/tests/unit/test_param_updater_binding.py +++ b/tests/unit/test_param_updater_binding.py @@ -24,7 +24,6 @@ from streamdiffusion.stream_parameter_updater import StreamParameterUpdater - # --------------------------------------------------------------------------- # Fixtures — mirror the minimal-fake-stream pattern from # tests/unit/test_prompt_interpolation.py so __init__ runs without a real pipeline. @@ -51,7 +50,7 @@ def _make_updater(**kwargs) -> StreamParameterUpdater: stream = _fake_stream() orig_attach = StreamParameterUpdater.attach_orchestrator - def _noop_attach(self, s): # noqa: ANN001 + def _noop_attach(self, s): self._preprocessing_orchestrator = None StreamParameterUpdater.attach_orchestrator = _noop_attach @@ -95,7 +94,7 @@ def test_positional_flag_binding_is_rejected(): """The keyword-only barrier makes the original bug a hard TypeError.""" stream = _fake_stream() with pytest.raises(TypeError): - StreamParameterUpdater(stream, False, False) # noqa: F841 + StreamParameterUpdater(stream, False, False) # --------------------------------------------------------------------------- diff --git a/tests/unit/test_phase3_correctness.py b/tests/unit/test_phase3_correctness.py index 49459b63e..a6997254b 100644 --- a/tests/unit/test_phase3_correctness.py +++ b/tests/unit/test_phase3_correctness.py @@ -34,7 +34,6 @@ from streamdiffusion.pipeline import StreamDiffusion from streamdiffusion.wrapper import StreamDiffusionWrapper - # --------------------------------------------------------------------------- # StreamDiffusion.prepare() -- mutable default removed # --------------------------------------------------------------------------- diff --git a/tests/unit/test_prompt_interpolation.py b/tests/unit/test_prompt_interpolation.py index d081efa35..1fe0cbe76 100644 --- a/tests/unit/test_prompt_interpolation.py +++ b/tests/unit/test_prompt_interpolation.py @@ -15,7 +15,6 @@ from streamdiffusion.stream_parameter_updater import StreamParameterUpdater - # --------------------------------------------------------------------------- # Minimal fake stream that satisfies the fields accessed during __init__ and # _apply_prompt_blending without touching the real pipeline. @@ -46,7 +45,7 @@ def _make_updater() -> StreamParameterUpdater: # a real PreprocessingOrchestrator. orig_attach = StreamParameterUpdater.attach_orchestrator - def _noop_attach(self, s): # noqa: ANN001 + def _noop_attach(self, s): self._preprocessing_orchestrator = None StreamParameterUpdater.attach_orchestrator = _noop_attach diff --git a/tests/unit/test_safety_checker.py b/tests/unit/test_safety_checker.py index b4c1d91a7..e4e288cd2 100644 --- a/tests/unit/test_safety_checker.py +++ b/tests/unit/test_safety_checker.py @@ -39,7 +39,6 @@ from streamdiffusion.wrapper import StreamDiffusionWrapper - # --------------------------------------------------------------------------- # helpers # --------------------------------------------------------------------------- diff --git a/tests/unit/test_sync_free_output_5_2.py b/tests/unit/test_sync_free_output_5_2.py index 76780f1fe..3e3fd9747 100644 --- a/tests/unit/test_sync_free_output_5_2.py +++ b/tests/unit/test_sync_free_output_5_2.py @@ -32,7 +32,6 @@ from streamdiffusion.preprocessing.preprocessing_orchestrator import PreprocessingOrchestrator from streamdiffusion.wrapper import StreamDiffusionWrapper - pytestmark = pytest.mark.skipif( not torch.cuda.is_available(), reason="Sub-phase 5.2 output paths require CUDA (pin_memory / cuda.Event)", diff --git a/tests/unit/test_td_pending_params.py b/tests/unit/test_td_pending_params.py index 23bf4c6ae..8500db425 100644 --- a/tests/unit/test_td_pending_params.py +++ b/tests/unit/test_td_pending_params.py @@ -19,7 +19,6 @@ from streamdiffusion.param_schema import PARAM_NAMES - # --------------------------------------------------------------------------- # Minimal faithful replica of the three methods under test. # Copy-pasted from td_manager.py and frozen here so any future regression in diff --git a/tests/unit/test_trt_atomic_engine_write.py b/tests/unit/test_trt_atomic_engine_write.py index 4b874a2f8..215d6042d 100644 --- a/tests/unit/test_trt_atomic_engine_write.py +++ b/tests/unit/test_trt_atomic_engine_write.py @@ -16,7 +16,6 @@ import pytest - # --------------------------------------------------------------------------- # Import guard — skip all tests if utilities.py's dependencies are unavailable # --------------------------------------------------------------------------- diff --git a/tests/unit/test_trt_engine_guards.py b/tests/unit/test_trt_engine_guards.py index 759bc252a..a4c373497 100644 --- a/tests/unit/test_trt_engine_guards.py +++ b/tests/unit/test_trt_engine_guards.py @@ -14,7 +14,6 @@ import pytest - # --------------------------------------------------------------------------- # Import guard — skip all tests if TRT is unavailable # --------------------------------------------------------------------------- diff --git a/tests/unit/test_wrapper_exception_hygiene.py b/tests/unit/test_wrapper_exception_hygiene.py index af10d1e68..0227c25d0 100644 --- a/tests/unit/test_wrapper_exception_hygiene.py +++ b/tests/unit/test_wrapper_exception_hygiene.py @@ -34,7 +34,6 @@ from streamdiffusion import wrapper as wrapper_module from streamdiffusion.wrapper import StreamDiffusionWrapper, _is_oom_error - # --------------------------------------------------------------------------- # _is_oom_error # --------------------------------------------------------------------------- diff --git a/tests/unit/test_zero_copy_staging_5_6.py b/tests/unit/test_zero_copy_staging_5_6.py index dbba00bbf..310520e89 100644 --- a/tests/unit/test_zero_copy_staging_5_6.py +++ b/tests/unit/test_zero_copy_staging_5_6.py @@ -20,7 +20,6 @@ import pytest - try: from streamdiffusion.acceleration.tensorrt.utilities import _staging_action diff --git a/tools/summarize_audit.py b/tools/summarize_audit.py index f865c1447..da2e58620 100644 --- a/tools/summarize_audit.py +++ b/tools/summarize_audit.py @@ -32,7 +32,6 @@ import tomllib - # ============================================================================ # PACKAGE CLASSIFICATION CONSTANTS # ============================================================================ @@ -1399,7 +1398,7 @@ def generate_markdown_report( if has_safe: lines.append("**Safe to Keep (Development Tools)**:") for category in safe_categories: - if category in orphan_data and orphan_data[category]: + if orphan_data.get(category): tag, description = CATEGORY_LABELS.get(category, ("[?]", category)) for pkg in sorted(orphan_data[category], key=lambda x: x["name"]): lines.append(f"- `{pkg['name']}` ({pkg['version']})") @@ -1410,7 +1409,7 @@ def generate_markdown_report( if has_domain: lines.append("**Domain-Specific Packages (Auto-Detected)**:") for category in domain_categories: - if category in orphan_data and orphan_data[category]: + if orphan_data.get(category): tag, description = CATEGORY_LABELS.get(category, ("[?]", category)) lines.append(f"- {description}:") for pkg in sorted(orphan_data[category], key=lambda x: x["name"]): @@ -1645,7 +1644,7 @@ def main() -> None: print(f"Error: File not found: {json_file}", file=sys.stderr) sys.exit(1) - with open(json_file, "r", encoding="utf-8") as f: + with open(json_file, encoding="utf-8") as f: content = f.read() # Handle pip-audit header line (e.g., "No known vulnerabilities found") diff --git a/utils/viewer.py b/utils/viewer.py index 2bd90984b..a85ca72b7 100644 --- a/utils/viewer.py +++ b/utils/viewer.py @@ -9,7 +9,6 @@ from streamdiffusion.image_utils import postprocess_image - sys.path.append(os.path.join(os.path.dirname(__file__), "..", ".."))