toshiaki1729 / dataset-tag-editor-standalone

WebUI to edit dataset captions for txt2img models
MIT License
134 stars 15 forks source link

Error when selecting an image added to filter #11

Closed tonirv68 closed 1 year ago

tonirv68 commented 1 year ago

Sorry if this issue is already under control, but I did not see any comment about it:

_I think that there is an error in ui module tab_filter_by_selection that produces the gradio blocks error: _Traceback (most recent call last): File "C:\Users\toni\AppData\Local\Programs\Python\Python310\lib\site-packages\gradio\routes.py", line 393, in run_predict output = await app.get_blocks().process_api( File "C:\Users\toni\AppData\Local\Programs\Python\Python310\lib\site-packages\gradio\blocks.py", line 1067, in process_api inputs = self.preprocess_data(fn_index, inputs, state) File "C:\Users\toni\AppData\Local\Programs\Python\Python310\lib\site-packages\gradio\blocks.py", line 956, in preprocess_data processed_input.append(block.preprocess(inputs[i])) File "C:\Users\toni\AppData\Local\Programs\Python\Python310\lib\site-packages\gradio\components.py", line 567, in preprocess return self._round_to_precision(x, self.precision) File "C:\Users\toni\AppData\Local\Programs\Python\Python310\lib\site-packages\gradio\components.py", line 529, in _round_toprecision return float(num) TypeError: float() argument must be a string or a real number, not 'list'"

In the row 80, theres a code that appeas like this


        self.btn_hidden_set_selection_index.click(
            fn=selection_index_changed,
            _js="(x) => [gl_filter_images_selected_index()]",
            inputs=[self.nb_hidden_selection_image_index],
            outputs=[self.txt_selection, self.nb_hidden_selection_image_index],
        )

And I think that the _js line should be:

_js="(x) => gl_filter_images_selected_index()", But please don´t get this as a solution I am not an expert in gradio nor python, so maybe I am wrong.

I only tested it in my local installation and worked

tonirv68 commented 1 year ago

Sorry, I have noticed that this solution was provided also here by alexsokolov69:

(https://github.com/toshiaki1729/stable-diffusion-webui-dataset-tag-editor/issues/69)

toshiaki1729 commented 1 year ago

sorry for too late but may be fixed in https://github.com/toshiaki1729/dataset-tag-editor-standalone/commit/801ebb5dc7329097a6b3c5de10beff478fb445d6