Omit PNGs without NovelAI prompts
Browse files
scan.py
CHANGED
|
@@ -213,16 +213,15 @@ def main():
|
|
| 213 |
key=lambda path: path.as_posix().casefold(),
|
| 214 |
)
|
| 215 |
files = [scan(path) for path in paths]
|
| 216 |
-
|
| 217 |
result = {
|
| 218 |
"root": ROOT.resolve().as_posix(),
|
| 219 |
-
"
|
| 220 |
-
"found":
|
| 221 |
-
"missing": len(files) - found,
|
| 222 |
"files": files,
|
| 223 |
}
|
| 224 |
OUTPUT.write_text(json.dumps(result, ensure_ascii=False, indent=2) + "\n", encoding="utf-8")
|
| 225 |
-
print(f"Scanned {len(
|
| 226 |
|
| 227 |
|
| 228 |
main()
|
|
|
|
| 213 |
key=lambda path: path.as_posix().casefold(),
|
| 214 |
)
|
| 215 |
files = [scan(path) for path in paths]
|
| 216 |
+
files = [item for item in files if item["prompt_found"]]
|
| 217 |
result = {
|
| 218 |
"root": ROOT.resolve().as_posix(),
|
| 219 |
+
"scanned": len(paths),
|
| 220 |
+
"found": len(files),
|
|
|
|
| 221 |
"files": files,
|
| 222 |
}
|
| 223 |
OUTPUT.write_text(json.dumps(result, ensure_ascii=False, indent=2) + "\n", encoding="utf-8")
|
| 224 |
+
print(f"Scanned {len(paths)} PNGs; found {len(files)}; wrote {OUTPUT}")
|
| 225 |
|
| 226 |
|
| 227 |
main()
|