diff --git a/gradio/components.py b/gradio/components.py index 428bf6cfcfbfc..7bd6a1e947344 100644 --- a/gradio/components.py +++ b/gradio/components.py @@ -1772,6 +1772,8 @@ def preprocess( mask = "" if self.tool == "sketch" and self.source in ["upload", "webcam"]: + if isinstance(x, str): + x = {"image":x, "mask": x[:]} assert isinstance(x, dict) x, mask = x["image"], x["mask"]