Фото в мультяшную карикатуру
Этот рабочий процесс максимально простой: загрузите фото и выберите один из 15 готовых мультяшных стилей, чтобы преобразовать изображение.
О проекте
Этот рабочий процесс ComfyUI превращает обычное фото в мультяшную карикатуру, используя один из 15 готовых пресетов. Он начинается с LoadImage для исходного фото, передает выбор стиля из выпадающего списка CustomCombo, извлекает соответствующие параметры пресета через JsonExtractString и собирает нужные идентификаторы через StringConcatenate. Основная стилизация выполняется в пользовательской ноде обработки (UUID d4c06663-cb1a-4a41-a36b-f09c93e55e7e): она принимает исходное изображение и выбранный ключ стиля и возвращает один стилизованный кадр. Результат можно смотреть в реальном времени через PreviewAny и сохранять финальное изображение через SaveImage.
Внутри система пресетов обеспечивает стабильные и повторяемые результаты для разных изображений. JSON-сопоставление отделяет понятные названия стилей от реальных значений конфигурации, которые ожидает нода обработки, поэтому стили можно менять без ручной настройки низкоуровневых параметров. Поскольку основная работа спрятана внутри ноды d4c06663-cb1a-4a41-a36b-f09c93e55e7e, граф остается простым и быстрым — не нужно дополнительно загружать модели или настраивать сэмплер.
Что вы предоставляете
- Чтение рабочего процесса
Работает в ComfyUI. Этот рабочий процесс нельзя запустить на этой странице. Откройте его в Comfy Cloud, где всё уже загружено, или скачайте его для своей ComfyUI.
Попробовать в CloudВнутри рабочего процесса
Предварительный просмотр графа узлов только для чтения. Откройте его в Comfy Cloud или скачайте, чтобы редактировать узлы.
Loading the graph
Open full-size workflow previewФайлы в этом рабочем процессе
- Автор
- Rob
Требуются пользовательские ноды
- Чтение рабочего процесса
Используйте этот рабочий процесс в коде
По возможности генерируется из графа рабочего процесса и входных данных; в противном случае отображаются сохранённые примеры. Перед запуском кода проверьте учётные данные и конечные точки: могут взиматься платежи.
What you need
- Runs on
- Comfy Cloud
- Ключ
- COMFY_API_KEY
Требуются платный тариф Cloud и кредиты.
# Python 3.10+: pip install comfy-sdk==0.4.0
import os
from comfy_sdk import Comfy
api_key = os.environ.get("COMFY_API_KEY", "").strip()
if not api_key: raise RuntimeError("Set COMFY_API_KEY")
os.environ.setdefault("COMFY_BASE_URL", "https://cloud.comfy.org")
client = Comfy(api_key=api_key)
workflow = client.workflows.from_json({
"132": {
"class_type": "LoadImage",
"inputs": {
"image": "f91bccebcc07a40d5c61625f96084268613a1845ca64f9472c54e37d7a1733db.png"
},
"_meta": {
"title": "Load Image"
}
},
"197": {
"class_type": "SaveImage",
"inputs": {
"filename_prefix": "Qwen_Edit_2511",
"images": [
"196:175",
0
]
},
"_meta": {
"title": "Save Image"
}
},
"234": {
"class_type": "StringConcatenate",
"inputs": {
"delimiter": " ",
"string_a": "Keep the exact same composition, camera framing, crop, pose, character outfit, background, environment, perspective, and lighting as the original photo.",
"string_b": [
"240",
0
]
},
"_meta": {
"title": "Assemble Prompt"
}
},
"235": {
"class_type": "PreviewAny",
"inputs": {
"source": [
"234",
0
]
},
"_meta": {
"title": "Preview as Text"
}
},
"239": {
"class_type": "CustomCombo",
"inputs": {
"choice": "Classic Caricature"
},
"_meta": {
"title": "Cartoon Style"
}
},
"240": {
"class_type": "JsonExtractString",
"inputs": {
"json_string": "{\n \"Classic Caricature\": \"Transform the attached photo into a caricature portrait in the tradition of classic literary and editorial caricature illustration \\u2014 enlarge the head slightly and perch it on a smaller, elongated body. Preserve the subject's true likeness and identity while wittily exaggerating their most distinctive features.\",\n \"Sunday Comics\": \"Transform the attached photo into a vintage Sunday newspaper comic-strip caricature: bold confident ink outlines, flat saturated colors over visible Ben-Day halftone dots, slight newsprint texture and off-register color charm, cheerful panel-ready energy, slightly oversized head on a compact body. Preserve the subject's true likeness and identity while wittily exaggerating their most distinctive features.\",\n \"Watercolor Sketch\": \"Transform the attached photo into a loose watercolor caricature sketch: soft pencil underdrawing with expressive, flowing watercolor washes, gentle color bleeds, and airy unpainted paper showing through. Slightly enlarged head with delicate, painterly features. Preserve the subject's true likeness and identity while wittily exaggerating their most distinctive features.\",\n \"Street Fair Caricature\": \"Transform the attached photo into a lively caricature done in bold marker and quick airbrush: a big expressive grin, huge head on a tiny dynamic body, spontaneous drawn-while-you-wait energy. Preserve the subject's true likeness and identity while wittily exaggerating their most distinctive features.\",\n \"Rubber-Hose\": \"Transform the attached photo into a rubber-hose cartoon: rubberhose animation style, exaggerated stringy limb length, white gloves, thick bouncy outlines, soft film grain and gleeful old-timey charm. Preserve the subject's true likeness and identity while wittily exaggerating their most distinctive features.\",\n \"Anime Chibi\": \"Transform the attached photo into a chibi anime caricature: super-deformed proportions with an oversized head and tiny body, huge expressive sparkling eyes, simplified button nose, clean cel-shaded line art. Preserve the subject's true likeness and identity while wittily exaggerating their most distinctive features.\",\n \"Vinyl Collectible\": \"Transform the attached photo into a glossy 3D collectible vinyl-toy caricature figure: smooth sculpted surfaces, oversized head on a small stylized body, soft studio lighting with clean reflections, premium designer-toy finish. Preserve the subject's true likeness and identity while wittily exaggerating their most distinctive features.\",\n \"Oil Painting Satire\": \"Transform the attached photo into an 18th-century oil painting caricature: rich visible brushwork, warm old-master palette, theatrical chiaroscuro lighting, varnished gallery finish, subtly exaggerated proportions in the grand satirical portrait tradition. Preserve the subject's true likeness and identity while wittily exaggerating their most distinctive features.\",\n \"Inflatable Balloon\": \"Transform the attached photo into a shiny inflatable balloon caricature: taut glossy balloon-vinyl skin, softly over-inflated puffy cheeks and limbs, visible welded seams and a small inflation valve, squeaky rubber highlights, buoyant parade-float presence. Preserve the subject's true likeness and identity while wittily exaggerating their most distinctive features.\",\n \"Claymation\": \"Transform the attached photo into a hand-sculpted claymation caricature: matte plasticine surface with visible thumbprints and sculpting-tool marks, slightly lumpy hand-modeled shapes, big expressive sculpted brow and smile, stop-motion charm. Preserve the subject's true likeness and identity while wittily exaggerating their most distinctive features.\",\n \"Paper Cutout\": \"Transform the attached photo into a layered paper-cutout collage caricature: flat construction-paper shapes with torn and scissor-cut edges, visible drop shadows between paper layers, slightly wobbly hand-cut lines, bold flat colors. Preserve the subject's true likeness and identity while wittily exaggerating their most distinctive features.\",\n \"Pixel Sprite\": \"Transform the attached photo into a retro 16-bit pixel-art sprite caricature: chunky visible pixels, limited vibrant color palette, crisp dithered shading, oversized head sprite proportions. Preserve the subject's true likeness and identity while wittily exaggerating their most distinctive features.\",\n \"Bobblehead\": \"Transform the attached photo into a plastic exaggerated extremely large bobblehead figurine caricature: oversized wobbling head on a small neck and rigid body, hand-painted finish with subtle brush marks, collectible desk-toy presence. Preserve the subject's true likeness and identity while wittily exaggerating their most distinctive features.\",\n \"Neon Airbrush\": \"Transform the attached photo into a 90s neon airbrush caricature: vivid fluorescent airbrushed gradients over deep black shading, glowing neon rim light, confident freehand spray strokes, retro boardwalk T-shirt art energy. Preserve the subject's true likeness and identity while wittily exaggerating their most distinctive features.\"\n}",
"key": [
"239",
0
]
},
"_meta": {
"title": "Style Prompt (JSON)"
}
},
"196:152": {
"class_type": "CFGNorm",
"inputs": {
"model": [
"196:155",
0
],
"pre_cfg": False,
"strength": 1
},
"_meta": {
"title": "CFGNorm"
}
},
"196:155": {
"class_type": "ModelSamplingAuraFlow",
"inputs": {
"model": [
"196:166",
0
],
"sampling": "flow",
"shift": 3.1
},
"_meta": {
"title": "ModelSamplingAuraFlow"
}
},
"196:156": {
"class_type": "VAELoader",
"inputs": {
"vae_name": "qwen_image_vae.safetensors"
},
"_meta": {
"title": "Load VAE"
}
},
"196:161": {
"class_type": "TextEncodeQwenImageEditPlus",
"inputs": {
"clip": [
"196:167",
0
],
"image1": [
"196:176",
0
],
"prompt": [
"235",
0
],
"vae": [
"196:156",
0
]
},
"_meta": {
"title": "TextEncodeQwenImageEditPlus (Positive)"
}
},
"196:162": {
"class_type": "LoraLoaderModelOnly",
"inputs": {
"lora_name": "Qwen-Image-Edit-2511-Lightning-4steps-V1.0-bf16.safetensors",
"model": [
"196:152",
0
],
"strength_model": 1
},
"_meta": {
"title": "Load LoRA"
}
},
"196:163": {
"class_type": "PrimitiveFloat",
"inputs": {
"value": 4
},
"_meta": {
"title": "CFG"
}
},
"196:164": {
"class_type": "PrimitiveFloat",
"inputs": {
"value": 1
},
"_meta": {
"title": "CFG"
}
},
"196:165": {
"class_type": "VAEEncode",
"inputs": {
"pixels": [
"196:176",
0
],
"vae": [
"196:156",
0
]
},
"_meta": {
"title": "VAE Encode"
}
},
"196:166": {
"class_type": "UNETLoader",
"inputs": {
"unet_name": "qwen_image_edit_2511_bf16.safetensors",
"weight_dtype": "default"
},
"_meta": {
"title": "Load Diffusion Model"
}
},
"196:167": {
"class_type": "CLIPLoader",
"inputs": {
"clip_name": "qwen_2.5_vl_7b_fp8_scaled.safetensors",
"device": "default",
"type": "qwen_image"
},
"_meta": {
"title": "Load CLIP"
}
},
"196:168": {
"class_type": "ComfySwitchNode",
"inputs": {
"on_false": [
"196:152",
0
],
"on_true": [
"196:162",
0
],
"switch": [
"196:171",
0
]
},
"_meta": {
"title": "Switch (Model)"
}
},
"196:169": {
"class_type": "PrimitiveInt",
"inputs": {
"value": 6
},
"_meta": {
"title": "Steps"
}
},
"196:170": {
"class_type": "PrimitiveInt",
"inputs": {
"value": 30
},
"_meta": {
"title": "Steps"
}
},
"196:171": {
"class_type": "PrimitiveBoolean",
"inputs": {
"value": True
},
"_meta": {
"title": "Enable 4steps LoRA?"
}
},
"196:172": {
"class_type": "ComfySwitchNode",
"inputs": {
"on_false": [
"196:163",
0
],
"on_true": [
"196:164",
0
],
"switch": [
"196:171",
0
]
},
"_meta": {
"title": "Switch (CFG)"
}
},
"196:173": {
"class_type": "ComfySwitchNode",
"inputs": {
"on_false": [
"196:170",
0
],
"on_true": [
"196:169",
0
],
"switch": [
"196:171",
0
]
},
"_meta": {
"title": "Switch (Steps)"
}
},
"196:174": {
"class_type": "KSampler",
"inputs": {
"cfg": [
"196:172",
0
],
"denoise": 1,
"latent_image": [
"196:165",
0
],
"model": [
"196:168",
0
],
"negative": [
"196:229",
0
],
"positive": [
"196:161",
0
],
"sampler_name": "euler",
"scheduler": "simple",
"seed": 1029537144521435,
"steps": [
"196:173",
0
]
},
"_meta": {
"title": "KSampler"
}
},
"196:175": {
"class_type": "VAEDecode",
"inputs": {
"samples": [
"196:174",
0
],
"vae": [
"196:156",
0
]
},
"_meta": {
"title": "VAE Decode"
}
},
"196:176": {
"class_type": "FluxKontextImageScale",
"inputs": {
"image": [
"132",
0
]
},
"_meta": {
"title": "FluxKontextImageScale"
}
},
"196:229": {
"class_type": "TextEncodeQwenImageEditPlus",
"inputs": {
"clip": [
"196:167",
0
],
"image1": [
"196:176",
0
],
"prompt": "",
"vae": [
"196:156",
0
]
},
"_meta": {
"title": "Text Encode Qwen Image Edit Plus"
}
}
})
# run() also passes api_key to the partner nodes in this workflow.
job = client.run(workflow, api_key=api_key)Вопросы и ответы
Расширить пресеты можно только если нода обработки (d4c06663-cb1a-4a41-a36b-f09c93e55e7e) поддерживает дополнительные ключи стилей. Обновите JSON-пресеты, которые подаются в JsonExtractString, и добавьте новую опцию в CustomCombo. Если нода не поддерживает новый ключ, она переключится на запасной вариант или завершится ошибкой.
Это зависит от того, как реализована пользовательская нода обработки в вашей системе. Многие ноды стилизации предпочитают GPU и работают заметно быстрее, но некоторые сборки могут запускаться на CPU с меньшей скоростью.
Портреты 512–1024 px по короткой стороне обычно дают чистые линии и цвета. По возможности кадрируйте до головы и плеч, используйте ровное освещение и избегайте сильного смаза.
Этот граф рассчитан на одно изображение через LoadImage. Для пакетов продублируйте ветку или замените загрузчик на ноду с поддержкой батча и подайте то же сопоставление пресетов CustomCombo/JSON в процессор.