mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
Expose img2img strength parameter in Web UI (#239)
* Expose img2img strength parameter in Web UI * Fix strength label id Co-authored-by: Mikhail Tishin <michail.tishin@fayrix.com> Co-authored-by: Kevin Gibbons https://github.com/bakkot
This commit is contained in:
parent
a547c33327
commit
b622819051
@ -65,6 +65,7 @@ class DreamServer(BaseHTTPRequestHandler):
|
|||||||
post_data = json.loads(self.rfile.read(content_length))
|
post_data = json.loads(self.rfile.read(content_length))
|
||||||
prompt = post_data['prompt']
|
prompt = post_data['prompt']
|
||||||
initimg = post_data['initimg']
|
initimg = post_data['initimg']
|
||||||
|
strength = float(post_data['strength'])
|
||||||
iterations = int(post_data['iterations'])
|
iterations = int(post_data['iterations'])
|
||||||
steps = int(post_data['steps'])
|
steps = int(post_data['steps'])
|
||||||
width = int(post_data['width'])
|
width = int(post_data['width'])
|
||||||
@ -174,6 +175,7 @@ class DreamServer(BaseHTTPRequestHandler):
|
|||||||
# Run img2img
|
# Run img2img
|
||||||
self.model.prompt2image(prompt,
|
self.model.prompt2image(prompt,
|
||||||
init_img = "./img2img-tmp.png",
|
init_img = "./img2img-tmp.png",
|
||||||
|
strength = strength,
|
||||||
iterations = iterations,
|
iterations = iterations,
|
||||||
cfg_scale = cfgscale,
|
cfg_scale = cfgscale,
|
||||||
seed = seed,
|
seed = seed,
|
||||||
|
@ -59,13 +59,14 @@
|
|||||||
<option value="832">832</option> <option value="896">896</option>
|
<option value="832">832</option> <option value="896">896</option>
|
||||||
<option value="960">960</option> <option value="1024">1024</option>
|
<option value="960">960</option> <option value="1024">1024</option>
|
||||||
</select>
|
</select>
|
||||||
<br>
|
|
||||||
<label title="Upload an image to use img2img" for="initimg">Img2Img Init:</label>
|
|
||||||
<input type="file" id="initimg" name="initimg" accept=".jpg, .jpeg, .png">
|
|
||||||
<label title="Set to -1 for random seed" for="seed">Seed:</label>
|
<label title="Set to -1 for random seed" for="seed">Seed:</label>
|
||||||
<input value="-1" type="number" id="seed" name="seed">
|
<input value="-1" type="number" id="seed" name="seed">
|
||||||
<button type="button" id="reset-seed">↺</button>
|
<button type="button" id="reset-seed">↺</button>
|
||||||
<span>•</span>
|
<br>
|
||||||
|
<label for="strength">Img2Img Strength:</label>
|
||||||
|
<input value="0.75" type="number" id="strength" name="strength" step="0.01" min="0" max="1">
|
||||||
|
<label title="Upload an image to use img2img" for="initimg">Init:</label>
|
||||||
|
<input type="file" id="initimg" name="initimg" accept=".jpg, .jpeg, .png">
|
||||||
<button type="button" id="reset-all">Reset to Defaults</button>
|
<button type="button" id="reset-all">Reset to Defaults</button>
|
||||||
<br>
|
<br>
|
||||||
<label for="progress_images">Display in-progress images (slows down generation):</label>
|
<label for="progress_images">Display in-progress images (slows down generation):</label>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user