تحويل الصورة إلى كاريكاتير بأسلوب كرتوني
سير العمل هذا بسيط: ارفع صورتك واختر واحدًا من 15 أسلوبًا كرتونيًا مُعدًا مسبقًا لتحويلها.
حول
يحوّل سير عمل ComfyUI هذا صورة عادية إلى كاريكاتير بأسلوب كرتوني باستخدام واحد من 15 مظهرًا مُعدًا مسبقًا. يبدأ بـ LoadImage لصورة المصدر، ويمرر اختيار الأسلوب من قائمة CustomCombo، ويستخرج معلمات الإعداد المسبق المطابقة عبر JsonExtractString، ويجمع أي معرّفات مطلوبة عبر StringConcatenate. تتم عملية التحويل الأساسية داخل عقدة معالجة مخصصة (UUID d4c06663-cb1a-4a41-a36b-f09c93e55e7e) والتي تأخذ صورة المصدر مع مفتاح الأسلوب المختار وتُخرج إطارًا واحدًا مُحوّلًا. يمكنك معاينة النتائج مباشرة عبر PreviewAny وحفظ الصورة النهائية عبر SaveImage.
داخليًا، يحافظ نظام الإعدادات المسبقة على نتائج متسقة وقابلة للتكرار عبر الصور. تفصل خريطة JSON بين أسماء الأساليب المفهومة للمستخدم وقيم الإعداد الفعلية التي تتوقعها عقدة المعالجة، ما يجعل تبديل الأساليب سهلًا دون لمس الإعدادات منخفضة المستوى. وبما أن المعالجة الثقيلة مغلّفة داخل عقدة d4c06663-cb1a-4a41-a36b-f09c93e55e7e، يبقى المخطط بسيطًا وسريع الاستخدام—ولا يتطلب تحميل نماذج إضافية أو ضبط sampler.
ما تقدّمه
- جارٍ قراءة سير العمل
يعمل في 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 بكسل على أقصر ضلع عادةً تعطي خطوطًا وألوانًا نظيفة. اقتطع للصورة إلى الرأس والكتفين إن أمكن، استخدم إضاءة متساوية، وتجنب طمس الحركة الشديد.
يركّز هذا المخطط على إدخال صورة واحدة عبر LoadImage. للدفعات، كرر الفرع أو استبدل بعقدة تحميل تدعم الدُفعات ومرّر نفس ربط CustomCombo/JSON إلى عقدة المعالجة.
مهام سير عمل ذات صلة
- Nano Banana Pro, Gemini3 Pro Image Preview, Google
Create a character turnaround
- Qwen-Image-Edit
Change a material
- Qwen-Image-Edit
See your subject from a new angle
- Flux.2 Dev, Flux
Create a product mockup
- Nano Banana Pro
Try an outfit on a character
- Seedream
Put your product in a new scene
- SSeedVR2
Upscale and restore detail
- Nano Banana Pro
Sharpen a product photo
- Topaz
Upscale an illustration
- HHitPaw
Restore portrait detail
- FLUX.1 Fill
Edit a selected region
- FLUX.1 Fill
Extend an image’s borders