Skip to content

Commit 4f48be4

Browse files
authored
feat(api-nodes): add new "arrow-1.1" and "arrow-1.1-max" SVG models (#13447)
Signed-off-by: bigcat88 <bigcat88@icloud.com>
1 parent 541fd10 commit 4f48be4

1 file changed

Lines changed: 65 additions & 70 deletions

File tree

comfy_api_nodes/nodes_quiver.py

Lines changed: 65 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,44 @@
1717
)
1818
from comfy_extras.nodes_images import SVG
1919

20+
_ARROW_MODELS = ["arrow-1.1", "arrow-1.1-max", "arrow-preview"]
21+
22+
23+
def _arrow_sampling_inputs():
24+
"""Shared sampling inputs for all Arrow model variants."""
25+
return [
26+
IO.Float.Input(
27+
"temperature",
28+
default=1.0,
29+
min=0.0,
30+
max=2.0,
31+
step=0.1,
32+
display_mode=IO.NumberDisplay.slider,
33+
tooltip="Randomness control. Higher values increase randomness.",
34+
advanced=True,
35+
),
36+
IO.Float.Input(
37+
"top_p",
38+
default=1.0,
39+
min=0.05,
40+
max=1.0,
41+
step=0.05,
42+
display_mode=IO.NumberDisplay.slider,
43+
tooltip="Nucleus sampling parameter.",
44+
advanced=True,
45+
),
46+
IO.Float.Input(
47+
"presence_penalty",
48+
default=0.0,
49+
min=-2.0,
50+
max=2.0,
51+
step=0.1,
52+
display_mode=IO.NumberDisplay.slider,
53+
tooltip="Token presence penalty.",
54+
advanced=True,
55+
),
56+
]
57+
2058

2159
class QuiverTextToSVGNode(IO.ComfyNode):
2260
@classmethod
@@ -39,6 +77,7 @@ def define_schema(cls):
3977
default="",
4078
tooltip="Additional style or formatting guidance.",
4179
optional=True,
80+
advanced=True,
4281
),
4382
IO.Autogrow.Input(
4483
"reference_images",
@@ -53,43 +92,7 @@ def define_schema(cls):
5392
),
5493
IO.DynamicCombo.Input(
5594
"model",
56-
options=[
57-
IO.DynamicCombo.Option(
58-
"arrow-preview",
59-
[
60-
IO.Float.Input(
61-
"temperature",
62-
default=1.0,
63-
min=0.0,
64-
max=2.0,
65-
step=0.1,
66-
display_mode=IO.NumberDisplay.slider,
67-
tooltip="Randomness control. Higher values increase randomness.",
68-
advanced=True,
69-
),
70-
IO.Float.Input(
71-
"top_p",
72-
default=1.0,
73-
min=0.05,
74-
max=1.0,
75-
step=0.05,
76-
display_mode=IO.NumberDisplay.slider,
77-
tooltip="Nucleus sampling parameter.",
78-
advanced=True,
79-
),
80-
IO.Float.Input(
81-
"presence_penalty",
82-
default=0.0,
83-
min=-2.0,
84-
max=2.0,
85-
step=0.1,
86-
display_mode=IO.NumberDisplay.slider,
87-
tooltip="Token presence penalty.",
88-
advanced=True,
89-
),
90-
],
91-
),
92-
],
95+
options=[IO.DynamicCombo.Option(m, _arrow_sampling_inputs()) for m in _ARROW_MODELS],
9396
tooltip="Model to use for SVG generation.",
9497
),
9598
IO.Int.Input(
@@ -112,7 +115,16 @@ def define_schema(cls):
112115
],
113116
is_api_node=True,
114117
price_badge=IO.PriceBadge(
115-
expr="""{"type":"usd","usd":0.429}""",
118+
depends_on=IO.PriceBadgeDepends(widgets=["model"]),
119+
expr="""
120+
(
121+
$contains(widgets.model, "max")
122+
? {"type":"usd","usd":0.3575}
123+
: $contains(widgets.model, "preview")
124+
? {"type":"usd","usd":0.429}
125+
: {"type":"usd","usd":0.286}
126+
)
127+
""",
116128
),
117129
)
118130

@@ -176,52 +188,26 @@ def define_schema(cls):
176188
"auto_crop",
177189
default=False,
178190
tooltip="Automatically crop to the dominant subject.",
191+
advanced=True,
179192
),
180193
IO.DynamicCombo.Input(
181194
"model",
182195
options=[
183196
IO.DynamicCombo.Option(
184-
"arrow-preview",
197+
m,
185198
[
186199
IO.Int.Input(
187200
"target_size",
188201
default=1024,
189202
min=128,
190203
max=4096,
191204
tooltip="Square resize target in pixels.",
192-
),
193-
IO.Float.Input(
194-
"temperature",
195-
default=1.0,
196-
min=0.0,
197-
max=2.0,
198-
step=0.1,
199-
display_mode=IO.NumberDisplay.slider,
200-
tooltip="Randomness control. Higher values increase randomness.",
201-
advanced=True,
202-
),
203-
IO.Float.Input(
204-
"top_p",
205-
default=1.0,
206-
min=0.05,
207-
max=1.0,
208-
step=0.05,
209-
display_mode=IO.NumberDisplay.slider,
210-
tooltip="Nucleus sampling parameter.",
211-
advanced=True,
212-
),
213-
IO.Float.Input(
214-
"presence_penalty",
215-
default=0.0,
216-
min=-2.0,
217-
max=2.0,
218-
step=0.1,
219-
display_mode=IO.NumberDisplay.slider,
220-
tooltip="Token presence penalty.",
221205
advanced=True,
222206
),
207+
*_arrow_sampling_inputs(),
223208
],
224-
),
209+
)
210+
for m in _ARROW_MODELS
225211
],
226212
tooltip="Model to use for SVG vectorization.",
227213
),
@@ -245,7 +231,16 @@ def define_schema(cls):
245231
],
246232
is_api_node=True,
247233
price_badge=IO.PriceBadge(
248-
expr="""{"type":"usd","usd":0.429}""",
234+
depends_on=IO.PriceBadgeDepends(widgets=["model"]),
235+
expr="""
236+
(
237+
$contains(widgets.model, "max")
238+
? {"type":"usd","usd":0.3575}
239+
: $contains(widgets.model, "preview")
240+
? {"type":"usd","usd":0.429}
241+
: {"type":"usd","usd":0.286}
242+
)
243+
""",
249244
),
250245
)
251246

0 commit comments

Comments
 (0)