{"slug": "enable-screenshot-image-input-for-custom-vision-models-in-zcode", "title": "Enable screenshot/image input for custom Vision models in ZCode", "summary": "ZCode, a developer tool, misclassifies custom OpenAI-compatible vision models as text-only, blocking screenshot input. A developer provided a Python script to patch the configuration file by adding image support to the model's modalities field, enabling vision capabilities for models like glm-5.2.", "body_md": "ZCode may classify an auto-discovered custom OpenAI-compatible model as text-only even when the underlying model and gateway support Vision.\n\nAfter attaching a screenshot, ZCode responds with a message similar to:\n\nI'm unable to view images. The selected model does not support image input.\n\nZCode stores custom-provider metadata in:\n\n```\n~/.zcode/v2/config.json\n```\n\nAn auto-discovered model may be recorded with an explicit text-only input modality:\n\n```\n{\n  \"modalities\": {\n    \"input\": [\"text\"],\n    \"output\": [\"text\"]\n  }\n}\n```\n\nSetting only `\"supportsImages\": true`\n\nis not enough. ZCode uses `modalities.input`\n\nas the effective capability gate, so the working model entry needs both declarations:\n\n```\n{\n  \"modalities\": {\n    \"input\": [\"text\", \"image\"],\n    \"output\": [\"text\"]\n  },\n  \"supportsImages\": true\n}\n```\n\nFirst verify that the model accepts an OpenAI-compatible multimodal request through the same gateway used by ZCode. A valid message uses a content array containing `text`\n\nand `image_url`\n\nparts:\n\n```\n{\n  \"model\": \"glm-5.2\",\n  \"messages\": [\n    {\n      \"role\": \"user\",\n      \"content\": [\n        {\"type\": \"text\", \"text\": \"Describe this image.\"},\n        {\n          \"type\": \"image_url\",\n          \"image_url\": {\"url\": \"data:image/png;base64,...\"}\n        }\n      ]\n    }\n  ]\n}\n```\n\nIf this request fails, fix the model/gateway path first. This ZCode patch only corrects client-side capability metadata.\n\n- Quit ZCode completely (\n`Cmd-Q`\n\non macOS;**Quit/Exit** on Windows or Linux). Closing only the window is insufficient because ZCode caches model capabilities. - Download\n`fix-zcode-custom-model-vision.py`\n\nfrom this gist. - Run it with the model ID used by the custom provider:\n\n```\npython3 fix-zcode-custom-model-vision.py glm-5.2\n```\n\nIf multiple custom providers contain the same model ID, list the candidates:\n\n```\npython3 fix-zcode-custom-model-vision.py glm-5.2\n```\n\nThen rerun with the intended provider UUID:\n\n```\npython3 fix-zcode-custom-model-vision.py glm-5.2 --provider-id PROVIDER_UUID\n```\n\nThe script:\n\n- ignores ZCode's built-in providers;\n- creates a timestamped backup;\n- preserves credentials and unrelated settings;\n- atomically updates the configuration;\n- verifies the saved result;\n- never prints API keys or provider options.\n\n- Reopen ZCode.\n- Select the patched custom model.\n- Start a\n**new** task/chat. - Attach a screenshot.\n- Ask for objectively verifiable OCR, such as:\n\n```\nTranscribe the largest visible heading exactly.\n```\n\nA successful HTTP request alone is not enough—the answer must demonstrate that the model saw the image.\n\nThe script prints the backup path, for example:\n\n```\n~/.zcode/v2/config.json.before-image-modalities-20260728-170000\n```\n\nQuit ZCode and restore that file over `~/.zcode/v2/config.json`\n\n.\n\nEditing or refreshing the custom provider—or upgrading ZCode—may regenerate the model metadata and restore `\"input\": [\"text\"]`\n\n. If screenshot support disappears, inspect the model entry and rerun the patch.\n\nThe durable upstream fix is for ZCode to preserve custom input modalities, expose them in the custom-model UI, or import reliable capability metadata during model discovery.", "url": "https://wpnews.pro/news/enable-screenshot-image-input-for-custom-vision-models-in-zcode", "canonical_source": "https://gist.github.com/mfellner/da8e587cb7091b5db04bdc16a95b02a8", "published_at": "2026-07-28 15:20:18+00:00", "updated_at": "2026-07-28 15:30:01.739575+00:00", "lang": "en", "topics": ["developer-tools", "artificial-intelligence", "computer-vision"], "entities": ["ZCode", "OpenAI"], "alternates": {"html": "https://wpnews.pro/news/enable-screenshot-image-input-for-custom-vision-models-in-zcode", "markdown": "https://wpnews.pro/news/enable-screenshot-image-input-for-custom-vision-models-in-zcode.md", "text": "https://wpnews.pro/news/enable-screenshot-image-input-for-custom-vision-models-in-zcode.txt", "jsonld": "https://wpnews.pro/news/enable-screenshot-image-input-for-custom-vision-models-in-zcode.jsonld"}}