mirror of
https://git.datalinker.icu/comfyanonymous/ComfyUI
synced 2026-11-22 04:47:03 +08:00
Update app.js
This is the way to generate the type 2 exif tag 37510 that you want to import json from a webp/jpeg:
```
exif = img.getexif()
dump = json.dumps(metadata)
exif[ExifTags.Base.UserComment] = json.dumps(metadata)
exif_dat = exif.tobytes()
img.save(image_path, exif=exif_dat)
```
In doing so, you cannot import the unicode json embedded the way pnginfo reads the webp. pnginfo.js also will be modified.
This commit is contained in:
parent
c61eadf69a
commit
4f2f332622
@ -2099,16 +2099,16 @@ export class ComfyApp {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (file.type === "image/webp") {
|
} else if (file.type === "image/webp") {
|
||||||
const pngInfo = await getWebpMetadata(file);
|
const pngInfo = await getWebpMetadata(file); // getWebpMetadata returns parsed JSON, so much simpler
|
||||||
if (pngInfo) {
|
if (pngInfo) {
|
||||||
if (pngInfo.workflow) {
|
if (pngInfo.workflow) {
|
||||||
this.loadGraphData(JSON.parse(pngInfo.workflow));
|
this.loadGraphData(pngInfo.workflow);
|
||||||
} else if (pngInfo.Workflow) {
|
} else if (pngInfo.Workflow) {
|
||||||
this.loadGraphData(JSON.parse(pngInfo.Workflow)); // Support loading workflows from that webp custom node.
|
this.loadGraphData(pngInfo.Workflow); // Support loading workflows from that webp custom node.
|
||||||
} else if (pngInfo.prompt) {
|
} else if (pngInfo.prompt) {
|
||||||
this.loadApiJson(JSON.parse(pngInfo.prompt));
|
this.loadApiJson(pngInfo.prompt);
|
||||||
} else if (pngInfo.Prompt) {
|
} else if (pngInfo.Prompt) {
|
||||||
this.loadApiJson(JSON.parse(pngInfo.Prompt)); // Support loading prompts from that webp custom node.
|
this.loadApiJson(pngInfo.Prompt); // Support loading prompts from that webp custom node.
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (file.type === "application/json" || file.name?.endsWith(".json")) {
|
} else if (file.type === "application/json" || file.name?.endsWith(".json")) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user