mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
feat(ui): add Graph.getid() util
This commit is contained in:
parent
ebc498ad19
commit
7e0a6d1538
@ -430,5 +430,16 @@ export class Graph {
|
||||
assert(fromField !== undefined && toNodeId !== undefined && toField !== undefined, 'Invalid edge arguments');
|
||||
return `${fromNodeId}.${fromField} -> ${toNodeId}.${toField}`;
|
||||
}
|
||||
/**
|
||||
* Gets a unique id.
|
||||
* @param prefix An optional prefix
|
||||
*/
|
||||
static getId(prefix?: string): string {
|
||||
if (prefix) {
|
||||
return `${prefix}_${uuidv4()}`;
|
||||
} else {
|
||||
return uuidv4();
|
||||
}
|
||||
}
|
||||
//#endregion
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user