-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: remove the sliders from the controlnet modes and leave the values the same as in the webapp #150
fix: remove the sliders from the controlnet modes and leave the values the same as in the webapp #150
Changes from 3 commits
478d1f6
6401f12
cd75e0b
e5ee70b
8b7e241
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -36,11 +36,16 @@ public partial class PromptWindowUI | |
|
||
public string selectedPreset = ""; | ||
public int selectedOption1Index = 0; | ||
public int selectedOption2Index = 0; | ||
public int selectedOption3Index = 0; | ||
public float sliderValue1 = 0.1f; | ||
public float sliderValue2 = 0.1f; | ||
public float sliderValue3 = 0.1f; | ||
|
||
/// <summary> | ||
/// Variable to display in interface on slider element. | ||
/// </summary> | ||
public int sliderDisplayedValue = 100; | ||
|
||
/// <summary> | ||
/// Value from the guidance slider in controlNet options, use to send to generation | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. seems that this value is not only for guidance but that's what the comment is saying |
||
/// </summary> | ||
public float sliderValue = 0.0f; | ||
|
||
internal bool isImageToImage = false; | ||
internal bool isControlNet = false; | ||
|
@@ -303,7 +308,6 @@ private Rect DrawUploadedImage(Rect dropArea) | |
heightSliderValue = matchingHeight != -1 ? matchingHeight : currentHeight; | ||
|
||
selectedOption1Index = NearestValueIndex(widthSliderValue, allowedWidthValues); | ||
selectedOption2Index = NearestValueIndex(heightSliderValue, allowedHeightValues); | ||
}); | ||
|
||
toolsMenu.DropDown(dropdownButtonRect); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,50 +31,23 @@ private void RenderControlNetFoldout() | |
if (isAdvancedSettings) | ||
{ | ||
GUILayout.BeginHorizontal(); | ||
GUILayout.Label("Model 1", EditorStyles.label); | ||
GUILayout.Label("Modality :", EditorStyles.label); | ||
|
||
List<string> availableOptions1 = new List<string> { "None" }; | ||
availableOptions1.AddRange(dropdownOptions); | ||
selectedOption1Index = EditorGUILayout.Popup(selectedOption1Index, availableOptions1.ToArray()); | ||
|
||
GUILayout.Label("Slider 1", EditorStyles.label); | ||
sliderValue1 = Mathf.Round(EditorGUILayout.Slider(Mathf.Clamp(sliderValue1, 0.1f, 1.0f), 0.1f, 1.0f) * 100) / 100; | ||
GUILayout.EndHorizontal(); | ||
|
||
if (selectedOption1Index > 0) | ||
{ | ||
GUILayout.BeginHorizontal(); | ||
GUILayout.Label("Model 2", EditorStyles.label); | ||
|
||
List<string> availableOptions2 = new List<string> { "None" }; | ||
availableOptions2.AddRange(dropdownOptions); | ||
availableOptions2.RemoveAt(selectedOption1Index); | ||
selectedOption2Index = EditorGUILayout.Popup(selectedOption2Index, availableOptions2.ToArray()); | ||
|
||
GUILayout.Label("Slider 2", EditorStyles.label); | ||
sliderValue2 = Mathf.Round(EditorGUILayout.Slider(Mathf.Clamp(sliderValue2, 0.1f, 1.0f), 0.1f, 1.0f) * 100) / 100; | ||
GUILayout.EndHorizontal(); | ||
} | ||
|
||
if (selectedOption2Index > 0) | ||
{ | ||
GUILayout.BeginHorizontal(); | ||
GUILayout.Label("Model 3", EditorStyles.label); | ||
|
||
List<string> availableOptions3 = new List<string> { "None" }; | ||
availableOptions3.AddRange(dropdownOptions); | ||
int option1Index = Array.IndexOf(dropdownOptions, availableOptions1[selectedOption1Index]); | ||
int option2Index = Array.IndexOf(dropdownOptions, dropdownOptions[selectedOption2Index]); | ||
|
||
availableOptions3.RemoveAt(option1Index + 1); | ||
availableOptions3.RemoveAt(option2Index); | ||
|
||
selectedOption3Index = EditorGUILayout.Popup(selectedOption3Index, availableOptions3.ToArray()); | ||
|
||
GUILayout.Label("Slider 3", EditorStyles.label); | ||
sliderValue3 = Mathf.Round(EditorGUILayout.Slider(Mathf.Clamp(sliderValue3, 0.1f, 1.0f), 0.1f, 1.0f) * 100) / 100; | ||
GUILayout.EndHorizontal(); | ||
{ | ||
GUILayout.Label("Guidance :", EditorStyles.label); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not aligned of calling this Guidance and I would prefer Influence. @qvaleroo what do you think ? |
||
sliderDisplayedValue = (int)EditorGUILayout.Slider(Mathf.Clamp(sliderDisplayedValue, 0, 100), 0, 100); | ||
sliderValue = sliderDisplayedValue / 100.0f; | ||
if (sliderValue == 0) | ||
{ | ||
sliderValue = 0.01f; | ||
} | ||
} | ||
GUILayout.EndHorizontal(); | ||
} | ||
else | ||
{ | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe rename Option1Name if there is no more 1-2-3-4, etc...
(and also other Something1Variable names)