mirror of
https://github.com/invoke-ai/InvokeAI.git
synced 2026-02-07 03:45:24 -05:00
fix(ui): use empty string fallback if unable to parse prompts when creating style preset from existing image
This commit is contained in:
committed by
psychedelicious
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: {
|
||||
|
||||
Reference in New Issue
Block a user