├── PuLID-FLUX_jupyter.ipynb ├── PuLID_jupyter.ipynb └── README.md /PuLID-FLUX_jupyter.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "markdown", 5 | "metadata": { 6 | "id": "view-in-github" 7 | }, 8 | "source": [ 9 | "[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/camenduru/PuLID-jupyter/blob/main/PuLID-FLUX_jupyter.ipynb)" 10 | ] 11 | }, 12 | { 13 | "cell_type": "code", 14 | "execution_count": null, 15 | "metadata": { 16 | "id": "VjYy0F2gZIPR" 17 | }, 18 | "outputs": [], 19 | "source": [ 20 | "%cd /content\n", 21 | "!git clone -b dev https://github.com/camenduru/PuLID-FLUX-hf\n", 22 | "%cd /content/PuLID-FLUX-hf\n", 23 | "!pip install diffusers gradio fire insightface onnx onnxruntime-gpu onnxruntime accelerate timm SentencePiece git+https://github.com/XPixelGroup/BasicSR ftfy einops facexlib fire\n", 24 | "!wget https://huggingface.co/camenduru/PuLID/resolve/main/bpe_simple_vocab_16e6.txt.gz -O /content/PuLID-FLUX-hf/eva_clip/bpe_simple_vocab_16e6.txt.gz\n", 25 | "!python app.py" 26 | ] 27 | } 28 | ], 29 | "metadata": { 30 | "accelerator": "GPU", 31 | "colab": { 32 | "gpuType": "T4", 33 | "provenance": [] 34 | }, 35 | "kernelspec": { 36 | "display_name": "Python 3", 37 | "name": "python3" 38 | }, 39 | "language_info": { 40 | "name": "python" 41 | } 42 | }, 43 | "nbformat": 4, 44 | "nbformat_minor": 0 45 | } 46 | -------------------------------------------------------------------------------- /PuLID_jupyter.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "markdown", 5 | "metadata": { 6 | "id": "view-in-github" 7 | }, 8 | "source": [ 9 | "[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/camenduru/PuLID-jupyter/blob/main/PuLID_jupyter.ipynb)" 10 | ] 11 | }, 12 | { 13 | "cell_type": "code", 14 | "execution_count": null, 15 | "metadata": { 16 | "id": "VjYy0F2gZIPR" 17 | }, 18 | "outputs": [], 19 | "source": [ 20 | "%cd /content\n", 21 | "!GIT_LFS_SKIP_SMUDGE=1 git clone -b dev https://github.com/camenduru/PuLID-hf\n", 22 | "%cd /content/PuLID-hf\n", 23 | "\n", 24 | "!pip install -q diffusers==0.25.0 xformers==0.0.25 einops ftfy basicsr facexlib insightface onnxruntime-gpu accelerate timm gradio apex\n", 25 | "\n", 26 | "!sed -i 's/from torchvision.transforms.functional_tensor import rgb_to_grayscale/from torchvision.transforms.functional import rgb_to_grayscale/' /usr/local/lib/python3.10/dist-packages/basicsr/data/degradations.py\n", 27 | "!wget https://huggingface.co/spaces/yanze/PuLID/resolve/main/eva_clip/bpe_simple_vocab_16e6.txt.gz -O /content/PuLID-hf/eva_clip/bpe_simple_vocab_16e6.txt.gz\n", 28 | "\n", 29 | "!pip install -U huggingface_hub diffusers\n", 30 | "!python app.py" 31 | ] 32 | } 33 | ], 34 | "metadata": { 35 | "accelerator": "GPU", 36 | "colab": { 37 | "gpuType": "T4", 38 | "provenance": [] 39 | }, 40 | "kernelspec": { 41 | "display_name": "Python 3", 42 | "name": "python3" 43 | }, 44 | "language_info": { 45 | "name": "python" 46 | } 47 | }, 48 | "nbformat": 4, 49 | "nbformat_minor": 0 50 | } 51 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 🐣 Please follow me for new updates https://twitter.com/camenduru
2 | 🔥 Please join our discord server https://discord.gg/k5BwmmvJJU
3 | 🥳 Please join my patreon community https://patreon.com/camenduru
4 | 5 | ### 🍊 Jupyter Notebook 6 | 7 | | Notebook | Info 8 | | --- | --- | 9 | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/camenduru/PuLID-jupyter/blob/main/PuLID_jupyter.ipynb) | PuLID_jupyter 10 | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/camenduru/PuLID-jupyter/blob/main/PuLID-FLUX_jupyter.ipynb) | PuLID-FLUX_jupyter (We need an A100 80GB; we cannot run this on Colab 😭) 11 | 12 | ### 🧬 Code 13 | https://github.com/ToTheBeginning/PuLID 14 | 15 | ### 📄 Paper 16 | https://arxiv.org/abs/2404.16022 17 | 18 | ### 🖼 Output 19 | ![Screenshot 2024-05-03 062011](https://github.com/camenduru/PuLID-jupyter/assets/54370274/1a2ebc6f-e2af-4fc0-b935-ae22a6ee0b45) 20 | --------------------------------------------------------------------------------