Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add ComfyUI tool for Stable Diffusion #8160

Merged
merged 11 commits into from
Sep 18, 2024
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
QunBB marked this conversation as resolved.
Show resolved Hide resolved
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
18 changes: 18 additions & 0 deletions api/core/tools/provider/builtin/comfyui/comfyui.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
from typing import Any

from core.tools.errors import ToolProviderCredentialValidationError
from core.tools.provider.builtin.comfyui.tools.comfyui_stable_diffusion import ComfyuiStableDiffusionTool
from core.tools.provider.builtin_tool_provider import BuiltinToolProviderController


class ComfyUIProvider(BuiltinToolProviderController):
def _validate_credentials(self, credentials: dict[str, Any]) -> None:
try:
ComfyuiStableDiffusionTool().fork_tool_runtime(
runtime={
"credentials": credentials,
}
).validate_models()
except Exception as e:
raise ToolProviderCredentialValidationError(str(e))

26 changes: 26 additions & 0 deletions api/core/tools/provider/builtin/comfyui/comfyui.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
identity:
author: Dify
QunBB marked this conversation as resolved.
Show resolved Hide resolved
name: comfyui
label:
en_US: ComfyUI
zh_Hans: ComfyUI
pt_BR: ComfyUI
description:
en_US: ComfyUI is a tool for generating images which can be deployed locally.
zh_Hans: ComfyUI 是一个可以在本地部署的图片生成的工具。
pt_BR: ComfyUI is a tool for generating images which can be deployed locally.
icon: icon.png
tags:
- image
credentials_for_provider:
base_url:
type: text-input
required: true
label:
en_US: Base URL
zh_Hans: ComfyUI服务器的Base URL
pt_BR: Base URL
placeholder:
en_US: Please input your ComfyUI server's Base URL
zh_Hans: 请输入你的 ComfyUI 服务器的 Base URL
pt_BR: Please input your ComfyUI server's Base URL
Loading