-
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.
* prompt node * skip extra networks for now * rename * category * category * cleanup * dont need input
- Loading branch information
Showing
4 changed files
with
90 additions
and
33 deletions.
There are no files selected for viewing
92 changes: 59 additions & 33 deletions
92
...i_custom_nodes/webui_checkpoint_loader.py → comfyui_custom_nodes/webui_proxy_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,59 @@ | ||
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 = "text" | ||
|
||
def get_prompts(self, void): | ||
positive_prompts, _extra_networks = proxies.extra_networks_parse_prompts([getattr(global_state, 'last_positive_prompt', '')]) | ||
|
||
return ( | ||
positive_prompts[0], | ||
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
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