mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
working, but there is a bug in underlying txt2png() call that is preventing upscaled images from being returned
This commit is contained in:
parent
e2ae6d288d
commit
18899be4ae
@ -46,6 +46,9 @@ class DreamServer(BaseHTTPRequestHandler):
|
|||||||
height = int(post_data['height'])
|
height = int(post_data['height'])
|
||||||
cfgscale = float(post_data['cfgscale'])
|
cfgscale = float(post_data['cfgscale'])
|
||||||
gfpgan_strength = float(post_data['gfpgan_strength'])
|
gfpgan_strength = float(post_data['gfpgan_strength'])
|
||||||
|
upscale_level = post_data['upscale_level']
|
||||||
|
upscale_strength = post_data['upscale_strength']
|
||||||
|
upscale = [int(upscale_level),float(upscale_strength)] if upscale_level != '' else None
|
||||||
seed = None if int(post_data['seed']) == -1 else int(post_data['seed'])
|
seed = None if int(post_data['seed']) == -1 else int(post_data['seed'])
|
||||||
|
|
||||||
print(f"Request to generate with prompt: {prompt}")
|
print(f"Request to generate with prompt: {prompt}")
|
||||||
@ -60,7 +63,9 @@ class DreamServer(BaseHTTPRequestHandler):
|
|||||||
height = height,
|
height = height,
|
||||||
seed = seed,
|
seed = seed,
|
||||||
steps = steps,
|
steps = steps,
|
||||||
gfpgan_strength = gfpgan_strength)
|
gfpgan_strength = gfpgan_strength,
|
||||||
|
upscale = upscale
|
||||||
|
)
|
||||||
else:
|
else:
|
||||||
# Decode initimg as base64 to temp file
|
# Decode initimg as base64 to temp file
|
||||||
with open("./img2img-tmp.png", "wb") as f:
|
with open("./img2img-tmp.png", "wb") as f:
|
||||||
@ -74,7 +79,9 @@ class DreamServer(BaseHTTPRequestHandler):
|
|||||||
cfg_scale = cfgscale,
|
cfg_scale = cfgscale,
|
||||||
seed = seed,
|
seed = seed,
|
||||||
gfpgan_strength=gfpgan_strength,
|
gfpgan_strength=gfpgan_strength,
|
||||||
steps = steps)
|
upscale = upscale,
|
||||||
|
steps = steps
|
||||||
|
)
|
||||||
# Remove the temp file
|
# Remove the temp file
|
||||||
os.remove("./img2img-tmp.png")
|
os.remove("./img2img-tmp.png")
|
||||||
|
|
||||||
|
@ -32,6 +32,9 @@ fieldset {
|
|||||||
padding: 5px 10px 5px 10px;
|
padding: 5px 10px 5px 10px;
|
||||||
border: 1px solid black;
|
border: 1px solid black;
|
||||||
}
|
}
|
||||||
|
#reset-all {
|
||||||
|
background-color: pink;
|
||||||
|
}
|
||||||
#results {
|
#results {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
max-width: 1000px;
|
max-width: 1000px;
|
||||||
@ -48,7 +51,7 @@ img {
|
|||||||
line-height:2em;
|
line-height:2em;
|
||||||
}
|
}
|
||||||
input[type="number"] {
|
input[type="number"] {
|
||||||
width: 30px;
|
width: 60px;
|
||||||
}
|
}
|
||||||
#seed {
|
#seed {
|
||||||
width: 150px;
|
width: 150px;
|
||||||
|
@ -68,14 +68,14 @@
|
|||||||
<p><em>The options below require the GFPGAN and ESRGAN packages to be installed</em></p>
|
<p><em>The options below require the GFPGAN and ESRGAN packages to be installed</em></p>
|
||||||
<label title="Strength of the gfpgan (face fixing) algorithm." for="gfpgan_strength">GPFGAN Strength:</label>
|
<label title="Strength of the gfpgan (face fixing) algorithm." for="gfpgan_strength">GPFGAN Strength:</label>
|
||||||
<input value="0.8" min="0" max="1" type="number" id="gfpgan_strength" name="gfpgan_strength" step="0.05">
|
<input value="0.8" min="0" max="1" type="number" id="gfpgan_strength" name="gfpgan_strength" step="0.05">
|
||||||
<label title="Upscaling to perform using ESRGAN." for="upscaling">Upscaling Level</label>
|
<label title="Upscaling to perform using ESRGAN." for="upscale_level">Upscaling Level</label>
|
||||||
<select id="upscaling" name="upscaling" value="">
|
<select id="upscale_level" name="upscale_level" value="">
|
||||||
<option value=""></option>
|
<option value=""></option>
|
||||||
<option value="2">2x</option>
|
<option value="2">2x</option>
|
||||||
<option value="4">4x</option>
|
<option value="4">4x</option>
|
||||||
</select>
|
</select>
|
||||||
<label title="Strength of the esrgan (upscaling) algorithm." for="esrgan_strength">ESRGAN Strength:</label>
|
<label title="Strength of the esrgan (upscaling) algorithm." for="upscale_strength">Upscale Strength:</label>
|
||||||
<input value="0.75" min="0" max="1" type="number" id="esrgan_strength" name="esrgan_strength" step="0.05">
|
<input value="0.75" min="0" max="1" type="number" id="upscale_strength" name="upscale_strength" step="0.05">
|
||||||
</fieldset>
|
</fieldset>
|
||||||
</form>
|
</form>
|
||||||
<div id="about">For news and support for this web service, visit our <a href="http://github.com/lstein/stable-diffusion">GitHub site</a></div>
|
<div id="about">For news and support for this web service, visit our <a href="http://github.com/lstein/stable-diffusion">GitHub site</a></div>
|
||||||
|
@ -55,7 +55,7 @@ function loadFields(form) {
|
|||||||
|
|
||||||
function clearFields(form) {
|
function clearFields(form) {
|
||||||
localStorage.clear()
|
localStorage.clear()
|
||||||
form.reset()
|
location.reload()
|
||||||
}
|
}
|
||||||
|
|
||||||
async function generateSubmit(form) {
|
async function generateSubmit(form) {
|
||||||
|
Loading…
Reference in New Issue
Block a user