Skip to content

Instantly share code, notes, and snippets.

@crosstyan
Last active December 14, 2025 13:11
Show Gist options
  • Select an option

  • Save crosstyan/b681d70ab7c2a260af39ce2039d41fa6 to your computer and use it in GitHub Desktop.

Select an option

Save crosstyan/b681d70ab7c2a260af39ce2039d41fa6 to your computer and use it in GitHub Desktop.
Comfy for Newbie

Linux, cu128, python3.12, needs uv

Use this PR: Added support for NewBieModel in E-Anlia/ComfyUI-NewBie

# for existing ComfyUI repo
git remote add newbie https://github.com/E-Anlia/ComfyUI-NewBie
git fetch newbie
git rebase newbie/master

need Dao-AILab/flash-attention, which could be built with MAX_JOBS=5 python setup.py bdist_wheel.

put the artifact (in dist if built successfully) into <root of ComfyUI>/wheels/flash_attn-2.8.3-cp312-cp312-linux_x86_64.whl

then uv sync, you should have hf cli installed in the newly created venv. (source <root of ComfyUI>/.venv/bin/activate)

hf download --max-workers 8 jinaai/jina-clip-v2
hf download --token <your hf token> google/gemma-3-4b-it
hf download NewBie-AI/NewBie-image-Exp0.1 --include "**diffusion_pytorch_model*"

models would be downloaded to ~/.cache/huggingface/hub, use them in the workflow. (for the UNet & VAE, use symbolic link to put them into Comfy)

See also the official guide (feishu, zh-CN)

