diff --git a/ai_frame_image_server.py b/ai_frame_image_server.py index ecd0527..2989357 100644 --- a/ai_frame_image_server.py +++ b/ai_frame_image_server.py @@ -58,23 +58,6 @@ def image_details(filename): "model": details["m"] } -# @app.route("/images", methods=["GET"]) -# def gallery() -> str: -# """ -# Renders the gallery HTML template. -# Returns: -# str: The rendered HTML template. -# """ -# images = [] -# for f in os.listdir(image_folder): -# if f.lower().endswith(('png', 'jpg', 'jpeg', 'gif')): -# path = os.path.join(image_folder, f) # Full path to the image -# details = get_details_from_png(path) # Your method to extract the prompt -# images.append({'filename': f, 'prompt': details["p"], 'model':details["m"], 'path': path}) # Add 'path' to the dictionary - -# images = sorted(images, key=lambda x: os.path.getmtime(x['path']), reverse=True) -# return render_template("gallery.html", images=images) - @app.route('/images/thumbnails/') def serve_thumbnail(filename): @@ -122,7 +105,6 @@ def create() -> str: create_image(prompt) threading.Thread(target=create_image_in_background).start() - # return jsonify({"message": "Image creation started", "prompt": prompt if prompt else "Prompt will be generated"}), 200 return render_template('image_queued.html', prompt=prompt) diff --git a/templates/gallery.html b/templates/gallery.html index 282f1a0..6feb14d 100644 --- a/templates/gallery.html +++ b/templates/gallery.html @@ -152,31 +152,63 @@ + \ No newline at end of file