mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
fix(ui): use empty string fallback if unable to parse prompts when creating style preset from existing image
This commit is contained in:
parent
83144f4fe3
commit
da7dee44c6
@ -86,8 +86,19 @@ export const useImageActions = (image_name?: string) => {
|
||||
|
||||
const createAsPreset = useCallback(async () => {
|
||||
if (image_name && metadata && imageDTO) {
|
||||
const positivePrompt = await handlers.positivePrompt.parse(metadata);
|
||||
const negativePrompt = await handlers.negativePrompt.parse(metadata);
|
||||
let positivePrompt;
|
||||
let negativePrompt;
|
||||
|
||||
try {
|
||||
positivePrompt = await handlers.positivePrompt.parse(metadata);
|
||||
} catch (error) {
|
||||
positivePrompt = ""
|
||||
}
|
||||
try {
|
||||
negativePrompt = await handlers.negativePrompt.parse(metadata);
|
||||
} catch (error) {
|
||||
negativePrompt = ""
|
||||
}
|
||||
|
||||
$stylePresetModalState.set({
|
||||
prefilledFormData: {
|
||||
|
Loading…
Reference in New Issue
Block a user