diff --git a/.dev_scripts/test_regression_txt2img_dream_v1_4.sh b/.dev_scripts/test_regression_txt2img_dream_v1_4.sh index 11cbf8f14b..9326d3c311 100644 --- a/.dev_scripts/test_regression_txt2img_dream_v1_4.sh +++ b/.dev_scripts/test_regression_txt2img_dream_v1_4.sh @@ -5,8 +5,7 @@ SAMPLES_DIR=${OUT_DIR} python scripts/dream.py \ --from_file ${PROMPT_FILE} \ --outdir ${OUT_DIR} \ - --sampler plms \ - --full_precision + --sampler plms # original output by CompVis/stable-diffusion IMAGE1=".dev_scripts/images/v1_4_astronaut_rides_horse_plms_step50_seed42.png" diff --git a/.github/workflows/mkdocs-flow.yml b/.github/workflows/mkdocs-flow.yml new file mode 100644 index 0000000000..49a9cbd423 --- /dev/null +++ b/.github/workflows/mkdocs-flow.yml @@ -0,0 +1,28 @@ +name: Deploy +on: + push: + branches: + - main + pull_request: + branches: + - main +jobs: + build: + name: Deploy docs to GitHub Pages + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + fetch-depth: 0 + - name: Build + uses: Tiryoh/actions-mkdocs@v0 + with: + mkdocs_version: 'latest' # option + requirements: '/requirements-mkdocs.txt' # option + configfile: '/mkdocs.yml' # option + - name: Deploy + uses: peaceiris/actions-gh-pages@v3 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: ./site diff --git a/.github/workflows/test-dream-conda.yml b/.github/workflows/test-dream-conda.yml index 3bd9b24582..6c51ebe718 100644 --- a/.github/workflows/test-dream-conda.yml +++ b/.github/workflows/test-dream-conda.yml @@ -85,9 +85,9 @@ jobs: fi # Utterly hacky, but I don't know how else to do this if [[ ${{ github.ref }} == 'refs/heads/master' ]]; then - time ${{ steps.vars.outputs.PYTHON_BIN }} scripts/dream.py --from_file tests/preflight_prompts.txt --full_precision + time ${{ steps.vars.outputs.PYTHON_BIN }} scripts/dream.py --from_file tests/preflight_prompts.txt elif [[ ${{ github.ref }} == 'refs/heads/development' ]]; then - time ${{ steps.vars.outputs.PYTHON_BIN }} scripts/dream.py --from_file tests/dev_prompts.txt --full_precision + time ${{ steps.vars.outputs.PYTHON_BIN }} scripts/dream.py --from_file tests/dev_prompts.txt fi mkdir -p outputs/img-samples - name: Archive results diff --git a/.gitignore b/.gitignore index df1e55ee6d..da74df3a1a 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,10 @@ # ignore default image save location and model symbolic link outputs/ models/ldm/stable-diffusion-v1/model.ckpt +ldm/dream/restoration/codeformer/weights + +# ignore the Anaconda/Miniconda installer used while building Docker image +anaconda.sh # ignore a directory which serves as a place for initial images inputs/ @@ -77,9 +81,6 @@ db.sqlite3-journal instance/ .webassets-cache -# WebUI temp files: -img2img-tmp.png - # Scrapy stuff: .scrapy @@ -186,3 +187,12 @@ testtube checkpoints # If it's a Mac .DS_Store + +# Let the frontend manage its own gitignore +!frontend/* + +# Scratch folder +.scratch/ +.vscode/ +gfpgan/ +models/ldm/stable-diffusion-v1/model.sha256 diff --git a/.prettierrc.yaml b/.prettierrc.yaml new file mode 100644 index 0000000000..ce4b99a07b --- /dev/null +++ b/.prettierrc.yaml @@ -0,0 +1,13 @@ +endOfLine: lf +tabWidth: 2 +useTabs: false +singleQuote: true +quoteProps: as-needed +embeddedLanguageFormatting: auto +overrides: + - files: '*.md' + options: + proseWrap: always + printWidth: 80 + parser: markdown + cursorOffset: -1 diff --git a/README.md b/README.md index 4c6681ee59..b61b365774 100644 --- a/README.md +++ b/README.md @@ -1,165 +1,190 @@ -
- -
+# InvokeAI: A Stable Diffusion Toolkit -
-
-
-
-
-
-
- -
+![dream-py-demo](../assets/dream-py-demo.png) -The `dream>` prompt's arguments are pretty much identical to those -used in the Discord bot, except you don't need to type "!dream" (it -doesn't hurt if you do). A significant change is that creation of -individual images is now the default unless --grid (-g) is given. A -full list is given in [List of prompt arguments] -(#list-of-prompt-arguments). +The `dream>` prompt's arguments are pretty much identical to those used in the +Discord bot, except you don't need to type "!dream" (it doesn't hurt if you do). +A significant change is that creation of individual images is now the default +unless `--grid` (`-g`) is given. A full list is given in +[List of prompt arguments](#list-of-prompt-arguments). -# Arguments +## Arguments -The script itself also recognizes a series of command-line switches -that will change important global defaults, such as the directory for -image outputs and the location of the model weight files. +The script itself also recognizes a series of command-line switches that will +change important global defaults, such as the directory for image outputs and +the location of the model weight files. -## List of arguments recognized at the command line: +### List of arguments recognized at the command line -These command-line arguments can be passed to dream.py when you first -run it from the Windows, Mac or Linux command line. Some set defaults -that can be overridden on a per-prompt basis (see [List of prompt -arguments] (#list-of-prompt-arguments). Others +These command-line arguments can be passed to `dream.py` when you first run it +from the Windows, Mac or Linux command line. Some set defaults that can be +overridden on a per-prompt basis (see [List of prompt arguments] +(#list-of-prompt-arguments). Others -| Argument | Shortcut | Default | Description | -|--------------------|------------|---------------------|--------------| -| --help | -h | | Print a concise help message. | -| --outdir- -
+ +![step1](../assets/step1.png) 2. Use any of the selection tools (Marquee, Lasso, or Wand) to select the area you desire to inpaint. -- -
-3. Because we'll be applying a mask over the area we want to preserve, you should now select the inverse by using the Shift + Ctrl + I shortcut, or right clicking and using the "Select Inverse" option. +![step2](../assets/step2.png) -4. You'll now create a mask by selecting the image layer, and Masking the selection. Make sure that you don't delete any of the underlying image, or your inpainting results will be dramatically impacted. -- -
+3. Because we'll be applying a mask over the area we want to preserve, you should now select the inverse by using the ++shift+ctrl+i++ shortcut, or right clicking and using the "Select Inverse" option. + +4. You'll now create a mask by selecting the image layer, and Masking the selection. Make sure that you don't delete any of the undrlying image, or your inpainting results will be dramatically impacted. + +![step4](../assets/step4.png) 5. Make sure to hide any background layers that are present. You should see the mask applied to your image layer, and the image on your canvas should display the checkered background. -- -
-- -
+![step5](../assets/step5.png) -6. Save the image as a transparent PNG by using the "Save a Copy" option in the File menu, or using the Alt + Ctrl + S keyboard shortcut. +6. Save the image as a transparent PNG by using the "Save a Copy" option in the File menu, or using the Alt + Ctrl + S keyboard shortcut + +![step6](../assets/step6.png) 7. After following the inpainting instructions above (either through the CLI or the Web UI), marvel at your newfound ability to selectively dream. Lookin' good! -- -
+![step7](../assets/step7.png) + +8. In the export dialogue, Make sure the "Save colour values from transparent pixels" checkbox is selected. diff --git a/docs/features/OTHER.md b/docs/features/OTHER.md index 3853b185ed..5faa1d32d0 100644 --- a/docs/features/OTHER.md +++ b/docs/features/OTHER.md @@ -1,65 +1,47 @@ +--- +title: Others +--- + +# :fontawesome-regular-share-from-square: Others + ## **Google Colab** Stable Diffusion AI Notebook: +>16&255,u[c++]=t>>8&255,u[c++]=255&t;2===s&&(t=n[e.charCodeAt(r)]<<2|n[e.charCodeAt(r+1)]>>4,u[c++]=255&t);1===s&&(t=n[e.charCodeAt(r)]<<10|n[e.charCodeAt(r+1)]<<4|n[e.charCodeAt(r+2)]>>2,u[c++]=t>>8&255,u[c++]=255&t);return u},t.fromByteArray=function(e){for(var t,n=e.length,o=n%3,a=[],i=16383,s=0,l=n-o;s0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");return-1===r&&(r=t),[r,r===t?0:4-r%4]}function u(e,t,n){for(var o,a,i=[],s=t;ss&&(r=s-l),a=r;a>=0;a--){let r=!0;for(let n=0;n>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}const o=this.length-t;if((void 0===r||r>o)&&(r=o),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");let a=!1;for(;;)switch(n){case"hex":return w(this,e,t,r);case"utf8":case"utf-8":return E(this,e,t,r);case"ascii":case"latin1":case"binary":return x(this,e,t,r);case"base64":return _(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return S(this,e,t,r);default:if(a)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),a=!0}},l.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const C=4096;function O(e,t,r){let n="";r=Math.min(e.length,r);for(let o=t;o