-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
81 additions
and
33 deletions.
There are no files selected for viewing
90 changes: 57 additions & 33 deletions
90
...i_custom_nodes/webui_checkpoint_loader.py → comfyui_custom_nodes/webui_input_nodes.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,57 @@ | ||
from lib_comfyui.webui import proxies | ||
|
||
|
||
class WebuiCheckpointLoader: | ||
@classmethod | ||
def INPUT_TYPES(s): | ||
return { | ||
"required": { | ||
"void": ("VOID", ), | ||
}, | ||
} | ||
RETURN_TYPES = ("MODEL", "CLIP", "VAE") | ||
FUNCTION = "load_checkpoint" | ||
|
||
CATEGORY = "loaders" | ||
|
||
def load_checkpoint(self, void): | ||
config = proxies.get_comfy_model_config() | ||
proxies.raise_on_unsupported_model_type(config) | ||
return ( | ||
proxies.ModelPatcher(proxies.Model()), | ||
proxies.ClipWrapper(proxies.Clip()), | ||
proxies.VaeWrapper(proxies.Vae()), | ||
) | ||
|
||
|
||
NODE_CLASS_MAPPINGS = { | ||
"WebuiCheckpointLoader": WebuiCheckpointLoader, | ||
} | ||
|
||
NODE_DISPLAY_NAME_MAPPINGS = { | ||
"WebuiCheckpointLoader": 'Webui Checkpoint', | ||
} | ||
from lib_comfyui.webui import proxies | ||
from lib_comfyui import global_state | ||
|
||
|
||
class WebuiCheckpointLoader: | ||
@classmethod | ||
def INPUT_TYPES(s): | ||
return { | ||
"required": { | ||
"void": ("VOID", ), | ||
}, | ||
} | ||
RETURN_TYPES = ("MODEL", "CLIP", "VAE") | ||
FUNCTION = "load_checkpoint" | ||
|
||
CATEGORY = "loaders" | ||
|
||
def load_checkpoint(self, void): | ||
config = proxies.get_comfy_model_config() | ||
proxies.raise_on_unsupported_model_type(config) | ||
return ( | ||
proxies.ModelPatcher(proxies.Model()), | ||
proxies.ClipWrapper(proxies.Clip()), | ||
proxies.VaeWrapper(proxies.Vae()), | ||
) | ||
|
||
|
||
class WebuiPrompts: | ||
@classmethod | ||
def INPUT_TYPES(s): | ||
return { | ||
"required": { | ||
"void": ("VOID", ), | ||
}, | ||
} | ||
RETURN_TYPES = ("STRING", "STRING") | ||
RETURN_NAMES = ("positive", "negative") | ||
FUNCTION = "get_prompts" | ||
|
||
CATEGORY = "loaders" | ||
|
||
def get_prompts(self, void): | ||
return ( | ||
getattr(global_state, 'last_positive_prompt', ''), | ||
getattr(global_state, 'last_negative_prompt', ''), | ||
) | ||
|
||
|
||
NODE_CLASS_MAPPINGS = { | ||
"WebuiCheckpointLoader": WebuiCheckpointLoader, | ||
"WebuiPrompts": WebuiPrompts, | ||
} | ||
|
||
NODE_DISPLAY_NAME_MAPPINGS = { | ||
"WebuiCheckpointLoader": 'Webui Checkpoint', | ||
"WebuiPrompts": "Webui Prompts", | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters