Repository: voicepaw/so-vits-svc-fork

Issue:
GUI Buttons to Infer not shown
**Describe the bug**
If i start the GUI with svcg everythings seems to be there except the buttons on the bottom.Not sure what i am missing or if its a bug.

**To Reproduce**
Steps to reproduce the behavior: svcg

**Additional context**
I trained a voice and everything is fine except i cant use the GUI and i have to use the console with svc infer +args instead.
<img width="842" alt="Screenshot 2023-04-28 134830" src="https://user-images.githubusercontent.com/50552332/235139910-7cf0a8b7-accc-4b96-8f0e-26ba05b0c634.png">
<img width="909" alt="Screenshot 2023-04-28 134130" src="https://user-images.githubusercontent.com/50552332/235139915-9b0b6eb3-ce53-41b3-83cd-64beffb61883.png">



Discussion:
Is it possible that it is simply out of view from the screen?
I wish it was that easy but thats not the case
<img width="884" alt="Screenshot 2023-04-30 002504" src="https://user-images.githubusercontent.com/50552332/235326564-314a908a-4f6d-49ae-a170-bd865e41dc48.png">


I'm having this same problem. Anyone figure out a fix?
huhh, same, ive rebuilt a bunch of times. same outcome
i am having the same problem, the GUI did not shown infer botton
I'm having the same problem. I had version 3.11 and it was working perfectly fine, but now that I updated it, the infer button disappeared. Does anyone know the solution?
same
same
I've had the exact same problem too. Does anyone know if a certain So-Vits version has a bug or has a certain requirement or maybe we have to install another version? I actually installed it in another computer and had the same outcome.
facing the same issue , please try adding scalability to the GUI as a solution
I had version 3.15.0, the infer button not showing
same here, infer button not showing on 3.15.0
> For me it was a resolution issue. I fixed it by changing the resolution in my Window settings to a lower value.

I just tried fixing the resolution to my computer. That doesn't work. The infer button still doesn't show. I have no idea how to fix it.
same with me,,,,,

> For me it was a resolution issue. I fixed it by changing the resolution in my Window settings to a lower value.

what is the resolution value do you use? i use highest res in my device (1366x768), inver value not showing; when i try lower resolution 1280x7200, the preset name field also not showing, i thought we need higher resolution, not lower resolution
I found a solution that worked well for me! I had my resolution set at 1440x900 with my scale at 125% and the infer button was nowhere to be found. The moment I switched my scale to 100%, they appeared! 

![image](https://github.com/voicepaw/so-vits-svc-fork/assets/134891447/3bbd5581-c97b-4e8b-b034-c9641b364e49)
![image](https://github.com/voicepaw/so-vits-svc-fork/assets/134891447/ad34f412-afe4-467a-aa05-e1848d84752b)

Give it a try if you're having the same problem!
> I found a solution that worked well for me! I had my resolution set at 1440x900 with my scale at 125% and the infer button was nowhere to be found. The moment I switched my scale to 100%, they appeared!
> 
> ![image](https://user-images.githubusercontent.com/134891447/241592799-3bbd5581-c97b-4e8b-b034-c9641b364e49.png) ![image](https://user-images.githubusercontent.com/134891447/241592826-ad34f412-afe4-467a-aa05-e1848d84752b.png)
> 
> Give it a try if you're having the same problem!

I don't have that large of a resolution. My largest resolution is 1366x768. Also, my scale is 100% currently at the moment. The infer button still doesn't show up.

![Screenshot 2023-05-28 200710](https://github.com/voicepaw/so-vits-svc-fork/assets/113648917/228c62bf-fb0d-4b6a-8038-e97d029f5f75)



Resolving patch:
diff --git a/src/so_vits_svc_fork/gui.py b/src/so_vits_svc_fork/gui.py
--- a/src/so_vits_svc_fork/gui.py
+++ b/src/so_vits_svc_fork/gui.py
@@ -2,6 +2,7 @@
 
 import json
 import multiprocessing
+import os
 from copy import copy
 from logging import getLogger
 from pathlib import Path
@@ -503,6 +504,28 @@ def main():
         frame.expand_x = True
         frames[name] = [frame]
 
+    bottoms = [
+        [
+            sg.Checkbox(
+                key="use_gpu",
+                default=get_optimal_device() != torch.device("cpu"),
+                text="Use GPU"
+                + (
+                    " (not available; if your device has GPU, make sure you installed PyTorch with CUDA support)"
+                    if get_optimal_device() == torch.device("cpu")
+                    else ""
+                ),
+                disabled=get_optimal_device() == torch.device("cpu"),
+            )
+        ],
+        [
+            sg.Button("Infer", key="infer"),
+            sg.Button("(Re)Start Voice Changer", key="start_vc"),
+            sg.Button("Stop Voice Changer", key="stop_vc"),
+            sg.Push(),
+            # sg.Button("ONNX Export", key="onnx_export"),
+        ],
+    ]
     column1 = sg.Column(
         [
             frames["Paths"],
@@ -515,42 +538,53 @@ def main():
             frames["File"],
             frames["Realtime"],
             frames["Presets"],
-            [
-                sg.Checkbox(
-                    key="use_gpu",
-                    default=get_optimal_device() != torch.device("cpu"),
-                    text="Use GPU"
-                    + (
-                        " (not available; if your device has GPU, make sure you installed PyTorch with CUDA support)"
-                        if get_optimal_device() == torch.device("cpu")
-                        else ""
-                    ),
-                    disabled=get_optimal_device() == torch.device("cpu"),
-                )
-            ],
-            [
-                sg.Button("Infer", key="infer"),
-                sg.Button("(Re)Start Voice Changer", key="start_vc"),
-                sg.Button("Stop Voice Changer", key="stop_vc"),
-                sg.Push(),
-                # sg.Button("ONNX Export", key="onnx_export"),
-            ],
         ]
+        + bottoms
     )
-
     # columns
     layout = [[column1, column2]]
-    # layout = [[sg.Column(layout, vertical_alignment="top", scrollable=True, expand_x=True, expand_y=True)]]
+    # get screen size
+    screen_width, screen_height = sg.Window.get_screen_size()
+    if screen_height < 720:
+        layout = [
+            [
+                sg.Column(
+                    layout,
+                    vertical_alignment="top",
+                    scrollable=False,
+                    expand_x=True,
+                    expand_y=True,
+                    vertical_scroll_only=True,
+                    key="main_column",
+                )
+            ]
+        ]
     window = sg.Window(
         f"{__name__.split('.')[0].replace('_', '-')} v{__version__}",
         layout,
         grab_anywhere=True,
         finalize=True,
+        scaling=1,
+        font=("Yu Gothic UI", 11) if os.name == "nt" else None,
+        # resizable=True,
+        # size=(1280, 720),
         # Below disables taskbar, which may be not useful for some users
         # use_custom_titlebar=True, no_titlebar=False
         # Keep on top
         # keep_on_top=True
     )
+
+    # event, values = window.read(timeout=0.01)
+    # window["main_column"].Scrollable = True
+
+    # make slider height smaller
+    try:
+        for v in window.element_list():
+            if isinstance(v, sg.Slider):
+                v.Widget.configure(sliderrelief="flat", width=10, sliderlength=20)
+    except Exception as e:
+        LOG.exception(e)
+
     # for n in ["input_device", "output_device"]:
     #     window[n].Widget.configure(justify="right")
     event, values = window.read(timeout=0.01)


Test patch: