mirror of
https://github.com/storytold/artcraft.git
synced 2026-11-20 16:45:10 +00:00
bug fix: ip adapter change empty strings to null (#535)
- fixes generation failing if ip adapter image not applied / empty string given to backend - fixed bug where removing IPA image doesn't clear the file state
This commit is contained in:
1 parent
6a35d053f0
commit
8dd1938f7f
5 files changed
+11
-8
No files matched your search
@@ -247,7 +247,7 @@ class Editor {
|
||||
styleStrength: 1.0,
|
||||
lipSync: false,
|
||||
cinematic: false,
|
||||
globalIpAdapterImageMediaToken: "",
|
||||
globalIpAdapterImageMediaToken: null,
|
||||
};
|
||||
|
||||
this.media_upload = new MediaUploadApi();
|
||||
|
||||
@@ -65,7 +65,7 @@ export const IPAdapter: React.FC = () => {
|
||||
) {
|
||||
try {
|
||||
const response = await mediaFilesApi.GetMediaFileByToken({
|
||||
mediaFileToken: globalIPAMediaToken.value || "",
|
||||
mediaFileToken: globalIPAMediaToken.value,
|
||||
});
|
||||
if (response.success && response.data) {
|
||||
const imageUrl = bucketConfig.getGcsUrl(
|
||||
@@ -185,7 +185,10 @@ export const IPAdapter: React.FC = () => {
|
||||
setImageSrc(null);
|
||||
setCrop(undefined);
|
||||
adapterImage.value = null;
|
||||
globalIPAMediaToken.value = "";
|
||||
globalIPAMediaToken.value = null;
|
||||
if (editorEngine) {
|
||||
editorEngine.globalIpAdapterImage = undefined;
|
||||
}
|
||||
};
|
||||
|
||||
const DragAndDropZone = () => {
|
||||
|
||||
@@ -4,7 +4,7 @@ export interface GenerationOptions {
|
||||
styleStrength: number;
|
||||
lipSync: boolean;
|
||||
cinematic: boolean;
|
||||
globalIpAdapterImageMediaToken: string; // base 64 image
|
||||
globalIpAdapterImageMediaToken: string | null;
|
||||
}
|
||||
|
||||
export class GenerationOptions {
|
||||
@@ -13,14 +13,14 @@ export class GenerationOptions {
|
||||
public styleStrength: number;
|
||||
public lipSync: boolean;
|
||||
public cinematic: boolean;
|
||||
public globalIpAdapterImageMediaToken: string;
|
||||
public globalIpAdapterImageMediaToken: string | null;
|
||||
constructor(
|
||||
upscale: boolean,
|
||||
faceDetail: boolean,
|
||||
styleStrength: number,
|
||||
lipSync: boolean,
|
||||
cinematic: boolean,
|
||||
globalIpAdapterImageMediaToken: string,
|
||||
globalIpAdapterImageMediaToken: string | null,
|
||||
) {
|
||||
this.upscale = upscale;
|
||||
this.faceDetail = faceDetail;
|
||||
|
||||
@@ -7,7 +7,7 @@ export interface SceneGenereationMetaData {
|
||||
negativePrompt: string;
|
||||
|
||||
cameraAspectRatio: CameraAspectRatio;
|
||||
globalIPAMediaToken: string;
|
||||
globalIPAMediaToken: string | null;
|
||||
|
||||
upscale: boolean;
|
||||
faceDetail: boolean;
|
||||
|
||||
@@ -11,7 +11,7 @@ export const promptsStore = {
|
||||
showNegativePrompt: signal(false),
|
||||
};
|
||||
|
||||
export const globalIPAMediaToken = signal("");
|
||||
export const globalIPAMediaToken = signal<string | null>(null);
|
||||
export const adapterImage = signal<string | null>(null);
|
||||
export const selectedArtStyle = signal<ArtStyle>(styleList[0].type);
|
||||
export const upscale = signal(false);
|
||||
|
||||
Reference in new issue
Block a user