Path: " + str(self.path) + "
" + \
+ "
Seed: " + str(self.seed) + "
" + \
+ "
Stable Diffusion Model: " + str(self.use_stable_diffusion_model) + "
" + \
+ "
Prompt: " + str(self.prompt) + "
" + \
+ "
Negative Prompt: " + str(self.negative_prompt) + "
" + \
+ "
Clip Skip: " + str(self.clip_skip) + "
" + \
+ "
VAE Model: " + str(self.use_vae_model) + "
" + \
+ "
Sampler: " + str(self.sampler_name) + "
" + \
+ "
Size: " + str(self.height) + "x" + str(self.width) + "
" + \
+ "
Inference Steps: " + str(self.num_inference_steps) + "
" + \
+ "
Guidance Scale: " + str(self.guidance_scale) + "
" + \
+ "
LoRA: " + str(self.lora) + "
" + \
+ "
Hypernetwork: " + str(self.use_hypernetwork_model) + "
" + \
+ "
Tiling: " + str(self.tiling) + "
" + \
+ "
Face Correction: " + str(self.use_face_correction) + "
" + \
+ "
Upscale: " + str(self.use_upscale) + "
" + \
+ "
Time Created: " + str(self.time_created) + "
" + \
+ "
NSFW: " + str(self.nsfw) + "
"
+
+ def settingsJSON(self) -> str:
+ # some are still missing: prompt strength, lora
+ json = {
+ "numOutputsTotal": 1,
+ "seed": self.seed,
+ "reqBody": {
+ "prompt": self.prompt,
+ "negative_prompt": self.negative_prompt,
+ "width": self.width,
+ "height": self.height,
+ "seed": self.seed,
+ "num_inference_steps": self.num_inference_steps,
+ "guidance_scale": self.guidance_scale,
+ "use_face_correction": self.use_face_correction,
+ "use_upscale": self.use_upscale,
+ "sampler_name": self.sampler_name,
+ "use_stable_diffusion_model": self.use_stable_diffusion_model,
+ "clip_skip": self.clip_skip,
+ "tiling": self.tiling,
+ "use_vae_model": self.use_vae_model,
+ "use_hypernetwork_model": self.use_hypernetwork_model
+ }}
+ from json import dumps
+ return dumps(json)
+
+
from easydiffusion.easydb.database import engine
GalleryImage.metadata.create_all(engine)
diff --git a/ui/index.html b/ui/index.html
index 9aeb7ab2..40beed92 100644
--- a/ui/index.html
+++ b/ui/index.html
@@ -518,9 +518,13 @@
+
-
+
+
+
+
diff --git a/ui/media/css/single-gallery.css b/ui/media/css/single-gallery.css
new file mode 100644
index 00000000..2427bf0b
--- /dev/null
+++ b/ui/media/css/single-gallery.css
@@ -0,0 +1,42 @@
+@import url("/media/css/themes.css");
+@import url("/media/css/main.css");
+
+body {
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+ background-color: var(--background-color1);
+}
+
+img {
+ border-radius: 5px;
+}
+
+p, h1, h2, h3, h4, h5, h6 {
+ color: var(--text-color);
+ cursor: default;
+ margin: 6px;
+}
+
+::-moz-selection {
+ /* Code for Firefox */
+ color: none;
+ background: none;
+}
+
+::selection {
+ color: none;
+ background: none;
+}
+
+button {
+ margin: 8px;
+}
+
+div {
+ margin: 16px;
+}
+
+:disabled {
+ color: gray;
+}
\ No newline at end of file
diff --git a/ui/media/js/main.js b/ui/media/js/main.js
index 0628b015..edacd977 100644
--- a/ui/media/js/main.js
+++ b/ui/media/js/main.js
@@ -3088,6 +3088,19 @@ let recentResolutionsValues = []
function galleryImage(item) {
let div = document.createElement("div")
let img = document.createElement("img")
+ img.addEventListener("click", (event) => {
+ let w;
+ w = window.open("/single_image?image_path=" + item.path, "_blank")
+ w.addEventListener("DOMContentLoaded", () => {
+ w.document.getElementsByTagName("body")[0].classList.add(themeField.value)
+ w.document.getElementById("use_these_settings").addEventListener("click", () => {
+ restoreTaskToUI(JSON.parse(w.document.getElementById("use_these_settings").getAttribute("json")))
+ })
+ w.document.getElementById("use_as_input").addEventListener("click", () => {
+ alert("use as input")
+ })
+ })
+ })
img.src = "/image/" + item.path
img.dataset["request"] = JSON.stringify(item)
@@ -3097,19 +3110,36 @@ function galleryImage(item) {
function refreshGallery() {
let container = document.getElementById("imagecontainer")
- params = new URLSearchParams({
- prompt: promptsearchfield,
- model: modelsearchfield
+ let params = new URLSearchParams({
+ prompt: document.getElementById("gallery-prompt-search").value,
+ model: document.getElementById("gallery-model-search").value,
+ page: document.getElementById("gallery-page").value
})
- container.innerHTML=""
+ container.innerHTML = ""
fetch('/all_images?' + params)
.then(response => response.json())
.then(json => {
- console.log(json)
- json.forEach( item => {
+ if (document.getElementById("gallery-page").value > 0 && json.length == 0) {
+ decrementGalleryPage()
+ alert("No more images")
+ return
+ }
+ json.forEach(item => {
container.appendChild(galleryImage(item))
})
- })
+ })
+ document.getElementById("gallery-refresh").innerText = "Refresh"
+}
+
+function decrementGalleryPage() {
+ let page = Math.max(document.getElementById("gallery-page").value - 1, 0)
+ document.getElementById("gallery-page").value = page
+ refreshGallery()
+}
+
+function incrementGalleryPage() {
+ document.getElementById("gallery-page").value++
+ refreshGallery()
}
function gallery_keyDown_handler(event) {