From ccea072dc56bb48058a724e2782316e02d41fe6f Mon Sep 17 00:00:00 2001 From: Qing Date: Sat, 13 Apr 2024 15:44:07 +0800 Subject: [PATCH] adjust sidebar effect --- .../components/SidePanel/DiffusionOptions.tsx | 408 ++++++++++-------- .../src/components/SidePanel/LabelTitle.tsx | 7 +- web_app/src/components/SidePanel/index.tsx | 7 +- web_app/src/components/ui/input.tsx | 15 +- 4 files changed, 242 insertions(+), 195 deletions(-) diff --git a/web_app/src/components/SidePanel/DiffusionOptions.tsx b/web_app/src/components/SidePanel/DiffusionOptions.tsx index 4999ec0..c0760d7 100644 --- a/web_app/src/components/SidePanel/DiffusionOptions.tsx +++ b/web_app/src/components/SidePanel/DiffusionOptions.tsx @@ -114,14 +114,22 @@ const DiffusionOptions = () => { return null } + let disable = settings.enableControlnet + let toolTip = + "BrushNet is a plug-and-play image inpainting model with decomposed dual-branch diffusion. It can be used to inpaint images by conditioning on a mask." + if (disable) { + toolTip = "ControlNet is enabled, BrushNet is disabled." + } + return (
-
+ { onCheckedChange={(value) => { updateSettings({ enableBrushNet: value }) }} + disabled={disable} /> -
-
- - - updateSettings({ brushnetConditioningScale: vals[0] / 100 }) - } - /> - { - updateSettings({ brushnetConditioningScale: val }) - }} - /> - -
+ + + + updateSettings({ brushnetConditioningScale: vals[0] / 100 }) + } + /> + { + updateSettings({ brushnetConditioningScale: val }) + }} + /> + -
+ -
+
@@ -192,14 +198,22 @@ const DiffusionOptions = () => { return null } + let disable = settings.enableBrushNet + let toolTip = + "Using an additional conditioning image to control how an image is generated" + if (disable) { + toolTip = "BrushNet is enabled, ControlNet is disabled." + } + return (
-
+ { onCheckedChange={(value) => { updateSettings({ enableControlnet: value }) }} + disabled={disable} /> -
+
@@ -218,7 +233,7 @@ const DiffusionOptions = () => { min={1} max={100} step={1} - disabled={!settings.enableControlnet} + disabled={!settings.enableControlnet || disable} value={[Math.floor(settings.controlnetConditioningScale * 100)]} onValueChange={(vals) => updateSettings({ controlnetConditioningScale: vals[0] / 100 }) @@ -227,7 +242,7 @@ const DiffusionOptions = () => { { @@ -237,7 +252,7 @@ const DiffusionOptions = () => {
-
+ -
+
@@ -271,13 +286,21 @@ const DiffusionOptions = () => { return null } + let disable = settings.enableBrushNet + let toolTip = + "Enable quality image generation in typically 2-4 steps. Suggest disabling guidance_scale by setting it to 0. You can also try values between 1.0 and 2.0. When LCM Lora is enabled, LCMSampler will be used automatically." + if (disable) { + toolTip = "BrushNet is enabled, LCM Lora is disabled." + } + return ( <> { onCheckedChange={(value) => { updateSettings({ enableLCMLora: value }) }} + disabled={disable} /> @@ -297,13 +321,22 @@ const DiffusionOptions = () => { return null } + let toolTip = + "FreeU is a technique for improving image quality. Different models may require different FreeU-specific hyperparameters, which can be viewed in the more info section." + if (settings.enableBrushNet) { + toolTip = "BrushNet is enabled, FreeU is disabled." + } + + let disable = settings.enableBrushNet || !settings.enableFreeu + return (
-
+ { onCheckedChange={(value) => { updateSettings({ enableFreeu: value }) }} + disabled={settings.enableBrushNet} /> -
+
-
+
{ @@ -338,12 +373,13 @@ const DiffusionOptions = () => { { @@ -360,12 +396,13 @@ const DiffusionOptions = () => { { @@ -379,12 +416,13 @@ const DiffusionOptions = () => { { @@ -522,36 +560,44 @@ const DiffusionOptions = () => { return null } + let disable = settings.enableBrushNet + let toolTip = + "Strength is a measure of how much noise is added to the base image, which influences how similar the output is to the base image. Higher value means more noise and more different from the base image" + if (disable) { + toolTip = "BrushNet is enabled, Strength is disabled." + } + return ( -
+ - - - updateSettings({ sdStrength: vals[0] / 100 }) - } - /> - { - updateSettings({ sdStrength: val }) - }} - /> - -
+ + updateSettings({ sdStrength: vals[0] / 100 }) + } + disabled={disable} + /> + { + updateSettings({ sdStrength: val }) + }} + disabled={disable} + /> + ) } @@ -679,67 +725,63 @@ const DiffusionOptions = () => { const renderSteps = () => { return ( -
+ - - updateSettings({ sdSteps: vals[0] })} - /> - { - updateSettings({ sdSteps: val }) - }} - /> - -
+ updateSettings({ sdSteps: vals[0] })} + /> + { + updateSettings({ sdSteps: val }) + }} + /> + ) } const renderGuidanceScale = () => { return ( -
+ - - - updateSettings({ sdGuidanceScale: vals[0] / 100 }) - } - /> - { - updateSettings({ sdGuidanceScale: val }) - }} - /> - -
+ + updateSettings({ sdGuidanceScale: vals[0] / 100 }) + } + /> + { + updateSettings({ sdGuidanceScale: val }) + }} + /> + ) } @@ -809,32 +851,30 @@ const DiffusionOptions = () => { const renderMaskBlur = () => { return ( -
+ - - updateSettings({ sdMaskBlur: vals[0] })} - /> - { - updateSettings({ sdMaskBlur: value }) - }} - /> - -
+ updateSettings({ sdMaskBlur: vals[0] })} + /> + { + updateSettings({ sdMaskBlur: value }) + }} + /> + ) } @@ -864,14 +904,14 @@ const DiffusionOptions = () => { return ( <>
- + { -
- + - + - -
+