[FE] increase rate limt, moves strength variable out

This commit is contained in:
HappyZ 2023-05-31 15:29:31 -07:00
parent e98b7bc206
commit 54dc193f4e
2 changed files with 21 additions and 21 deletions

View File

@ -40,7 +40,7 @@ limiter = Limiter(
@app.route("/add_job", methods=["POST"])
@limiter.limit("1/second")
@limiter.limit("4/second")
def add_job():
req = request.get_json()
@ -90,7 +90,7 @@ def add_job():
@app.route("/cancel_job", methods=["POST"])
@limiter.limit("1/second")
@limiter.limit("4/second")
def cancel_job():
req = request.get_json()
if APIKEY not in req:
@ -131,7 +131,7 @@ def cancel_job():
@app.route("/get_jobs", methods=["POST"])
@limiter.limit("1/second")
@limiter.limit("4/second")
def get_jobs():
req = request.get_json()
if APIKEY not in req:
@ -168,7 +168,7 @@ def get_jobs():
@app.route("/random_jobs", methods=["GET"])
@limiter.limit("1/second")
@limiter.limit("4/second")
def random_jobs():
# define max number of jobs to fetch from db
job_count_limit = 20

View File

@ -90,7 +90,7 @@
data-zh_CN="非必填。形容这张图不长什么样。">Optional. Describe what's NOT the image.</div>
</div>
<div class="row">
<div class="col-md-3 mb-3">
<div class="col-md-2 mb-3">
<div class="input-group input-group-sm">
<label for="inputSeed" class="input-group-text" data-en_XX="Seed"
data-zh_CN="随机数">Seed</label>
@ -101,7 +101,7 @@
Leave it empty or set 0 to use a random seed
</div>
</div>
<div class="col-md-3 mb-3">
<div class="col-md-2 mb-3">
<div class="input-group input-group-sm">
<label for="guidanceScale" class="input-group-text" data-en_XX="Guidance"
data-zh_CN="指示强度">Guidance</label>
@ -114,6 +114,20 @@
20 = follow prompt, 7 = creative/artistic. Lower it if you see bad images.
</div>
</div>
<div class="col-md-2 mb-3">
<div class="input-group input-group-sm">
<label for="strength" class="input-group-text" data-en_XX="Strength"
data-zh_CN="改变程度">Strength</label>
<input type="number" class="form-control" id="inputStrength"
aria-describedby="inputStrengthHelp" placeholder="0.5" min="0"
max="1">
</div>
<div id="inputStrengthHelp" class="form-text"
data-en_XX="How different from the original image. 0 means the same, 1 means very different."
data-zh_CN="和原图有多么的不同。0指一样1指非常不一样。">How different from the
original image
</div>
</div>
<div class="col-md-2 mb-3">
<div class="input-group input-group-sm">
<label for="inputSteps" class="input-group-text" data-en_XX="Steps"
@ -180,20 +194,6 @@
data-en_XX="Upload image" data-zh_CN="上传一张图片">Upload
image</button>
</div>
<div class="row mb-3">
<div class="input-group input-group-sm">
<label for="strength" class="input-group-text" data-en_XX="Strength"
data-zh_CN="改变程度">Strength</label>
<input type="number" class="form-control" id="inputStrength"
aria-describedby="inputStrengthHelp" placeholder="0.5" min="0"
max="1">
</div>
<div id="inputStrengthHelp" class="form-text"
data-en_XX="How different from the original image. 0 means the same, 1 means very different."
data-zh_CN="和参照图有多么的不同。0指一样1指非常不一样。">How different from the
original image
</div>
</div>
<div class="row">
<button id="newImg2ImgJob" class="btn btn-primary mb-3"
data-en_XX="Let's Go with Image Below!" data-zh_CN="就用下面的图生成!">Let's
@ -818,7 +818,7 @@
var stepsVal = parseInt(getInputValue('#inputSteps', '50'));
var widthVal = parseInt(getInputValue('#inputWidth', '512'));
var heightVal = parseInt(getInputValue('#inputHeight', '512'));
if (promptVal === '') {
alert("Missing prompt!");
return;