Skip to content

Commit 757bb7c

Browse files
committed
fix for GPFGAN RGB/BGR (thanks deggua)
experimental support for negative prompts (without UI) option to do inpainting at full resolution Tooltips for UI elements
1 parent a8c0025 commit 757bb7c

File tree

3 files changed

+194
-35
lines changed

3 files changed

+194
-35
lines changed

script.js

+53
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
console.log("running")
2+
3+
titles = {
4+
"Sampling steps": "How many times to imptove the generated image itratively; higher values take longer; very low values can produce bad results",
5+
"Sampling method": "Which algorithm to use to produce the image",
6+
"GFPGAN": "Restore low quality faces using GFPGAN neural network",
7+
"Euler a": "Euler Ancestral - very creative, each can get acompletely different pictures depending on step count, setting seps tohigher than 30-40 does not help",
8+
"DDIM": "Denoising Diffusion Implicit Models - best at inpainting",
9+
"Prompt matrix": "Separate prompts into part using vertical pipe character (|) and the script will create a picture for every combination of them (except for first part, which will be present in all combinations)",
10+
"Batch count": "How many batches of images to create",
11+
"Batch size": "How many image to create in a single batch",
12+
"CFG Scale": "Classifier Free Guidance Scale - how strongly the image should conform to prompt - lower values produce more creative results",
13+
"Seed": "A value that determines the output of random number generator - if you create an image with same parameters and seed as another image, you'll get the same result",
14+
15+
"Inpaint a part of image": "Draw a mask over an image, and the script will regenerate the masked area with content according to prompt",
16+
"Loopback": "Process an image, use it as an input, repeat. Batch count determings number of iterations.",
17+
"SD upscale": "Upscale image normally, split result into tiles, improve each tile using img2img, merge whole image back",
18+
19+
"Just resize": "Resize image to target resolution. Unless height and width match, you will get incorrect aspect ratio.",
20+
"Crop and resize": "Resize the image so that entirety of target resolution is filled with the image. Crop parts that stick out.",
21+
"Resize and fill": "Resize the image so that entirety of image is inside target resolution. Fill empty space with image's colors.",
22+
23+
"Mask blur": "How much to blur the mask before processing, in pixels.",
24+
"Masked content": "What to put inside the masked area before processing it with Stable Diffusion.",
25+
"fill": "fill it with colors of the image",
26+
"original": "keep whatever was there originally",
27+
"latent noise": "fill it with latent space noise",
28+
"latent nothing": "fill it with latent space zeroes",
29+
"Inpaint at full resolution": "Upscale masked region to target resolution, do inpainting, downscale back and paste into original image",
30+
31+
"Denoising Strength": "Determines how little respect the algorithm should have for image's content. At 0, nothing will change, and at 1 you'll get an unrelated image.",
32+
}
33+
34+
function gradioApp(){
35+
return document.getElementsByTagName('gradio-app')[0];
36+
}
37+
38+
function addTitles(root){
39+
root.querySelectorAll('span').forEach(function(span){
40+
tooltip = titles[span.textContent];
41+
if(tooltip){
42+
span.title = tooltip;
43+
}
44+
})
45+
}
46+
47+
document.addEventListener("DOMContentLoaded", function() {
48+
var mutationObserver = new MutationObserver(function(m){
49+
addTitles(gradioApp().shadowRoot);
50+
});
51+
mutationObserver.observe( gradioApp().shadowRoot, { childList:true, subtree:true })
52+
53+
});

style.css

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
.output-html p {margin: 0 0.5em;}
2+
.performance { font-size: 0.85em; color: #444; }
13

24
button{
35
align-self: stretch !important;

0 commit comments

Comments
 (0)