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
20f8ec87
Commit
20f8ec87
authored
Oct 06, 2022
by
AUTOMATIC
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove type annotations in new code because presumably they don't work in 3.7
parent
f8e41a96
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
modules/prompt_parser.py
modules/prompt_parser.py
+3
-3
No files found.
modules/prompt_parser.py
View file @
20f8ec87
...
...
@@ -175,14 +175,14 @@ def get_multicond_prompt_list(prompts):
class
ComposableScheduledPromptConditioning
:
def
__init__
(
self
,
schedules
,
weight
=
1.0
):
self
.
schedules
:
list
[
ScheduledPromptConditioning
]
=
schedules
self
.
schedules
=
schedules
# : list[ScheduledPromptConditioning]
self
.
weight
:
float
=
weight
class
MulticondLearnedConditioning
:
def
__init__
(
self
,
shape
,
batch
):
self
.
shape
:
tuple
=
shape
# the shape field is needed to send this object to DDIM/PLMS
self
.
batch
:
list
[
list
[
ComposableScheduledPromptConditioning
]]
=
batch
self
.
batch
=
batch
# : list[list[ComposableScheduledPromptConditioning]]
def
get_multicond_learned_conditioning
(
model
,
prompts
,
steps
)
->
MulticondLearnedConditioning
:
...
...
@@ -203,7 +203,7 @@ def get_multicond_learned_conditioning(model, prompts, steps) -> MulticondLearne
return
MulticondLearnedConditioning
(
shape
=
(
len
(
prompts
),),
batch
=
res
)
def
reconstruct_cond_batch
(
c
:
list
[
list
[
ScheduledPromptConditioning
]],
current_step
):
def
reconstruct_cond_batch
(
c
,
current_step
):
# c: list[list[ScheduledPromptConditioning]]
param
=
c
[
0
][
0
]
.
cond
res
=
torch
.
zeros
((
len
(
c
),)
+
param
.
shape
,
device
=
param
.
device
,
dtype
=
param
.
dtype
)
for
i
,
cond_schedule
in
enumerate
(
c
):
...
...
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