Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
chenpangpang
ComfyUI
Commits
60ac9832
Commit
60ac9832
authored
Apr 08, 2023
by
comfyanonymous
Browse files
Merge branch 'master' of
https://github.com/city96/ComfyUI
parents
ebd7f9bf
9ac95e6a
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
58 additions
and
2 deletions
+58
-2
custom_nodes/example_node.py.example
custom_nodes/example_node.py.example
+5
-0
nodes.py
nodes.py
+50
-0
server.py
server.py
+2
-1
web/scripts/app.js
web/scripts/app.js
+1
-1
No files found.
custom_nodes/example_node.py.example
View file @
60ac9832
...
@@ -88,3 +88,8 @@ class Example:
...
@@ -88,3 +88,8 @@ class Example:
NODE_CLASS_MAPPINGS = {
NODE_CLASS_MAPPINGS = {
"Example": Example
"Example": Example
}
}
# A dictionary that contains the friendly/humanly readable titles for the nodes
NODE_DISPLAY_NAME_MAPPINGS = {
"Example": "Example Node"
}
nodes.py
View file @
60ac9832
...
@@ -1104,6 +1104,54 @@ NODE_CLASS_MAPPINGS = {
...
@@ -1104,6 +1104,54 @@ NODE_CLASS_MAPPINGS = {
"DiffusersLoader"
:
DiffusersLoader
,
"DiffusersLoader"
:
DiffusersLoader
,
}
}
NODE_DISPLAY_NAME_MAPPINGS
=
{
# Sampling
"KSampler"
:
"KSampler"
,
"KSamplerAdvanced"
:
"KSampler (Advanced)"
,
# Loaders
"CheckpointLoader"
:
"Load Checkpoint"
,
"CheckpointLoaderSimple"
:
"Load Checkpoint (Simple)"
,
"VAELoader"
:
"Load VAE"
,
"LoraLoader"
:
"Load LoRA"
,
"CLIPLoader"
:
"Load CLIP"
,
"ControlNetLoader"
:
"Load ControlNet Model"
,
"DiffControlNetLoader"
:
"Load ControlNet Model (diff)"
,
"StyleModelLoader"
:
"Load Style Model"
,
"CLIPVisionLoader"
:
"Load CLIP Vision"
,
"UpscaleModelLoader"
:
"Load Upscale Model"
,
# Conditioning
"CLIPVisionEncode"
:
"CLIP Vision Encode"
,
"StyleModelApply"
:
"Apply Style Model"
,
"CLIPTextEncode"
:
"CLIP Text Encode (Prompt)"
,
"CLIPSetLastLayer"
:
"CLIP Set Last Layer"
,
"ConditioningCombine"
:
"Conditioning (Combine)"
,
"ConditioningSetArea"
:
"Conditioning (Set Area)"
,
"ControlNetApply"
:
"Apply ControlNet"
,
# Latent
"VAEEncodeForInpaint"
:
"VAE Encode (for Inpainting)"
,
"SetLatentNoiseMask"
:
"Set Latent Noise Mask"
,
"VAEDecode"
:
"VAE Decode"
,
"VAEEncode"
:
"VAE Encode"
,
"LatentRotate"
:
"Rotate Latent"
,
"LatentFlip"
:
"Flip Latent"
,
"LatentCrop"
:
"Crop Latent"
,
"EmptyLatentImage"
:
"Empty Latent Image"
,
"LatentUpscale"
:
"Upscale Latent"
,
"LatentComposite"
:
"Latent Composite"
,
# Image
"SaveImage"
:
"Save Image"
,
"PreviewImage"
:
"Preview Image"
,
"LoadImage"
:
"Load Image"
,
"LoadImageMask"
:
"Load Image (as Mask)"
,
"ImageScale"
:
"Upscale Image"
,
"ImageUpscaleWithModel"
:
"Upscale Image (using Model)"
,
"ImageInvert"
:
"Invert Image"
,
"ImagePadForOutpaint"
:
"Pad Image for Outpainting"
,
# _for_testing
"VAEDecodeTiled"
:
"VAE Decode (Tiled)"
,
"VAEEncodeTiled"
:
"VAE Encode (Tiled)"
,
}
def
load_custom_node
(
module_path
):
def
load_custom_node
(
module_path
):
module_name
=
os
.
path
.
basename
(
module_path
)
module_name
=
os
.
path
.
basename
(
module_path
)
if
os
.
path
.
isfile
(
module_path
):
if
os
.
path
.
isfile
(
module_path
):
...
@@ -1119,6 +1167,8 @@ def load_custom_node(module_path):
...
@@ -1119,6 +1167,8 @@ def load_custom_node(module_path):
module_spec
.
loader
.
exec_module
(
module
)
module_spec
.
loader
.
exec_module
(
module
)
if
hasattr
(
module
,
"NODE_CLASS_MAPPINGS"
)
and
getattr
(
module
,
"NODE_CLASS_MAPPINGS"
)
is
not
None
:
if
hasattr
(
module
,
"NODE_CLASS_MAPPINGS"
)
and
getattr
(
module
,
"NODE_CLASS_MAPPINGS"
)
is
not
None
:
NODE_CLASS_MAPPINGS
.
update
(
module
.
NODE_CLASS_MAPPINGS
)
NODE_CLASS_MAPPINGS
.
update
(
module
.
NODE_CLASS_MAPPINGS
)
if
hasattr
(
module
,
"NODE_DISPLAY_NAME_MAPPINGS"
)
and
getattr
(
module
,
"NODE_DISPLAY_NAME_MAPPINGS"
)
is
not
None
:
NODE_DISPLAY_NAME_MAPPINGS
.
update
(
module
.
NODE_DISPLAY_NAME_MAPPINGS
)
else
:
else
:
print
(
f
"Skip
{
module_path
}
module for custom nodes due to the lack of NODE_CLASS_MAPPINGS."
)
print
(
f
"Skip
{
module_path
}
module for custom nodes due to the lack of NODE_CLASS_MAPPINGS."
)
except
Exception
as
e
:
except
Exception
as
e
:
...
...
server.py
View file @
60ac9832
...
@@ -177,7 +177,8 @@ class PromptServer():
...
@@ -177,7 +177,8 @@ class PromptServer():
info
[
'input'
]
=
obj_class
.
INPUT_TYPES
()
info
[
'input'
]
=
obj_class
.
INPUT_TYPES
()
info
[
'output'
]
=
obj_class
.
RETURN_TYPES
info
[
'output'
]
=
obj_class
.
RETURN_TYPES
info
[
'output_name'
]
=
obj_class
.
RETURN_NAMES
if
hasattr
(
obj_class
,
'RETURN_NAMES'
)
else
info
[
'output'
]
info
[
'output_name'
]
=
obj_class
.
RETURN_NAMES
if
hasattr
(
obj_class
,
'RETURN_NAMES'
)
else
info
[
'output'
]
info
[
'name'
]
=
x
#TODO
info
[
'name'
]
=
x
info
[
'display_name'
]
=
nodes
.
NODE_DISPLAY_NAME_MAPPINGS
[
x
]
if
x
in
nodes
.
NODE_DISPLAY_NAME_MAPPINGS
.
keys
()
else
x
info
[
'description'
]
=
''
info
[
'description'
]
=
''
info
[
'category'
]
=
'sd'
info
[
'category'
]
=
'sd'
if
hasattr
(
obj_class
,
'CATEGORY'
):
if
hasattr
(
obj_class
,
'CATEGORY'
):
...
...
web/scripts/app.js
View file @
60ac9832
...
@@ -835,7 +835,7 @@ class ComfyApp {
...
@@ -835,7 +835,7 @@ class ComfyApp {
app
.
#
invokeExtensionsAsync
(
"
nodeCreated
"
,
this
);
app
.
#
invokeExtensionsAsync
(
"
nodeCreated
"
,
this
);
},
},
{
{
title
:
nodeData
.
name
,
title
:
nodeData
.
display_name
||
nodeData
.
name
,
comfyClass
:
nodeData
.
name
,
comfyClass
:
nodeData
.
name
,
}
}
);
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment