remove make GIF
This commit is contained in:
parent
04c5dfece8
commit
7463a599a9
@ -71,7 +71,6 @@ import { Slider } from "./ui/slider"
|
|||||||
// import InteractiveSegReplaceModal from "../InteractiveSeg/ReplaceModal"
|
// import InteractiveSegReplaceModal from "../InteractiveSeg/ReplaceModal"
|
||||||
import { PluginName } from "@/lib/types"
|
import { PluginName } from "@/lib/types"
|
||||||
import { useHotkeys } from "react-hotkeys-hook"
|
import { useHotkeys } from "react-hotkeys-hook"
|
||||||
// import MakeGIF from "./MakeGIF"
|
|
||||||
|
|
||||||
const TOOLBAR_SIZE = 200
|
const TOOLBAR_SIZE = 200
|
||||||
const MIN_BRUSH_SIZE = 10
|
const MIN_BRUSH_SIZE = 10
|
||||||
@ -1583,7 +1582,6 @@ export default function Editor() {
|
|||||||
onMouseMove={onMouseMove}
|
onMouseMove={onMouseMove}
|
||||||
onMouseUp={onPointerUp}
|
onMouseUp={onPointerUp}
|
||||||
>
|
>
|
||||||
{/* <MakeGIF renders={renders} /> */}
|
|
||||||
{/* <InteractiveSegConfirmActions
|
{/* <InteractiveSegConfirmActions
|
||||||
onAcceptClick={onInteractiveAccept}
|
onAcceptClick={onInteractiveAccept}
|
||||||
onCancelClick={onInteractiveCancel}
|
onCancelClick={onInteractiveCancel}
|
||||||
|
@ -236,35 +236,3 @@ export async function downloadToOutput(
|
|||||||
throw new Error(`Something went wrong: ${error}`)
|
throw new Error(`Something went wrong: ${error}`)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function makeGif(
|
|
||||||
originFile: File,
|
|
||||||
cleanImage: HTMLImageElement,
|
|
||||||
filename: string,
|
|
||||||
mimeType: string
|
|
||||||
) {
|
|
||||||
const cleanFile = await srcToFile(cleanImage.src, filename, mimeType)
|
|
||||||
const fd = new FormData()
|
|
||||||
fd.append("name", PluginName.MakeGIF)
|
|
||||||
fd.append("image", originFile)
|
|
||||||
fd.append("clean_img", cleanFile)
|
|
||||||
fd.append("filename", filename)
|
|
||||||
|
|
||||||
try {
|
|
||||||
const res = await fetch(`${API_ENDPOINT}/run_plugin`, {
|
|
||||||
method: "POST",
|
|
||||||
body: fd,
|
|
||||||
})
|
|
||||||
if (!res.ok) {
|
|
||||||
const errMsg = await res.text()
|
|
||||||
throw new Error(errMsg)
|
|
||||||
}
|
|
||||||
|
|
||||||
const blob = await res.blob()
|
|
||||||
const newImage = new Image()
|
|
||||||
await loadImage(newImage, URL.createObjectURL(blob))
|
|
||||||
return newImage
|
|
||||||
} catch (error) {
|
|
||||||
throw new Error(`Something went wrong: ${error}`)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
@ -86,7 +86,6 @@ interface AppState {
|
|||||||
isInteractiveSegRunning: boolean
|
isInteractiveSegRunning: boolean
|
||||||
interactiveSegClicks: number[][]
|
interactiveSegClicks: number[][]
|
||||||
enableFileManager: boolean
|
enableFileManager: boolean
|
||||||
gifImage: HTMLImageElement | undefined
|
|
||||||
brushSize: number
|
brushSize: number
|
||||||
isControlNet: boolean
|
isControlNet: boolean
|
||||||
controlNetMethod: string
|
controlNetMethod: string
|
||||||
@ -108,7 +107,6 @@ export const appState = atom<AppState>({
|
|||||||
isInteractiveSegRunning: false,
|
isInteractiveSegRunning: false,
|
||||||
interactiveSegClicks: [],
|
interactiveSegClicks: [],
|
||||||
enableFileManager: false,
|
enableFileManager: false,
|
||||||
gifImage: undefined,
|
|
||||||
brushSize: 40,
|
brushSize: 40,
|
||||||
isControlNet: false,
|
isControlNet: false,
|
||||||
controlNetMethod: ControlNetMethod.canny,
|
controlNetMethod: ControlNetMethod.canny,
|
||||||
@ -225,18 +223,6 @@ export const enableFileManagerState = selector({
|
|||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
export const gifImageState = selector({
|
|
||||||
key: "gifImageState",
|
|
||||||
get: ({ get }) => {
|
|
||||||
const app = get(appState)
|
|
||||||
return app.gifImage
|
|
||||||
},
|
|
||||||
set: ({ get, set }, newValue: any) => {
|
|
||||||
const app = get(appState)
|
|
||||||
set(appState, { ...app, gifImage: newValue })
|
|
||||||
},
|
|
||||||
})
|
|
||||||
|
|
||||||
export const fileState = selector({
|
export const fileState = selector({
|
||||||
key: "fileState",
|
key: "fileState",
|
||||||
get: ({ get }) => {
|
get: ({ get }) => {
|
||||||
|
@ -5,5 +5,4 @@ export enum PluginName {
|
|||||||
GFPGAN = "GFPGAN",
|
GFPGAN = "GFPGAN",
|
||||||
RestoreFormer = "RestoreFormer",
|
RestoreFormer = "RestoreFormer",
|
||||||
InteractiveSeg = "InteractiveSeg",
|
InteractiveSeg = "InteractiveSeg",
|
||||||
MakeGIF = "MakeGIF",
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user