Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feeding display_image_cleaner() path not working #18

Open
WASasquatch opened this issue Sep 1, 2022 · 1 comment
Open

Feeding display_image_cleaner() path not working #18

WASasquatch opened this issue Sep 1, 2022 · 1 comment

Comments

@WASasquatch
Copy link

I'm not sure what's going on. I can't get the image cleaner to work within my script. I've fed it an absolute path, a pathlib path from cwd, a os cwd path from changing dir, and no matter what, I get: TypeError: expected str, bytes or os.PathLike object, not NoneType

Full stack on the error:

---------------------------------------------------------------------------

TypeError                                 Traceback (most recent call last)

[<ipython-input-8-88fd12b35813>](https://localhost:8080/#) in <module>
    553     print(imgdir, defaultprint=True)
    554     print("Image Management Browser:")
--> 555     display_image_cleaner(imgdir)
    556 
    557 

4 frames

[/usr/local/lib/python3.7/dist-packages/jmd_imagescraper/imagecleaner.py](https://localhost:8080/#) in display_image_cleaner(path)
    187     icln_create_widgets(ICLN_BATCH_SZ)
    188     _,_,_,_,_,ddlFolder,_ = icln_pager.children
--> 189     icln_render_batch(ddlFolder.value, 0)

[/usr/local/lib/python3.7/dist-packages/jmd_imagescraper/imagecleaner.py](https://localhost:8080/#) in icln_render_batch(folder, batch, force_reload)
    131 
    132   if(folder == "/"): folder = ""
--> 133   path = icln_base_path/folder
    134 
    135   if((icln_folder != folder) or (force_reload)):

[/usr/lib/python3.7/pathlib.py](https://localhost:8080/#) in __truediv__(self, key)
    923 
    924     def __truediv__(self, key):
--> 925         return self._make_child((key,))
    926 
    927     def __rtruediv__(self, key):

[/usr/lib/python3.7/pathlib.py](https://localhost:8080/#) in _make_child(self, args)
    702 
    703     def _make_child(self, args):
--> 704         drv, root, parts = self._parse_args(args)
    705         drv, root, parts = self._flavour.join_parsed_parts(
    706             self._drv, self._root, self._parts, drv, root, parts)

[/usr/lib/python3.7/pathlib.py](https://localhost:8080/#) in _parse_args(cls, args)
    656                 parts += a._parts
    657             else:
--> 658                 a = os.fspath(a)
    659                 if isinstance(a, str):
    660                     # Force-cast str subclasses to str (issue #21127)

TypeError: expected str, bytes or os.PathLike object, not NoneType

Output:

/content/drive/MyDrive/AI/Stable_Diffusion/images_out/time_to_stabilize
Image Management Browser:

As you can see, the path is correct, and leads to the images folder, but for some reason it always thinks the path isn't a string or bytes.

@WASasquatch
Copy link
Author

There seems to be some sort of conflict, nothing works, not even `display_image_cleaner('./') will work, same error. Something in my program (https://rebrand.ly/easy-diffusion) is conflicting with paths, but no clue what. It works fine in the colab example for the scraper.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant