-
-
Notifications
You must be signed in to change notification settings - Fork 307
[Installer] Dynamic theme preview loading, Iframe previews, and other small improvements #1036
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
mrblomblo
wants to merge
9
commits into
mcmonkeyprojects:master
Choose a base branch
from
mrblomblo:installer-improvements
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 7 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
f17d2fa
Dynamic theme preview loading, Iframe previews, and other improvements
mrblomblo 3614d74
oops
mrblomblo e37f176
Fixes
mrblomblo 6619a86
Fix theme previews not being applied
mrblomblo e803b23
Use ViewData instead of GET for overriding theme in _Layout
mrblomblo 3229b3a
Add core parameters to preview
mrblomblo 484a073
Merge branch 'master' into pr/1036
mcmonkey4eva 54a5f85
Fixes
mrblomblo f2e56a7
Add noise image bg to core params
mrblomblo 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
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
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 |
---|---|---|
@@ -0,0 +1,55 @@ | ||
@page | ||
@{ | ||
var themeOverride = Request.Query["theme"].ToString(); | ||
ViewData["theme_override"] = themeOverride; | ||
} | ||
@section Header { | ||
<link rel="stylesheet" href="css/[email protected]" /> | ||
<link rel="stylesheet" href="css/[email protected]" /> | ||
} | ||
<script> | ||
function reuseLastParamVal() { | ||
return null; // Prevent error in browser console | ||
} | ||
function generateInputs() { | ||
const container = getRequiredElementById('input_group_content_coreparameters'); | ||
container.innerHTML = | ||
makeNumberInput(null, 'input_images', 'images', 'Images', '', 1, 1, 10000, 1, 'big', false, true) | ||
+ makeNumberInput(null, 'input_seed', 'seed', 'Seed', '', -1, -1, 9223372036854776000, 1, 'seed', false, true) | ||
+ makeSliderInput(null, 'input_steps', 'steps', 'Steps', '', 20, 0, 500, 0, 100, 1, false, false, true) | ||
+ makeSliderInput(null, 'input_cfgscale', 'cfgscale', 'CFG Scale', '', 7, 0, 100, 0, 20, 0.5, false, false, true); | ||
autoNumberWidth(document.getElementById('input_images')); | ||
enableSliderAbove(document.getElementById('input_steps')); | ||
enableSliderAbove(document.getElementById('input_cfgscale')); | ||
} | ||
document.addEventListener('DOMContentLoaded', function() { | ||
makeGenericPopover('input_images', 'Images', 'Integer', 'How many images to generate at once.', ["1", "4"]) | ||
makeGenericPopover('input_seed', 'Seed', 'Integer', 'Image seed.\n-1 = random.\nDifferent seeds produce different results for the same prompt.', ["1", "2", "...", "10"]) | ||
makeGenericPopover('input_steps', 'Steps', 'Integer', 'Diffusion works by running a model repeatedly to slowly build and then refine an image.\nThis parameter is how many times to run the model.\nMore steps = better quality, but more time.\n20 is a good baseline for speed, 40 is good for maximizing quality.\nSome models, such as Turbo models, are intended for low step counts like 4 or 8.\nYou can go much higher, but it quickly becomes pointless above 70 or so.\nNote that steps is a core parameter used for defining diffusion schedules and other advanced internals,\nand merely running the model over top of an existing image is not the same as increasing the steps.\nNote that the number of steps actually ran can be influenced by other parameters such as Init Image Creativity when applied.', ["10", "15", "20", "30", "40"]) | ||
makeGenericPopover('input_cfgscale', 'CFG Scale', 'Decimal', 'How strongly to scale prompt input.\nHigher CFG scales tend to produce more contrast, and lower CFG scales produce less contrast.\nToo-high values can cause corrupted/burnt images, too-low can cause nonsensical images.\n7 is a good baseline. Normal usages vary between 4 and 9.\nSome model types, such as Flux, Hunyuan Video, or any Turbo model, expect CFG to be set to 1.', ["5", "6", "7", "8", "9"]) | ||
generateInputs(); | ||
}); | ||
</script> | ||
<div class="theme_preview-content"> | ||
<div class="theme_preview-item" id="theme_preview_coreparameters"> | ||
<div class="input-group input-group-open" id="auto-group-coreparameters"> | ||
<div class="input-group-content" id="input_group_content_coreparameters"></div> | ||
</div> | ||
</div> | ||
|
||
<hr> | ||
|
||
<div class="theme_preview-item"> | ||
<div class="alt-prompt-buttons-wrapper"> | ||
<button class="alt-prompt-buttons alt-prompt-generate-button basic-button translate" id="alt_generate_button">Generate</button> | ||
<button class="alt-prompt-buttons alt-prompt-center-button basic-button" id="alt_center_button">⮟</button> | ||
<button class="alt-prompt-buttons interrupt-button interrupt-button-none alt-interrupt" id="alt_interrupt_button">×</button> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
@section Scripts { | ||
<script src="js/genpage/helpers/[email protected]"></script> | ||
} |
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
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 |
---|---|---|
@@ -0,0 +1,33 @@ | ||
html, body { | ||
height: 100% | ||
mrblomblo marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
} | ||
#alt_generate_button { | ||
margin-left: 0 !important; | ||
} | ||
.version-display { | ||
display: none; | ||
visibility: hidden; | ||
} | ||
.theme_preview-content { | ||
height: 100%; | ||
align-content: center; | ||
margin-top: -0.25rem; | ||
} | ||
.theme_preview-item { | ||
display: flex; | ||
justify-content: center; | ||
} | ||
.theme_preview-item:not(:last-child) { | ||
margin-bottom: 0.5em; | ||
} | ||
.theme_preview-item .theme_preview-text { | ||
font-size: 1.25rem; | ||
margin-bottom: 0; | ||
} | ||
.input-group.input-group-open { | ||
display: block; | ||
margin: 0 0.5rem; | ||
} | ||
.input-group.input-group-open .input-group-content { | ||
margin-top: 0; | ||
} |
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.
Uh oh!
There was an error while loading. Please reload this page.