code: def extend_sdxl(model):
      """this adds a bunch of parameters to make SDXL model look a bit more like SD1.5 to the rest of the codebase."""
  
      dtype = next(model.model.diffusion_model.parameters()).dtype
      model.model.diffusion_model.dtype = dtype
      model.model.conditioning_key = "crossattn"
      model.cond_stage_key = "txt"
      # model.cond_stage_model will be set in sd_hijack
  
      model.parameterization = (
          "v"
          if isinstance(
              model.denoiser.scaling,
              sgm.modules.diffusionmodules.denoiser_scaling.VScaling,
          )
          else "eps"
      )
  
      discretization = (
          sgm.modules.diffusionmodules.discretizer.LegacyDDPMDiscretization()
      )
      model.alphas_cumprod = torch.asarray(
          discretization.alphas_cumprod,
          device=devices.device,
          dtype=dtype,
      )
  
      model.conditioner.wrapped = torch.nn.Module()
  
file_path: stable-diffusion-webui/modules/sd_models_xl.py
imports: from __future__ import annotations
  import torch
  import sgm.models.diffusion
  import sgm.modules.diffusionmodules.denoiser_scaling
  import sgm.modules.diffusionmodules.discretizer
  from modules import devices, shared, prompt_parser
label_desc: Use image node_id 8 for calling a global function with example usage: extend_sdxl(model) without return types