Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions plugins/LocalVisage/LocalVisage.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
name: Local Visage
description: Local Performer Recognition plugin using DeepFace
# requires: PythonDepManager
# requires: StashUserscriptLibrary
version: 1.0
# requires: stashUserscriptLibrary7dJx1qP
version: 1.0.1
exec:
- python
- "{pluginDir}/LocalVisage.py"
interface: raw
ui:
requires:
- StashUserscriptLibrary
- stashUserscriptLibrary7dJx1qP
javascript:
- frontend.js
- https://cdn.jsdelivr.net/npm/@gradio/client@1.15.3/dist/index.js
Expand Down
40 changes: 20 additions & 20 deletions plugins/LocalVisage/frontend.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
(function (stash) {
(function () {
"use strict";

// Using CDN version of @gradio/client to avoid bundling issues
// import { Client, handle_file } from "@gradio/client";

Expand Down Expand Up @@ -42,7 +41,7 @@
runPluginTask(plugin_id:"LocalVisage",task_name:"Start server")
}`,
};
await stash.callGQL(reqData);
await stash7dJx1qP.stash.callGQL(reqData);
}

async function getPerformersForScene(scene_id) {
Expand All @@ -55,7 +54,7 @@
}
}`,
};
var result = await stash.callGQL(reqData);
var result = await stash7dJx1qP.stash.callGQL(reqData);
return result.data.findScene.performers.map((p) => p.id);
}

Expand All @@ -69,7 +68,7 @@
}
}`,
};
var result = await stash.callGQL(reqData);
var result = await stash7dJx1qP.stash.callGQL(reqData);
return result.data.findImage.performers.map((p) => p.id);
}

Expand All @@ -82,7 +81,7 @@
}
}`,
};
return stash.callGQL(reqData);
return stash7dJx1qP.stash.callGQL(reqData);
}

async function updateImage(image_id, performer_ids) {
Expand All @@ -94,7 +93,7 @@
}
}`,
};
return stash.callGQL(reqData);
return stash7dJx1qP.stash.callGQL(reqData);
}

async function getStashboxEndpoint() {
Expand All @@ -109,7 +108,7 @@
}
}`,
};
var result = await stash.callGQL(reqData);
var result = await stash7dJx1qP.stash.callGQL(reqData);
return result.data.configuration.general.stashBoxes[0].endpoint;
}

Expand Down Expand Up @@ -151,7 +150,7 @@
}
}`,
};
var result = await stash.callGQL(reqData);
var result = await stash7dJx1qP.stash.callGQL(reqData);
return result.data.scrapeSinglePerformer.filter(
(p) => p.remote_site_id === stash_id
)[0];
Expand All @@ -166,7 +165,7 @@
}
}`,
};
return stash.callGQL(reqData);
return stash7dJx1qP.stash.callGQL(reqData);
}

let gradioClientModule = null;
Expand Down Expand Up @@ -433,7 +432,7 @@
}
}`,
};
var result = await stash.callGQL(reqData);
var result = await stash7dJx1qP.stash.callGQL(reqData);
const url = result.data.findScene.paths["sprite"];
const response = await fetch(url);
if (response.status === 404) {
Expand Down Expand Up @@ -2563,7 +2562,7 @@
a,
"href",
(a_href_value =
window.stash.serverUrl.slice(0, -1) +
window.stash7dJx1qP.stash.serverUrl +
"/performers/" +
/*match*/ ctx[14].id)
);
Expand Down Expand Up @@ -2647,7 +2646,7 @@
dirty & /*matches*/ 1 &&
a_href_value !==
(a_href_value =
window.stash.serverUrl.slice(0, -1) +
window.stash7dJx1qP.stash.serverUrl +
"/performers/" +
/*match*/ ctx[14].id)
) {
Expand Down Expand Up @@ -13970,14 +13969,16 @@
if (
performer.image &&
typeof performer.image === "string" &&
!performer.image.startsWith(window.stash.serverUrl)
!performer.image.startsWith(
window.stash7dJx1qP.stash.serverUrl
)
) {
performer.image =
window.stash.serverUrl.slice(0, -1) + performer.image;
window.stash7dJx1qP.stash.serverUrl + performer.image;
}
if (performer.performer_url) {
performer.performer_url =
window.stash.serverUrl.slice(0, -1) +
window.stash7dJx1qP.stash.serverUrl +
performer.performer_url;
}
});
Expand Down Expand Up @@ -14553,8 +14554,7 @@
init(this, options, instance, create_fragment, safe_not_equal, {});
}
}

stash.addEventListener("stash:page:scene", function () {
stash7dJx1qP.stash.addEventListener("page:scene", function () {
let elms = ".scene-toolbar-group:nth-child(1)";
waitForElm(elms).then(() => {
const e = document.querySelector(elms);
Expand All @@ -14567,7 +14567,7 @@
//To use the above, a compatible version of mediapipe is required and i didnt find it
});
});
stash.addEventListener("stash:page:image", function () {
stash7dJx1qP.stash.addEventListener("page:image", function () {
let elms = ".image-toolbar-group:nth-child(1)";
waitForElm(elms).then(() => {
if (!document.querySelector("#localFaces")) {
Expand All @@ -14576,4 +14576,4 @@
}
});
});
})(window.stash || stash);
})(window.stash7dJx1qP);
2 changes: 1 addition & 1 deletion plugins/LocalVisage/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ A plugin for recognizing performers from their images using [DeepFace](https://g

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

## ⚙️ Tasks

Expand Down
17 changes: 15 additions & 2 deletions plugins/LocalVisage/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,19 @@
#Dont install this manually. The plugin will create a venv and install the requirements automatically.
#
#nvidia-cublas-cu12==12.4.5.8
#nvidia-cuda-cupti-cu12==12.4.127
#nvidia-cuda-nvrtc-cu12==12.4.127
#nvidia-cuda-runtime-cu12==12.4.127
#nvidia-cudnn-cu12==9.1.0.70
#nvidia-cufft-cu12==11.2.1.3
#nvidia-curand-cu12==10.3.5.147
#nvidia-cusolver-cu12==11.6.1.9
#nvidia-cusparse-cu12==12.3.1.170
#nvidia-cusparselt-cu12==0.6.2
#nvidia-nccl-cu12==2.21.5
#nvidia-nvjitlink-cu12==12.4.127
#nvidia-nvtx-cu12==12.4.127
stashapp-tools>=0.2.58
psutil==7.0.0
absl-py==2.2.2
aiofiles==24.1.0
annotated-types==0.7.0
Expand Down Expand Up @@ -49,7 +62,6 @@ markdown-it-py==3.0.0
markupsafe==3.0.2
matplotlib==3.10.1
mdurl==0.1.2
mediapipe>=0.10.21
ml-dtypes==0.5.1
mpmath==1.3.0
mtcnn==1.0.0
Expand Down Expand Up @@ -110,6 +122,7 @@ ultralytics==8.3.69
ultralytics-thop==2.0.14
urllib3==2.4.0
uvicorn==0.34.2
#voyager==2.1.0
websockets==15.0.1
werkzeug==3.1.3
wheel==0.45.1
Expand Down