{"id":2442,"library":"comfyui-workflow-templates","title":"ComfyUI Workflow Templates","description":"The `comfyui-workflow-templates` library provides a convenient Python package to access a collection of pre-defined ComfyUI workflow JSONs. It allows developers to easily retrieve and use these templates programmatically, streamlining the creation and sharing of ComfyUI workflows. The current version is 0.9.45, with updates typically released as new templates are added or existing ones are refined.","status":"active","version":"0.9.45","language":"en","source_language":"en","source_url":"https://github.com/comfyflow/comfyui-workflow-templates","tags":["comfyui","ai","workflow","templates","image-generation","utility"],"install":[{"cmd":"pip install comfyui-workflow-templates","lang":"bash","label":"Install stable version"}],"dependencies":[],"imports":[{"symbol":"get_workflow_template","correct":"from comfyui_workflow_templates import get_workflow_template"},{"symbol":"list_templates","correct":"from comfyui_workflow_templates import list_templates"},{"symbol":"comfyui_workflow_templates (as cwt)","correct":"import comfyui_workflow_templates as cwt"}],"quickstart":{"code":"import comfyui_workflow_templates as cwt\nimport json\n\n# List all available templates\nprint(\"Available templates:\", cwt.list_templates()[:5], \"...\")\n\n# Get a specific template by name (e.g., 'sdxl_base_workflow')\n# Note: Template names can change; check available_templates if unsure.\ntry:\n    template_name = \"sdxl_base_workflow\" # This is an example, verify with list_templates()\n    workflow_json = cwt.get_workflow_template(template_name)\n    print(f\"\\nSuccessfully loaded template '{template_name}'.\")\n    # print(json.dumps(workflow_json, indent=2))\n    print(f\"Template keys (top-level): {list(workflow_json.keys())}\")\nexcept KeyError as e:\n    print(f\"\\nError: Template '{template_name}' not found. Available templates might have changed.\")\n    print(\"Consider using `cwt.list_templates()` to see current names.\")\n","lang":"python","description":"This quickstart demonstrates how to list available ComfyUI workflow templates and retrieve a specific one by name using the `comfyui_workflow_templates` package. The retrieved template is a standard Python dictionary representing the ComfyUI workflow JSON."},"warnings":[{"fix":"Always use `cwt.list_templates()` to get the current list of available template names, or wrap calls to `cwt.get_workflow_template()` in a `try-except KeyError` block.","message":"Template names are dynamic strings and can change or be removed between `comfyui-workflow-templates` versions. Relying on hardcoded template names without verification can lead to `KeyError`.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Users must manually load this dictionary into ComfyUI's API or UI if they wish to execute or manipulate the workflow within ComfyUI. The library solely provides the data.","message":"The `workflow_json` returned by `get_workflow_template()` is a raw Python dictionary representation of the ComfyUI workflow JSON. It provides no direct integration, validation, or interaction with a running ComfyUI instance.","severity":"gotcha","affected_versions":"All versions"},{"fix":"If precise template content is critical for your application, pin the `comfyui-workflow-templates` package to a specific version in your `requirements.txt` (e.g., `comfyui-workflow-templates==0.9.45`).","message":"The internal content of specific templates (e.g., node configurations, connections) can be updated between package versions. This might subtly alter the behavior of your workflows if you depend on a precise template structure.","severity":"gotcha","affected_versions":"All versions"}],"env_vars":null,"last_verified":"2026-04-10T00:00:00.000Z","next_check":"2026-07-09T00:00:00.000Z"}