{
"id": "57343ce5-d749-4924-b5c5-3b4d3a7484d3",
"revision": 0,
"last_node_id": 21,
"last_link_id": 17,
"nodes": [
{
"id": 10,
"type": "RescaleCFG",
"pos": [
1096.8659103750344,
-415.1945890731481
],
"size": [
324,
111.5999984741211
],
"flags": {},
"order": 7,
"mode": 0,
"inputs": [
{
"label": "模型",
"name": "model",
"type": "MODEL",
"link": 16
}
],
"outputs": [
{
"label": "模型",
"name": "MODEL",
"type": "MODEL",
"links": [
14
]
}
],
"properties": {
"cnr_id": "comfy-core",
"ver": "0.3.59",
"Node name for S&R": "RescaleCFG"
},
"widgets_values": [
0.7
]
},
{
"id": 15,
"type": "NewBieLoraModelOnly",
"pos": [
850.4337900079114,
-181.75239963351248
],
"size": [
353.3166809082031,
243.60000610351562
],
"flags": {},
"order": 6,
"mode": 4,
"inputs": [
{
"label": "model",
"name": "model",
"type": "MODEL",
"link": 15
}
],
"outputs": [
{
"label": "MODEL",
"name": "MODEL",
"type": "MODEL",
"links": [
16
]
}
],
"properties": {
"aux_id": "NewBieAI-Lab/ComfyUI-Newbie-Nodes",
"ver": "96c1d2c926e6191faaa33d97ac1fb5ed4d9bd61c",
"Node name for S&R": "NewBieLoraModelOnly"
},
"widgets_values": [
"adapter_model.safetensors",
1,
true
]
},
{
"id": 3,
"type": "VAELoader",
"pos": [
846.2556421422839,
846.4486863708048
],
"size": [
324,
111.5999984741211
],
"flags": {},
"order": 0,
"mode": 0,
"inputs": [],
"outputs": [
{
"name": "VAE",
"type": "VAE",
"links": [
8
]
}
],
"properties": {
"cnr_id": "comfy-core",
"ver": "0.3.59",
"Node name for S&R": "VAELoader"
},
"widgets_values": [
"flux1-dev.vae.safetensors"
]
},
{
"id": 2,
"type": "NewBieCLIPLoader",
"pos": [
839.47006874394,
440.99564821792615
],
"size": [
344.1000061035156,
383.6000061035156
],
"flags": {},
"order": 1,
"mode": 0,
"inputs": [],
"outputs": [
{
"label": "CLIP",
"name": "CLIP",
"type": "CLIP",
"links": [
1,
2
]
}
],
"properties": {
"aux_id": "NewBieAI-Lab/ComfyUI-Newbie-Nodes",
"ver": "96c1d2c926e6191faaa33d97ac1fb5ed4d9bd61c",
"Node name for S&R": "NewBieCLIPLoader"
},
"widgets_values": [
"/home/crosstyan/.cache/huggingface/hub/models--google--gemma-3-4b-it/snapshots/093f9f388b31de276ce2de164bdc2081324b9767",
"/home/crosstyan/.cache/huggingface/hub/models--jinaai--jina-clip-v2/snapshots/344d954da76eb8ad47a7aaff42d012e30c15b8fe",
"cuda",
"bf16",
true,
true,
"mean",
1,
true
]
},
{
"id": 1,
"type": "DiffusionModelLoaderKJ",
"pos": [
579.0898748129866,
119.26265974356193
],
"size": [
368.9333190917969,
281.6000061035156
],
"flags": {},
"order": 2,
"mode": 0,
"inputs": [
{
"label": "extra_state_dict",
"name": "extra_state_dict",
"shape": 7,
"type": "STRING",
"link": null
}
],
"outputs": [
{
"label": "MODEL",
"name": "MODEL",
"type": "MODEL",
"links": [
15
]
}
],
"properties": {
"cnr_id": "comfyui-kjnodes",
"ver": "1.1.7",
"Node name for S&R": "DiffusionModelLoaderKJ",
"aux_id": "kijai/ComfyUI-KJNodes"
},
"widgets_values": [
"NewBiev0.1.safetensors",
"bf16",
"default",
false,
"disabled",
false
]
},
{
"id": 8,
"type": "VAEDecode",
"pos": [
1852.4979074108105,
51.59554013873719
],
"size": [
225,
101.5999984741211
],
"flags": {},
"order": 9,
"mode": 0,
"inputs": [
{
"label": "Latent",
"name": "samples",
"type": "LATENT",
"link": 7
},
{
"label": "VAE",
"name": "vae",
"type": "VAE",
"link": 8
}
],
"outputs": [
{
"label": "图像",
"name": "IMAGE",
"type": "IMAGE",
"links": [
17
]
}
],
"properties": {
"cnr_id": "comfy-core",
"ver": "0.3.59",
"Node name for S&R": "VAEDecode"
},
"widgets_values": []
},
{
"id": 6,
"type": "NewBieCLIPTextEncode",
"pos": [
1465.029788088712,
926.1005557159622
],
"size": [
424.6666564941406,
535.433349609375
],
"flags": {},
"order": 5,
"mode": 0,
"inputs": [
{
"label": "clip",
"name": "clip",
"type": "CLIP",
"link": 2
},
{
"label": "image",
"name": "image",
"shape": 7,
"type": "IMAGE",
"link": null
}
],
"outputs": [
{
"label": "CONDITIONING",
"name": "CONDITIONING",
"type": "CONDITIONING",
"links": [
5
]
}
],
"properties": {
"aux_id": "NewBieAI-Lab/ComfyUI-Newbie-Nodes",
"ver": "96c1d2c926e6191faaa33d97ac1fb5ed4d9bd61c",
"Node name for S&R": "NewBieCLIPTextEncode"
},
"widgets_values": [
"<danbooru_tags>worst quality, bad quality, lowres, artifacts, jpeg artifacts, bad anatomy, extra digits, text, watermark, signature, logo, 2koma, 4koma, adversarial noise</danbooru_tags>",
"You are an assistant designed to generate high-quality anime images with the highest degree of image-text alignment based on textual prompts. <Prompt Start> ",
false
]
},
{
"id": 4,
"type": "KSampler",
"pos": [
1858.3096346884067,
198.82025066037284
],
"size": [
252,
373.3333435058594
],
"flags": {},
"order": 8,
"mode": 0,
"inputs": [
{
"label": "模型",
"name": "model",
"type": "MODEL",
"link": 14
},
{
"label": "正面条件",
"name": "positive",
"type": "CONDITIONING",
"link": 4
},
{
"label": "负面条件",
"name": "negative",
"type": "CONDITIONING",
"link": 5
},
{
"label": "Latent",
"name": "latent_image",
"type": "LATENT",
"link": 3
}
],
"outputs": [
{
"label": "Latent",
"name": "LATENT",
"type": "LATENT",
"links": [
7
]
}
],
"properties": {
"cnr_id": "comfy-core",
"ver": "0.3.59",
"Node name for S&R": "KSampler"
},
"widgets_values": [
306281605772894,
"randomize",
30,
5,
"res_multistep",
"linear_quadratic",
1
]
},
{
"id": 7,
"type": "EmptyLatentImage",
"pos": [
1927.971556987939,
758.39343960214
],
"size": [
324,
179.60000610351562
],
"flags": {},
"order": 3,
"mode": 0,
"inputs": [],
"outputs": [
{
"label": "Latent",
"name": "LATENT",
"type": "LATENT",
"links": [
3
]
}
],
"properties": {
"cnr_id": "comfy-core",
"ver": "0.3.59",
"Node name for S&R": "EmptyLatentImage"
},
"widgets_values": [
832,
1264,
2
]
},
{
"id": 5,
"type": "NewBieCLIPTextEncode",
"pos": [
1372.1995316227358,
170.38998373624418
],
"size": [
379.5,
580.3499755859375
],
"flags": {},
"order": 4,
"mode": 0,
"inputs": [
{
"label": "clip",
"name": "clip",
"type": "CLIP",
"link": 1
},
{
"label": "image",
"name": "image",
"shape": 7,
"type": "IMAGE",
"link": null
}
],
"outputs": [
{
"label": "CONDITIONING",
"name": "CONDITIONING",
"type": "CONDITIONING",
"links": [
4
]
}
],
"properties": {
"aux_id": "NewBieAI-Lab/ComfyUI-Newbie-Nodes",
"ver": "96c1d2c926e6191faaa33d97ac1fb5ed4d9bd61c",
"Node name for S&R": "NewBieCLIPTextEncode"
},
"widgets_values": [
"<character_1>\n <n>sameko_saba</n>\n <gender>1girl</gender>\n\n <appearance>\n fish_girl,\n blonde_hair, long_hair, very_long_hair,\n multicolored_hair, streaked_hair, blue_hair,\n blue_eyes,\n animal_ears, cat_ears, animal_ear_fluff,\n tail, fish_tail, fins\n </appearance>\n\n <clothing>\n alternate_costume,\n shirt, white_shirt,\n serafuku, sailor_collar, school_uniform,\n skirt, blue_skirt\n </clothing>\n\n <expression>\n smile, tongue, tongue_out,\n looking_at_viewer\n </expression>\n\n <action>\n on_desk, sitting,\n barefoot, feet, soles, toes\n </action>\n\n <position>\n center\n </position>\n</character_1>\n\n<general_tags>\n <count>solo</count>\n\n <copyright>\n indie_virtual_youtuber, virtual_youtuber\n </copyright>\n\n <artist>fpvjoe</artist>\n\n <background>\n white_background\n </background>\n\n <objects>\n desk\n </objects>\n</general_tags>\n",
"You are an assistant designed to generate high-quality anime images with the highest degree of image-text alignment based on xml format textual prompts. <Prompt Start>",
false
]
},
{
"id": 21,
"type": "SaveImage",
"pos": [
2170.2924380867953,
-250.5372914779481
],
"size": [
532.2166748046875,
953.4166870117188
],
"flags": {},
"order": 10,
"mode": 0,
"inputs": [
{
"name": "images",
"type": "IMAGE",
"link": 17
}
],
"outputs": [],
"properties": {
"cnr_id": "comfy-core",
"ver": "0.4.0"
},
"widgets_values": [
"ComfyUI"
]
}
],
"links": [
[
1,
2,
0,
5,
0,
"CLIP"
],
[
2,
2,
0,
6,
0,
"CLIP"
],
[
3,
7,
0,
4,
3,
"LATENT"
],
[
4,
5,
0,
4,
1,
"CONDITIONING"
],
[
5,
6,
0,
4,
2,
"CONDITIONING"
],
[
7,
4,
0,
8,
0,
"LATENT"
],
[
8,
3,
0,
8,
1,
"VAE"
],
[
14,
10,
0,
4,
0,
"MODEL"
],
[
15,
1,
0,
15,
0,
"MODEL"
],
[
16,
15,
0,
10,
0,
"MODEL"
],
[
17,
8,
0,
21,
0,
"IMAGE"
]
],
"groups": [],
"config": {},
"extra": {
"ds": {
"scale": 0.5989500000000081,
"offset": [
-579.9512631387261,
791.6809120605242
]
},
"frontendVersion": "1.34.8",
"workflowRendererVersion": "Vue"
},
"version": 0.4
}
[project]
name = "ComfyUI"
version = "0.4.0"
readme = "README.md"
description = "ComfyUI with Newbie support"
license = { file = "LICENSE" }
requires-python = ">=3.12,<3.13"
dependencies = [
"torch==2.9.1",
"torchvision",
"torchaudio",
"flash-attn",
"comfyui-frontend-package==1.34.8",
"comfyui-workflow-templates==0.7.54",
"comfyui-embedded-docs==0.3.1",
"torchsde>=0.2.6",
"numpy>=1.25.0",
"einops>=0.8.1",
"transformers>=4.50.3",
"tokenizers>=0.13.3",
"sentencepiece>=0.2.1",
"safetensors>=0.4.2",
"aiohttp>=3.11.8",
"yarl>=1.18.0",
"pyyaml>=6.0.3",
"pillow>=10.3.0",
"scipy>=1.16.3",
"tqdm>=4.67.1",
"psutil>=7.1.3",
"alembic>=1.17.2",
"sqlalchemy>=2.0.45",
"av>=14.2.0",
"kornia>=0.7.1",
"spandrel>=0.4.1",
"pydantic~=2.0",
"pydantic-settings~=2.0",
"gitpython>=3.1.45",
"pygithub>=2.8.1",
"matrix-nio>=0.25.2",
"huggingface-hub>=0.36.0",
"typer>=0.20.0",
"rich>=14.2.0",
"typing-extensions>=4.15.0",
"toml>=0.10.2",
"uv>=0.9.17",
"chardet>=5.2.0",
"color-matcher>=0.6.0",
"matplotlib>=3.10.8",
"mss>=10.1.0",
"opencv-python-headless>=4.11.0.86",
"timm>=1.0.22",
"accelerate>=1.12.0",
]
[project.optional-dependencies]
dev = ["pip", "packaging", "setuptools"]
[project.urls]
homepage = "https://www.comfy.org/"
repository = "https://github.com/comfyanonymous/ComfyUI"
documentation = "https://docs.comfy.org/"
[tool.uv.sources]
torch = [{ index = "pytorch-cu128" }]
torchvision = [{ index = "pytorch-cu128" }]
torchaudio = [{ index = "pytorch-cu128" }]
flash-attn = { path = "wheels/flash_attn-2.8.3-cp312-cp312-linux_x86_64.whl" }
[[tool.uv.index]]
name = "pytorch-cu128"
url = "https://download.pytorch.org/whl/cu128"
explicit = true
[tool.ruff]
lint.select = [
"N805", # invalid-first-argument-name-for-method
"S307", # suspicious-eval-usage
"S102", # exec
"T", # print-usage
"W",
# The "F" series in Ruff stands for "Pyflakes" rules, which catch various Python syntax errors and undefined names.
# See all rules here: https://docs.astral.sh/ruff/rules/#pyflakes-f
"F",
]
exclude = ["*.ipynb", "**/generated/*.pyi"]
[tool.pylint]
master.py-version = "3.10"
master.extension-pkg-allow-list = ["pydantic"]
reports.output-format = "colorized"
similarities.ignore-imports = "yes"
messages_control.disable = [
"missing-module-docstring",
"missing-class-docstring",
"missing-function-docstring",
"line-too-long",
"too-few-public-methods",
"too-many-public-methods",
"too-many-instance-attributes",
"too-many-positional-arguments",
"broad-exception-raised",
"too-many-lines",
"invalid-name",
"unused-argument",
"broad-exception-caught",
"consider-using-with",
"fixme",
"too-many-statements",
"too-many-branches",
"too-many-locals",
"too-many-arguments",
"too-many-return-statements",
"too-many-nested-blocks",
"duplicate-code",
"abstract-method",
"superfluous-parens",
"arguments-differ",
"redefined-builtin",
"unnecessary-lambda",
"dangerous-default-value",
"invalid-overridden-method",
# next warnings should be fixed in future
"bad-classmethod-argument", # Class method should have 'cls' as first argument
"wrong-import-order", # Standard imports should be placed before third party imports
"ungrouped-imports",
"unnecessary-pass",
"unnecessary-lambda-assignment",
"no-else-return",
"unused-variable",
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment