Function CompileComfyJSON

  • Compile a normalized json from the comfyui backend into a string representing the final code.

    Parameters

    • cfg: Record<string, {
          inputs: Record<string, {
              metadata?: {
                  default?: unknown;
                  max?: unknown;
                  min?: unknown;
                  step?: unknown;
              };
              required: boolean;
              type: string | string[];
          }>;
          metadata: {
              category: string;
              description: string;
              display_name: string;
              is_output_node: boolean;
              name: string;
              python_module: string;
          };
          outputs: Record<string, {
              is_list: boolean;
              type: string;
          }>;
      }>

      all entries to generate the interface code from.

    • Optionalbasename: string

      the package name for this client library. comfyui-bun-client by default.

    Returns string

    string encoded typescript sourcecode implementing the interface.