AisingioroHao0 commited on
Commit
6bae58f
·
1 Parent(s): 50ef1a3

add downlaod models

Browse files
Files changed (1) hide show
  1. artistic_portrait_gen.ipynb +30 -1
artistic_portrait_gen.ipynb CHANGED
@@ -18,7 +18,9 @@
18
  "from diffusers import ControlNetModel\n",
19
  "from PIL import Image\n",
20
  "from ip_adapter_diffusers.ip_adapter import *\n",
21
- "from diffusers import DPMSolverMultistepScheduler"
 
 
22
  ]
23
  },
24
  {
@@ -33,6 +35,32 @@
33
  "id_adapter_path = \"models/pulid_adapter_diffusers_1.1.pth\""
34
  ]
35
  },
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
36
  {
37
  "cell_type": "code",
38
  "execution_count": null,
@@ -50,6 +78,7 @@
50
  " torch_dtype=torch.float16,\n",
51
  " style_adapter_path=style_adapter_path,\n",
52
  " id_adapter_path=id_adapter_path,\n",
 
53
  " device=device,\n",
54
  ").to(device)\n",
55
  "pipe.scheduler = DPMSolverMultistepScheduler.from_config(\n",
 
18
  "from diffusers import ControlNetModel\n",
19
  "from PIL import Image\n",
20
  "from ip_adapter_diffusers.ip_adapter import *\n",
21
+ "from diffusers import DPMSolverMultistepScheduler\n",
22
+ "from huggingface_hub import hf_hub_download\n",
23
+ "import os"
24
  ]
25
  },
26
  {
 
35
  "id_adapter_path = \"models/pulid_adapter_diffusers_1.1.pth\""
36
  ]
37
  },
38
+ {
39
+ "cell_type": "code",
40
+ "execution_count": null,
41
+ "metadata": {},
42
+ "outputs": [],
43
+ "source": [
44
+ "if not os.path.exists(\"models/csd_clip.pth\"):\n",
45
+ " hf_hub_download(\n",
46
+ " repo_id=\"AisingioroHao0/IP-Adapter-Art\",\n",
47
+ " filename=\"csd_clip.pth\",\n",
48
+ " local_dir=\"models\",\n",
49
+ " )\n",
50
+ "if not os.path.exists(style_adapter_path):\n",
51
+ " hf_hub_download(\n",
52
+ " repo_id=\"AisingioroHao0/IP-Adapter-Art\",\n",
53
+ " filename=\"ip_adapter_art_sdxl_512.pth\",\n",
54
+ " local_dir=\"models\",\n",
55
+ " )\n",
56
+ "if not os.path.exists(id_adapter_path):\n",
57
+ " hf_hub_download(\n",
58
+ " repo_id=\"AisingioroHao0/IP-Adapter-Art\",\n",
59
+ " filename=\"pulid_adapter_diffusers_1.1.pth\",\n",
60
+ " local_dir=\"models\",\n",
61
+ " )"
62
+ ]
63
+ },
64
  {
65
  "cell_type": "code",
66
  "execution_count": null,
 
78
  " torch_dtype=torch.float16,\n",
79
  " style_adapter_path=style_adapter_path,\n",
80
  " id_adapter_path=id_adapter_path,\n",
81
+ " variant=\"fp16\",\n",
82
  " device=device,\n",
83
  ").to(device)\n",
84
  "pipe.scheduler = DPMSolverMultistepScheduler.from_config(\n",