mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2025-04-20 11:23:29 +00:00
Prevent generating bad replacement regex
This commit is contained in:
parent
04d9bc13af
commit
5186b3266a
@ -131,6 +131,7 @@ export async function importA1111(graph, parameters) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function replaceEmbeddings(text) {
|
function replaceEmbeddings(text) {
|
||||||
|
if(!embeddings.length) return text;
|
||||||
return text.replaceAll(
|
return text.replaceAll(
|
||||||
new RegExp(
|
new RegExp(
|
||||||
"\\b(" + embeddings.map((e) => e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")).join("\\b|\\b") + ")\\b",
|
"\\b(" + embeddings.map((e) => e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")).join("\\b|\\b") + ")\\b",
|
||||||
|
Loading…
Reference in New Issue
Block a user