+
     åûjÒ$  ã                  ó¦   € ^ RI Ht ^ RIHtHtHt ^ RIHt ^RIH	t	 ^RI
Ht  ! R R]P                  ]	]4      t ! R R	]P                  ]	]4      tR
# )é    )Úannotations)ÚAnyÚLiteralÚOptional)Únn)ÚImageModuleMixIn)ÚONNXExportMixinc                  ó¦   a € ] tR t^tRtR V 3R lltR V 3R llt]R R l4       t]P                  RR R	 ll4       tR
RRR/R V 3R lllt
RtV ;t# )ÚImageModulea6  Subclass for an image ``nn.Module`` whose call also takes NumPy arrays, PIL images and image paths.

A subclass defines ``forward`` on tensors. ``out = module(image, output_type="pt")`` converts ``image`` to a tensor
when it is a NumPy array, a PIL image or, as the first positional argument, the path of an image file, runs
``forward`` and returns the output as a tensor (``"pt"``), a channels-last NumPy array (``"numpy"``) or a PIL image,
a list of them for a batch (``"pil"``). The last output is kept for :meth:`ImageModuleMixIn.show` and
:meth:`ImageModuleMixIn.save`.

Note:
    The output cache retains a detached reference to the last tensor output, so it can keep that storage alive and
    reflects later in-place edits. Setting ``disable_features = True`` clears the cache and bypasses the extra
    behavior. The cache is omitted when the module is pickled.

See Also:
    - :class:`ImageSequential`: the same conversions around an ``nn.Sequential`` chain of modules.
    - :class:`ImageModuleMixIn`: the conversion methods alone, as a decorator for any function.

c               ó$   € V ^8„  d   QhRRRRRR/# ©é   Úargsr   ÚkwargsÚreturnÚNone© )Úformats   "ÚNC:\Ai_Coding\apps\studio\ComfyUI\.venv\Lib\site-packages\kornia\core\module.pyÚ__annotate__ÚImageModule.__annotate__0   ó!   € ÷ "ñ "˜cð "¨Sð "°Tñ "ó    c                	óD   <€ \         SV `  ! V/ VB  R V n        RV n        R# ©FN©ÚsuperÚ__init__Ú_disable_featuresÚ_output_image©Úselfr   r   Ú	__class__s   &*,€r   r   ÚImageModule.__init__0   ó%   ø€ Ü‰Ò˜$Ð) &Ò)Ø',ˆÔØ!ˆÖr   c               ó   € V ^8„  d   QhRR/# ©r   r   zdict[str, Any]r   )r   s   "r   r   r   5   ó   € ÷ ñ ˜nñ r   c                	óH   <€ \         SV `  4       pVP                  R R4       V# ©r    N©r   Ú__getstate__Úpop©r"   Ústater#   s   & €r   r,   ÚImageModule.__getstate__5   ó#   ø€ Ü‘Ñ$Ó&ˆØ�	‰	�/ 4Ô(Øˆr   c               ó   € V ^8„  d   QhRR/# ©r   r   Úboolr   )r   s   "r   r   r   ;   ó   € ÷ &ñ & $ñ &r   c                ó   € V P                   # )aÑ  Whether convenience I/O (input/output) helper features are disabled.

This flag controls the extra behavior provided by :class:`ImageModuleMixIn`,
such as automatic input conversion (for example, PIL or NumPy inputs),
automatic output conversion, and output caching for visualization helpers.

Returns:
    ``True`` if the helper features are bypassed and the module behaves like
    a plain :class:`torch.nn.Module` call. ``False`` if helper features are enabled.
©r   ©r"   s   &r   Údisable_featuresÚImageModule.disable_features:   ó   € ð ×%Ñ%Ð%r   c               ó    € V ^8„  d   QhRRRR/# ©r   Úvaluer4   r   r   r   )r   s   "r   r   r   I   ó   € ÷ &ñ & dð &°dñ &r   c                ó4   € Wn         V'       d
   RV n        R# R# )a)  Enable or disable convenience I/O (input/output) handling features.

Args:
    value: Feature toggle.
        - ``True``: disable automatic type conversion and output caching,
          so ``__call__`` behaves closer to a raw PyTorch module call.
        - ``False``: keep helper features active.
N©r   r    ©r"   r>   s   &&r   r9   r:   H   ó   € ð "'ÔßØ!%ˆDÖñ r   Úinput_names_to_handleNÚoutput_typeÚptc          
     ó,   € V ^8„  d   QhRRRRRRRRRR/# ©	r   Úinputsr   rD   zOptional[list[Any]]rE   zLiteral['pt', 'numpy', 'pil']r   r   r   )r   s   "r   r   r   V   ó<   € ÷ !ñ !àð!ð  3ð!ð 3ð	!ð
 ð!ð 
ñ!r   c          	     ó  <€ V P                   '       g^   V P                  \        SV `  W4VRV P                  R7      pV P                  V P                  VR4      R4       V P                  WR4      pV# \        SV `  ! V/ VB pV# ©a¤  Run the module on converted inputs and return its output as ``output_type``.

Args:
    inputs: Inputs to operate on.
    input_names_to_handle: List of parameter names to convert. Module calls use the ``forward``
        signature; a variadic parameter name selects all its values.
        If None, convert every tensor, NumPy array and PIL image argument, and load a string as an image
        path only if it is the first positional argument.
    output_type: Desired output type ('pt', 'numpy', or 'pil').
    kwargs: Additional arguments.

