Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
chenpangpang
ComfyUI
Commits
877a8f7a
Commit
877a8f7a
authored
Feb 22, 2024
by
comfyanonymous
Browse files
Merge branch 'patch-1' of
https://github.com/feffy380/ComfyUI
parents
f81dbe26
820807c8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
1 deletion
+1
-1
comfy_extras/nodes_perpneg.py
comfy_extras/nodes_perpneg.py
+1
-1
No files found.
comfy_extras/nodes_perpneg.py
View file @
877a8f7a
...
@@ -35,7 +35,7 @@ class PerpNeg:
...
@@ -35,7 +35,7 @@ class PerpNeg:
pos
=
noise_pred_pos
-
noise_pred_nocond
pos
=
noise_pred_pos
-
noise_pred_nocond
neg
=
noise_pred_neg
-
noise_pred_nocond
neg
=
noise_pred_neg
-
noise_pred_nocond
perp
=
((
torch
.
mul
(
pos
,
neg
).
sum
())
/
(
torch
.
norm
(
neg
)
**
2
))
*
neg
perp
=
neg
-
((
torch
.
mul
(
neg
,
pos
).
sum
())
/
(
torch
.
norm
(
pos
)
**
2
))
*
pos
perp_neg
=
perp
*
neg_scale
perp_neg
=
perp
*
neg_scale
cfg_result
=
noise_pred_nocond
+
cond_scale
*
(
pos
-
perp_neg
)
cfg_result
=
noise_pred_nocond
+
cond_scale
*
(
pos
-
perp_neg
)
cfg_result
=
x
-
cfg_result
cfg_result
=
x
-
cfg_result
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment