Skip to content

Commit 05b0e72

Browse files
authored
[LocalVisage] Fixed major issue (#592)
1 parent 5a2ca5e commit 05b0e72

File tree

4 files changed

+39
-26
lines changed

4 files changed

+39
-26
lines changed

plugins/LocalVisage/LocalVisage.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
name: Local Visage
22
description: Local Performer Recognition plugin using DeepFace
33
# requires: PythonDepManager
4-
# requires: StashUserscriptLibrary
5-
version: 1.0
4+
# requires: stashUserscriptLibrary7dJx1qP
5+
version: 1.0.1
66
exec:
77
- python
88
- "{pluginDir}/LocalVisage.py"
99
interface: raw
1010
ui:
1111
requires:
12-
- StashUserscriptLibrary
12+
- stashUserscriptLibrary7dJx1qP
1313
javascript:
1414
- frontend.js
1515
- https://cdn.jsdelivr.net/npm/@gradio/[email protected]/dist/index.js

plugins/LocalVisage/frontend.js

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
(function (stash) {
1+
(function () {
22
"use strict";
3-
43
// Using CDN version of @gradio/client to avoid bundling issues
54
// import { Client, handle_file } from "@gradio/client";
65

@@ -42,7 +41,7 @@
4241
runPluginTask(plugin_id:"LocalVisage",task_name:"Start server")
4342
}`,
4443
};
45-
await stash.callGQL(reqData);
44+
await stash7dJx1qP.stash.callGQL(reqData);
4645
}
4746

4847
async function getPerformersForScene(scene_id) {
@@ -55,7 +54,7 @@
5554
}
5655
}`,
5756
};
58-
var result = await stash.callGQL(reqData);
57+
var result = await stash7dJx1qP.stash.callGQL(reqData);
5958
return result.data.findScene.performers.map((p) => p.id);
6059
}
6160

@@ -69,7 +68,7 @@
6968
}
7069
}`,
7170
};
72-
var result = await stash.callGQL(reqData);
71+
var result = await stash7dJx1qP.stash.callGQL(reqData);
7372
return result.data.findImage.performers.map((p) => p.id);
7473
}
7574

@@ -82,7 +81,7 @@
8281
}
8382
}`,
8483
};
85-
return stash.callGQL(reqData);
84+
return stash7dJx1qP.stash.callGQL(reqData);
8685
}
8786

8887
async function updateImage(image_id, performer_ids) {
@@ -94,7 +93,7 @@
9493
}
9594
}`,
9695
};
97-
return stash.callGQL(reqData);
96+
return stash7dJx1qP.stash.callGQL(reqData);
9897
}
9998

10099
async function getStashboxEndpoint() {
@@ -109,7 +108,7 @@
109108
}
110109
}`,
111110
};
112-
var result = await stash.callGQL(reqData);
111+
var result = await stash7dJx1qP.stash.callGQL(reqData);
113112
return result.data.configuration.general.stashBoxes[0].endpoint;
114113
}
115114

@@ -151,7 +150,7 @@
151150
}
152151
}`,
153152
};
154-
var result = await stash.callGQL(reqData);
153+
var result = await stash7dJx1qP.stash.callGQL(reqData);
155154
return result.data.scrapeSinglePerformer.filter(
156155
(p) => p.remote_site_id === stash_id
157156
)[0];
@@ -166,7 +165,7 @@
166165
}
167166
}`,
168167
};
169-
return stash.callGQL(reqData);
168+
return stash7dJx1qP.stash.callGQL(reqData);
170169
}
171170

172171
let gradioClientModule = null;
@@ -433,7 +432,7 @@
433432
}
434433
}`,
435434
};
436-
var result = await stash.callGQL(reqData);
435+
var result = await stash7dJx1qP.stash.callGQL(reqData);
437436
const url = result.data.findScene.paths["sprite"];
438437
const response = await fetch(url);
439438
if (response.status === 404) {
@@ -2563,7 +2562,7 @@
25632562
a,
25642563
"href",
25652564
(a_href_value =
2566-
window.stash.serverUrl.slice(0, -1) +
2565+
window.stash7dJx1qP.stash.serverUrl +
25672566
"/performers/" +
25682567
/*match*/ ctx[14].id)
25692568
);
@@ -2647,7 +2646,7 @@
26472646
dirty & /*matches*/ 1 &&
26482647
a_href_value !==
26492648
(a_href_value =
2650-
window.stash.serverUrl.slice(0, -1) +
2649+
window.stash7dJx1qP.stash.serverUrl +
26512650
"/performers/" +
26522651
/*match*/ ctx[14].id)
26532652
) {
@@ -13970,14 +13969,16 @@
1397013969
if (
1397113970
performer.image &&
1397213971
typeof performer.image === "string" &&
13973-
!performer.image.startsWith(window.stash.serverUrl)
13972+
!performer.image.startsWith(
13973+
window.stash7dJx1qP.stash.serverUrl
13974+
)
1397413975
) {
1397513976
performer.image =
13976-
window.stash.serverUrl.slice(0, -1) + performer.image;
13977+
window.stash7dJx1qP.stash.serverUrl + performer.image;
1397713978
}
1397813979
if (performer.performer_url) {
1397913980
performer.performer_url =
13980-
window.stash.serverUrl.slice(0, -1) +
13981+
window.stash7dJx1qP.stash.serverUrl +
1398113982
performer.performer_url;
1398213983
}
1398313984
});
@@ -14553,8 +14554,7 @@
1455314554
init(this, options, instance, create_fragment, safe_not_equal, {});
1455414555
}
1455514556
}
14556-
14557-
stash.addEventListener("stash:page:scene", function () {
14557+
stash7dJx1qP.stash.addEventListener("page:scene", function () {
1455814558
let elms = ".scene-toolbar-group:nth-child(1)";
1455914559
waitForElm(elms).then(() => {
1456014560
const e = document.querySelector(elms);
@@ -14567,7 +14567,7 @@
1456714567
//To use the above, a compatible version of mediapipe is required and i didnt find it
1456814568
});
1456914569
});
14570-
stash.addEventListener("stash:page:image", function () {
14570+
stash7dJx1qP.stash.addEventListener("page:image", function () {
1457114571
let elms = ".image-toolbar-group:nth-child(1)";
1457214572
waitForElm(elms).then(() => {
1457314573
if (!document.querySelector("#localFaces")) {
@@ -14576,4 +14576,4 @@
1457614576
}
1457714577
});
1457814578
});
14579-
})(window.stash || stash);
14579+
})(window.stash7dJx1qP);

plugins/LocalVisage/readme.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ A plugin for recognizing performers from their images using [DeepFace](https://g
2222

2323
- Python 3.10.11 (temporarily, see instructions below)
2424
- `PythonDepManager`
25-
- `StashUserscriptLibrary`
25+
- `stashUserscriptLibrary7djx1qp` (add repo https://7djx1qp.github.io/stash-plugins/
2626

2727
## ⚙️ Tasks
2828

plugins/LocalVisage/requirements.txt

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,19 @@
11
#Dont install this manually. The plugin will create a venv and install the requirements automatically.
2+
#
3+
#nvidia-cublas-cu12==12.4.5.8
4+
#nvidia-cuda-cupti-cu12==12.4.127
5+
#nvidia-cuda-nvrtc-cu12==12.4.127
6+
#nvidia-cuda-runtime-cu12==12.4.127
7+
#nvidia-cudnn-cu12==9.1.0.70
8+
#nvidia-cufft-cu12==11.2.1.3
9+
#nvidia-curand-cu12==10.3.5.147
10+
#nvidia-cusolver-cu12==11.6.1.9
11+
#nvidia-cusparse-cu12==12.3.1.170
12+
#nvidia-cusparselt-cu12==0.6.2
13+
#nvidia-nccl-cu12==2.21.5
14+
#nvidia-nvjitlink-cu12==12.4.127
15+
#nvidia-nvtx-cu12==12.4.127
216
stashapp-tools>=0.2.58
3-
psutil==7.0.0
417
absl-py==2.2.2
518
aiofiles==24.1.0
619
annotated-types==0.7.0
@@ -49,7 +62,6 @@ markdown-it-py==3.0.0
4962
markupsafe==3.0.2
5063
matplotlib==3.10.1
5164
mdurl==0.1.2
52-
mediapipe>=0.10.21
5365
ml-dtypes==0.5.1
5466
mpmath==1.3.0
5567
mtcnn==1.0.0
@@ -110,6 +122,7 @@ ultralytics==8.3.69
110122
ultralytics-thop==2.0.14
111123
urllib3==2.4.0
112124
uvicorn==0.34.2
125+
#voyager==2.1.0
113126
websockets==15.0.1
114127
werkzeug==3.1.3
115128
wheel==0.45.1

0 commit comments

Comments
 (0)