* Fix minor things from last big UI restyle
These two changes were applied to txt2img tab but not img2img tab:
Sample select changed from Radio to Dropdown,
Seed Input restricted to single line, which also removes the resize handlebar
Added a small CSS Workaround for a gradio bug in firefox: The Seed output box is a disabled number field, in chromium gradio will hide the up/down arrows but on firefox it leaves a weird grey square, the CSS rule included in this commit fixes that issue.
* remove full_width from where it doesn't belong
Co-authored-by: hlky <106811348+hlky@users.noreply.github.com>
The negative filename reported in #112 was caused by the old (now
replaced) listdir-based sequence number calculation, that incorrectly
subtracted 1 from the number of files already in the directory:
base_count = len([x for x in os.listdir(sample_path_i) if x.endswith(('.png', '.jpg'))]) - 1 # start at 0
The `- 1` was probably copied from the code for the base directory,
which had to subtract 1 to account for the `samples/` subdirectory (that
was before the listdir code started checking file extensions).
The get_next_sequence_number could never return negative numbers, since
it returns `result + 1`, meaning the sequence starts at 0 as intended.
Commit 82770bacae broke regular prompt
matrix, causing the following error:
Traceback (most recent call last):
File "/.../sd/miniconda3/envs/ldx/lib/python3.8/site-packages/gradio/routes.py", line 247, in run_predict
output = await app.blocks.process_api(
File "/.../sd/miniconda3/envs/ldx/lib/python3.8/site-packages/gradio/blocks.py", line 641, in process_api
predictions, duration = await self.call_function(fn_index, processed_input)
File "/.../sd/miniconda3/envs/ldx/lib/python3.8/site-packages/gradio/blocks.py", line 556, in call_function
prediction = await anyio.to_thread.run_sync(
File "/.../sd/miniconda3/envs/ldx/lib/python3.8/site-packages/anyio/to_thread.py", line 31, in run_sync
return await get_asynclib().run_sync_in_worker_thread(
File "/.../sd/miniconda3/envs/ldx/lib/python3.8/site-packages/anyio/_backends/_asyncio.py", line 937, in run_sync_in_worker_thread
return await future
File "/.../sd/miniconda3/envs/ldx/lib/python3.8/site-packages/anyio/_backends/_asyncio.py", line 867, in run
result = context.run(func, *args)
File "scripts/webui.py", line 933, in txt2img
output_images, seed, info, stats = process_images(
File "scripts/webui.py", line 841, in process_images
grid = image_grid(output_images, batch_size, force_n_rows=1 << ((len(prompt_matrix_parts)-1)//2), captions=prompt_matrix_parts)
File "scripts/webui.py", line 384, in image_grid
size = d.textbbox( (0,0), captions[i], font=fnt, stroke_width=2, align="center" )
IndexError: list index out of range
* Expose some useful Gradio server launch arguments to command line
* add --grid-format, --gradio-share args
* fixes, add --gradio-disable-queue
* space
This should behave much better, for example if (re)moving older files
from the output directories.
Also remove the increments (which never had any effect), and move the
grid_count calculation right before where it's used.
Max value for a 32bit unsigned int is 2**32 - 1, not 2**32 (and the
range of possible values returned by randint includes both of its
arguments).
Python's hash() function is not deterministic across different
invocations of the interpreter. This meant a given string seed would
produce different results after restarting the script. Use the passed
strings to seed a Random instance instead.