```python:inference/core/workflows/core_steps/models/foundation/qwen3_5vl/v1.py
##########################################################################
# Qwen3.5-VL Workflow Block
##########################################################################
from typing import Optional

from inference.core.entities.requests.inference import LMMInferenceRequest
from inference.core.env import (HOSTED_CORE_MODEL_URL, LOCAL_INFERENCE_API_URL,
                                WORKFLOWS_REMOTE_API_TARGET)
from inference.core.managers.base import ModelManager
from inference.core.workflows.core_steps.common.entities import \
    StepExecutionMode
from inference.core.workflows.execution_engine.entities.base import (
    Batch, WorkflowImageData)
from inference.core.workflows.prototypes.block import (BlockResult,
                                                       WorkflowBlock)
from inference_sdk import InferenceHTTPClient


class Qwen35VLBlockV1(WorkflowBlock):
    def __init__(
        self,
        model_manager: ModelManager,
        api_key: Optional[str],
        step_execution_mode: StepExecutionMode,
    ):
        self._model_manager = model_manager
        self._api_key = api_key
        self._step_execution_mode = step_execution_mode

    def run(
        self,
        images: Batch[WorkflowImageData],
        model_version: str,
        prompt: Optional[str],
        system_prompt: Optional[str],
    ) -> BlockResult:
        if self._step_execution_mode == StepExecutionMode.LOCAL:
            return self.run_locally(
                images=images,
                model_version=model_version,
                prompt=prompt,
                system_prompt=system_prompt,
            )
        elif self._step_execution_mode == StepExecutionMode.REMOTE:
            return self.run_remotely(
                images=images,
                model_version=model_version,
                prompt=prompt,
                system_prompt=system_prompt,
            )
        else:
            raise ValueError(
                f"Unknown step execution mode: {self._step_execution_mode}"
            )

    def run_remotely(
        self,
        images: Batch[WorkflowImageData],
        model_version: str,
        prompt: Optional[str],
        system_prompt: Optional[str],
    ) -> BlockResult:
        api_url = (
            LOCAL_INFERENCE_API_URL
            if WORKFLOWS_REMOTE_API_TARGET != "hosted"
            else HOSTED_CORE_MODEL_URL
        )
        client = InferenceHTTPClient(
            api_url=api_url,
            api_key=self._api_key,
        )
        if WORKFLOWS_REMOTE_API_TARGET == "hosted":
            client.select_api_v0()

        prompt = prompt or "Describe what's in this image."
        system_prompt = (
            system_prompt
            or "You are a Qwen3.5-VL model that can answer questions about any image."
        )
        combined_prompt = prompt + "<system_prompt>" + system_prompt

        predictions = []
        if not images:
            return predictions

        inference_inputs = [image.base64_image for image in images]
        result = client.infer_lmm(
            inference_input=inference_inputs,
            model_id=model_version,
            prompt=combined_prompt,
            model_id_in_path=True,
        )

        if isinstance(result, list):
            for res in result:
                response_text = res.get("response", res)
                predictions.append({"parsed_output": response_text})
        else:
            response_text = result.get("response", result)
            predictions.append({"parsed_output": response_text})

        return predictions

    def run_locally(
        self,
        images: Batch[WorkflowImageData],
        model_version: str,
        prompt: Optional[str],
        system_prompt: Optional[str],
    ) -> BlockResult:
        # Convert each image to the format required by the model.
        inference_images = [
            i.to_inference_format(numpy_preferred=False) for i in images
        ]
        # Use the provided prompt or default to a generic image description request.
        prompt = prompt or "Describe what's in this image."
        system_prompt = (
            system_prompt
            or "You are a Qwen3.5-VL model that can answer questions about any image."
        )
        prompts = [prompt + "<system_prompt>" + system_prompt] * len(inference_images)
        # Register Qwen3.5-VL with the model manager.
        self._model_manager.add_model(model_id=model_version, api_key=self._api_key)

        predictions = []
        for image, single_prompt in zip(inference_images, prompts):
            # Build an LMMInferenceRequest with both prompt and image.
            request = LMMInferenceRequest(
                api_key=self._api_key,
                model_id=model_version,
                image=image,
                source="workflow-execution",
                prompt=single_prompt,
            )
            # Run inference.
            prediction = self._model_manager.infer_from_request_sync(
                model_id=model_version, request=request
            )
            response_text = prediction.response
            predictions.append(
                {
                    "parsed_output": response_text,
                }
            )
        return predictions
```