Skip to content

Commit a597713

Browse files
authored
Update demo.ipynb
1 parent e76338e commit a597713

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

examples/research_projects/gligen/demo.ipynb

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@
2626
"%load_ext autoreload\n",
2727
"%autoreload 2\n",
2828
"\n",
29-
"from diffusers import StableDiffusionGLIGENPipeline"
29+
"import torch\n",
30+
"from diffusers import StableDiffusionGLIGENTextImagePipeline, StableDiffusionGLIGENPipeline"
3031
]
3132
},
3233
{
@@ -35,17 +36,16 @@
3536
"metadata": {},
3637
"outputs": [],
3738
"source": [
38-
"from transformers import CLIPTextModel, CLIPTokenizer\n",
39-
"\n",
39+
"import os\n",
4040
"import diffusers\n",
4141
"from diffusers import (\n",
4242
" AutoencoderKL,\n",
4343
" DDPMScheduler,\n",
44-
" EulerDiscreteScheduler,\n",
4544
" UNet2DConditionModel,\n",
45+
" UniPCMultistepScheduler,\n",
46+
" EulerDiscreteScheduler,\n",
4647
")\n",
47-
"\n",
48-
"\n",
48+
"from transformers import CLIPImageProcessor, CLIPTextModel, CLIPTokenizer\n",
4949
"# pretrained_model_name_or_path = 'masterful/gligen-1-4-generation-text-box'\n",
5050
"\n",
5151
"pretrained_model_name_or_path = '/root/data/zhizhonghuang/checkpoints/models--masterful--gligen-1-4-generation-text-box/snapshots/d2820dc1e9ba6ca082051ce79cfd3eb468ae2c83'\n",
@@ -122,7 +122,6 @@
122122
"\n",
123123
"import numpy as np\n",
124124
"\n",
125-
"\n",
126125
"boxes = np.array([x[1] for x in gen_boxes])\n",
127126
"boxes = boxes / 512\n",
128127
"boxes[:, 2] = boxes[:, 0] + boxes[:, 2]\n",

0 commit comments

Comments
 (0)