Merge pull request #10 from alembics/colab-notebook-collapse-improvements

Adds a human-readable id to each cell and collapses more cells by default
pull/11/head
Adam Letts 3 years ago committed by GitHub
commit 92d90c0666
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 147
      Disco_Diffusion.ipynb
  2. 10
      disco.py

@ -12,7 +12,9 @@
},
{
"cell_type": "markdown",
"metadata": {},
"metadata": {
"id": "TitleTop"
},
"source": [
"# Disco Diffusion v5 - Now with 3D animation\n",
"\n",
@ -24,7 +26,7 @@
{
"cell_type": "markdown",
"metadata": {
"id": "1YwMUyt9LHG1"
"id": "CreditsChTop"
},
"source": [
"### Credits & Changelog \u2b07\ufe0f"
@ -32,7 +34,9 @@
},
{
"cell_type": "markdown",
"metadata": {},
"metadata": {
"id": "Credits"
},
"source": [
"#### Credits\n",
"\n",
@ -59,16 +63,20 @@
},
{
"cell_type": "markdown",
"metadata": {},
"metadata": {
"id": "LicenseTop"
},
"source": [
"#### License"
]
},
{
"cell_type": "markdown",
"metadata": {},
"metadata": {
"id": "License"
},
"source": [
"@title Licensed under the MIT License\n",
"Licensed under the MIT License\n",
"\n",
"Copyright (c) 2021 Katherine Crowson \n",
"\n",
@ -143,14 +151,19 @@
},
{
"cell_type": "markdown",
"metadata": {},
"metadata": {
"id": "ChangelogTop"
},
"source": [
"#### Changelog"
]
},
{
"cell_type": "code",
"metadata": {},
"metadata": {
"cellView": "form",
"id": "Changelog"
},
"source": [
"#@title <- View Changelog\n",
"skip_for_run_all = True #@param {type: 'boolean'}\n",
@ -235,7 +248,7 @@
{
"cell_type": "markdown",
"metadata": {
"id": "XTu6AjLyFQUq"
"id": "TutorialTop"
},
"source": [
"# Tutorial"
@ -243,7 +256,9 @@
},
{
"cell_type": "markdown",
"metadata": {},
"metadata": {
"id": "DiffusionSet"
},
"source": [
"**Diffusion settings (Defaults are heavily outdated)**\n",
"---\n",
@ -294,7 +309,9 @@
},
{
"cell_type": "markdown",
"metadata": {},
"metadata": {
"id": "SetupTop"
},
"source": [
"# 1. Set Up"
]
@ -302,7 +319,8 @@
{
"cell_type": "code",
"metadata": {
"id": "_9Eg9Kf5FlfK"
"cellView": "form",
"id": "CheckGPU"
},
"source": [
"#@title 1.1 Check GPU Status\n",
@ -324,7 +342,10 @@
},
{
"cell_type": "code",
"metadata": {},
"metadata": {
"cellView": "form",
"id": "PrepFolders"
},
"source": [
"#@title 1.2 Prepare Folders\n",
"import subprocess\n",
@ -404,7 +425,10 @@
},
{
"cell_type": "code",
"metadata": {},
"metadata": {
"cellView": "form",
"id": "InstallDeps"
},
"source": [
"#@title ### 1.3 Install and import dependencies\n",
"\n",
@ -573,7 +597,10 @@
},
{
"cell_type": "code",
"metadata": {},
"metadata": {
"cellView": "form",
"id": "DefMidasFns"
},
"source": [
"#@title ### 1.4 Define Midas functions\n",
"\n",
@ -682,7 +709,10 @@
},
{
"cell_type": "code",
"metadata": {},
"metadata": {
"cellView": "form",
"id": "DefFns"
},
"source": [
"#@title 1.5 Define necessary functions\n",
"\n",
@ -1440,7 +1470,10 @@
},
{
"cell_type": "code",
"metadata": {},
"metadata": {
"cellView": "form",
"id": "DefSecModel"
},
"source": [
"#@title 1.6 Define the secondary diffusion model\n",
"\n",
@ -1611,7 +1644,10 @@
},
{
"cell_type": "code",
"metadata": {},
"metadata": {
"cellView": "form",
"id": "DefSuperRes"
},
"source": [
"#@title 1.7 SuperRes Define\n",
"class DDIMSampler(object):\n",
@ -2141,22 +2177,26 @@
},
{
"cell_type": "markdown",
"metadata": {},
"metadata": {
"id": "DiffClipSetTop"
},
"source": [
"# 2. Diffusion and CLIP model settings"
]
},
{
"cell_type": "code",
"metadata": {},
"metadata": {
"id": "ModelSettings"
},
"source": [
"#@markdown ####**Models Settings:**\n",
"diffusion_model = \"512x512_diffusion_uncond_finetune_008100\" #@param [\"256x256_diffusion_uncond\", \"512x512_diffusion_uncond_finetune_008100\"]\n",
"use_secondary_model = True #@param {type: 'boolean'}\n",
"sampling_mode = 'ddim' #@param ['plms','ddim'] \n",
"\n",
"timestep_respacing = '250' # param ['25','50','100','150','250','500','1000','ddim25','ddim50', 'ddim75', 'ddim100','ddim150','ddim250','ddim500','ddim1000'] \n",
"diffusion_steps = 1000 # param {type: 'number'}\n",
"timestep_respacing = '250' #@param ['25','50','100','150','250','500','1000','ddim25','ddim50', 'ddim75', 'ddim100','ddim150','ddim250','ddim500','ddim1000'] \n",
"diffusion_steps = 1000 #@param {type: 'number'}\n",
"use_checkpoint = True #@param {type: 'boolean'}\n",
"ViTB32 = True #@param{type:\"boolean\"}\n",
"ViTB16 = True #@param{type:\"boolean\"}\n",
@ -2166,8 +2206,8 @@
"RN50x4 = False #@param{type:\"boolean\"}\n",
"RN50x16 = False #@param{type:\"boolean\"}\n",
"RN50x64 = False #@param{type:\"boolean\"}\n",
"SLIPB16 = False # param{type:\"boolean\"}\n",
"SLIPL16 = False # param{type:\"boolean\"}\n",
"SLIPB16 = False #@param{type:\"boolean\"}\n",
"SLIPL16 = False #@param{type:\"boolean\"}\n",
"\n",
"#@markdown If you're having issues with model downloads, check this to compare SHA's:\n",
"check_model_SHA = False #@param{type:\"boolean\"}\n",
@ -2337,14 +2377,18 @@
},
{
"cell_type": "markdown",
"metadata": {},
"metadata": {
"id": "SettingsTop"
},
"source": [
"# 3. Settings"
]
},
{
"cell_type": "code",
"metadata": {},
"metadata": {
"id": "BasicSettings"
},
"source": [
"#@markdown ####**Basic Settings:**\n",
"batch_name = 'TimeToDisco' #@param{type: 'string'}\n",
@ -2389,7 +2433,7 @@
{
"cell_type": "markdown",
"metadata": {
"id": "CnkTNXJAPzL2"
"id": "AnimSetTop"
},
"source": [
"### Animation Settings"
@ -2397,7 +2441,9 @@
},
{
"cell_type": "code",
"metadata": {},
"metadata": {
"id": "AnimSettings"
},
"source": [
"#@markdown ####**Animation Mode:**\n",
"animation_mode = 'None' #@param ['None', '2D', '3D', 'Video Input'] {type:'string'}\n",
@ -2713,7 +2759,7 @@
{
"cell_type": "markdown",
"metadata": {
"id": "u1VHzHvNx5fd"
"id": "ExtraSetTop"
},
"source": [
"### Extra Settings\n",
@ -2722,7 +2768,9 @@
},
{
"cell_type": "code",
"metadata": {},
"metadata": {
"id": "ExtraSettings"
},
"source": [
"#@markdown ####**Saving:**\n",
"\n",
@ -2800,7 +2848,9 @@
},
{
"cell_type": "markdown",
"metadata": {},
"metadata": {
"id": "PromptsTop"
},
"source": [
"### Prompts\n",
"`animation_mode: None` will only use the first set. `animation_mode: 2D / Video` will run through them per the set frames and hold on the last one."
@ -2808,7 +2858,9 @@
},
{
"cell_type": "code",
"metadata": {},
"metadata": {
"id": "Prompts"
},
"source": [
"text_prompts = {\n",
" 0: [\"A beautiful painting of a singular lighthouse, shining its light across a tumultuous sea of blood by greg rutkowski and thomas kinkade, Trending on artstation.\", \"yellow color scheme\"],\n",
@ -2824,14 +2876,18 @@
},
{
"cell_type": "markdown",
"metadata": {},
"metadata": {
"id": "DiffuseTop"
},
"source": [
"# 4. Diffuse!"
]
},
{
"cell_type": "code",
"metadata": {},
"metadata": {
"id": "DoTheRun"
},
"source": [
"#@title Do the Run!\n",
"#@markdown `n_batches` ignored with animation modes.\n",
@ -3015,14 +3071,18 @@
},
{
"cell_type": "markdown",
"metadata": {},
"metadata": {
"id": "CreateVidTop"
},
"source": [
"# 5. Create the video"
]
},
{
"cell_type": "code",
"metadata": {},
"metadata": {
"id": "CreateVid"
},
"source": [
"# @title ### **Create video**\n",
"#@markdown Video file will save in the same folder as your images.\n",
@ -3108,11 +3168,16 @@
"accelerator": "GPU",
"colab": {
"collapsed_sections": [
"1YwMUyt9LHG1",
"XTu6AjLyFQUq",
"_9Eg9Kf5FlfK",
"CnkTNXJAPzL2",
"u1VHzHvNx5fd"
"CreditsChTop",
"TutorialTop",
"CheckGPU",
"InstallDeps",
"DefMidasFns",
"DefFns",
"DefSecModel",
"DefSuperRes",
"AnimSetTop",
"ExtraSetTop"
],
"machine_shape": "hm",
"name": "Disco Diffusion v5 [w/ 3D animation]",

@ -49,7 +49,7 @@ Somnai (https://twitter.com/Somnai_dreams) added Diffusion Animation techniques,
# %%
"""
@title Licensed under the MIT License
Licensed under the MIT License
Copyright (c) 2021 Katherine Crowson
@ -2073,8 +2073,8 @@ diffusion_model = "512x512_diffusion_uncond_finetune_008100" #@param ["256x256_d
use_secondary_model = True #@param {type: 'boolean'}
sampling_mode = 'ddim' #@param ['plms','ddim']
timestep_respacing = '250' # param ['25','50','100','150','250','500','1000','ddim25','ddim50', 'ddim75', 'ddim100','ddim150','ddim250','ddim500','ddim1000']
diffusion_steps = 1000 # param {type: 'number'}
timestep_respacing = '250' #@param ['25','50','100','150','250','500','1000','ddim25','ddim50', 'ddim75', 'ddim100','ddim150','ddim250','ddim500','ddim1000']
diffusion_steps = 1000 #@param {type: 'number'}
use_checkpoint = True #@param {type: 'boolean'}
ViTB32 = True #@param{type:"boolean"}
ViTB16 = True #@param{type:"boolean"}
@ -2084,8 +2084,8 @@ RN50 = True #@param{type:"boolean"}
RN50x4 = False #@param{type:"boolean"}
RN50x16 = False #@param{type:"boolean"}
RN50x64 = False #@param{type:"boolean"}
SLIPB16 = False # param{type:"boolean"}
SLIPL16 = False # param{type:"boolean"}
SLIPB16 = False #@param{type:"boolean"}
SLIPL16 = False #@param{type:"boolean"}
#@markdown If you're having issues with model downloads, check this to compare SHA's:
check_model_SHA = False #@param{type:"boolean"}

Loading…
Cancel
Save