mirror of
https://github.com/lllyasviel/Fooocus.git
synced 2026-08-16 13:13:16 +02:00
+1
-1
@@ -1 +1 @@
|
|||||||
version = '2.0.89'
|
version = '2.0.90'
|
||||||
|
|||||||
+11
-6
@@ -8,6 +8,7 @@ outputs = []
|
|||||||
def worker():
|
def worker():
|
||||||
global buffer, outputs
|
global buffer, outputs
|
||||||
|
|
||||||
|
import traceback
|
||||||
import numpy as np
|
import numpy as np
|
||||||
import torch
|
import torch
|
||||||
import time
|
import time
|
||||||
@@ -46,8 +47,8 @@ def worker():
|
|||||||
def handler(task):
|
def handler(task):
|
||||||
execution_start_time = time.perf_counter()
|
execution_start_time = time.perf_counter()
|
||||||
|
|
||||||
prompt, negative_prompt, style_selections, performance_selction, \
|
prompt, negative_prompt, style_selections, performance_selection, \
|
||||||
aspect_ratios_selction, image_number, image_seed, sharpness, adm_scaler_positive, adm_scaler_negative, guidance_scale, adaptive_cfg, sampler_name, scheduler_name, \
|
aspect_ratios_selection, image_number, image_seed, sharpness, adm_scaler_positive, adm_scaler_negative, guidance_scale, adaptive_cfg, sampler_name, scheduler_name, \
|
||||||
overwrite_step, overwrite_switch, overwrite_width, overwrite_height, overwrite_vary_strength, overwrite_upscale_strength, \
|
overwrite_step, overwrite_switch, overwrite_width, overwrite_height, overwrite_vary_strength, overwrite_upscale_strength, \
|
||||||
base_model_name, refiner_model_name, \
|
base_model_name, refiner_model_name, \
|
||||||
l1, w1, l2, w2, l3, w3, l4, w4, l5, w5, \
|
l1, w1, l2, w2, l3, w3, l4, w4, l5, w5, \
|
||||||
@@ -89,7 +90,7 @@ def worker():
|
|||||||
tiled = False
|
tiled = False
|
||||||
inpaint_worker.current_task = None
|
inpaint_worker.current_task = None
|
||||||
|
|
||||||
if performance_selction == 'Speed':
|
if performance_selection == 'Speed':
|
||||||
steps = 30
|
steps = 30
|
||||||
switch = 20
|
switch = 20
|
||||||
else:
|
else:
|
||||||
@@ -104,7 +105,7 @@ def worker():
|
|||||||
|
|
||||||
pipeline.clear_all_caches() # save memory
|
pipeline.clear_all_caches() # save memory
|
||||||
|
|
||||||
width, height = aspect_ratios[aspect_ratios_selction]
|
width, height = aspect_ratios[aspect_ratios_selection]
|
||||||
|
|
||||||
if overwrite_width > 0:
|
if overwrite_width > 0:
|
||||||
width = overwrite_width
|
width = overwrite_width
|
||||||
@@ -400,7 +401,7 @@ def worker():
|
|||||||
('Negative Prompt', raw_negative_prompt),
|
('Negative Prompt', raw_negative_prompt),
|
||||||
('Fooocus V2 Expansion', task['expansion']),
|
('Fooocus V2 Expansion', task['expansion']),
|
||||||
('Styles', str(raw_style_selections)),
|
('Styles', str(raw_style_selections)),
|
||||||
('Performance', performance_selction),
|
('Performance', performance_selection),
|
||||||
('Resolution', str((width, height))),
|
('Resolution', str((width, height))),
|
||||||
('Sharpness', sharpness),
|
('Sharpness', sharpness),
|
||||||
('Guidance Scale', guidance_scale),
|
('Guidance Scale', guidance_scale),
|
||||||
@@ -433,7 +434,11 @@ def worker():
|
|||||||
time.sleep(0.01)
|
time.sleep(0.01)
|
||||||
if len(buffer) > 0:
|
if len(buffer) > 0:
|
||||||
task = buffer.pop(0)
|
task = buffer.pop(0)
|
||||||
handler(task)
|
try:
|
||||||
|
handler(task)
|
||||||
|
except:
|
||||||
|
traceback.print_exc()
|
||||||
|
outputs.append(['results', []])
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -112,8 +112,8 @@ with shared.gradio_root:
|
|||||||
|
|
||||||
with gr.Column(scale=0.5, visible=False) as right_col:
|
with gr.Column(scale=0.5, visible=False) as right_col:
|
||||||
with gr.Tab(label='Setting'):
|
with gr.Tab(label='Setting'):
|
||||||
performance_selction = gr.Radio(label='Performance', choices=['Speed', 'Quality'], value='Speed')
|
performance_selection = gr.Radio(label='Performance', choices=['Speed', 'Quality'], value='Speed')
|
||||||
aspect_ratios_selction = gr.Radio(label='Aspect Ratios', choices=list(aspect_ratios.keys()),
|
aspect_ratios_selection = gr.Radio(label='Aspect Ratios', choices=list(aspect_ratios.keys()),
|
||||||
value='1152×896', info='width × height')
|
value='1152×896', info='width × height')
|
||||||
image_number = gr.Slider(label='Image Number', minimum=1, maximum=32, step=1, value=2)
|
image_number = gr.Slider(label='Image Number', minimum=1, maximum=32, step=1, value=2)
|
||||||
negative_prompt = gr.Textbox(label='Negative Prompt', show_label=True, placeholder="Type prompt here.",
|
negative_prompt = gr.Textbox(label='Negative Prompt', show_label=True, placeholder="Type prompt here.",
|
||||||
@@ -211,7 +211,7 @@ with shared.gradio_root:
|
|||||||
advanced_checkbox.change(lambda x: gr.update(visible=x), advanced_checkbox, right_col, queue=False)
|
advanced_checkbox.change(lambda x: gr.update(visible=x), advanced_checkbox, right_col, queue=False)
|
||||||
ctrls = [
|
ctrls = [
|
||||||
prompt, negative_prompt, style_selections,
|
prompt, negative_prompt, style_selections,
|
||||||
performance_selction, aspect_ratios_selction, image_number, image_seed, sharpness, adm_scaler_positive, adm_scaler_negative, guidance_scale, adaptive_cfg, sampler_name, scheduler_name
|
performance_selection, aspect_ratios_selection, image_number, image_seed, sharpness, adm_scaler_positive, adm_scaler_negative, guidance_scale, adaptive_cfg, sampler_name, scheduler_name
|
||||||
]
|
]
|
||||||
ctrls += overwrite_ctrls
|
ctrls += overwrite_ctrls
|
||||||
ctrls += [base_model, refiner_model] + lora_ctrls
|
ctrls += [base_model, refiner_model] + lora_ctrls
|
||||||
|
|||||||
Reference in New Issue
Block a user