mirror of
https://github.com/lllyasviel/Fooocus.git
synced 2026-08-16 13:13:16 +02:00
remove unused codes (#568)
This commit is contained in:
@@ -210,13 +210,9 @@ def preprocess(img):
|
|||||||
|
|
||||||
@torch.no_grad()
|
@torch.no_grad()
|
||||||
@torch.inference_mode()
|
@torch.inference_mode()
|
||||||
def patch_model(model, ip_tasks):
|
def patch_model(model, tasks):
|
||||||
new_model = model.clone()
|
new_model = model.clone()
|
||||||
|
|
||||||
tasks = []
|
|
||||||
for cn_img, cn_stop, cn_weight in ip_tasks:
|
|
||||||
tasks.append((cn_img, cn_stop, cn_weight, {}))
|
|
||||||
|
|
||||||
def make_attn_patcher(ip_index):
|
def make_attn_patcher(ip_index):
|
||||||
def patcher(n, context_attn2, value_attn2, extra_options):
|
def patcher(n, context_attn2, value_attn2, extra_options):
|
||||||
org_dtype = n.dtype
|
org_dtype = n.dtype
|
||||||
@@ -229,7 +225,7 @@ def patch_model(model, ip_tasks):
|
|||||||
v = [value_attn2]
|
v = [value_attn2]
|
||||||
b, _, _ = q.shape
|
b, _, _ = q.shape
|
||||||
|
|
||||||
for ip_conds, cn_stop, cn_weight, cache in tasks:
|
for ip_conds, cn_stop, cn_weight in tasks:
|
||||||
if current_step < cn_stop:
|
if current_step < cn_stop:
|
||||||
ip_k_c = ip_conds[ip_index * 2].to(device=ip_adapter.load_device, dtype=ip_adapter.dtype)
|
ip_k_c = ip_conds[ip_index * 2].to(device=ip_adapter.load_device, dtype=ip_adapter.dtype)
|
||||||
ip_v_c = ip_conds[ip_index * 2 + 1].to(device=ip_adapter.load_device, dtype=ip_adapter.dtype)
|
ip_v_c = ip_conds[ip_index * 2 + 1].to(device=ip_adapter.load_device, dtype=ip_adapter.dtype)
|
||||||
|
|||||||
+1
-1
@@ -1 +1 @@
|
|||||||
version = '2.1.4'
|
version = '2.1.5'
|
||||||
|
|||||||
Reference in New Issue
Block a user