def generate(self, **kwargs) -> Iterator[GeneratorResult]:
        """Generate images and return them as an iterator.

        Args:
            **kwargs: Keyword arguments containing model outputs.

        Returns:
            Iterator yielding visualization results.

        Raises:
            ValueError: If outputs are not provided in kwargs.
        """
        outputs = kwargs.get("outputs", None)
        if outputs is None:
            msg = "Outputs must be provided to generate images."
            raise ValueError(msg)
        return self._visualize_batch(outputs)
Generate images and return them as an iterator.

        Args:
            **kwargs: Keyword arguments containing model outputs.

        Returns:
            Iterator yielding visualization results.

        Raises:
            ValueError: If outputs are not provided in kwargs.
        
src/anomalib/utils/visualization/image.py