🥞
Glif Docs/Guide
  • Getting Started
    • 👋What is Glif?
    • 💡What can I do with a glif?
      • 🏃Run a glif
      • 🔌Build a glif
      • 🔀Remix a glif
      • 🗣️Comment on a glif
      • 🔳Embed a glif
    • ⚒️How do I build a glif?
      • 📽️Video tutorial: Building a simple image generator
      • 🟰Using variables
    • ⚙️Profile Settings
    • 🪙Credits and Payments
    • ❓FAQs
  • Blocks
    • 🙋Inputs
      • ✍️Text Input Block
      • 🖼️Image Input Block
      • 📋Multipick Block
    • 🪄Generators
      • 📃Text Block
      • 🖼️Image Block
      • ➡️Image to Text Block
        • Florence2Sam2Segmenter
    • 🧰Tools
      • 🔀Text Combiner Block
      • 🔬JSON Extractor Block
    • 💅Styling
      • 🎨HTML Block
      • 🖼️Canvas Block
    • 🧑‍🔬Advanced/Experimental
      • 🎙️Audio Input Block
      • ↔️Glif Block
      • 🌐Web Fetcher Block
      • 🔊Audio Spell
      • 🧱ComfyUI Block
      • 📡Audio to Text Block
      • 🎥Video Input Block
      • 🔧JSON Repair Block
  • Apps
    • 🎨Glif It! Browser Extension
  • Glif University
    • 🎥Video Tutorials
      • 🐲How To: D&D Character Sheet Generator
      • 🧠How To: Expanding Brain Meme Generator
      • 🦑How To: Occult Memelord Generator
      • 🥸How To: InstantID Portrait Restyle Glif
      • 🕺How To: Style and Pose a Character with InstantID + Controlnet
      • 😱How To: Create a Simple Cartoon Portrait Animation Glif (LivePortrait + Custom Blocks)
      • 👗How to Create a Clothing Restyler App (IP Adapter, ControlNet + GPT Vision)
      • 🤡How to Create a 4+ Panel Storyboard/Comic (Flux Schnell)
      • 🎂How to Create a Recipe Generator with Accompanying Pictures
      • How to Use JasperAI Depth Controlnet on Flux Dev
      • 🦸‍♂️How to Make a Consistent Comic Panel Generator
    • 🧑‍🏫Prompt Engineering 101
    • 🖼️ControlNet
    • 📚AI Glossary
  • API - for Developers
    • ⚡Running glifs via the API
    • 🤖Using AI Assistants to build with the Glif API
    • 📙Reading & writing data via the API
    • 🗾Glif Graph JSON Schema
    • 📫Embed player & custom webpages
    • 📫Sample code
    • ❓What can I make with the Glif API?
      • Browser Extensions
      • Discord Bots
      • Games
      • Social Media Bots
      • Experimental Projects
  • Policies
    • 👨‍👩‍👧‍👦Community Guidelines
  • Programs
    • 🖼️Loradex Trainer Program
  • Community Resources
    • 🧑‍🤝‍🧑Resources Created by Glif Community Members
  • Contact Us
    • 📣Send us your feedback
    • 🚔Information for law enforcement
Powered by GitBook
On this page
  • Step by Step
  • Code and Content
  1. Glif University
  2. Video Tutorials

How To: InstantID Portrait Restyle Glif

This workflow guides you through leveraging the InstantID tool in ComfyUI to style any portrait!

PreviousHow To: Occult Memelord GeneratorNextHow To: Style and Pose a Character with InstantID + Controlnet

Last updated 9 months ago

Step by Step

  1. Click ‘Build’ to start a new project

  2. Add a user input Text block and rename it

  3. Change the user facing text to read "Your Portrait:"

  4. Add a user input Multipick block and rename it.

  5. Add a list of names corresponding with the LoRA models you aim to use to the Multipick

  6. Change the Multipick label to "Art Style"

  7. (Optional) Create your model repo on Huggingface

  8. Add a Text Generation block

  9. Adjust the Text Generation block with the provided instructions, tailoring it to match your LoRA list

  10. Add a ComfyUI block

  11. Adjust the ComfyUI block by replacing the default JSON with the provided code block.

Code and Content

Replace the default System Prompt info with this text generation prompt info:

System Prompt

You are able to sort out information. From this list, if the input represents something on the left colum, just generate the right column information. Don't give any additional information. You have to use the .safetensors file format at the end.

