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

Basic improvements + optional image support #4

Open
wants to merge 11 commits into
base: main
Choose a base branch
from

Conversation

Zetaphor
Copy link

@Zetaphor Zetaphor commented Apr 25, 2024

I love this idea!

Here are some basic improvements:

  • Add a requirements.txt to simplify installation
  • Move the API URL and key to a separate .env file
  • Add a .gitignore for the script outputs and pycache

I've renamed the sanitize function to _format_page to support the changes in #2

This PR additionally implements image support using SearXNG. This does assume you're hosting your own instance or have access to one. The image search works by grabbing the first result matching an images alt tag content.

I've got a lot more ideas about how to improve this. I'm going to continue working in my fork and will later consult you to see if you're interested in what I'm thinking.

I don't use reddit, if you want to reach me on Discord I use the same username there.

@Zetaphor Zetaphor changed the title Add requirements.txt, move API values to .env file, add .gitignore Basic improvements + optional image support Apr 25, 2024
@Zetaphor
Copy link
Author

Some examples of images working:

image
image
image

@pwcarney
Copy link

Heh, I'm actually working on SD support in my fork. It's very WIP but you can take a look if you're interested.

@scalar27
Copy link

I'm getting some errors like:
if int(img["width"]) > int(os.getenv("MAX_IMAGE_WIDTH")):
ValueError: invalid literal for int() with base 10: '200px'

any ideas? I just left the url in .env as you had it. Is that the problem?

@Zetaphor
Copy link
Author

Zetaphor commented Apr 26, 2024

@scalar27 I've fixed this in my fork in my latest commit.

I've actually decided I'm going to take my fork a very different direction, as it's unclear if/what the future of this repo is intended to be.

I'll leave this PR open if Sebby37 wants to merge it, but I'll be diverging into a new repo that won't be tracking against this one.

@iChristGit
Copy link

Some examples of images working:

image image image

Is that from Stable Diffusion or SearXNG?

@Zetaphor
Copy link
Author

Is that from Stable Diffusion or SearXNG?

Please read the PR description

@iChristGit
Copy link

Is that from Stable Diffusion or SearXNG?

Please read the PR description

Yeah sorry I mixed things up..
waiting for some SDXL turbo intergration

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

Successfully merging this pull request may close these issues.

5 participants