Spaces:
Paused
Paused
lllyasviel
commited on
Commit
·
f00f46e
1
Parent(s):
7a907d3
i (#114)
Browse files- fooocus_version.py +1 -1
- modules/async_worker.py +4 -1
- modules/html.py +6 -0
- modules/patch.py +3 -1
- update_log.md +4 -0
- webui.py +5 -2
fooocus_version.py
CHANGED
@@ -1 +1 @@
|
|
1 |
-
version = '1.0.
|
|
|
1 |
+
version = '1.0.30'
|
modules/async_worker.py
CHANGED
@@ -14,6 +14,7 @@ def worker():
|
|
14 |
import random
|
15 |
import modules.default_pipeline as pipeline
|
16 |
import modules.path
|
|
|
17 |
|
18 |
from PIL import Image
|
19 |
from modules.sdxl_styles import apply_style, aspect_ratios
|
@@ -30,11 +31,13 @@ def worker():
|
|
30 |
|
31 |
def handler(task):
|
32 |
prompt, negative_prompt, style_selction, performance_selction, \
|
33 |
-
aspect_ratios_selction, image_number, image_seed, base_model_name, refiner_model_name, \
|
34 |
l1, w1, l2, w2, l3, w3, l4, w4, l5, w5 = task
|
35 |
|
36 |
loras = [(l1, w1), (l2, w2), (l3, w3), (l4, w4), (l5, w5)]
|
37 |
|
|
|
|
|
38 |
pipeline.refresh_base_model(base_model_name)
|
39 |
pipeline.refresh_refiner_model(refiner_model_name)
|
40 |
pipeline.refresh_loras(loras)
|
|
|
14 |
import random
|
15 |
import modules.default_pipeline as pipeline
|
16 |
import modules.path
|
17 |
+
import modules.patch
|
18 |
|
19 |
from PIL import Image
|
20 |
from modules.sdxl_styles import apply_style, aspect_ratios
|
|
|
31 |
|
32 |
def handler(task):
|
33 |
prompt, negative_prompt, style_selction, performance_selction, \
|
34 |
+
aspect_ratios_selction, image_number, image_seed, sharpness, base_model_name, refiner_model_name, \
|
35 |
l1, w1, l2, w2, l3, w3, l4, w4, l5, w5 = task
|
36 |
|
37 |
loras = [(l1, w1), (l2, w2), (l3, w3), (l4, w4), (l5, w5)]
|
38 |
|
39 |
+
modules.patch.sharpness = sharpness
|
40 |
+
|
41 |
pipeline.refresh_base_model(base_model_name)
|
42 |
pipeline.refresh_refiner_model(refiner_model_name)
|
43 |
pipeline.refresh_loras(loras)
|
modules/html.py
CHANGED
@@ -76,6 +76,12 @@ progress::after {
|
|
76 |
resize: none !important;
|
77 |
}
|
78 |
|
|
|
|
|
|
|
|
|
|
|
|
|
79 |
'''
|
80 |
progress_html = '''
|
81 |
<div class="loader-container">
|
|
|
76 |
resize: none !important;
|
77 |
}
|
78 |
|
79 |
+
.refresh_button{
|
80 |
+
border: none !important;
|
81 |
+
background: none !important;
|
82 |
+
font-size: none !important;
|
83 |
+
}
|
84 |
+
|
85 |
'''
|
86 |
progress_html = '''
|
87 |
<div class="loader-container">
|
modules/patch.py
CHANGED
@@ -7,6 +7,8 @@ from comfy.samplers import model_management, lcm, math
|
|
7 |
from comfy.ldm.modules.diffusionmodules.openaimodel import timestep_embedding, forward_timestep_embed
|
8 |
from modules.filters import gaussian_filter_2d
|
9 |
|
|
|
|
|
10 |
|
11 |
def sampling_function_patched(model_function, x, timestep, uncond, cond, cond_scale, cond_concat=None, model_options={},
|
12 |
seed=None):
|
@@ -346,7 +348,7 @@ def unet_forward_patched(self, x, timesteps=None, context=None, y=None, control=
|
|
346 |
x0 = self.out(h)
|
347 |
|
348 |
alpha = 1.0 - (timesteps / 999.0)[:, None, None, None].clone()
|
349 |
-
alpha *= 0.
|
350 |
degraded_x0 = gaussian_filter_2d(x0) * alpha + x0 * (1.0 - alpha)
|
351 |
|
352 |
x0 = x0 * uc_mask + degraded_x0 * (1.0 - uc_mask)
|
|
|
7 |
from comfy.ldm.modules.diffusionmodules.openaimodel import timestep_embedding, forward_timestep_embed
|
8 |
from modules.filters import gaussian_filter_2d
|
9 |
|
10 |
+
sharpness = 2.0
|
11 |
+
|
12 |
|
13 |
def sampling_function_patched(model_function, x, timestep, uncond, cond, cond_scale, cond_concat=None, model_options={},
|
14 |
seed=None):
|
|
|
348 |
x0 = self.out(h)
|
349 |
|
350 |
alpha = 1.0 - (timesteps / 999.0)[:, None, None, None].clone()
|
351 |
+
alpha *= 0.001 * sharpness
|
352 |
degraded_x0 = gaussian_filter_2d(x0) * alpha + x0 * (1.0 - alpha)
|
353 |
|
354 |
x0 = x0 * uc_mask + degraded_x0 * (1.0 - uc_mask)
|
update_log.md
CHANGED
@@ -1,5 +1,9 @@
|
|
1 |
### 1.0.29
|
2 |
|
|
|
|
|
|
|
|
|
3 |
* Fix overcook problem in 1.0.28
|
4 |
|
5 |
### 1.0.28
|
|
|
1 |
### 1.0.29
|
2 |
|
3 |
+
* Added "Advanced->Advanced->Advanced" block for future development.
|
4 |
+
|
5 |
+
### 1.0.29
|
6 |
+
|
7 |
* Fix overcook problem in 1.0.28
|
8 |
|
9 |
### 1.0.28
|
webui.py
CHANGED
@@ -75,7 +75,10 @@ with shared.gradio_root:
|
|
75 |
lora_model = gr.Dropdown(label=f'SDXL LoRA {i+1}', choices=['None'] + modules.path.lora_filenames, value=modules.path.default_lora_name if i == 0 else 'None')
|
76 |
lora_weight = gr.Slider(label='Weight', minimum=-2, maximum=2, step=0.01, value=modules.path.default_lora_weight)
|
77 |
lora_ctrls += [lora_model, lora_weight]
|
78 |
-
|
|
|
|
|
|
|
79 |
|
80 |
def model_refresh_clicked():
|
81 |
modules.path.update_all_model_names()
|
@@ -90,7 +93,7 @@ with shared.gradio_root:
|
|
90 |
advanced_checkbox.change(lambda x: gr.update(visible=x), advanced_checkbox, right_col)
|
91 |
ctrls = [
|
92 |
prompt, negative_prompt, style_selction,
|
93 |
-
performance_selction, aspect_ratios_selction, image_number, image_seed
|
94 |
]
|
95 |
ctrls += [base_model, refiner_model] + lora_ctrls
|
96 |
run_button.click(fn=generate_clicked, inputs=ctrls, outputs=[run_button, progress_html, progress_window, gallery])
|
|
|
75 |
lora_model = gr.Dropdown(label=f'SDXL LoRA {i+1}', choices=['None'] + modules.path.lora_filenames, value=modules.path.default_lora_name if i == 0 else 'None')
|
76 |
lora_weight = gr.Slider(label='Weight', minimum=-2, maximum=2, step=0.01, value=modules.path.default_lora_weight)
|
77 |
lora_ctrls += [lora_model, lora_weight]
|
78 |
+
with gr.Row():
|
79 |
+
model_refresh = gr.Button(label='Refresh', value='\U0001f504 Refresh All Files', variant='secondary', elem_classes='refresh_button')
|
80 |
+
with gr.Accordion(label='Advanced', open=False):
|
81 |
+
sharpness = gr.Slider(label='Image Sharpness', minimum=0.0, maximum=20.0, step=0.01, value=2.0)
|
82 |
|
83 |
def model_refresh_clicked():
|
84 |
modules.path.update_all_model_names()
|
|
|
93 |
advanced_checkbox.change(lambda x: gr.update(visible=x), advanced_checkbox, right_col)
|
94 |
ctrls = [
|
95 |
prompt, negative_prompt, style_selction,
|
96 |
+
performance_selction, aspect_ratios_selction, image_number, image_seed, sharpness
|
97 |
]
|
98 |
ctrls += [base_model, refiner_model] + lora_ctrls
|
99 |
run_button.click(fn=generate_clicked, inputs=ctrls, outputs=[run_button, progress_html, progress_window, gallery])
|