code: def prior_attention_to_diffusers(
      checkpoint,
      *,
      diffusers_attention_prefix,
      original_attention_prefix,
      attention_head_dim,
  ):
      diffusers_checkpoint = {}
  
      # <original>.c_qkv -> <diffusers>.{to_q, to_k, to_v}
      [q_weight, k_weight, v_weight], [
          q_bias,
          k_bias,
          v_bias,
      ] = split_attentions(
          weight=checkpoint[
              f"{original_attention_prefix}.c_qkv.weight"
          ],
          bias=checkpoint[f"{original_attention_prefix}.c_qkv.bias"],
          split=3,
          chunk_size=attention_head_dim,
      )
  
      diffusers_checkpoint.update(
          {
              f"{diffusers_attention_prefix}.to_q.weight": q_weight,
              f"{diffusers_attention_prefix}.to_q.bias": q_bias,
              f"{diffusers_attention_prefix}.to_k.weight": k_weight,
              f"{diffusers_attention_prefix}.to_k.bias": k_bias,
              f"{diffusers_attention_prefix}.to_v.weight": v_weight,
              f"{diffusers_attention_prefix}.to_v.bias": v_bias,
          }
      )
  
      # <original>.c_proj -> <diffusers>.to_out.0
      diffusers_checkpoint.update(
          {
              f"{diffusers_attention_prefix}.to_out.0.weight": checkpoint[
                  f"{original_attention_prefix}.c_proj.weight"
              ],
              f"{diffusers_attention_prefix}.to_out.0.bias": checkpoint[
                  f"{original_attention_prefix}.c_proj.bias"
              ],
          }
      )
  
      return diffusers_checkpoint
  
imports: import argparse
  import tempfile
  import torch
  from accelerate import load_checkpoint_and_dispatch
  from transformers import CLIPTextModelWithProjection, CLIPTokenizer
  from diffusers import UnCLIPPipeline, UNet2DConditionModel, UNet2DModel
  from diffusers.models.prior_transformer import PriorTransformer
  from diffusers.pipelines.unclip.text_proj import UnCLIPTextProjModel
  from diffusers.schedulers.scheduling_unclip import UnCLIPScheduler
label_desc: Use image node_id 3 for calling a global function with example usage: prior_attention_to_diffusers(checkpoint) and returns: diffusers_checkpoint