{"record":{"id":"21727f62ceab8b0c","repo":"invoke-ai/InvokeAI","slug":"s-is-not-supported","errorCode":null,"errorMessage":"%s is not supported","messagePattern":"(.+?) is not supported","errorType":"exception","errorClass":"NameError","httpStatus":null,"severity":"error","filePath":"invokeai/backend/image_util/imwatermark/vendor.py","lineNumber":72,"sourceCode":"        if bits is None:\n            bits = []\n        self._watermarks = [int(bit) % 2 for bit in bits]\n        self._wmLen = len(self._watermarks)\n        self._wmType = \"bits\"\n\n    def set_watermark(self, wmType=\"bytes\", content=\"\"):\n        if wmType == \"ipv4\":\n            self.set_by_ipv4(content)\n        elif wmType == \"uuid\":\n            self.set_by_uuid(content)\n        elif wmType == \"bits\":\n            self.set_by_bits(content)\n        elif wmType == \"bytes\":\n            self.set_by_bytes(content)\n        elif wmType == \"b16\":\n            self.set_by_b16(content)\n        else:\n            raise NameError(\"%s is not supported\" % wmType)\n\n    def get_length(self):\n        return self._wmLen\n\n    # @classmethod\n    # def loadModel(cls):\n    #     RivaWatermark.loadModel()\n\n    def encode(self, cv2Image, method=\"dwtDct\", **configs):\n        (r, c, channels) = cv2Image.shape\n        if r * c < 256 * 256:\n            raise RuntimeError(\"image too small, should be larger than 256x256\")\n\n        if method == \"dwtDct\":\n            embed = EmbedMaxDct(self._watermarks, wmLen=self._wmLen, **configs)\n            return embed.encode(cv2Image)\n        # elif method == 'dwtDctSvd':\n        #     embed = EmbedDwtDctSvd(self._watermarks, wmLen=self._wmLen, **configs)","sourceCodeStart":54,"sourceCodeEnd":90,"githubUrl":"https://github.com/invoke-ai/InvokeAI/blob/0b6a024f2ff6a86bfb953dcdb9cc504ef7397a06/invokeai/backend/image_util/imwatermark/vendor.py#L54-L90","documentation":"The vendored WatermarkEncoder.set_watermark supports watermark content types 'bits', 'bytes', and 'b16'; any other wmType string raises NameError. This is a vendored legacy API that signals unsupported encoder content types.","triggerScenarios":"Constructing WatermarkEncoder with a wm_type other than bits/bytes/b16 (e.g. 'ipv4', 'chars') and then calling add_watermark -> set_watermark.","commonSituations":"Confusing decoder-only types (like 'ipv4') with encoder types, typos like 'byte', copying decoder constructor args into the encoder.","solutions":["Use one of 'bits', 'bytes', or 'b16' as the watermark type for encoding","Convert your content: e.g. encode text as bytes via set_watermark(content, 'bytes')","For 'ipv4' style watermarks, convert the IP string to bytes and use 'bytes'"],"exampleFix":"// before\nencoder.set_watermark(wm, \"ipv4\")\n// after\nimport socket\nip_bytes = socket.inet_aton(\"192.168.1.1\")\nencoder.set_watermark(ip_bytes, \"bytes\")","handlingStrategy":"validation","validationCode":"SUPPORTED_WM_TYPES = {\"bits\", \"bytes\", \"b16\"}\nif wm_type not in SUPPORTED_WM_TYPES:\n    wm_type = \"bytes\"\nencoder.set_watermark(content, wm_type)","typeGuard":"def is_encodable_wm_type(t: str) -> bool:\n    return t in {\"bits\", \"bytes\", \"b16\"}","tryCatchPattern":"try:\n    encoder.set_watermark(content, wm_type)\nexcept NameError as e:\n    logger.warning(\"unsupported wmType %s; falling back to bytes\", wm_type)\n    encoder.set_watermark(str(content).encode(), \"bytes\")","preventionTips":["Only use bits/bytes/b16 types with WatermarkEncoder","Reserve types like 'ipv4' for the decoder","Wrap content in bytes explicitly before encoding"],"tags":["watermark","unsupported-value","vendored-code"],"backgroundTag":"invalid-enum-value","analyzedSha":"0b6a024f2ff6a86bfb953dcdb9cc504ef7397a06","analyzedAt":"2026-08-29T04:46:49.967Z","schemaVersion":2},"datasetVersion":"2026-08-29T07:17:48.351Z"}