class_docstr: CLIP guided stable diffusion based on the amazing repo by @crowsonkb and @Jack000
  - https://github.com/Jack000/glid-3-xl
  - https://github.dev/crowsonkb/k-diffusion
class_docstr_tok: ["CLIP","guided","stable","diffusion","based","on","the","amazing","repo","by","@","crowsonkb","and","@","Jack000","-","https",":","\/\/github.com\/Jack000\/glid-3-xl","-","https",":","\/\/github.dev\/crowsonkb\/k-diffusion"]
code: def enable_attention_slicing(
      self, slice_size: Optional[Union[str, int]] = "auto"
  ):
      if slice_size == "auto":
          # half the attention head size is usually a good trade-off between
          # speed and memory
          slice_size = self.unet.config.attention_head_dim // 2
      self.unet.set_attention_slice(slice_size)
  
imports: import inspect
  from typing import List, Optional, Union
  import numpy
  import PIL.Image
  import torch
  from torch import nn
  from torch.nn import functional
  from torchvision import transforms
  from transformers import CLIPFeatureExtractor, CLIPModel, CLIPTextModel, CLIPTokenizer
  from diffusers import AutoencoderKL, DDIMScheduler, DiffusionPipeline, DPMSolverMultistepScheduler, LMSDiscreteScheduler, PNDMScheduler, UNet2DConditionModel
  from diffusers.pipelines.stable_diffusion.pipeline_stable_diffusion import StableDiffusionPipelineOutput
  from diffusers.utils import PIL_INTERPOLATION, deprecate
  from diffusers.utils.torch_utils import randn_tensor
label_desc: Use image node_id 2 for calling the CLIPGuidedStableDiffusion obj's underlying member method code with example usage: obj.enable_attention_slicing(slice_size) without return types