Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
S
Stable Diffusion Webui
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
novelai-storage
Stable Diffusion Webui
Commits
87cd07b3
Commit
87cd07b3
authored
Dec 02, 2023
by
Nuullll
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix fp64
parent
7499148a
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
3 deletions
+3
-3
modules/sd_samplers_timesteps_impl.py
modules/sd_samplers_timesteps_impl.py
+2
-2
modules/xpu_specific.py
modules/xpu_specific.py
+1
-1
No files found.
modules/sd_samplers_timesteps_impl.py
View file @
87cd07b3
...
...
@@ -11,7 +11,7 @@ from modules.models.diffusion.uni_pc import uni_pc
def
ddim
(
model
,
x
,
timesteps
,
extra_args
=
None
,
callback
=
None
,
disable
=
None
,
eta
=
0.0
):
alphas_cumprod
=
model
.
inner_model
.
inner_model
.
alphas_cumprod
alphas
=
alphas_cumprod
[
timesteps
]
alphas_prev
=
alphas_cumprod
[
torch
.
nn
.
functional
.
pad
(
timesteps
[:
-
1
],
pad
=
(
1
,
0
))]
.
to
(
torch
.
float64
if
x
.
device
.
type
!=
'mps'
else
torch
.
float32
)
alphas_prev
=
alphas_cumprod
[
torch
.
nn
.
functional
.
pad
(
timesteps
[:
-
1
],
pad
=
(
1
,
0
))]
.
to
(
torch
.
float64
if
x
.
device
.
type
!=
'mps'
and
x
.
device
.
type
!=
'xpu'
else
torch
.
float32
)
sqrt_one_minus_alphas
=
torch
.
sqrt
(
1
-
alphas
)
sigmas
=
eta
*
np
.
sqrt
((
1
-
alphas_prev
.
cpu
()
.
numpy
())
/
(
1
-
alphas
.
cpu
())
*
(
1
-
alphas
.
cpu
()
/
alphas_prev
.
cpu
()
.
numpy
()))
...
...
@@ -43,7 +43,7 @@ def ddim(model, x, timesteps, extra_args=None, callback=None, disable=None, eta=
def
plms
(
model
,
x
,
timesteps
,
extra_args
=
None
,
callback
=
None
,
disable
=
None
):
alphas_cumprod
=
model
.
inner_model
.
inner_model
.
alphas_cumprod
alphas
=
alphas_cumprod
[
timesteps
]
alphas_prev
=
alphas_cumprod
[
torch
.
nn
.
functional
.
pad
(
timesteps
[:
-
1
],
pad
=
(
1
,
0
))]
.
to
(
torch
.
float64
if
x
.
device
.
type
!=
'mps'
else
torch
.
float32
)
alphas_prev
=
alphas_cumprod
[
torch
.
nn
.
functional
.
pad
(
timesteps
[:
-
1
],
pad
=
(
1
,
0
))]
.
to
(
torch
.
float64
if
x
.
device
.
type
!=
'mps'
and
x
.
device
.
type
!=
'xpu'
else
torch
.
float32
)
sqrt_one_minus_alphas
=
torch
.
sqrt
(
1
-
alphas
)
extra_args
=
{}
if
extra_args
is
None
else
extra_args
...
...
modules/xpu_specific.py
View file @
87cd07b3
...
...
@@ -4,7 +4,7 @@ from modules.sd_hijack_utils import CondFunc
has_ipex
=
False
try
:
import
torch
import
intel_extension_for_pytorch
as
ipex
import
intel_extension_for_pytorch
as
ipex
# noqa: F401
has_ipex
=
True
except
Exception
:
pass
...
...
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