feat: Add ComfyUI tool for Stable Diffusion (#8160)
parent
e896d1e9d7
commit
cf645c3ba1
Binary file not shown.
|
After Width: | Height: | Size: 209 KiB |
@ -0,0 +1,17 @@
|
|||||||
|
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))
|
||||||
@ -0,0 +1,42 @@
|
|||||||
|
identity:
|
||||||
|
author: Qun
|
||||||
|
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
|
||||||
|
model:
|
||||||
|
type: text-input
|
||||||
|
required: true
|
||||||
|
label:
|
||||||
|
en_US: Model with suffix
|
||||||
|
zh_Hans: 模型, 需要带后缀
|
||||||
|
pt_BR: Model with suffix
|
||||||
|
placeholder:
|
||||||
|
en_US: Please input your model
|
||||||
|
zh_Hans: 请输入你的模型名称
|
||||||
|
pt_BR: Please input your model
|
||||||
|
help:
|
||||||
|
en_US: The checkpoint name of the ComfyUI server, e.g. xxx.safetensors
|
||||||
|
zh_Hans: ComfyUI服务器的模型名称, 比如 xxx.safetensors
|
||||||
|
pt_BR: The checkpoint name of the ComfyUI server, e.g. xxx.safetensors
|
||||||
|
url: https://docs.dify.ai/tutorials/tool-configuration/comfyui
|
||||||
@ -0,0 +1,107 @@
|
|||||||
|
{
|
||||||
|
"3": {
|
||||||
|
"inputs": {
|
||||||
|
"seed": 156680208700286,
|
||||||
|
"steps": 20,
|
||||||
|
"cfg": 8,
|
||||||
|
"sampler_name": "euler",
|
||||||
|
"scheduler": "normal",
|
||||||
|
"denoise": 1,
|
||||||
|
"model": [
|
||||||
|
"4",
|
||||||
|
0
|
||||||
|
],
|
||||||
|
"positive": [
|
||||||
|
"6",
|
||||||
|
0
|
||||||
|
],
|
||||||
|
"negative": [
|
||||||
|
"7",
|
||||||
|
0
|
||||||
|
],
|
||||||
|
"latent_image": [
|
||||||
|
"5",
|
||||||
|
0
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"class_type": "KSampler",
|
||||||
|
"_meta": {
|
||||||
|
"title": "KSampler"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"4": {
|
||||||
|
"inputs": {
|
||||||
|
"ckpt_name": "3dAnimationDiffusion_v10.safetensors"
|
||||||
|
},
|
||||||
|
"class_type": "CheckpointLoaderSimple",
|
||||||
|
"_meta": {
|
||||||
|
"title": "Load Checkpoint"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"5": {
|
||||||
|
"inputs": {
|
||||||
|
"width": 512,
|
||||||
|
"height": 512,
|
||||||
|
"batch_size": 1
|
||||||
|
},
|
||||||
|
"class_type": "EmptyLatentImage",
|
||||||
|
"_meta": {
|
||||||
|
"title": "Empty Latent Image"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"6": {
|
||||||
|
"inputs": {
|
||||||
|
"text": "beautiful scenery nature glass bottle landscape, , purple galaxy bottle,",
|
||||||
|
"clip": [
|
||||||
|
"4",
|
||||||
|
1
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"class_type": "CLIPTextEncode",
|
||||||
|
"_meta": {
|
||||||
|
"title": "CLIP Text Encode (Prompt)"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"7": {
|
||||||
|
"inputs": {
|
||||||
|
"text": "text, watermark",
|
||||||
|
"clip": [
|
||||||
|
"4",
|
||||||
|
1
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"class_type": "CLIPTextEncode",
|
||||||
|
"_meta": {
|
||||||
|
"title": "CLIP Text Encode (Prompt)"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"8": {
|
||||||
|
"inputs": {
|
||||||
|
"samples": [
|
||||||
|
"3",
|
||||||
|
0
|
||||||
|
],
|
||||||
|
"vae": [
|
||||||
|
"4",
|
||||||
|
2
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"class_type": "VAEDecode",
|
||||||
|
"_meta": {
|
||||||
|
"title": "VAE Decode"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"9": {
|
||||||
|
"inputs": {
|
||||||
|
"filename_prefix": "ComfyUI",
|
||||||
|
"images": [
|
||||||
|
"8",
|
||||||
|
0
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"class_type": "SaveImage",
|
||||||
|
"_meta": {
|
||||||
|
"title": "Save Image"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue