Giter Club home page Giter Club logo

Comments (6)

Automaticism avatar Automaticism commented on May 27, 2024

Should be solved by commit that fixed #12

from promptvision.

don1138 avatar don1138 commented on May 27, 2024

Unfortunately, this is still an issue.

I can see a flash of the thumbnail view with image, but then it gets overlaid with the debugger window.

Error message

Thumbnail Section Output

OSError

OSError: cannot write mode RGBA as JPEG
Traceback (most recent call last)

    File "/opt/homebrew/lib/python3.11/site-packages/PIL/JpegImagePlugin.py", line 643, in _save

    rawmode = RAWMODE[im.mode]
              ^^^^^^^^^^^^^^^^

    The above exception was the direct cause of the following exception:
    File "/opt/homebrew/lib/python3.11/site-packages/flask/app.py", line 2551, in __call__

    return self.wsgi_app(environ, start_response)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

    File "/opt/homebrew/lib/python3.11/site-packages/flask/app.py", line 2531, in wsgi_app

    response = self.handle_exception(e)
               ^^^^^^^^^^^^^^^^^^^^^^^^

    File "/opt/homebrew/lib/python3.11/site-packages/flask/app.py", line 2528, in wsgi_app

    response = self.full_dispatch_request()
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^

    File "/opt/homebrew/lib/python3.11/site-packages/flask/app.py", line 1825, in full_dispatch_request

    rv = self.handle_user_exception(e)
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

    File "/opt/homebrew/lib/python3.11/site-packages/flask/app.py", line 1823, in full_dispatch_request

    rv = self.dispatch_request()
         ^^^^^^^^^^^^^^^^^^^^^^^

    File "/opt/homebrew/lib/python3.11/site-packages/flask/app.py", line 1799, in dispatch_request

    return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

    File "/Users/don/Developer/Promptvision/gallery.py", line 392, in thumbnails

    thumbnails = fetch_thumbnails(limit=limit, offset=offset, imgsrc=imgsrc)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

    File "/Users/don/Developer/Promptvision/gallery.py", line 250, in fetch_thumbnails

    thumbnail = (get_thumbnail_from_image(image))
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

    File "/Users/don/Developer/Promptvision/gallery.py", line 215, in get_thumbnail_from_image

    img.save(thumbnail_path, format='JPEG', quality=85)
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

    File "/opt/homebrew/lib/python3.11/site-packages/PIL/Image.py", line 2431, in save

    save_handler(self, fp, filename)
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

    File "/opt/homebrew/lib/python3.11/site-packages/PIL/JpegImagePlugin.py", line 646, in _save

    raise OSError(msg) from e
    ^^^^^^^^^^^^^^^^^^^^^^^^^

    OSError: cannot write mode RGBA as JPEG

This is the Copy/Paste friendly version of the traceback.
Traceback (most recent call last):
  File "/opt/homebrew/lib/python3.11/site-packages/PIL/JpegImagePlugin.py", line 643, in _save
    rawmode = RAWMODE[im.mode]
              ^^^^^^^^^^^^^^^^
KeyError: 'RGBA'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/opt/homebrew/lib/python3.11/site-packages/flask/app.py", line 2551, in __call__
    return self.wsgi_app(environ, start_response)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/lib/python3.11/site-packages/flask/app.py", line 2531, in wsgi_app
    response = self.handle_exception(e)
               ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/lib/python3.11/site-packages/flask/app.py", line 2528, in wsgi_app
    response = self.full_dispatch_request()
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/lib/python3.11/site-packages/flask/app.py", line 1825, in full_dispatch_request
    rv = self.handle_user_exception(e)
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/lib/python3.11/site-packages/flask/app.py", line 1823, in full_dispatch_request
    rv = self.dispatch_request()
         ^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/lib/python3.11/site-packages/flask/app.py", line 1799, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/don/Developer/Promptvision/gallery.py", line 392, in thumbnails
    thumbnails = fetch_thumbnails(limit=limit, offset=offset, imgsrc=imgsrc)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/don/Developer/Promptvision/gallery.py", line 250, in fetch_thumbnails
    thumbnail = (get_thumbnail_from_image(image))
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/don/Developer/Promptvision/gallery.py", line 215, in get_thumbnail_from_image
    img.save(thumbnail_path, format='JPEG', quality=85)
  File "/opt/homebrew/lib/python3.11/site-packages/PIL/Image.py", line 2431, in save
    save_handler(self, fp, filename)
  File "/opt/homebrew/lib/python3.11/site-packages/PIL/JpegImagePlugin.py", line 646, in _save
    raise OSError(msg) from e
OSError: cannot write mode RGBA as JPEG
The debugger caught an exception in your WSGI application. You can now look at the traceback which led to the error. If you enable JavaScript you can also use additional features such as code execution (if the evalex feature is enabled), automatic pasting of the exceptions and much more.
Brought to you by DON'T PANIC, your friendly Werkzeug powered traceback interpreter.

Terminal Output

127.0.0.1 - - [29/Mar/2023 19:00:26] "GET /thumbnails?limit=557&offset=45&imgsrc=/Users/user/GRABS/fashionista/188655.png HTTP/1.1" 500 -
Traceback (most recent call last):
  File "/opt/homebrew/lib/python3.11/site-packages/PIL/JpegImagePlugin.py", line 643, in _save
    rawmode = RAWMODE[im.mode]
              ^^^^^^^^^^^^^^^^
KeyError: 'RGBA'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/opt/homebrew/lib/python3.11/site-packages/flask/app.py", line 2551, in __call__
    return self.wsgi_app(environ, start_response)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/lib/python3.11/site-packages/flask/app.py", line 2531, in wsgi_app
    response = self.handle_exception(e)
               ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/lib/python3.11/site-packages/flask/app.py", line 2528, in wsgi_app
    response = self.full_dispatch_request()
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/lib/python3.11/site-packages/flask/app.py", line 1825, in full_dispatch_request
    rv = self.handle_user_exception(e)
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/lib/python3.11/site-packages/flask/app.py", line 1823, in full_dispatch_request
    rv = self.dispatch_request()
         ^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/lib/python3.11/site-packages/flask/app.py", line 1799, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/user/Promptvision/gallery.py", line 392, in thumbnails
    thumbnails = fetch_thumbnails(limit=limit, offset=offset, imgsrc=imgsrc)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/user/Promptvision/gallery.py", line 250, in fetch_thumbnails
    thumbnail = (get_thumbnail_from_image(image))
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/user/Promptvision/gallery.py", line 215, in get_thumbnail_from_image
    img.save(thumbnail_path, format='JPEG', quality=85)
  File "/opt/homebrew/lib/python3.11/site-packages/PIL/Image.py", line 2431, in save
    save_handler(self, fp, filename)
  File "/opt/homebrew/lib/python3.11/site-packages/PIL/JpegImagePlugin.py", line 646, in _save
    raise OSError(msg) from e
OSError: cannot write mode RGBA as JPEG

from promptvision.

Automaticism avatar Automaticism commented on May 27, 2024

And this was with the latest commit?

from promptvision.

Automaticism avatar Automaticism commented on May 27, 2024

Sorry, this fix disappeared since I was working on the wrong branch the other day.
I have added the fix now.

from promptvision.

don1138 avatar don1138 commented on May 27, 2024

This fixed it for me.

I'm still having some issues when using it my folder of images grabbed from model cards and etcetera -- there are multiple <div class=thumbnails"> that overlap each other -- but on the main output folder for my SD-UI renders, it works as expected. 👍

I have some suggestions for UI/CSS mods I've made to my local install.
I'll add them as a feature request when I get some time.

from promptvision.

Automaticism avatar Automaticism commented on May 27, 2024

The overlap is something I've fixed, but it's in the "extended" branch atm. I'll probably be merging them today. Working on some new features.

And if you have CSS / UI suggestions I am happy because the default CSS is the result of a little cram before publishing it.
(I should probably have used CSS variables, compiled it and had multiple colors, but CSS isn't my main forte)

from promptvision.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.