-
-
Notifications
You must be signed in to change notification settings - Fork 26
Fixed additional input rows. Added option for Schedule Type. #152
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
thebollo
wants to merge
1
commit into
mcmonkeyprojects:master
Choose a base branch
from
thebollo:Fixes_and_additions
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,7 +15,7 @@ | |
import os, numpy, threading | ||
from copy import copy | ||
from datetime import datetime | ||
from modules import images, shared, sd_models, sd_vae, sd_samplers, scripts, processing, ui_components | ||
from modules import images, shared, sd_models, sd_vae, sd_samplers, scripts, processing, ui_components, sd_schedulers | ||
from modules.processing import process_images, Processed | ||
from modules.shared import opts, state | ||
from PIL import Image | ||
|
@@ -154,6 +154,7 @@ def try_init(): | |
registerMode("Sigma TMin", GridSettingMode(dry=True, type="decimal", min=0, max=1, apply=apply_field("s_tmin"))) | ||
registerMode("Sigma TMax", GridSettingMode(dry=True, type="decimal", min=0, max=1, apply=apply_field("s_tmax"))) | ||
registerMode("Sigma Noise", GridSettingMode(dry=True, type="decimal", min=0, max=1, apply=apply_field("s_noise"))) | ||
registerMode("Schedule Type", GridSettingMode(dry=True, type="text", apply=apply_field("scheduler"), valid_list=lambda: [x.label for x in sd_schedulers.schedulers])) | ||
registerMode("Out Width", GridSettingMode(dry=True, type="integer", min=0, apply=apply_field("inf_grid_out_width"))) | ||
registerMode("Out Height", GridSettingMode(dry=True, type="integer", min=0, apply=apply_field("inf_grid_out_height"))) | ||
registerMode("Restore Faces", GridSettingMode(dry=True, type="text", apply=apply_restore_faces, valid_list=lambda: list(map(lambda m: m.name(), shared.face_restorers)) + ["true", "false"])) | ||
|
@@ -347,11 +348,11 @@ def show(self, is_img2img): | |
return True | ||
|
||
def ui(self, is_img2img): | ||
try_init() # Moved to the beginning to ensure modes are registered before UI is built | ||
core.list_image_files() | ||
try_init() | ||
gr.HTML(value=f"<br>Confused/new? View <a style=\"border-bottom: 1px #00ffff dotted;\" href=\"{INF_GRID_README}\" target=\"_blank\" rel=\"noopener noreferrer\">the README</a> for usage instructions.<br><br>") | ||
with gr.Row(): | ||
grid_file = gr.Dropdown(value="Create in UI",label="Select grid definition file", choices=["Create in UI"] + core.get_name_list()) | ||
grid_file = gr.Dropdown(value="Create in UI", label="Select grid definition file", choices=["Create in UI"] + core.get_name_list()) | ||
def refresh(): | ||
new_choices = ["Create in UI"] + core.get_name_list() | ||
grid_file.choices = new_choices | ||
|
@@ -427,7 +428,7 @@ def on_axis_change(mode_name, out_file): | |
group_obj = sets[group + 1][0] | ||
next_rows = sets[group + 1][1] | ||
def make_vis(prior, r1, r2, r3, r4): | ||
return gr.Group.update(visible=(prior+r1+r2+r3+r4).strip() != "") | ||
return gr.update(visible=(prior+r1+r2+r3+r4).strip() != "") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why exactly is this change needed? |
||
row_mode.change(fn=make_vis, inputs=[row_mode] + next_rows, outputs=[group_obj]) | ||
gr.HTML('<span style="opacity:0.5;">(More input rows will be automatically added after you select modes above.)</span>') | ||
grid_file.change( | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(A) it was already at the beginning, the move doesn't really make sense
(B) shouldn't leave change comments in code, make the change in code and leave notes on git