Scifi Surreal Illustration : Araminta_K_Illustrated.safetensors
Black and White Print : araminta_K_bw_manga.safetensors
Anime Illustration : araminta_k-soft-n-squishy-illustration_.safetensors
Soft Focus 3D : araminta_k_soft_focus_3d_1.safetensors
Inky Illustration : araminta_k_the_point_1.safetensors
Crayon Style : crayons_v1_sdxl_.safetensors
Embroidery Style : embroidered_style_v1_sdxl.safetensors
Nighttime Style : nighttime_v1.safetensors

Copy and paste the following into the ComfyUI Block:

{
  "3": {
    "inputs": {
      "seed": 270796374588362,
      "steps": 45,
      "cfg": 5,
      "sampler_name": "ddpm",
      "scheduler": "karras",
      "denoise": 0.9,
      "model": [
        "31",
        0
      ],
      "positive": [
        "31",
        1
      ],
      "negative": [
        "31",
        2
      ],
      "latent_image": [
        "33",
        0
      ]
    },
    "class_type": "KSampler",
    "_meta": {
      "title": "KSampler"
    }
  },
  "4": {
    "inputs": {
      "ckpt_name": "albedobaseXL_v21.safetensors"
    },
    "class_type": "CheckpointLoaderSimple",
    "_meta": {
      "title": "Load Checkpoint"
    }
  },
  "6": {
    "inputs": {
      "text": "portrait, {drop-down}",
      "clip": [
        "35",
        1
      ]
    },
    "class_type": "CLIPTextEncode",
    "_meta": {
      "title": "CLIP Text Encode (Prompt)"
    }
  },
  "7": {
    "inputs": {
      "text": "watermark, text, signature, blurry, ugly, messy, long neck, multiple, duplicate\n",
      "clip": [
        "35",
        1
      ]
    },
    "class_type": "CLIPTextEncode",
    "_meta": {
      "title": "CLIP Text Encode (Prompt)"
    }
  },
  "8": {
    "inputs": {
      "samples": [
        "3",
        0
      ],
      "vae": [
        "4",
        2
      ]
    },
    "class_type": "VAEDecode",
    "_meta": {
      "title": "VAE Decode"
    }
  },
  "24": {
    "inputs": {
      "image": "{portrait}"
    },
    "class_type": "LoadImage",
    "_meta": {
      "title": "Load Image"
    }
  },
  "25": {
    "inputs": {
      "filename_prefix": "ComfyUI",
      "images": [
        "8",
        0
      ]
    },
    "class_type": "SaveImage",
    "_meta": {
      "title": "Save Image"
    }
  },
  "29": {
    "inputs": {
      "instantid_file": "SDXL/ip-adapter.bin"
    },
    "class_type": "InstantIDModelLoader",
    "_meta": {
      "title": "Load InstantID Model"
    }
  },
  "30": {
    "inputs": {
      "provider": "CPU"
    },
    "class_type": "InstantIDFaceAnalysis",
    "_meta": {
      "title": "InstantID Face Analysis"
    }
  },
  "31": {
    "inputs": {
      "weight": 0.75,
      "start_at": 0,
      "end_at": 1,
      "instantid": [
        "29",
        0
      ],
      "insightface": [
        "30",
        0
      ],
      "control_net": [
        "32",
        0
      ],
      "image": [
        "24",
        0
      ],
      "model": [
        "35",
        0
      ],
      "positive": [
        "6",
        0
      ],
      "negative": [
        "7",
        0
      ]
    },
    "class_type": "ApplyInstantID",
    "_meta": {
      "title": "Apply InstantID"
    }
  },
  "32": {
    "inputs": {
      "control_net_name": "SDXL/instantid/diffusion_pytorch_model.safetensors"
    },
    "class_type": "ControlNetLoader",
    "_meta": {
      "title": "Load ControlNet Model"
    }
  },
  "33": {
    "inputs": {
      "width": 1016,
      "height": 1016,
      "batch_size": 1
    },
    "class_type": "EmptyLatentImage",
    "_meta": {
      "title": "Empty Latent Image"
    }
  },
  "35": {
    "inputs": {
      "repo_id": "glif/instantid_tutorial_dropdown_models",
      "subfolder": "",
      "filename": "{safetensor}",
      "strength_model": 1,
      "strength_clip": 1,
      "model": [
        "4",
        0
      ],
      "clip": [
        "4",
        1
      ]
    },
    "class_type": "HFHubLoraLoader",
    "_meta": {
      "title": "Load HF Lora"
    }
  }
}

🎥
🥸
Remix the existing Glif here!
Check out the Huggingface repository here!
Part 1
Part 2
Supplemental Huggingface Repo Tutorial (Optional)