ComfyPilotComfyPilot
工作流 / LLM / Gemma4:文本生成
Gemma4:文本生成

Gemma4:文本生成

Gemma4: Text Generation

输入您的文本提示词,并可选择图像、音频或视频。通过可配置的推理、编码和多语言支持生成文本输出。

LLM 9 个节点 3 个输入 73 次使用 ComfyUI ≥ 0.21.0 ComfyUI 10 KB

下载工作流 JSON 查看官方来源

下载后把文件拖进 ComfyUI 窗口即可打开。

需要的权重

这个工作流引用了 1 个权重文件,其中 1 个能在本站模型库里找到。

gemma4_e4b_it_fp8_scaled.safetensors 在模型库查看

节点构成

MarkdownNote × 2
CLIPLoader × 1
LoadAudio × 1
LoadImage × 1
PreviewAny × 1
TextGenerate × 1
LoadVideo × 1
GetVideoComponents × 1

官方标注的模型

Gemma 4

工作流 JSON

和上面「下载工作流 JSON」是同一份文件。

1{
2 "id": "6a7153c2-a483-48c6-bddf-7a3884dee602",
3 "revision": 0,
4 "last_node_id": 9,
5 "last_link_id": 8,
6 "nodes": [
7 {
8 "id": 3,
9 "type": "CLIPLoader",
10 "pos": [
11 10,
12 270
13 ],
14 "size": [
15 370,
16 150
17 ],
18 "flags": [],
19 "order": 0,
20 "mode": 0,
21 "showAdvanced": false,
22 "inputs": [],
23 "outputs": [
24 {
25 "name": "CLIP",
26 "type": "CLIP",
27 "links": [
28 2
29 ]
30 }
31 ],
32 "properties": {
33 "cnr_id": "comfy-core",
34 "ver": "0.21.0",
35 "Node name for S&R": "CLIPLoader",
36 "models": [
37 {
38 "name": "gemma4_e4b_it_fp8_scaled.safetensors",
39 "url": "https://huggingface.co/Comfy-Org/gemma-4/resolve/main/text_encoders/gemma4_e4b_it_fp8_scaled.safetensors",
40 "directory": "text_encoders"
41 }
42 ]
43 },
44 "widgets_values": [
45 "gemma4_e4b_it_fp8_scaled.safetensors",
46 "stable_diffusion",
47 "default"
48 ]
49 },
50 {
51 "id": 5,
52 "type": "LoadAudio",
53 "pos": [
54 100,
55 870
56 ],
57 "size": [
58 290,
59 160
60 ],
61 "flags": [],
62 "order": 1,
63 "mode": 0,
64 "inputs": [],
65 "outputs": [
66 {
67 "name": "AUDIO",
68 "type": "AUDIO",
69 "links": [
70 8
71 ]
72 }
73 ],
74 "properties": {
75 "cnr_id": "comfy-core",
76 "ver": "0.21.0",
77 "Node name for S&R": "LoadAudio"
78 },
79 "widgets_values": [
80 "long_demo.mp3",
81 null,
82 null
83 ]
84 },
85 {
86 "id": 2,
87 "type": "LoadImage",
88 "pos": [
89 10,
90 480
91 ],
92 "size": [
93 380,
94 340
95 ],
96 "flags": [],
97 "order": 2,
98 "mode": 0,
99 "inputs": [],
100 "outputs": [
101 {
102 "name": "IMAGE",
103 "type": "IMAGE",
104 "links": [
105 7
106 ]
107 },
108 {
109 "name": "MASK",
110 "type": "MASK",
111 "links": null
112 }
113 ],
114 "properties": {
115 "cnr_id": "comfy-core",
116 "ver": "0.21.0",
117 "Node name for S&R": "LoadImage"
118 },
119 "widgets_values": [
120 "the_lily_veil.png",
121 "image"
122 ]
123 },
124 {
125 "id": 4,
126 "type": "PreviewAny",
127 "pos": [
128 970,
129 270
130 ],
131 "size": [
132 560,
133 660
134 ],
135 "flags": {
136 "collapsed": false
137 },
138 "order": 8,
139 "mode": 0,
140 "inputs": [
141 {
142 "name": "source",
143 "type": "*",
144 "link": 3
145 }
146 ],
147 "outputs": [
148 {
149 "name": "STRING",
150 "type": "STRING",
151 "links": null
152 }
153 ],
154 "properties": {
155 "cnr_id": "comfy-core",
156 "ver": "0.21.0",
157 "Node name for S&R": "PreviewAny"
158 },
159 "widgets_values": [
160 null,
161 null,
162 null
163 ]
164 },
165 {
166 "id": 1,
167 "type": "TextGenerate",
168 "pos": [
169 520,
170 270
171 ],
172 "size": [
173 400,
174 562.65625
175 ],
176 "flags": [],
177 "order": 6,
178 "mode": 0,
179 "showAdvanced": true,
180 "inputs": [
181 {
182 "name": "clip",
183 "type": "CLIP",
184 "link": 2
185 },
186 {
187 "name": "image",
188 "shape": 7,
189 "type": "IMAGE",
190 "link": 7
191 },
192 {
193 "name": "video",
194 "shape": 7,
195 "type": "IMAGE",
196 "link": null
197 },
198 {
199 "name": "audio",
200 "shape": 7,
201 "type": "AUDIO",
202 "link": 8
203 }
204 ],
205 "outputs": [
206 {
207 "name": "generated_text",
208 "type": "STRING",
209 "links": [
210 3
211 ]
212 }
213 ],
214 "properties": {
215 "cnr_id": "comfy-core",
216 "ver": "0.21.0",
217 "Node name for S&R": "TextGenerate"
218 },
219 "widgets_values": [
220 "Describe the image, and transcribe the audio",
221 2048,
222 "on",
223 0.7,
224 64,
225 0.95,
226 0.05,
227 1.05,
228 0,
229 0,
230 false,
231 true
232 ]
233 },
234 {
235 "id": 6,
236 "type": "LoadVideo",
237 "pos": [
238 40,
239 1140
240 ],
241 "size": [
242 290,
243 392
244 ],
245 "flags": [],
246 "order": 3,
247 "mode": 0,
248 "inputs": [],
249 "outputs": [
250 {
251 "name": "VIDEO",
252 "type": "VIDEO",
253 "links": [
254 5
255 ]
256 }
257 ],
258 "properties": {
259 "cnr_id": "comfy-core",
260 "ver": "0.21.0",
261 "Node name for S&R": "LoadVideo"
262 },
263 "widgets_values": [
264 "video_wan_vace_inpainting_input_video.mp4",
265 "image"
266 ]
267 },
268 {
269 "id": 7,
270 "type": "GetVideoComponents",
271 "pos": [
272 410,
273 1140
274 ],
275 "size": [
276 230,
277 100
278 ],
279 "flags": [],
280 "order": 7,
281 "mode": 0,
282 "inputs": [
283 {
284 "name": "video",
285 "type": "VIDEO",
286 "link": 5
287 }
288 ],
289 "outputs": [
290 {
291 "name": "images",
292 "type": "IMAGE",
293 "links": []
294 },
295 {
296 "name": "audio",
297 "type": "AUDIO",
298 "links": null
299 },
300 {
301 "name": "fps",
302 "type": "FLOAT",
303 "links": null
304 }
305 ],
306 "properties": {
307 "cnr_id": "comfy-core",
308 "ver": "0.21.0",
309 "Node name for S&R": "GetVideoComponents"
310 },
311 "widgets_values": []
312 },
313 {
314 "id": 8,
315 "type": "MarkdownNote",
316 "pos": [
317 -710,
318 270
319 ],
320 "size": [
321 640,
322 674.96875
323 ],
324 "flags": [],
325 "order": 4,
326 "mode": 0,
327 "inputs": [],
328 "outputs": [],
329 "properties": [],
330 "widgets_values": [
331 "Related PR: [#13376](https://github.com/Comfy-Org/ComfyUI/pull/13376)\n\n## Model Links\n\n- [Hugging Face:Comfy-Org/gemma-4](https://huggingface.co/Comfy-Org/gemma-4)\n- [ModelScope:Comfy-Org/gemma-4](https://modelscope.cn/models/Comfy-Org/gemma-4)\n\n**text_encoders**\n\n- [gemma4_e4b_it_fp8_scaled.safetensors](https://huggingface.co/Comfy-Org/gemma-4/resolve/main/text_encoders/gemma4_e4b_it_fp8_scaled.safetensors) (8.44 GB)\n\n## Model Storage Location\n\n```\n📂 ComfyUI/\n├── 📂 models/\n│ └── 📂 text_encoders/\n│ └── gemma4_e4b_it_fp8_scaled.safetensors\n```\n\n---\n* Other model weights: https://huggingface.co/Comfy-Org/gemma-4/tree/main/text_encoders\n\n## Report Issue\n\nNote: Please update ComfyUI first ([guide](https://docs.comfy.org/installation/update_comfyui)) and prepare required models. Desktop/Cloud updates follow stable releases, so some nightly-supported models may not be available yet.\n\n- Cannot run / runtime errors: [ComfyUI/issues](https://github.com/comfyanonymous/ComfyUI/issues)\n- UI / frontend issues: [ComfyUI_frontend/issues](https://github.com/Comfy-Org/ComfyUI_frontend/issues)\n- Workflow issues: [workflow_templates/issues](https://github.com/Comfy-Org/workflow_templates/issues)\n"
332 ],
333 "color": "#222",
334 "bgcolor": "#000"
335 },
336 {
337 "id": 9,
338 "type": "MarkdownNote",
339 "pos": [
340 -730,
341 1020
342 ],
343 "size": [
344 660,
345 600
346 ],
347 "flags": [],
348 "order": 5,
349 "mode": 0,
350 "inputs": [],
351 "outputs": [],
352 "title": "Gemma4 Core Capabilities",
353 "properties": [],
354 "widgets_values": [
355 "**Core Capabilities**\n\n[Gemma 4](https://huggingface.co/google/gemma-4-E2B-it) models handle a broad range of tasks across text, vision, and audio. Key capabilities include:\n\n+ **Thinking** – Built-in reasoning mode that lets the model think step-by-step before answering.\n+ **Long Context** – Context windows of up to 128K tokens (E2B/E4B) and 256K tokens (26B A4B/31B).\n+ **Image Understanding** – Object detection, Document/PDF parsing, screen and UI understanding, chart comprehension, OCR (including multilingual), handwriting recognition, and pointing. Images can be processed at variable aspect ratios and resolutions.\n+ **Video Understanding** – Analyze video by processing sequences of frames.\n+ **Interleaved Multimodal Input** – Freely mix text and images in any order within a single prompt.\n+ **Function Calling** – Native support for structured tool use, enabling agentic workflows.\n+ **Coding** – Code generation, completion, and correction.\n+ **Multilingual** – Out-of-the-box support for 35+ languages, pre-trained on 140+ languages.\n+ **Audio** (E2B and E4B only) – Automatic speech recognition (ASR) and speech-to-translated-text translation across multiple languages.\n"
356 ],
357 "color": "#222",
358 "bgcolor": "#000"
359 }
360 ],
361 "links": [
362 [
363 2,
364 3,
365 0,
366 1,
367 0,
368 "CLIP"
369 ],
370 [
371 3,
372 1,
373 0,
374 4,
375 0,
376 "STRING"
377 ],
378 [
379 5,
380 6,
381 0,
382 7,
383 0,
384 "VIDEO"
385 ],
386 [
387 7,
388 2,
389 0,
390 1,
391 1,
392 "IMAGE"
393 ],
394 [
395 8,
396 5,
397 0,
398 1,
399 3,
400 "AUDIO"
401 ]
402 ],
403 "groups": [
404 {
405 "id": 1,
406 "title": "Video Input Example",
407 "bounding": [
408 30,
409 1070,
410 660,
411 500
412 ],
413 "color": "#3f789e",
414 "flags": []
415 }
416 ],
417 "config": [],
418 "extra": {
419 "ds": {
420 "scale": 0.25392770255200803,
421 "offset": [
422 1710.5226325043593,
423 1195.667376097804
424 ]
425 },
426 "frontendVersion": "1.43.18"
427 },
428 "version": 0.4
429}