mirror of
https://github.com/lllyasviel/Fooocus.git
synced 2026-08-16 13:13:16 +02:00
2.1.840
* Fix some potential frozen after model mismatch * Fix crash when cfg=1 when using anime preset * Added some guidelines for troubleshoot the "CUDA kernel errors asynchronously" problem
This commit is contained in:
@@ -801,12 +801,12 @@ def worker():
|
||||
task = async_tasks.pop(0)
|
||||
try:
|
||||
handler(task)
|
||||
except:
|
||||
traceback.print_exc()
|
||||
finally:
|
||||
build_image_wall(task)
|
||||
task.yields.append(['finish', task.results])
|
||||
pipeline.prepare_text_encoder(async_call=True)
|
||||
except:
|
||||
traceback.print_exc()
|
||||
task.yields.append(['finish', task.results])
|
||||
pass
|
||||
|
||||
|
||||
|
||||
+9
-5
@@ -214,16 +214,20 @@ def compute_cfg(uncond, cond, cfg_scale, t):
|
||||
|
||||
|
||||
def patched_sampling_function(model, x, timestep, uncond, cond, cond_scale, model_options=None, seed=None):
|
||||
if math.isclose(cond_scale, 1.0):
|
||||
return calc_cond_uncond_batch(model, cond, None, x, timestep, model_options)[0]
|
||||
|
||||
global eps_record
|
||||
|
||||
if math.isclose(cond_scale, 1.0):
|
||||
final_x0 = calc_cond_uncond_batch(model, cond, None, x, timestep, model_options)[0]
|
||||
|
||||
if eps_record is not None:
|
||||
eps_record = ((x - final_x0) / timestep).cpu()
|
||||
|
||||
return final_x0
|
||||
|
||||
positive_x0, negative_x0 = calc_cond_uncond_batch(model, cond, uncond, x, timestep, model_options)
|
||||
|
||||
positive_eps = x - positive_x0
|
||||
negative_eps = x - negative_x0
|
||||
sigma = timestep
|
||||
|
||||
alpha = 0.001 * sharpness * global_diffusion_progress
|
||||
|
||||
@@ -234,7 +238,7 @@ def patched_sampling_function(model, x, timestep, uncond, cond, cond_scale, mode
|
||||
cfg_scale=cond_scale, t=global_diffusion_progress)
|
||||
|
||||
if eps_record is not None:
|
||||
eps_record = (final_eps / sigma).cpu()
|
||||
eps_record = (final_eps / timestep).cpu()
|
||||
|
||||
return x - final_eps
|
||||
|
||||
|
||||
Reference in New Issue
Block a user