code: def generation_bot(state, num_inference_steps):
      global image
      outputs = state.messages[-1][-1]
      caption = copy.deepcopy(outputs)
  
      id1 = caption.find("<gen_image>")
      num_space = 12
      id2 = caption.find("</gen_image>")
      if id1 == -1 and id2 == -1:
          caption = caption
      elif id1 == -1 and id2 != -1:
          caption = caption[:id2]
      elif id1 != -1 and id2 == -1:
          caption = caption[id1 + num_space :]
      else:
          caption = caption[id1 + num_space : id2]
  
      if id1 != -1:
          image = pipe(
              caption, num_inference_steps=num_inference_steps
          ).images[0]
          yield (image, enable_btn)
      else:
          yield (None, enable_btn)
  
imports: import argparse
  import datetime
  import json
  import os
  import time
  import gradio
  import requests
  from llmga.llava.conversation import default_conversation, conv_templates, SeparatorStyle
  from llmga.llava.constants import LOGDIR
  from llmga.llava.utils import build_logger, server_error_msg, violates_moderation, moderation_msg
  from llmga.llava.constants import IMAGE_TOKEN_INDEX, DEFAULT_IMAGE_TOKEN, DEFAULT_IM_START_TOKEN, DEFAULT_IM_END_TOKEN
  from llmga.llava.conversation import conv_templates, SeparatorStyle
  from llmga.llava.model.builder import load_pretrained_model
  from llmga.llava.utils import disable_torch_init
  from llmga.llava.mm_utils import tokenizer_image_token, get_model_name_from_path, KeywordsStoppingCriteria
  import hashlib
  import torch
  from llmga.diffusers.pipeline_stable_diffusion_xl_lpw import StableDiffusionXLPipeline
  import copy
label_desc: Use image node_id 7 for calling a global function with example usage: generation_bot(state, num_inference_steps) without return types