-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Revamped the img2img workflow, added soft inapinting, added fooocus inpainting, added IPA integration with masking and added CN union integration
- Loading branch information
Showing
16 changed files
with
294 additions
and
460 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
46 changes: 46 additions & 0 deletions
46
assets/js/src/MainForm/ComfySoftInpaintingFields/ComfySoftInpaintingFields.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
import { Control, Controller } from "react-hook-form"; | ||
import { comfySoftPaintingFields } from "./constants"; | ||
import Slider from "../../components/Slider"; | ||
import { MainFormValues } from "../MainForm"; | ||
import ExpandCollapseCheckbox from "../../components/ExpandCollapseCheckbox"; | ||
|
||
export type ComfySoftInpaintingArgs = { | ||
isEnabled: boolean; | ||
maskBlur: number; | ||
}; | ||
|
||
const SoftInpaintingFields = ({ | ||
control, | ||
}: { | ||
control: Control<MainFormValues>; | ||
}) => { | ||
return ( | ||
<div className="flex flex-col gap-3"> | ||
<Controller | ||
name={"comfySoftInpainting.isEnabled"} | ||
control={control} | ||
render={({ field }) => ( | ||
<ExpandCollapseCheckbox {...field} label="Soft Inpainting"> | ||
<div className="h-auto flex relative flex-col gap-8 bg-neutral-100/5 p-4 rounded-md overflow-hidden"> | ||
{comfySoftPaintingFields?.map( | ||
({ value: defaultValue, ...rest }) => ( | ||
<div key={rest.name}> | ||
<Controller | ||
name={"comfySoftInpainting." + rest.name} | ||
control={control} | ||
render={({ field }) => <Slider {...rest} {...field} />} | ||
defaultValue={defaultValue} | ||
/> | ||
</div> | ||
) | ||
)} | ||
</div> | ||
</ExpandCollapseCheckbox> | ||
)} | ||
defaultValue={false} | ||
/> | ||
</div> | ||
); | ||
}; | ||
|
||
export default SoftInpaintingFields; |
24 changes: 24 additions & 0 deletions
24
assets/js/src/MainForm/ComfySoftInpaintingFields/constants.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import { ComfySoftInpaintingArgs } from "./ComfySoftInpaintingFields"; | ||
|
||
export const defaultComfySoftPaintingArgs: ComfySoftInpaintingArgs = { | ||
isEnabled: false, | ||
maskBlur: 6, | ||
}; | ||
|
||
export const comfySoftPaintingFields: { | ||
label: string; | ||
name: keyof ComfySoftInpaintingArgs; | ||
value: number; | ||
min: number; | ||
max: number; | ||
step: number; | ||
}[] = [ | ||
{ | ||
label: "Mask Blur", | ||
name: "maskBlur", | ||
value: 6, | ||
min: 0, | ||
max: 30, | ||
step: 1, | ||
}, | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export { default } from "./ComfySoftInpaintingFields"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.