mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
a lot of formatting updates to CLI.md
This commit is contained in:
parent
cd66b2c76d
commit
b3d7ad7461
@ -130,20 +130,34 @@ file should contain the startup options as you would type them on the
|
|||||||
command line (`--steps=10 --grid`), one argument per line, or a
|
command line (`--steps=10 --grid`), one argument per line, or a
|
||||||
mixture of both using any of the accepted command switch formats:
|
mixture of both using any of the accepted command switch formats:
|
||||||
|
|
||||||
!!! example ""
|
!!! example "my unmodified initialization file"
|
||||||
|
|
||||||
```bash
|
```bash title="~/.invokeai" linenums="1"
|
||||||
--web
|
# InvokeAI initialization file
|
||||||
--steps=28
|
# This is the InvokeAI initialization file, which contains command-line default values.
|
||||||
--grid
|
# Feel free to edit. If anything goes wrong, you can re-initialize this file by deleting
|
||||||
-f 0.6 -C 11.0 -A k_euler_a
|
# or renaming it and then running configure_invokeai.py again.
|
||||||
|
|
||||||
|
# The --root option below points to the folder in which InvokeAI stores its models, configs and outputs.
|
||||||
|
--root="/Users/mauwii/invokeai"
|
||||||
|
|
||||||
|
# the --outdir option controls the default location of image files.
|
||||||
|
--outdir="/Users/mauwii/invokeai/outputs"
|
||||||
|
|
||||||
|
# You may place other frequently-used startup commands here, one or more per line.
|
||||||
|
# Examples:
|
||||||
|
# --web --host=0.0.0.0
|
||||||
|
# --steps=20
|
||||||
|
# -Ak_euler_a -C10.0
|
||||||
```
|
```
|
||||||
|
|
||||||
Note that the initialization file only accepts the command line arguments.
|
!!! note
|
||||||
There are additional arguments that you can provide on the `invoke>` command
|
|
||||||
line (such as `-n` or `--iterations`) that cannot be entered into this file.
|
The initialization file only accepts the command line arguments.
|
||||||
Also be alert for empty blank lines at the end of the file, which will cause
|
There are additional arguments that you can provide on the `invoke>` command
|
||||||
an arguments error at startup time.
|
line (such as `-n` or `--iterations`) that cannot be entered into this file.
|
||||||
|
Also be alert for empty blank lines at the end of the file, which will cause
|
||||||
|
an arguments error at startup time.
|
||||||
|
|
||||||
## List of prompt arguments
|
## List of prompt arguments
|
||||||
|
|
||||||
@ -195,15 +209,17 @@ Here are the invoke> command that apply to txt2img:
|
|||||||
| `--with_variations <pattern>` | | `None` | Combine two or more variations. See [Variations](./VARIATIONS.md) for now to use this. |
|
| `--with_variations <pattern>` | | `None` | Combine two or more variations. See [Variations](./VARIATIONS.md) for now to use this. |
|
||||||
| `--save_intermediates <n>` | | `None` | Save the image from every nth step into an "intermediates" folder inside the output directory |
|
| `--save_intermediates <n>` | | `None` | Save the image from every nth step into an "intermediates" folder inside the output directory |
|
||||||
|
|
||||||
Note that the width and height of the image must be multiples of 64. You can
|
!!! note
|
||||||
provide different values, but they will be rounded down to the nearest multiple
|
|
||||||
of 64.
|
|
||||||
|
|
||||||
### This is an example of img2img:
|
the width and height of the image must be multiples of 64. You can
|
||||||
|
provide different values, but they will be rounded down to the nearest multiple
|
||||||
|
of 64.
|
||||||
|
|
||||||
```
|
!!! example "This is a example of img2img"
|
||||||
invoke> waterfall and rainbow -I./vacation-photo.png -W640 -H480 --fit
|
|
||||||
```
|
```bash
|
||||||
|
invoke> waterfall and rainbow -I./vacation-photo.png -W640 -H480 --fit
|
||||||
|
```
|
||||||
|
|
||||||
This will modify the indicated vacation photograph by making it more like the
|
This will modify the indicated vacation photograph by making it more like the
|
||||||
prompt. Results will vary greatly depending on what is in the image. We also ask
|
prompt. Results will vary greatly depending on what is in the image. We also ask
|
||||||
@ -253,7 +269,7 @@ description of the part of the image to replace. For example, if you have an
|
|||||||
image of a breakfast plate with a bagel, toast and scrambled eggs, you can
|
image of a breakfast plate with a bagel, toast and scrambled eggs, you can
|
||||||
selectively mask the bagel and replace it with a piece of cake this way:
|
selectively mask the bagel and replace it with a piece of cake this way:
|
||||||
|
|
||||||
```
|
```bash
|
||||||
invoke> a piece of cake -I /path/to/breakfast.png -tm bagel
|
invoke> a piece of cake -I /path/to/breakfast.png -tm bagel
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -265,7 +281,7 @@ are getting too much or too little masking you can adjust the threshold down (to
|
|||||||
get more mask), or up (to get less). In this example, by passing `-tm` a higher
|
get more mask), or up (to get less). In this example, by passing `-tm` a higher
|
||||||
value, we are insisting on a more stringent classification.
|
value, we are insisting on a more stringent classification.
|
||||||
|
|
||||||
```
|
```bash
|
||||||
invoke> a piece of cake -I /path/to/breakfast.png -tm bagel 0.6
|
invoke> a piece of cake -I /path/to/breakfast.png -tm bagel 0.6
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -275,16 +291,16 @@ You can load and use hundreds of community-contributed Textual
|
|||||||
Inversion models just by typing the appropriate trigger phrase. Please
|
Inversion models just by typing the appropriate trigger phrase. Please
|
||||||
see [Concepts Library](CONCEPTS.md) for more details.
|
see [Concepts Library](CONCEPTS.md) for more details.
|
||||||
|
|
||||||
# Other Commands
|
## Other Commands
|
||||||
|
|
||||||
The CLI offers a number of commands that begin with "!".
|
The CLI offers a number of commands that begin with "!".
|
||||||
|
|
||||||
## Postprocessing images
|
### Postprocessing images
|
||||||
|
|
||||||
To postprocess a file using face restoration or upscaling, use the `!fix`
|
To postprocess a file using face restoration or upscaling, use the `!fix`
|
||||||
command.
|
command.
|
||||||
|
|
||||||
### `!fix`
|
#### `!fix`
|
||||||
|
|
||||||
This command runs a post-processor on a previously-generated image. It takes a
|
This command runs a post-processor on a previously-generated image. It takes a
|
||||||
PNG filename or path and applies your choice of the `-U`, `-G`, or `--embiggen`
|
PNG filename or path and applies your choice of the `-U`, `-G`, or `--embiggen`
|
||||||
@ -311,19 +327,19 @@ Some examples:
|
|||||||
[1] outputs/img-samples/000017.4829112.gfpgan-00.png: !fix "outputs/img-samples/0000045.4829112.png" -s 50 -S -W 512 -H 512 -C 7.5 -A k_lms -G 0.8
|
[1] outputs/img-samples/000017.4829112.gfpgan-00.png: !fix "outputs/img-samples/0000045.4829112.png" -s 50 -S -W 512 -H 512 -C 7.5 -A k_lms -G 0.8
|
||||||
```
|
```
|
||||||
|
|
||||||
### !mask
|
#### `!mask`
|
||||||
|
|
||||||
This command takes an image, a text prompt, and uses the `clipseg` algorithm to
|
This command takes an image, a text prompt, and uses the `clipseg` algorithm to
|
||||||
automatically generate a mask of the area that matches the text prompt. It is
|
automatically generate a mask of the area that matches the text prompt. It is
|
||||||
useful for debugging the text masking process prior to inpainting with the
|
useful for debugging the text masking process prior to inpainting with the
|
||||||
`--text_mask` argument. See [INPAINTING.md] for details.
|
`--text_mask` argument. See [INPAINTING.md] for details.
|
||||||
|
|
||||||
## Model selection and importation
|
### Model selection and importation
|
||||||
|
|
||||||
The CLI allows you to add new models on the fly, as well as to switch among them
|
The CLI allows you to add new models on the fly, as well as to switch among them
|
||||||
rapidly without leaving the script.
|
rapidly without leaving the script.
|
||||||
|
|
||||||
### !models
|
#### `!models`
|
||||||
|
|
||||||
This prints out a list of the models defined in `config/models.yaml'. The active
|
This prints out a list of the models defined in `config/models.yaml'. The active
|
||||||
model is bold-faced
|
model is bold-faced
|
||||||
@ -336,7 +352,7 @@ laion400m not loaded <no description>
|
|||||||
waifu-diffusion not loaded Waifu Diffusion v1.3
|
waifu-diffusion not loaded Waifu Diffusion v1.3
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
### !switch <model>
|
#### `!switch <model>`
|
||||||
|
|
||||||
This quickly switches from one model to another without leaving the CLI script.
|
This quickly switches from one model to another without leaving the CLI script.
|
||||||
`invoke.py` uses a memory caching system; once a model has been loaded,
|
`invoke.py` uses a memory caching system; once a model has been loaded,
|
||||||
@ -381,7 +397,7 @@ laion400m not loaded <no description>
|
|||||||
waifu-diffusion cached Waifu Diffusion v1.3
|
waifu-diffusion cached Waifu Diffusion v1.3
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
### !import_model <path/to/model/weights>
|
#### `!import_model <path/to/model/weights>`
|
||||||
|
|
||||||
This command imports a new model weights file into InvokeAI, makes it available
|
This command imports a new model weights file into InvokeAI, makes it available
|
||||||
for image generation within the script, and writes out the configuration for the
|
for image generation within the script, and writes out the configuration for the
|
||||||
@ -431,7 +447,7 @@ OK to import [n]? <b>y</b>
|
|||||||
invoke>
|
invoke>
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
###!edit_model <name_of_model>
|
#### `!edit_model <name_of_model>`
|
||||||
|
|
||||||
The `!edit_model` command can be used to modify a model that is already defined
|
The `!edit_model` command can be used to modify a model that is already defined
|
||||||
in `config/models.yaml`. Call it with the short name of the model you wish to
|
in `config/models.yaml`. Call it with the short name of the model you wish to
|
||||||
@ -468,12 +484,12 @@ text... Outputs: [2] outputs/img-samples/000018.2273800735.embiggen-00.png: !fix
|
|||||||
"outputs/img-samples/000017.243781548.gfpgan-00.png" -s 50 -S 2273800735 -W 512
|
"outputs/img-samples/000017.243781548.gfpgan-00.png" -s 50 -S 2273800735 -W 512
|
||||||
-H 512 -C 7.5 -A k_lms --embiggen 3.0 0.75 0.25 ```
|
-H 512 -C 7.5 -A k_lms --embiggen 3.0 0.75 0.25 ```
|
||||||
|
|
||||||
## History processing
|
### History processing
|
||||||
|
|
||||||
The CLI provides a series of convenient commands for reviewing previous actions,
|
The CLI provides a series of convenient commands for reviewing previous actions,
|
||||||
retrieving them, modifying them, and re-running them.
|
retrieving them, modifying them, and re-running them.
|
||||||
|
|
||||||
### !history
|
#### `!history`
|
||||||
|
|
||||||
The invoke script keeps track of all the commands you issue during a session,
|
The invoke script keeps track of all the commands you issue during a session,
|
||||||
allowing you to re-run them. On Mac and Linux systems, it also writes the
|
allowing you to re-run them. On Mac and Linux systems, it also writes the
|
||||||
@ -485,20 +501,22 @@ during the session (Windows), or the most recent 1000 commands (Mac|Linux). You
|
|||||||
can then repeat a command by using the command `!NNN`, where "NNN" is the
|
can then repeat a command by using the command `!NNN`, where "NNN" is the
|
||||||
history line number. For example:
|
history line number. For example:
|
||||||
|
|
||||||
```bash
|
!!! example ""
|
||||||
invoke> !history
|
|
||||||
...
|
|
||||||
[14] happy woman sitting under tree wearing broad hat and flowing garment
|
|
||||||
[15] beautiful woman sitting under tree wearing broad hat and flowing garment
|
|
||||||
[18] beautiful woman sitting under tree wearing broad hat and flowing garment -v0.2 -n6
|
|
||||||
[20] watercolor of beautiful woman sitting under tree wearing broad hat and flowing garment -v0.2 -n6 -S2878767194
|
|
||||||
[21] surrealist painting of beautiful woman sitting under tree wearing broad hat and flowing garment -v0.2 -n6 -S2878767194
|
|
||||||
...
|
|
||||||
invoke> !20
|
|
||||||
invoke> watercolor of beautiful woman sitting under tree wearing broad hat and flowing garment -v0.2 -n6 -S2878767194
|
|
||||||
```
|
|
||||||
|
|
||||||
### !fetch
|
```bash
|
||||||
|
invoke> !history
|
||||||
|
...
|
||||||
|
[14] happy woman sitting under tree wearing broad hat and flowing garment
|
||||||
|
[15] beautiful woman sitting under tree wearing broad hat and flowing garment
|
||||||
|
[18] beautiful woman sitting under tree wearing broad hat and flowing garment -v0.2 -n6
|
||||||
|
[20] watercolor of beautiful woman sitting under tree wearing broad hat and flowing garment -v0.2 -n6 -S2878767194
|
||||||
|
[21] surrealist painting of beautiful woman sitting under tree wearing broad hat and flowing garment -v0.2 -n6 -S2878767194
|
||||||
|
...
|
||||||
|
invoke> !20
|
||||||
|
invoke> watercolor of beautiful woman sitting under tree wearing broad hat and flowing garment -v0.2 -n6 -S2878767194
|
||||||
|
```
|
||||||
|
|
||||||
|
####`!fetch`
|
||||||
|
|
||||||
This command retrieves the generation parameters from a previously generated
|
This command retrieves the generation parameters from a previously generated
|
||||||
image and either loads them into the command line (Linux|Mac), or prints them
|
image and either loads them into the command line (Linux|Mac), or prints them
|
||||||
@ -508,33 +526,36 @@ a folder with image png files, and wildcard \*.png to retrieve the dream command
|
|||||||
used to generate the images, and save them to a file commands.txt for further
|
used to generate the images, and save them to a file commands.txt for further
|
||||||
processing.
|
processing.
|
||||||
|
|
||||||
This example loads the generation command for a single png file:
|
!!! example "load the generation command for a single png file"
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
invoke> !fetch 0000015.8929913.png
|
invoke> !fetch 0000015.8929913.png
|
||||||
# the script returns the next line, ready for editing and running:
|
# the script returns the next line, ready for editing and running:
|
||||||
invoke> a fantastic alien landscape -W 576 -H 512 -s 60 -A plms -C 7.5
|
invoke> a fantastic alien landscape -W 576 -H 512 -s 60 -A plms -C 7.5
|
||||||
```
|
```
|
||||||
|
|
||||||
This one fetches the generation commands from a batch of files and stores them
|
!!! example "fetch the generation commands from a batch of files and store them into `selected.txt`"
|
||||||
into `selected.txt`:
|
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
invoke> !fetch outputs\selected-imgs\*.png selected.txt
|
invoke> !fetch outputs\selected-imgs\*.png selected.txt
|
||||||
```
|
```
|
||||||
|
|
||||||
### !replay
|
#### `!replay`
|
||||||
|
|
||||||
This command replays a text file generated by !fetch or created manually
|
This command replays a text file generated by !fetch or created manually
|
||||||
|
|
||||||
```
|
!!! example
|
||||||
invoke> !replay outputs\selected-imgs\selected.txt
|
|
||||||
```
|
|
||||||
|
|
||||||
Note that these commands may behave unexpectedly if given a PNG file that was
|
```bash
|
||||||
not generated by InvokeAI.
|
invoke> !replay outputs\selected-imgs\selected.txt
|
||||||
|
```
|
||||||
|
|
||||||
### !search <search string>
|
!!! note
|
||||||
|
|
||||||
|
These commands may behave unexpectedly if given a PNG file that was
|
||||||
|
not generated by InvokeAI.
|
||||||
|
|
||||||
|
#### `!search <search string>`
|
||||||
|
|
||||||
This is similar to !history but it only returns lines that contain
|
This is similar to !history but it only returns lines that contain
|
||||||
`search string`. For example:
|
`search string`. For example:
|
||||||
@ -544,7 +565,7 @@ invoke> !search surreal
|
|||||||
[21] surrealist painting of beautiful woman sitting under tree wearing broad hat and flowing garment -v0.2 -n6 -S2878767194
|
[21] surrealist painting of beautiful woman sitting under tree wearing broad hat and flowing garment -v0.2 -n6 -S2878767194
|
||||||
```
|
```
|
||||||
|
|
||||||
### `!clear`
|
#### `!clear`
|
||||||
|
|
||||||
This clears the search history from memory and disk. Be advised that this
|
This clears the search history from memory and disk. Be advised that this
|
||||||
operation is irreversible and does not issue any warnings!
|
operation is irreversible and does not issue any warnings!
|
||||||
|
Loading…
x
Reference in New Issue
Block a user