├── README.md └── DiffSketcher_colab.ipynb /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 | ## 🦒 Colab 6 | 7 | | Colab | Info 8 | | --- | --- | 9 | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/camenduru/DiffSketcher-colab/blob/main/DiffSketcher_colab.ipynb) | DiffSketcher_colab 10 | 11 | ## Main Repo 12 | https://github.com/ximinng/DiffSketcher 13 | 14 | ## Paper 15 | https://arxiv.org/abs/2306.14685 16 | 17 | ## Page 18 | https://ximinng.github.io/DiffSketcher-project/ 19 | 20 | ## Output 21 | 22 | https://github.com/camenduru/DiffSketcher-colab/assets/54370274/17aad7da-12ef-43c3-800d-931d369794bd 23 | 24 | teaser 25 | -------------------------------------------------------------------------------- /DiffSketcher_colab.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/DiffSketcher-colab/blob/main/DiffSketcher_colab.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/DiffSketcher\n", 22 | "%cd /content/DiffSketcher\n", 23 | "!pip install -e .\n", 24 | "\n", 25 | "%cd /content\n", 26 | "!git clone -b dev --recursive https://github.com/camenduru/diffvg\n", 27 | "%cd /content/diffvg\n", 28 | "!pip uninstall tensorflow -y\n", 29 | "!python setup.py install -v\n", 30 | "\n", 31 | "!pip install -q https://download.pytorch.org/whl/cu121/xformers-0.0.22.post7-cp310-cp310-manylinux2014_x86_64.whl\n", 32 | "!pip install -q git+https://github.com/openai/CLIP.git cssutils\n", 33 | "!wget https://huggingface.co/camenduru/DiffSketcher/resolve/main/u2net.pth -O /content/DiffSketcher/checkpoint/u2net.pth" 34 | ] 35 | }, 36 | { 37 | "cell_type": "code", 38 | "execution_count": null, 39 | "metadata": {}, 40 | "outputs": [], 41 | "source": [ 42 | "%cd /content/DiffSketcher\n", 43 | "!python run_painterly_render.py \\\n", 44 | " -c diffsketcher.yaml \\\n", 45 | " -eval_step 10 -save_step 10 \\\n", 46 | " -update \"token_ind=2 num_paths=96 sds.warmup=1000 sds.grad_scale=1e-5 num_iter=1500\" \\\n", 47 | " -pt \"A horse is drinking water by the lake\" \\\n", 48 | " -respath ./workdir/draw_horse \\\n", 49 | " -d 998 \\\n", 50 | " --download" 51 | ] 52 | } 53 | ], 54 | "metadata": { 55 | "accelerator": "GPU", 56 | "colab": { 57 | "gpuType": "T4", 58 | "provenance": [] 59 | }, 60 | "kernelspec": { 61 | "display_name": "Python 3", 62 | "name": "python3" 63 | }, 64 | "language_info": { 65 | "name": "python" 66 | } 67 | }, 68 | "nbformat": 4, 69 | "nbformat_minor": 0 70 | } 71 | --------------------------------------------------------------------------------