Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
2 changes: 1 addition & 1 deletion comfy_extras/nodes_lt.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ def define_schema(cls):
@classmethod
def execute(cls, width, height, length, batch_size=1) -> io.NodeOutput:
latent = torch.zeros([batch_size, 128, ((length - 1) // 8) + 1, height // 32, width // 32], device=comfy.model_management.intermediate_device())
return io.NodeOutput({"samples": latent})
return io.NodeOutput({"samples": latent, "downscale_ratio_spacial": 32})

generate = execute # TODO: remove

Expand Down
32 changes: 32 additions & 0 deletions comfy_extras/nodes_string.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,41 @@
import re
import json
import string
from typing_extensions import override

from comfy_api.latest import ComfyExtension, io


class StringFormat(io.ComfyNode):
@classmethod
def define_schema(cls) -> io.Schema:
autogrow = io.Autogrow.TemplateNames(
input=io.AnyType.Input("value"),
names=list(string.ascii_lowercase),
min=0,
)
return io.Schema(
node_id="StringFormat",
display_name="Format Text",
category="text",
search_aliases=["string", "format"],
description="Same as Python's string format method. Supports all of Python's format options and features.",
inputs=[
io.Autogrow.Input("values", template=autogrow),
io.String.Input("f_string", default="{a}", multiline=True),
],
outputs=[
io.String.Output(),
],
)

@classmethod
def execute(
cls, values: io.Autogrow.Type, f_string: str
) -> io.NodeOutput:
return io.NodeOutput(f_string.format(**values))


class StringConcatenate(io.ComfyNode):
@classmethod
def define_schema(cls):
Expand Down Expand Up @@ -413,6 +444,7 @@ class StringExtension(ComfyExtension):
@override
async def get_node_list(self) -> list[type[io.ComfyNode]]:
return [
StringFormat,
StringConcatenate,
StringSubstring,
StringLength,
Expand Down
13 changes: 8 additions & 5 deletions openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4162,7 +4162,8 @@ paths:
description: Display name for the API key
description:
type: string
description: User-provided description for the key
description: User-provided description of the key's purpose
maxLength: 5000
responses:
"201":
description: API key created
Expand Down Expand Up @@ -7680,15 +7681,16 @@ components:
required:
- id
- name
- description
properties:
id:
type: string
name:
type: string
description:
type: string
nullable: true
description: User-provided description
maxLength: 5000
description: User-provided description of the key's purpose. Always present in responses; empty string when no description was supplied on create.
prefix:
type: string
description: First few characters of the key for identification
Expand All @@ -7709,6 +7711,7 @@ components:
required:
- id
- name
- description
- key
properties:
id:
Expand All @@ -7717,8 +7720,8 @@ components:
type: string
description:
type: string
nullable: true
description: User-provided description
maxLength: 5000
description: User-provided description of the key's purpose. Always present in responses; empty string when no description was supplied on create.
key:
type: string
description: Full API key value (only returned on creation)
Expand Down
Loading