Update README.md

This commit is contained in:
2022-12-29 01:56:56 +01:00
committed by GitHub
parent 6c473855be
commit c5c20803a9
+13 -27
View File
@@ -1,37 +1,23 @@
# training-picker # Prompt Generator
Adds a tab to the webui that allows the user to automatically extract keyframes from video, and manually extract 512x512 crops of those frames for use in model training. Adds a tab to the webui that allows the user generate a prompt from a small base prompt. Based on [FredZhang7/distilgpt2-stable-diffusion-v2](https://huggingface.co/FredZhang7/distilgpt2-stable-diffusion-v2). I did nothing apart from trying to port it to AUTOMATIC1111 WebUI
![image](https://user-images.githubusercontent.com/2313721/200236386-5fed34df-03e4-4ea6-a653-e1b60393afcd.png) ![image](https://user-images.githubusercontent.com/8998556/209889483-d73ec794-d6eb-4f06-8fc5-2fb9ced5a655.png)
## Installation: ## Installation:
1. Install [AUTOMATIC1111's Stable Diffusion Webui](https://github.com/AUTOMATIC1111/stable-diffusion-webui) 1. Install [AUTOMATIC1111's Stable Diffusion Webui](https://github.com/AUTOMATIC1111/stable-diffusion-webui)
2. Install [ffmpeg](https://ffmpeg.org/) for your operating system 2. Clone this repository into the `extensions` folder inside the webui
3. Clone this repository into the `extensions` folder inside the webui
Make sure you don't already have `python-ffmpeg` installed globally, as the library this program uses is `ffmpeg-python`, and your installation will conflict with it.
## Usage: ## Usage:
### Creating an extracted frame set 1. Write in the prompt in the *Start of the prompt* text box
2. Click Generate and wait
1. Drop videos you want to extract cropped frames from into the `training-picker/videos` folder ## Prompt Explanation
2. Open up the Training Picker tab of the webui - **Start of the prompt**: As the name, the start of the prompt that the generator should start with
3. Select one of the videos you placed in the `training-picker/videos` folder from the dropdown on the left - **Temperature**: A higher temperature will produce more diverse results, but with a higher risk of less coherent text
4. Click 'Extract Frames` - **Top K**: The number of tokens to sample from at each step
5. After the extraction finishes, a new keyframe set for the video should be selectable in the dropdown on the right - **Max Length**: the maximum number of tokens for the output of the model
6. Select the keyframe set, and the frames will appear in the browser below - **Repetition Penalty**: The penalty value for each repetition of a token
- **How Many To Generate**: The number of results to generate
Optionally, you can also just supply a large collection of individual images you would like to work with directly by placing them into a folder within `training-picker/extracted-frames`.
### Cropping
* Scroll up and down to increase or decrease the size of the crop brush
* Ctrl+scroll to adjust the aspect ratio of the crop, and middle-click to reset the aspect ratio to 1:1
* Shift+scroll to adjust the size / aspect ratio by smaller increments
* Click to save a crop at the brush's position
* Navigate between frames in the collection by clicking the navigation buttons, entering a number into the counter, or by using the arrow keys / AD
* Select an outfill method to outfill the non-square area of a rectangular crop into a square shape
* Click "Bulk process frames with chosen outfill method" to automatically process every image in the current frame set using the outfill method chosen, outputting to the directory under "Save crops to:"
* Crops will be saved to `training-picker/cropped-frames` by default