Skip to content

Commit

Permalink
Fix disco notebook (#1507)
Browse files Browse the repository at this point in the history
fix notebook
  • Loading branch information
plyfager authored Dec 6, 2022
1 parent 768e022 commit 692044e
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions configs/disco_diffusion/tutorials.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,7 @@
"!git clone -b dev-1.x https://github.com/open-mmlab/mmediting.git \n",
"%cd mmediting\n",
"!pip install -r requirements.txt\n",
"!pip install -e .\n",
"%cd configs/disco_diffusion"
"!pip install -e ."
]
},
{
Expand Down Expand Up @@ -122,7 +121,7 @@
"metadata": {},
"outputs": [],
"source": [
"config = 'disco-diffusion_adm-u-finetuned_imagenet-512x512.py'\n",
"config = 'configs/disco_diffusion/disco-diffusion_adm-u-finetuned_imagenet-512x512.py'\n",
"disco = MODELS.build(Config.fromfile(config).model).cuda().eval()\n",
"text_prompts = {\n",
" 0: [\"clouds surround the mountains and Chinese palaces, sunshine, lake, overlook, overlook, unreal engine, light effect, Dream, Greg Rutkowski, James Gurney, artstation\"]\n",
Expand Down Expand Up @@ -219,7 +218,7 @@
"text_prompts = {\n",
" 0: [\"clouds surround the mountains and Chinese palaces,sunshine,lake,overlook,overlook,unreal engine,light effect,Dream,Greg Rutkowski,James Gurney,artstation\"]\n",
"}\n",
"config = 'disco-diffusion_adm-u-finetuned_imagenet-256x256.py'\n",
"config = 'configs/disco_diffusion/disco-diffusion_adm-u-finetuned_imagenet-256x256.py'\n",
"disco = MODELS.build(Config.fromfile(config).model).cuda().eval()\n",
"image = disco.infer(width=512, height=448, text_prompts=text_prompts, show_progress=True, num_inference_steps=num_inference_steps, eta=0.8, seed=seed)['samples']\n",
"show_tensor(image)"
Expand All @@ -233,7 +232,7 @@
"source": [
"\n",
"# 512x512_diffusion_uncond_finetune_008100\n",
"config = 'disco-diffusion_adm-u-finetuned_imagenet-512x512.py'\n",
"config = 'configs/disco_diffusion/disco-diffusion_adm-u-finetuned_imagenet-512x512.py'\n",
"disco = MODELS.build(Config.fromfile(config).model).cuda().eval()\n",
"image = disco.infer(width=1280, height=768, text_prompts=text_prompts, show_progress=True, num_inference_steps=num_inference_steps, eta=0.8, seed=seed)['samples']\n",
"show_tensor(image)\n"
Expand Down Expand Up @@ -294,7 +293,7 @@
"from mmedit.models.editors.disco_diffusion.guider import ImageTextGuider\n",
"\n",
"\n",
"config = 'disco-diffusion_adm-u-finetuned_imagenet-512x512.py'\n",
"config = 'configs/disco_diffusion/disco-diffusion_adm-u-finetuned_imagenet-512x512.py'\n",
"disco = MODELS.build(Config.fromfile(config).model).cuda().eval()\n",
"text_prompts = {0: [\"A beautiful painting of a map of the city of Atlantis\"]}\n"
]
Expand Down Expand Up @@ -1179,7 +1178,7 @@
"metadata": {},
"outputs": [],
"source": [
"config = 'disco-diffusion_adm-u-finetuned_imagenet-512x512.py'\n",
"config = 'configs/disco_diffusion/disco-diffusion_adm-u-finetuned_imagenet-512x512.py'\n",
"disco = MODELS.build(Config.fromfile(config).model).cuda().eval()"
]
},
Expand Down

0 comments on commit 692044e

Please sign in to comment.