def __init__(
        self,
        backbone: str = "mcait",
        flow_steps: int = 4,
        affine_clamp: float = 2.0,
        affine_subnet_channels_ratio: float = 1.0,
        permute_soft: bool = False,
        pre_processor: PreProcessor | bool = True,
        post_processor: PostProcessor | bool = True,
        evaluator: Evaluator | bool = True,
        visualizer: Visualizer | bool = True,
    ) -> None:
        """Initialize U-Flow model.

        Args:
            backbone (str, optional): Name of the backbone feature extractor.
                Must be one of ``["mcait", "resnet18", "wide_resnet50_2"]``.
                Defaults to ``"mcait"``.
            flow_steps (int, optional): Number of normalizing flow steps.
                Defaults to ``4``.
            affine_clamp (float, optional): Clamping value for affine coupling
                layers. Defaults to ``2.0``.
            affine_subnet_channels_ratio (float, optional): Channel ratio for
                affine coupling subnet. Defaults to ``1.0``.
            permute_soft (bool, optional): Whether to use soft permutation.
                Defaults to ``False``.
            pre_processor (PreProcessor | bool, optional): Pre-processor for
                input data. If ``True``, uses default pre-processor. Defaults to
                ``True``.
            post_processor (PostProcessor | bool, optional): Post-processor for
                model outputs. If ``True``, uses default post-processor.
                Defaults to ``True``.
            evaluator (Evaluator | bool, optional): Evaluator for model
                performance. If ``True``, uses default evaluator. Defaults to
                ``True``.
            visualizer (Visualizer | bool, optional): Visualizer for model
                outputs. If ``True``, uses default visualizer. Defaults to
                ``True``.

        Raises:
            ValueError: If ``input_size`` is not provided during initialization.
        """
        super().__init__(
            pre_processor=pre_processor,
            post_processor=post_processor,
            evaluator=evaluator,
            visualizer=visualizer,
        )
        if self.input_size is None:
            msg = "Input size is required for UFlow model."
            raise ValueError(msg)

        self.backbone = backbone
        self.flow_steps = flow_steps
        self.affine_clamp = affine_clamp
        self.affine_subnet_channels_ratio = affine_subnet_channels_ratio
        self.permute_soft = permute_soft

        self.model = UflowModel(
            input_size=self.input_size,
            backbone=self.backbone,
            flow_steps=self.flow_steps,
            affine_clamp=self.affine_clamp,
            affine_subnet_channels_ratio=self.affine_subnet_channels_ratio,
            permute_soft=self.permute_soft,
        )
        self.loss = UFlowLoss()
Initialize U-Flow model.

        Args:
            backbone (str, optional): Name of the backbone feature extractor.
                Must be one of ``["mcait", "resnet18", "wide_resnet50_2"]``.
                Defaults to ``"mcait"``.
            flow_steps (int, optional): Number of normalizing flow steps.
                Defaults to ``4``.
            affine_clamp (float, optional): Clamping value for affine coupling
                layers. Defaults to ``2.0``.
            affine_subnet_channels_ratio (float, optional): Channel ratio for
                affine coupling subnet. Defaults to ``1.0``.
            permute_soft (bool, optional): Whether to use soft permutation.
                Defaults to ``False``.
            pre_processor (PreProcessor | bool, optional): Pre-processor for
                input data. If ``True``, uses default pre-processor. Defaults to
                ``True``.
            post_processor (PostProcessor | bool, optional): Post-processor for
                model outputs. If ``True``, uses default post-processor.
                Defaults to ``True``.
            evaluator (Evaluator | bool, optional): Evaluator for model
                performance. If ``True``, uses default evaluator. Defaults to
                ``True``.
            visualizer (Visualizer | bool, optional): Visualizer for model
                outputs. If ``True``, uses default visualizer. Defaults to
                ``True``.

        Raises:
            ValueError: If ``input_size`` is not provided during initialization.
        
src/anomalib/models/image/uflow/lightning_model.py