diff --git a/README.md b/README.md index e7cc38c..ea93efe 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ A collection of custom nodes for ComfyUI designed to replicate certain visual el ## Metadata - **Keywords**: ComfyUI, Custom Nodes, Image Processing, Snap Effects, Filters, Overlays -- **Repository Name**: ComfySnap +- **Repository Name**: comfyui-ComfySnap ## Installation @@ -16,7 +16,7 @@ Since this repository is not yet listed in the ComfyUI Manager, you can install 1. Navigate to your ComfyUI `custom_nodes` directory. 2. Clone this repository: ```bash - git clone https://github.com/SignalCha1n/ComfySnap + git clone https://github.com/SignalCha1n/comfyui-ComfySnap ``` 3. Restart ComfyUI. diff --git a/examples/ComfySnap.json b/examples/ComfySnap.json new file mode 100644 index 0000000..06bb1ce --- /dev/null +++ b/examples/ComfySnap.json @@ -0,0 +1,878 @@ +{ + "id": "aec1ea3e-fceb-4a4e-8f73-5e04301759db", + "revision": 0, + "last_node_id": 22, + "last_link_id": 18, + "nodes": [ + { + "id": 7, + "type": "CLIPTextEncode", + "pos": [ + 413, + 389 + ], + "size": [ + 425.27801513671875, + 180.6060791015625 + ], + "flags": {}, + "order": 10, + "mode": 0, + "inputs": [ + { + "name": "clip", + "type": "CLIP", + "link": 5 + } + ], + "outputs": [ + { + "name": "CONDITIONING", + "type": "CONDITIONING", + "slot_index": 0, + "links": [ + 6 + ] + } + ], + "properties": { + "cnr_id": "comfy-core", + "ver": "0.3.29", + "Node name for S&R": "CLIPTextEncode" + }, + "widgets_values": [ + "text, watermark" + ] + }, + { + "id": 4, + "type": "CheckpointLoaderSimple", + "pos": [ + 70, + 190 + ], + "size": [ + 315, + 98 + ], + "flags": {}, + "order": 0, + "mode": 0, + "inputs": [], + "outputs": [ + { + "name": "MODEL", + "type": "MODEL", + "slot_index": 0, + "links": [ + 1 + ] + }, + { + "name": "CLIP", + "type": "CLIP", + "slot_index": 1, + "links": [ + 3, + 5 + ] + }, + { + "name": "VAE", + "type": "VAE", + "slot_index": 2, + "links": [ + 8 + ] + } + ], + "properties": { + "cnr_id": "comfy-core", + "ver": "0.3.29", + "Node name for S&R": "CheckpointLoaderSimple" + }, + "widgets_values": [ + "lustifySDXLNSFW_v40DMD2.safetensors" + ] + }, + { + "id": 3, + "type": "KSampler", + "pos": [ + 863, + 186 + ], + "size": [ + 315, + 474 + ], + "flags": {}, + "order": 11, + "mode": 0, + "inputs": [ + { + "name": "model", + "type": "MODEL", + "link": 1 + }, + { + "name": "positive", + "type": "CONDITIONING", + "link": 4 + }, + { + "name": "negative", + "type": "CONDITIONING", + "link": 6 + }, + { + "name": "latent_image", + "type": "LATENT", + "link": 2 + } + ], + "outputs": [ + { + "name": "LATENT", + "type": "LATENT", + "slot_index": 0, + "links": [ + 7 + ] + } + ], + "properties": { + "cnr_id": "comfy-core", + "ver": "0.3.29", + "Node name for S&R": "KSampler" + }, + "widgets_values": [ + 46545674249846, + "randomize", + 8, + 1, + "lcm", + "exponential", + 1 + ] + }, + { + "id": 6, + "type": "CLIPTextEncode", + "pos": [ + 415, + 186 + ], + "size": [ + 422.84503173828125, + 164.31304931640625 + ], + "flags": {}, + "order": 9, + "mode": 0, + "inputs": [ + { + "name": "clip", + "type": "CLIP", + "link": 3 + } + ], + "outputs": [ + { + "name": "CONDITIONING", + "type": "CONDITIONING", + "slot_index": 0, + "links": [ + 4 + ] + } + ], + "properties": { + "cnr_id": "comfy-core", + "ver": "0.3.29", + "Node name for S&R": "CLIPTextEncode" + }, + "widgets_values": [ + "(raw, film grain, jpeg artifacts, low res, low quality:1.3), shot on GoPro Hero, Annabelle, elegant body, green eyes, chestnut hair, half-up half-down hairstyle, 19 year old girl, white girl, pale skin, girl next door, average girl, plain face, sweater, skirt, (driver:1.3), car, candid, portrait, upper body, close up, cute woman, dark lighting, dim lighting, night, covered in shadow, , (solo, sitting in the car, driving, night, amateur photo, amateur selfie, close up selfie:1.2) cute innocent face, shy" + ] + }, + { + "id": 5, + "type": "EmptyLatentImage", + "pos": [ + 860, + 710 + ], + "size": [ + 315, + 106 + ], + "flags": {}, + "order": 1, + "mode": 0, + "inputs": [], + "outputs": [ + { + "name": "LATENT", + "type": "LATENT", + "slot_index": 0, + "links": [ + 2 + ] + } + ], + "properties": { + "cnr_id": "comfy-core", + "ver": "0.3.29", + "Node name for S&R": "EmptyLatentImage" + }, + "widgets_values": [ + 768, + 1344, + 1 + ] + }, + { + "id": 15, + "type": "SnapBasicFilters", + "pos": [ + 1580, + 190 + ], + "size": [ + 317.4000244140625, + 226 + ], + "flags": {}, + "order": 16, + "mode": 0, + "inputs": [ + { + "name": "image", + "type": "IMAGE", + "link": 14 + } + ], + "outputs": [ + { + "name": "IMAGE", + "type": "IMAGE", + "links": [ + 15 + ] + } + ], + "properties": { + "aux_id": "SignalCha1n/ComfySnap", + "ver": "f2699e2b977da3e5e15017689419934d3bd2d02d", + "Node name for S&R": "SnapBasicFilters" + }, + "widgets_values": [ + "original", + 1, + true, + true, + 0.5, + 1, + 854720550822366, + "randomize" + ], + "color": "#223", + "bgcolor": "#335" + }, + { + "id": 14, + "type": "SnapTextOverlay", + "pos": [ + 1210, + 190 + ], + "size": [ + 340, + 274 + ], + "flags": {}, + "order": 15, + "mode": 0, + "inputs": [ + { + "name": "image", + "type": "IMAGE", + "link": 17 + }, + { + "name": "custom_vertical_percentage", + "type": "FLOAT", + "widget": { + "name": "custom_vertical_percentage" + }, + "link": 13 + } + ], + "outputs": [ + { + "name": "IMAGE", + "type": "IMAGE", + "links": [ + 14 + ] + } + ], + "properties": { + "aux_id": "SignalCha1n/ComfySnap", + "ver": "f2699e2b977da3e5e15017689419934d3bd2d02d", + "Node name for S&R": "SnapTextOverlay" + }, + "widgets_values": [ + "Your Text Here", + "arial.ttf", + 0.05, + "custom", + 100, + "#FFFFFF", + 0.7, + 4, + "#000000", + 0.5 + ], + "color": "#223", + "bgcolor": "#335" + }, + { + "id": 11, + "type": "UltralyticsDetectorProvider", + "pos": [ + 710, + -40 + ], + "size": [ + 226.8000030517578, + 78 + ], + "flags": {}, + "order": 2, + "mode": 0, + "inputs": [], + "outputs": [ + { + "name": "BBOX_DETECTOR", + "type": "BBOX_DETECTOR", + "slot_index": 0, + "links": [ + 11 + ] + }, + { + "name": "SEGM_DETECTOR", + "type": "SEGM_DETECTOR", + "links": null + } + ], + "properties": { + "cnr_id": "comfyui-impact-subpack", + "ver": "1.2.9", + "Node name for S&R": "UltralyticsDetectorProvider" + }, + "widgets_values": [ + "bbox/face_yolov8m.pt" + ] + }, + { + "id": 8, + "type": "VAEDecode", + "pos": [ + 1050, + 130 + ], + "size": [ + 210, + 46 + ], + "flags": { + "collapsed": true + }, + "order": 12, + "mode": 0, + "inputs": [ + { + "name": "samples", + "type": "LATENT", + "link": 7 + }, + { + "name": "vae", + "type": "VAE", + "link": 8 + } + ], + "outputs": [ + { + "name": "IMAGE", + "type": "IMAGE", + "slot_index": 0, + "links": [ + 17, + 18 + ] + } + ], + "properties": { + "cnr_id": "comfy-core", + "ver": "0.3.29", + "Node name for S&R": "VAEDecode" + }, + "widgets_values": [] + }, + { + "id": 16, + "type": "LowQualityDigitalLook", + "pos": [ + 1930, + 190 + ], + "size": [ + 315, + 130 + ], + "flags": {}, + "order": 17, + "mode": 0, + "inputs": [ + { + "name": "image", + "type": "IMAGE", + "link": 15 + } + ], + "outputs": [ + { + "name": "IMAGE", + "type": "IMAGE", + "links": [ + 16 + ] + } + ], + "properties": { + "aux_id": "SignalCha1n/ComfySnap", + "ver": "d589a0fbabfe02558a34115a16447e1ca81db3ef", + "Node name for S&R": "LowQualityDigitalLook" + }, + "widgets_values": [ + "Standard Snap Low Light", + 0.5, + 3986034771, + "randomize" + ], + "color": "#223", + "bgcolor": "#335" + }, + { + "id": 10, + "type": "PreviewImage", + "pos": [ + 2270, + 190 + ], + "size": [ + 590, + 870 + ], + "flags": {}, + "order": 18, + "mode": 0, + "inputs": [ + { + "name": "images", + "type": "IMAGE", + "link": 16 + } + ], + "outputs": [], + "properties": { + "cnr_id": "comfy-core", + "ver": "0.3.29", + "Node name for S&R": "PreviewImage" + }, + "widgets_values": [] + }, + { + "id": 18, + "type": "Note", + "pos": [ + 1210, + 510 + ], + "size": [ + 317.01934814453125, + 204.04486083984375 + ], + "flags": {}, + "order": 3, + "mode": 0, + "inputs": [], + "outputs": [], + "title": "Snap Text", + "properties": {}, + "widgets_values": [ + "# Snap Text Node\n\nThis node adds social media style text captions with a semi-transparent background bar. \n\nFeatures include:\n- Automatic text wrapping based on image width\n- Multiple vertical placement options (top/middle/bottom/custom)\n- Customizable text color and font size\n- Adjustable background bar opacity\n- Supports various fonts (system must have the font installed)\n- Dynamic bar sizing based on text content" + ], + "color": "#2a363b", + "bgcolor": "#3f5159" + }, + { + "id": 12, + "type": "BboxDetectorCombined_v2", + "pos": [ + 970, + -40 + ], + "size": [ + 210, + 102 + ], + "flags": {}, + "order": 13, + "mode": 0, + "inputs": [ + { + "name": "bbox_detector", + "type": "BBOX_DETECTOR", + "link": 11 + }, + { + "name": "image", + "type": "IMAGE", + "link": 18 + } + ], + "outputs": [ + { + "name": "MASK", + "type": "MASK", + "links": [ + 12 + ] + } + ], + "properties": { + "cnr_id": "comfyui-impact-pack", + "ver": "8.8.1", + "Node name for S&R": "BboxDetectorCombined_v2" + }, + "widgets_values": [ + 0.5, + 4 + ] + }, + { + "id": 13, + "type": "FaceAvoidRandomY", + "pos": [ + 1210, + -40 + ], + "size": [ + 337.6000061035156, + 178 + ], + "flags": {}, + "order": 14, + "mode": 0, + "inputs": [ + { + "name": "mask", + "type": "MASK", + "link": 12 + } + ], + "outputs": [ + { + "name": "vertical_pos_100_top", + "type": "FLOAT", + "links": [ + 13 + ] + } + ], + "properties": { + "aux_id": "SignalCha1n/ComfySnap", + "ver": "f2699e2b977da3e5e15017689419934d3bd2d02d", + "Node name for S&R": "FaceAvoidRandomY" + }, + "widgets_values": [ + 0.5, + -30, + 20, + 36803831127522, + "randomize", + false + ], + "color": "#223", + "bgcolor": "#335" + }, + { + "id": 22, + "type": "Note", + "pos": [ + 1560, + -210 + ], + "size": [ + 210, + 103.95748138427734 + ], + "flags": {}, + "order": 4, + "mode": 0, + "inputs": [], + "outputs": [], + "title": "Face Avoid Usage Note", + "properties": {}, + "widgets_values": [ + "Avoid threshold is only active when generate_random = true\n\nTo manually adjust text placement from face position, enter a +/- value in vertical_adjustment" + ], + "color": "#2a363b", + "bgcolor": "#3f5159" + }, + { + "id": 19, + "type": "Note", + "pos": [ + 1580, + 460 + ], + "size": [ + 296.44744873046875, + 246.99424743652344 + ], + "flags": {}, + "order": 5, + "mode": 0, + "inputs": [], + "outputs": [], + "title": "Snap Basic Filters", + "properties": {}, + "widgets_values": [ + "# Snap Basic Filters Node\n\nApply quick color filter effects similar to Snapchat's swipe filters:\n- Grayscale: Convert image to black and white\n- Vivid: Enhance colors and contrast\n- Cooler: Add a subtle blue tint for a colder atmosphere\n- Warmer: Add an orange tint for a warmer feel\n- Brighter: Increase overall image brightness\n- Darker: Reduce brightness and increase contrast slightly\n\nFeatures:\n- Adjustable strength for subtle to dramatic effects\n- Randomization options\n- Stackable with other effects" + ], + "color": "#2a363b", + "bgcolor": "#3f5159" + }, + { + "id": 21, + "type": "Note", + "pos": [ + 1050, + -340 + ], + "size": [ + 502.47015380859375, + 235.3252410888672 + ], + "flags": {}, + "order": 6, + "mode": 0, + "inputs": [], + "outputs": [], + "title": "Face Avoid", + "properties": {}, + "widgets_values": [ + "# Face Avoid Node\n\nIntelligently position elements like text or logos away from faces in your images:\n- Automatically detects face position from a face mask\n- Calculates safe zones that avoid covering important facial features\n- Returns a vertical position value (0-100 scale, 100=Top)\n- Adjustable avoidance zone size\n- Optional manual vertical adjustment\n- Random# Face Avoid Node\n\nIntelligently position elements like text or logos away from faces in your images:\n- Automatically detects face position from a face mask\n- Calculates safe zones that avoid covering important facial features\n- Returns a vertical position value (0-100 scale, 100=Top)\n- Adjustable avoidance zone size\n- Optional manual vertical adjustment\n- Random" + ], + "color": "#2a363b", + "bgcolor": "#3f5159" + }, + { + "id": 20, + "type": "Note", + "pos": [ + 1930, + 360 + ], + "size": [ + 290, + 170 + ], + "flags": {}, + "order": 7, + "mode": 0, + "inputs": [], + "outputs": [], + "title": "Low Quality Digital Look", + "properties": {}, + "widgets_values": [ + "# Low Quality Digital Look Node\n\nSimulate the imperfect aesthetic of smartphone cameras or early 2000s digital photos:\n- Add realistic digital noise patterns\n- Apply JPEG compression artifacts\n- Adjust color saturation and brightness\n- Two presets: \"Standard Snap Low Light\" and \"Early 2000s Digital\"\n- Fully adjustable effect level from subtle to extreme" + ], + "color": "#2a363b", + "bgcolor": "#3f5159" + }, + { + "id": 17, + "type": "Note", + "pos": [ + 70, + -20 + ], + "size": [ + 526.8050537109375, + 155.7118377685547 + ], + "flags": {}, + "order": 8, + "mode": 0, + "inputs": [], + "outputs": [], + "title": "Intro", + "properties": {}, + "widgets_values": [ + "# ComfySnap: Snapchat-Style Effects for ComfyUI\n\nComfySnap is a collection of nodes that bring Snapchat-inspired visual effects, filters, and text overlays to your ComfyUI workflows. \n\nNodes included in this package:\n- Snap Text: Add caption bars with customizable text\n- Snap Basic Filters: Apply color grading similar to Snapchat swipe filters\n- Low Quality Digital Look: Simulate phone camera artifacts and early digital aesthetics\n- Face Avoid: Smart positioning of elements to avoid faces in your images" + ], + "color": "#2a363b", + "bgcolor": "#3f5159" + } + ], + "links": [ + [ + 1, + 4, + 0, + 3, + 0, + "MODEL" + ], + [ + 2, + 5, + 0, + 3, + 3, + "LATENT" + ], + [ + 3, + 4, + 1, + 6, + 0, + "CLIP" + ], + [ + 4, + 6, + 0, + 3, + 1, + "CONDITIONING" + ], + [ + 5, + 4, + 1, + 7, + 0, + "CLIP" + ], + [ + 6, + 7, + 0, + 3, + 2, + "CONDITIONING" + ], + [ + 7, + 3, + 0, + 8, + 0, + "LATENT" + ], + [ + 8, + 4, + 2, + 8, + 1, + "VAE" + ], + [ + 11, + 11, + 0, + 12, + 0, + "BBOX_DETECTOR" + ], + [ + 12, + 12, + 0, + 13, + 0, + "MASK" + ], + [ + 13, + 13, + 0, + 14, + 1, + "FLOAT" + ], + [ + 14, + 14, + 0, + 15, + 0, + "IMAGE" + ], + [ + 15, + 15, + 0, + 16, + 0, + "IMAGE" + ], + [ + 16, + 16, + 0, + 10, + 0, + "IMAGE" + ], + [ + 17, + 8, + 0, + 14, + 0, + "IMAGE" + ], + [ + 18, + 8, + 0, + 12, + 1, + "IMAGE" + ] + ], + "groups": [], + "config": {}, + "extra": { + "ds": { + "scale": 0.6934334949441878, + "offset": [ + 47.01260771431134, + 466.53218732442195 + ] + }, + "frontendVersion": "1.16.8" + }, + "version": 0.4 +} \ No newline at end of file diff --git a/examples/README.md b/examples/README.md new file mode 100644 index 0000000..11f7d05 --- /dev/null +++ b/examples/README.md @@ -0,0 +1,19 @@ +# comfyui-ComfySnap Example Workflow + +This directory contains example workflows demonstrating how to use comfyui-ComfySnap nodes effectively. + +## Available Workflows + +1. **ComfySnap.json** - A comprehensive demo showcasing all ComfySnap nodes including text overlays, filters, and effects. + +## How to Use + +1. Launch ComfyUI +2. Click the "Load" button in the ComfyUI interface +3. Navigate to and select the workflow JSON file +4. The workflow will be loaded with all nodes preconfigured +5. I use comfyui-impact-pack for face detection. You may need to download this if you don't have another face detection node. Otherwise, just delete the face detection node. + +## Notes on Example Workflows + +The example workflows are designed to demonstrate the capabilities of ComfySnap nodes. You may need to adjust certain parameters like file paths for images depending on your specific setup. \ No newline at end of file