Returns:
    The output of ``forward``, converted to ``output_type``; a tuple or list output is converted element by
    element.

rF   )Úsignature_source©r   Ú_call_convertedr   Ú__call__ÚforwardÚ_store_output_imageÚ_convert_output©r"   rD   rE   rI   r   Útensor_outputr    r#   s   &$$*,  €r   rP   ÚImageModule.__call__V   ó’   ø€ ð0 ×%×%Ð%Ø ×0Ñ0Ü‘Ñ  &Ð2GÈÐ`d×`lÑ`lð 1ó ˆMð ×$Ñ$ T×%9Ñ%9¸-ÈÓ%NÐPTÔUØ ×0Ñ0°ÓLˆMð Ðô "™GÒ,¨fÐ?¸Ñ?ˆMØÐr   rA   ©T©Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__r   r,   Úpropertyr9   ÚsetterrP   Ú__static_attributes__Ú__classcell__©r#   s   @r   r   r      sm   ø† ñ÷&"ð "÷
ð ð
 ô&ó ð&ð ×Ñö&ó ð&ð!ð 6:ð!ð 6:÷	!÷ !ð !r   r   c                  ó¦   a € ] tR t^ztRtR V 3R lltR V 3R llt]R R l4       t]P                  RR R	 ll4       tR
RRR/R V 3R lllt
RtV ;t# )ÚImageSequentiala‹  Chain modules in an ``nn.Sequential`` whose call also takes NumPy arrays, PIL images and image paths.

``seq = ImageSequential(first, second)`` builds an ``nn.Sequential`` of the given modules.
``out = seq(image, output_type="numpy")`` converts the input and the output of the whole chain as
:class:`ImageModule` converts those of its ``forward``, keeps the last output for :meth:`ImageModuleMixIn.show` and
:meth:`ImageModuleMixIn.save`, and :meth:`ONNXExportMixin.to_onnx` exports the chain. For random augmentations whose
parameters are recorded and replayed, use the container of the same name,
:class:`~kornia.augmentation.container.ImageSequential`.

Note:
    The output cache retains a detached reference to the last tensor output, so it can keep that storage alive and
    reflects later in-place edits. Setting ``disable_features = True`` clears the cache and bypasses the extra
    behavior. The cache is omitted when the module is pickled.

See Also:
    - :class:`ImageModule`: the same conversions around one module with its own ``forward``.
    - :class:`~kornia.augmentation.container.ImageSequential`: records and replays its random parameters.

c               ó$   € V ^8„  d   QhRRRRRR/# r   r   )r   s   "r   r   ÚImageSequential.__annotate__�   r   r   c                	óD   <€ \         SV `  ! V/ VB  R V n        RV n        R# r   r   r!   s   &*,€r   r   ÚImageSequential.__init__�   r%   r   c               ó   € V ^8„  d   QhRR/# r'   r   )r   s   "r   r   rg   ”   r(   r   c                	óH   <€ \         SV `  4       pVP                  R R4       V# r*   r+   r.   s   & €r   r,   ÚImageSequential.__getstate__”   r1   r   c               ó   € V ^8„  d   QhRR/# r3   r   )r   s   "r   r   rg   š   r5   r   c                ó   € V P                   # )aÕ  Whether convenience I/O (input/output) helper features are disabled.

This flag controls the extra behavior provided by :class:`ImageModuleMixIn`,
such as automatic input conversion (for example, PIL or NumPy inputs),
automatic output conversion, and output caching for visualization helpers.

Returns:
    ``True`` if the helper features are bypassed and the module behaves like
    a plain :class:`torch.nn.Sequential` call. ``False`` if helper features are enabled.
r7   r8   s   &r   r9   Ú ImageSequential.disable_features™   r;   r   c               ó    € V ^8„  d   QhRRRR/# r=   r   )r   s   "r   r   rg   ¨   r?   r   c                ó4   € Wn         V'       d
   RV n        R# R# )a-  Enable or disable convenience I/O (input/output) handling features.

Args:
    value: Feature toggle.
        - ``True``: disable automatic type conversion and output caching,
          so ``__call__`` behaves closer to a raw PyTorch sequential call.
        - ``False``: keep helper features active.
NrA   rB   s   &&r   r9   ro   §   rC   r   rD   NrE   rF   c          
     ó,   € V ^8„  d   QhRRRRRRRRRR/# rH   r   )r   s   "r   r   rg   µ   rJ   r   c          	     ó  <€ V P                   '       g^   V P                  \        SV `  W4VRV P                  R7      pV P                  V P                  VR4      R4       V P                  WR4      pV# \        SV `  ! V/ VB pV# rL   rN   rT   s   &$$*,  €r   rP   ÚImageSequential.__call__µ   rW   r   rA   rX   rY   rc   s   @r   re   re   z   sm   ø† ñ÷("ð "÷
ð ð
 ô&ó ð&ð ×Ñö&ó ð&ð!ð 6:ð!ð 6:÷	!÷ !ð !r   re   N)Ú
__future__r   Útypingr   r   r   Útorchr   Úmixin.image_moduler   Ú
mixin.onnxr	   ÚModuler   Ú
Sequentialre   r   r   r   Ú<module>r|      sH   ðõ$ #ç )Ñ )å å 0Ý 'ô[�"—)‘)Ð-¨ô [ô|\�b—m‘mÐ%5°ö \r   