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
03a80f19
Commit
03a80f19
authored
Mar 13, 2023
by
Vladimir Mandic
Committed by
GitHub
Mar 13, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add pbar to unipc
parent
dfeee786
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
3 deletions
+4
-3
modules/models/diffusion/uni_pc/sampler.py
modules/models/diffusion/uni_pc/sampler.py
+1
-1
modules/models/diffusion/uni_pc/uni_pc.py
modules/models/diffusion/uni_pc/uni_pc.py
+3
-2
No files found.
modules/models/diffusion/uni_pc/sampler.py
View file @
03a80f19
...
...
@@ -71,7 +71,7 @@ class UniPCSampler(object):
# sampling
C
,
H
,
W
=
shape
size
=
(
batch_size
,
C
,
H
,
W
)
print
(
f
'Data shape for UniPC sampling is {size}'
)
#
print(f'Data shape for UniPC sampling is {size}')
device
=
self
.
model
.
betas
.
device
if
x_T
is
None
:
...
...
modules/models/diffusion/uni_pc/uni_pc.py
View file @
03a80f19
import
torch
import
torch.nn.functional
as
F
import
math
from
tqdm.auto
import
trange
class
NoiseScheduleVP
:
...
...
@@ -750,7 +751,7 @@ class UniPC:
if
method
==
'multistep'
:
assert
steps
>=
order
,
"UniPC order must be < sampling steps"
timesteps
=
self
.
get_time_steps
(
skip_type
=
skip_type
,
t_T
=
t_T
,
t_0
=
t_0
,
N
=
steps
,
device
=
device
)
print
(
f
"Running UniPC Sampling with {timesteps.shape[0]} timesteps, order {order}"
)
#
print(f"Running UniPC Sampling with {timesteps.shape[0]} timesteps, order {order}")
assert
timesteps
.
shape
[
0
]
-
1
==
steps
with
torch
.
no_grad
():
vec_t
=
timesteps
[
0
]
.
expand
((
x
.
shape
[
0
]))
...
...
@@ -766,7 +767,7 @@ class UniPC:
self
.
after_update
(
x
,
model_x
)
model_prev_list
.
append
(
model_x
)
t_prev_list
.
append
(
vec_t
)
for
step
in
range
(
order
,
steps
+
1
):
for
step
in
t
range
(
order
,
steps
+
1
):
vec_t
=
timesteps
[
step
]
.
expand
(
x
.
shape
[
0
])
if
lower_order_final
:
step_order
=
min
(
order
,
steps
+
1
-
step
)
...
...
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