Update app.py
Browse files
app.py
CHANGED
@@ -28,7 +28,7 @@ def load_pipeline(model_id):
|
|
28 |
NUM_CPU_CORES = psutil.cpu_count(logical=True)
|
29 |
|
30 |
# Cap the number of threads to the available physical cores
|
31 |
-
MAX_THREADS =
|
32 |
|
33 |
# Device and hardware configuration
|
34 |
DEVICE = "cpu"
|
@@ -88,10 +88,16 @@ def generate_image(prompt, negative_prompt, seed, randomize_seed, width, height,
|
|
88 |
return images, f"Час генерації: {generation_time:.2f} секунд"
|
89 |
|
90 |
with gr.Blocks() as demo:
|
|
|
|
|
|
|
|
|
|
|
|
|
91 |
with gr.Row():
|
92 |
with gr.Column(scale=5):
|
93 |
prompt = gr.Textbox(label="Опис зображення")
|
94 |
-
negative_prompt = gr.Textbox(label="Не показувати", value="")
|
95 |
with gr.Column(scale=1):
|
96 |
model_choice = gr.Radio(
|
97 |
choices=list(MODEL_OPTIONS.keys()),
|
@@ -106,7 +112,7 @@ with gr.Blocks() as demo:
|
|
106 |
width = gr.Slider(label="Ширина", minimum=512, maximum=512, step=64, value=DEFAULT_IMAGE_SIZE)
|
107 |
height = gr.Slider(label="Висота", minimum=512, maximum=512, step=64, value=DEFAULT_IMAGE_SIZE)
|
108 |
with gr.Row():
|
109 |
-
guidance_scale = gr.Slider(label="
|
110 |
num_inference_steps = gr.Slider(label="Кроки інференсу", minimum=20, maximum=50, step=10, value=20)
|
111 |
|
112 |
with gr.Row():
|
|
|
28 |
NUM_CPU_CORES = psutil.cpu_count(logical=True)
|
29 |
|
30 |
# Cap the number of threads to the available physical cores
|
31 |
+
MAX_THREADS = min(8, NUM_CPU_CORES)
|
32 |
|
33 |
# Device and hardware configuration
|
34 |
DEVICE = "cpu"
|
|
|
88 |
return images, f"Час генерації: {generation_time:.2f} секунд"
|
89 |
|
90 |
with gr.Blocks() as demo:
|
91 |
+
|
92 |
+
with gr.Column(elem_id="col-container"):
|
93 |
+
gr.Markdown(f"""
|
94 |
+
# Демоверсія [автор Ростислав Губа]
|
95 |
+
Для співпраці пишіть на [gubarostislav@gmail.com]
|
96 |
+
""")
|
97 |
with gr.Row():
|
98 |
with gr.Column(scale=5):
|
99 |
prompt = gr.Textbox(label="Опис зображення")
|
100 |
+
negative_prompt = gr.Textbox(label="Не показувати", value="clone,lowres")
|
101 |
with gr.Column(scale=1):
|
102 |
model_choice = gr.Radio(
|
103 |
choices=list(MODEL_OPTIONS.keys()),
|
|
|
112 |
width = gr.Slider(label="Ширина", minimum=512, maximum=512, step=64, value=DEFAULT_IMAGE_SIZE)
|
113 |
height = gr.Slider(label="Висота", minimum=512, maximum=512, step=64, value=DEFAULT_IMAGE_SIZE)
|
114 |
with gr.Row():
|
115 |
+
guidance_scale = gr.Slider(label="Шкала відповідності", minimum=0, maximum=10, step=0.5, value=7.5)
|
116 |
num_inference_steps = gr.Slider(label="Кроки інференсу", minimum=20, maximum=50, step=10, value=20)
|
117 |
|
118 |
with gr.Row():
|