ai-toolkit
ai-toolkit copied to clipboard
JSON caption error on frontend
This is for bugs only
Did you already ask in the discord?
No
You verified that this is a bug and not a feature request or question by asking in the discord?
No. I'm not using Discord.
Describe the bug
The frontend ui crashed when using JSON schema caption like this in txt file
{
"cloth": {
"comprehensive_description": "This top is a black, slim-fit, short-cut cotton short-sleeved T-shirt with a classic round neck design. The front features a portrait of Britney and blue handwritten-style text. The fabric has a vintage washed and faded texture, adding a retro atmosphere; the short cut shows the abdomen, and the sleeve style is regular shoulder short sleeves. The overall style combines street casual and retro trends, and it looks more personalized when paired with black denim bottoms.",
"cloth_type": "Black Slim-Fit Short-Cut Cotton Short-Sleeved T-Shirt",
"collar_type": "Classic round neck design, the neckline fits the neckline without additional decorative details.",
"hat_type": "No hat",
"front_panel": "The front panel is made of black cotton fabric, surface treated with vintage washing to present a natural faded retro texture; the center of the front is printed with a portrait of Britney (with a faded vintage effect), next to the image is a blue handwritten-style \"Britney\" text print. It is speculated that the printing process is digital direct injection combined with vintage treatment; no pocket design, the overall layout is simple and the visual focus is concentrated.",
"back_panel": "The back design is simple with a flat back structure, no additional prints or decorative details, and the fabric is consistent with the front panel to maintain the overall style unity.",
"sleeve": "Short sleeve design, the sleeve type is regular shoulder sleeve, the sleeve length is short, exposing the upper part of the arm; the cuffs are cut from the same fabric, no ribbing or other收口设计, and the edges fit the arm neatly.",
"lower_hem": "The hem is a horizontal short cut, the length just exposes the abdomen, no ribbing or other收口, and the edge lines are neat.",
"size": "Slim-Fit Short-Cut"
},
"image": {
"watermark": {
"is_exist": true,
"watermark_type": "Semi-transparent text watermark in the lower left corner",
"watermark_text": "DICTION 腾讯 KEEP FASHION IN TOUCH Balenciaga"
},
"jpeg_artifact": false,
"photo_category": "Model display image with solid color background"
}
}
Here's what console logs.
The issue clearly arises from not properly stringifying the JSON. If I have time, I will try to fix this problem.
Here's the patch to fix this issue which can be applied using git apply.