image download use real filename

Signed-off-by: Vladimir Mandic <mandic00@live.com>
This commit is contained in:
Vladimir Mandic
2025-08-12 08:15:29 -04:00
parent fe38da3086
commit 28ad5bb0c3
3 changed files with 26 additions and 13 deletions
+4 -3
View File
@@ -1,8 +1,8 @@
# Change Log for SD.Next
## Update for 2025-08-10
## Update for 2025-08-12
### Highlights for 2025-08-10
### Highlights for 2025-08-12
Several new models: [Qwen-Image](https://qwenlm.github.io/blog/qwen-image/) (plus *Lightning* variant) and [FLUX.1-Krea-Dev](https://www.krea.ai/blog/flux-krea-open-source-release)
Several updated models: [Chroma](https://huggingface.co/lodestones/Chroma), [SkyReels-V2](https://huggingface.co/Skywork/SkyReels-V2-DF-14B-720P-Diffusers) and [Wan-VACE](https://huggingface.co/Wan-AI/Wan2.1-VACE-14B-diffusers)
@@ -12,7 +12,7 @@ And (*as always*) many bugfixes and improvements to existing features!
[ReadMe](https://github.com/vladmandic/automatic/blob/master/README.md) | [ChangeLog](https://github.com/vladmandic/automatic/blob/master/CHANGELOG.md) | [Docs](https://vladmandic.github.io/sdnext-docs/) | [WiKi](https://github.com/vladmandic/automatic/wiki) | [Discord](https://discord.com/invite/sd-next-federal-batch-inspectors-1101998836328697867)
### Details for 2025-08-10
### Details for 2025-08-12
- **Models**
- [Qwen-Image](https://qwenlm.github.io/blog/qwen-image/)
@@ -70,6 +70,7 @@ And (*as always*) many bugfixes and improvements to existing features!
- networks display indicator for currently active items
applies to: *styles, loras*
- apply privacy blur to hf and civitai tokens
- image download will now use actual image filename
- *hint*: card layout
card layout is used by networks, gallery, civitai search, etc.
you can change card size in *settings -> user interface*
-2
View File
@@ -81,8 +81,6 @@ models = {
}
styles = [
'Fixed Astronaut',
]
styles_tbd = [
'Fixed Bear',
'Fixed Steampunk City',
'Fixed Road sign',
+22 -8
View File
@@ -1,12 +1,4 @@
/* eslint-disable max-classes-per-file */
// Known issues
// Images flash on the screen before they get processed and separator is properly closed, especially when root/subfolder has large amount of files
// Search is a bit wonky, I tried to get the separators to hide if 0 hits in seperator are found, but no luck so
// Sorting huge amount of images is slow, might look at optimising, I don't think it's a regression.
// TODO
// Setting to enable or disable separator state persistence
let ws;
let url;
let currentImage;
@@ -663,6 +655,27 @@ async function galleryHidden() {
if (pruneImagesTimer) clearInterval(pruneImagesTimer);
}
async function monitorGalleries() {
async function galleryMutation(mutations) {
const galleries = mutations.filter((m) => m.target?.classList?.contains('preview'));
for (const gallery of galleries) {
const links = gallery.target.querySelectorAll('a');
for (const link of links) {
const href = link.getAttribute('href');
if (!href) continue;
const fn = href.split('/').pop().split('\\').pop();
link.setAttribute('download', fn);
}
}
}
const galleryElements = gradioApp().querySelectorAll('.gradio-gallery');
for (const gallery of galleryElements) {
const galleryObserver = new MutationObserver(galleryMutation);
galleryObserver.observe(gallery, { childList: true, subtree: true, attributes: true });
}
}
async function initGallery() { // triggered on gradio change to monitor when ui gets sufficiently constructed
log('initGallery');
el.folders = gradioApp().getElementById('tab-gallery-folders');
@@ -682,6 +695,7 @@ async function initGallery() { // triggered on gradio change to monitor when ui
if (entries[0].intersectionRatio > 0) galleryVisible();
});
intersectionObserver.observe(el.folders);
monitorGalleries();
}
// register on startup