diff --git a/gui/src/components/Profiles.tsx b/gui/src/components/Profiles.tsx index c0185e11..92fe992f 100644 --- a/gui/src/components/Profiles.tsx +++ b/gui/src/components/Profiles.tsx @@ -14,7 +14,7 @@ import { TextField, } from '@mui/material'; import * as ExifReader from 'exifreader'; -import { defaultTo } from 'lodash'; +import { defaultTo, isString } from 'lodash'; import * as React from 'react'; import { useContext } from 'react'; import { useTranslation } from 'react-i18next'; @@ -176,11 +176,11 @@ export async function parseImageParams(file: File): Promise { +export async function parseAutoComment(comment: string): Promise> { + if (isProbablyJSON(comment)) { + return parseJSONParams(comment); + } + const lines = comment.split('\n'); const [prompt, maybeNegative, ...otherLines] = lines;