update 添加保存
This commit is contained in:
28
prompts/test/random-pony.ts
Normal file
28
prompts/test/random-pony.ts
Normal file
@@ -0,0 +1,28 @@
|
||||
import { PromptGenerator, saveToFile } from "../src/index.ts";
|
||||
import { source } from "./source.ts";
|
||||
import path from 'node:path';
|
||||
|
||||
const coreValue = [
|
||||
"像素艺术",
|
||||
"矢量插画",
|
||||
"线条艺术",
|
||||
"可爱",
|
||||
"日式可爱",
|
||||
"Q版",
|
||||
"萌",
|
||||
"简约",
|
||||
"极简主义",
|
||||
"干净线条",
|
||||
"扁平色彩",
|
||||
]
|
||||
const promptGenerator = new PromptGenerator({
|
||||
count: 1000,
|
||||
source: source,
|
||||
additionalValues: coreValue,
|
||||
endString: '纯色背景'
|
||||
});
|
||||
|
||||
const promptMap = promptGenerator.generateMap();
|
||||
|
||||
const outputPath = path.join(process.cwd(), "./docs/prompts.json");
|
||||
await saveToFile(promptMap, outputPath);
|
||||
Reference in New Issue
Block a user