From 03158aa1a9e561c16feeb7abaaf66a149f5db89b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1s=20Guimar=C3=A3es=20Pellegrino?= <75428702+tomas-gp@users.noreply.github.com> Date: Fri, 28 Nov 2025 15:55:26 -0300 Subject: [PATCH] Fixing "Clear All Prompts" functionality on Notebook Example When clicking, the process would break due to trying to iterate on 'self.state' (which is None). Even fixing this, the code would break due to erasing the image from the processor. I'm not the most versatile in coding, but this fixed the issue. --- examples/sam3_image_interactive.ipynb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/sam3_image_interactive.ipynb b/examples/sam3_image_interactive.ipynb index 7e1e7666..38cb5514 100644 --- a/examples/sam3_image_interactive.ipynb +++ b/examples/sam3_image_interactive.ipynb @@ -430,9 +430,9 @@ " if self.current_image is not None:\n", " try:\n", " self._set_loading(True, \"Clearing prompts and resetting...\")\n", - " self.state = self.processor.reset_all_prompts(self.state)\n", - " if \"prompted_boxes\" in self.state:\n", - " del self.state[\"prompted_boxes\"]\n", + " image_placeholder = self.current_image + " self.state = self.processor.reset_all_prompts(self.state) + " self.state = self.processor.set_image(image_placeholder) " self.text_input.value = \"\"\n", " self._set_loading(False)\n", " self.status_label.value = \"Cleared all prompts\"\n",