From 89903c2d9bc4f571c7402aa988f1644d803fd817 Mon Sep 17 00:00:00 2001 From: tazlin Date: Wed, 5 Jun 2024 18:07:45 -0400 Subject: [PATCH] feat: support news `title` and `more_info_urls` fields (#414) * feat: support news `title` and `more_info_urls` fields - Incidentally moves the news pieces to a json file - Also exposes the existing "tags" field via api endpoint * chore: bump formatter versions * fix: correct typo in `black` version * tests: update dummy bridge agent major version This was causing the CI to fail as extra images are associated with a bridge agent version greater than 5 (which was the value before). * tests: other test bridge agent causing fail * tests: debug the image gen tests * tests: more image gen debug * test: tweaks for consistency * tests: set all fixtures to session scoped * fix: try/except news.json load This would be in the off chance the json is malformed. --- horde/apis/models/v2.py | 7 + horde/classes/base/news.py | 676 +----------------------- horde/data/news.json | 825 ++++++++++++++++++++++++++++++ requirements.dev.txt | 4 +- tests/conftest.py | 8 +- tests/test_image.py | 11 +- tests/test_image_extra_sources.py | 3 +- 7 files changed, 870 insertions(+), 664 deletions(-) create mode 100644 horde/data/news.json diff --git a/horde/apis/models/v2.py b/horde/apis/models/v2.py index 36ea7877..98e071c4 100644 --- a/horde/apis/models/v2.py +++ b/horde/apis/models/v2.py @@ -1168,6 +1168,13 @@ def __init__(self, api): example="Information", description="How critical this piece of news is.", ), + "tags": fields.List( + fields.String(description="Tags for this newspiece."), + ), + "title": fields.String(description="The title of this newspiece."), + "more_info_urls": fields.List( + fields.String(description="URLs for more information about this newspiece."), + ), }, ) diff --git a/horde/classes/base/news.py b/horde/classes/base/news.py index b31f0882..0df168fb 100644 --- a/horde/classes/base/news.py +++ b/horde/classes/base/news.py @@ -1,661 +1,29 @@ from datetime import datetime +from loguru import logger + class News: - HORDE_NEWS = [ - { - "date_published": "2024-05-20", - "newspiece": ( - "You can now generate QR Codes on the AI Horde!" - "Currently this functionality is only available for Stable Diffusion 1.5." - "To use this functionality, your frontend needs to support it so that you can type the text you wish" - "to be made into a QR code and to specify the specific qr_code workflow." - ), - "tags": ["db0", "nlnet", "text2img"], - "importance": "Information", - }, - { - "date_published": "2024-05-12", - "newspiece": ( - "The AI Horde now supports Stable Cascade 2pass" - "Simply switch hires_fix to True to use. Note that this has double the cost of a normal Stable Cascade." - ), - "tags": ["Stable Cascade", "db0", "nlnet"], - "importance": "Information", - }, - { - "date_published": "2024-03-24", - "newspiece": ( - "The AI Horde now supports [Stable Cascade](https://stability.ai/news/introducing-stable-cascade) along with its" - "[image variations / remix](https://comfyanonymous.github.io/ComfyUI_examples/stable_cascade/#image-variations)" - " capabilities!" - ), - "tags": ["Stable Cascade", "db0", "nlnet"], - "importance": "Information", - }, - { - "date_published": "2024-02-13", - "newspiece": ( - "The AI Horde now supports [custom error return codes]" - "(https://github.com/Haidra-Org/AI-Horde/blob/main/README_return_codes.md) " - "You can use this to better machine parse the various errors returned from the AI horde " - "or to provide error translations." - ), - "tags": ["errors", "db0", "nlnet"], - "importance": "Information", - }, - { - "date_published": "2024-02-03", - "newspiece": ( - "Webhooks are here. You can [now specify a webhook URL]" - "(https://github.com/Haidra-Org/AI-Horde/blob/main/README_integration.md#webhooks) " - "which the horde will POST to when your generations are ready" - ), - "tags": ["webhooks", "db0", "nlnet"], - "importance": "Information", - }, - { - "date_published": "2024-01-13", - "newspiece": ( - "We have now [added batching](https://dbzer0.com/blog/ludicrous-speed/) to the AI Horde!" - "This means that if your frontend is handling this properly, " - "sending requests for multiple images should fulfill much faster overall." - "However this can have an impact on the resulting seed. If you need to have an accurate seed, " - "for now you can use disable_batching." - ), - "tags": ["dreamer", "db0", "batching", "seed", "nlnet"], - "importance": "Information", - }, - { - "date_published": "2024-01-07", - "newspiece": ( - "The new generation of the AI Horde worker is out. " - "The [Horde Worker reGen](https://github.com/Haidra-Org/horde-worker-reGen)!" - "It should have always the latest version of comfyUI, which allows us access " - "to all the latest features of Stable Diffusion" - "Every worker should work on switching ASAP, as the new worker can support SDXL models " - "as well as LCM payloads!" - ), - "tags": ["dreamer", "tazlin"], - "importance": "Workers", - }, - { - "date_published": "2023-11-26", - "newspiece": "The AI Horde now supports different LoRa versions from each LoRa. " "Happy Winter Solstice!", - "tags": ["lora", "nlnet"], - "importance": "Information", - }, - { - "date_published": "2023-11-23", - "newspiece": "The AI Horde will receive " "[an NLNet Grant!](https://dbzer0.com/blog/ai-horde-to-receive-nlnet-grant/)", - "tags": ["devlog", "funding", "nlnet"], - "importance": "Information", - }, - { - "date_published": "2023-09-03", - "newspiece": "The AI Horde is officially " "[one year old!](https://dbzer0.com/blog/year-one-of-the-ai-horde/)", - "tags": ["devlog"], - "importance": "Information", - }, - { - "date_published": "2023-08-30", - "newspiece": ( - "Textual Inversions support has now been merged into the main worker branch! " - "Read the [devlog](https://dbzer0.com/blog/the-ai-horde-now-seamlessly-provides-all-civitai-textual-inversions/)" - ), - "tags": ["devlog", "TI", "text2img"], - "importance": "Information", - }, - { - "date_published": "2023-07-23", - "newspiece": "Join our [Lemmy Community](https://lemmy.dbzer0.com/c/aihorde).", - "tags": ["lemmy"], - "importance": "Information", - }, - { - "date_published": "2023-07-04", - "newspiece": "New [State of the AI Horde](https://dbzer0.com/blog/state-of-the-ai-horde-july-2023/) is out!", - "tags": ["state of the ai horde"], - "importance": "Information", - }, - { - "date_published": "2023-07-04", - "newspiece": "New [State of the AI Horde](https://dbzer0.com/blog/state-of-the-ai-horde-july-2023/) is out!", - "tags": ["state of the ai horde"], - "importance": "Information", - }, - { - "date_published": "2023-06-01", - "newspiece": ( - "LoRas support has now been merged into the main worker branch! " - "All kudos to [Jug](https://github.com/jug-dev/) and " - "[Tazlin](https://github.com/tazlin/) for their invaluable efforts! " - "Read the [devlog](https://dbzer0.com/blog/the-ai-horde-now-seamlessly-provides-all-civitai-loras/)" - ), - "tags": ["devlog", "lora", "text2img"], - "importance": "Workers", - }, - { - "date_published": "2023-05-30", - "newspiece": ( - "Early support for LoRa has been added to the AI Horde with a few workers providing it. " - "UIs are still adding it, with [Lucid Creations](https://dbzer0.itch.io/lucid-creations/devlog/537949/1170-loras), " - "ArtBot and the Krita plugin already supporting it." - "Try it out and let us know how it works for you." - ), - "tags": ["UI", "lora", "text2img"], - "importance": "Information", - }, - { - "date_published": "2023-05-25", - "newspiece": ( - "I wanted to point out a very cool voice-2-text-2-voice AI Horde integration: " - "[ProtoReplicant](https://github.com/OpenReplicant/ProtoReplicant). " - "It converts your voice into text which it then sends to an LLM model, " - "and finally converts the resulting text into voice and plays it back." - "Here's the new [Discord integration channel](https://discordapp.com/channels/781145214752129095/1111189841120596008)" - ), - "tags": ["UI", "voice", "llm"], - "importance": "Integration", - }, - { - "date_published": "2023-05-22", - "newspiece": ( - "A new AI Horde integration has been created. " - "A Telegram bot by the name of [Imaginarium](https://t.me/ImaginariumAIbot). " - "Here's the new [Discord integration channel](https://discordapp.com/channels/781145214752129095/1109825249933000714)" - ), - "tags": ["bot", "telegram"], - "importance": "Integration", - }, - { - "date_published": "2023-05-14", - "newspiece": ( - "The AI Horde has finally moved to the [hordelib](https://pypi.org/project/hordelib/) library. " - "Which is powered by the [ComfyUI](https://github.com/comfyanonymous/ComfyUI) inference backend. " - "[Read the Devlog](https://dbzer0.com/blog/the-ai-horde-worker-moves-to-a-completely-new-inference-backend/)!" - ), - "tags": ["devlog", "backend", "Jug", "Tazlin", "dreamer", "alchemist"], - "importance": "Information", - }, - { - "date_published": "2023-05-11", - "newspiece": ( - "With the upcoming deployment of the [hordelib](https://pypi.org/project/hordelib/)-based worker. " - "[Jug](https://github.com/jug-dev/) has looked into creating a more efficient model to determine generation kudos " - "instead of reusing the numbers I hallucinated one day. " - "He used what we know best and we trained an explicit model to calculate kudos, " - "based on the performance of his own GPU on the comfy branch " - "This new calculation should be much more accurate in terms of things like controlnet and resolution impact. " - "The good news is that the new comfy branch this seems to reduce kudos costs for high resolutions accross the board. " - "Note: Due to the current worker (based on nataili) being slightly lower quality " - "at the benefit of speed, and thus getting a boost due to the new kudos model, " - "we have implemented a 25% reduction for its rewards to bring it up to line with its actual performance." - ), - "tags": ["kudos", "dreamer", "Jug"], - "importance": "Workers", - }, - { - "date_published": "2023-05-09", - "newspiece": ( - "A new feature appeared on the Horde. " - "You can now create [API keys you can share with others](https://dbzer0.com/blog/key-sharing/) to use your own priority." - ), - "tags": ["apikey", "shared key"], - "importance": "Information", - }, - { - "date_published": "2023-05-05", - "newspiece": ( - "You can now run an AI Horde worker inside a docker container. " - "http://ghcr.io/db0/ai-horde-worker:main " - "Our README [contains information on how to configure it]" - "(https://github.com/db0/AI-Horde-Worker/blob/main/README.md#docker) " - "All kudos to [Gus Puffy#8887](https://github.com/guspuffygit)" - ), - "tags": ["docker", "dreamer"], - "importance": "Workers", - }, - { - "date_published": "2023-04-23", - "newspiece": ( - "The Command Line Interface for the AI Horde has now been extended to support Image Generation, " - "Text Generation and Image Alchemy. " - "It has been split into three files and is now available in its own repository: " - "https://github.com/db0/AI-Horde-CLI" - ), - "tags": ["cli"], - "importance": "Information", - }, - { - "date_published": "2023-04-16", - "newspiece": ( - "The AI Horde has received its first patreon sponsorship " - "Many thanks to [pawkygame VR](https://discord.gg/Zbe63QTU9X) for their support!" - ), - "tags": ["sponsor", "patreon"], - "importance": "Information", - }, - { - "date_published": "2023-03-23", - "newspiece": ( - "Inpainting is re-enabled that to the work of [ResidentChief](https://github.com/ResidentChief)! " - "Now also have support for multiple inpainting models." - ), - "tags": ["inpainting", "ResidentChief"], - "importance": "Information", - }, - { - "date_published": "2023-03-19", - "newspiece": ( - "The AI Horde Interrogator Worker has now been renamed to 'Alchemist' " - "The Horde alchemist can now run all the post-processors, along with all the interrogation forms. " - "This means that if you have an existing image you wish to face-fix or upscale, you can just do that " - "by requesting it via alchemy. " - "For now, the alchemist does not support extracting ControlNet intermediate images, but this will be coming soon. " - "The endpoints remain as `api/v2interrogation/` for now but I plan to rename them in v3." - ), - "tags": ["upscale", "post-processing", "alchemy"], - "importance": "Information", - }, - { - "date_published": "2023-03-15", - "newspiece": ( - "the AI Horde now supports the DDIM sampler and the RealESRGAN_x4plus_anime_6B upscaler! " - "Keep in mind that you cannot use two upscalers at the same time. " - "All kudos to [ResidentChief](https://github.com/ResidentChief)!" - ), - "tags": ["upscale", "post-processing", "ResidentChief", "samplers"], - "importance": "Information", - }, - { - "date_published": "2023-03-13", - "newspiece": ( - "A new option `replacement_filter` is available for image generations. " - "When set to True and a potential CSAM prompt is detected, " - "all underage context will be transparently replaced or removed " - "and some extra negative prompts will be added to the negative prompt." - "When set to False (default) or the prompt size is over 500 chars " - "The previous behaviour will be used, where the prompt is rejected and an IP timeout will be put in place. " - "This feature should make sending text generations to be turned into images a less frustrating experience." - ), - "tags": ["csam", "text2text", "text2img"], - "importance": "Information", - }, - { - "date_published": "2023-03-10", - "newspiece": "We now have an AI-driven anti-CSAM filter as well. " - "Read about it on [the main developer's blog](https://dbzer0.com/blog/ai-powered-anti-csam-filter-for-stable-diffusion/).", - "tags": ["csam"], - "importance": "Information", - }, - { - "date_published": "2023-03-03", - "newspiece": "The Horde Ratings are back in action. Go to your typical UI and rate away!", - "tags": ["ratings"], - "importance": "Information", - }, - { - "date_published": "2023-02-23", - "newspiece": "KoboldAI Horde has been merged into Stable Horde as a unified AI Horde!", - "tags": ["text2text", "ai horde"], - "importance": "Information", - }, - { - "date_published": "2023-02-21", - "newspiece": ( - "The Horde now supports ControlNet on all models! All kudos go to " - "[hlky](https://github.com/hlky) who again weaved the dark magic!" - ), - "tags": ["controlnet", "img2img", "hlky"], - "importance": "Information", - }, - { - "date_published": "2023-02-14", - "newspiece": ("You can now use an almost unlimited prompt size thanks to the work of ResidentChief!"), - "tags": ["text2img", "img2img", "ResidentChief"], - "importance": "Information", - }, - { - "date_published": "2023-02-09", - "newspiece": ( - "You can now select to generate a higher-sized image using hires_fix, " - "which uses the composition of stable diffusion at 512x512 which tends to be more consistent." - ), - "tags": ["text2img", "img2img", "ResidentChief"], - "importance": "Information", - }, - { - "date_published": "2023-02-03", - "newspiece": ("The horde now supports pix2pix. All you have to do is use img2img as normal and select the pix2pix model!"), - "tags": ["img2img", "ResidentChief"], - "importance": "Information", - }, - { - "date_published": "2023-01-24", - "newspiece": ( - 'We now support sending tiling requests! Send `"tiling":true"` ' - "into your payload params to request an image that seamlessly tiles." - ), - "tags": ["text2img", "img2img", "ResidentChief"], - "importance": "Information", - }, - { - "date_published": "2023-01-23", - "newspiece": ( - "I have tightened the rules around NSFW models. " - "As they seem to be straying into 'unethical' territory even when not explicitly prompted, " - "I am forced to tighten the safety controls around them. From now on, " - "otherwise generic terms for young people like `girl` ,`boy` etc " - "Cannot be used on those models. Please either use terms like `woman` " - "or `man` or switch to a non-NSFW model instead." - ), - "tags": ["countermeasures", "nsfw"], - "importance": "Information", - }, - { - "date_published": "2023-01-23", - "newspiece": ("The horde now has a [Blender Plugin](https://github.com/benrugg/AI-Render)!"), - "tags": ["plugin", "blender"], - "importance": "Information", - }, - { - "date_published": "2023-01-18", - "newspiece": ( - "We now have a [New Discord Bot](https://github.com/ZeldaFan0225/Stable_Horde_Discord), " - "courtesy of Zelda_Fan#0225. Check out [their other bot](https://slashbot.de/) as well! " - "Only downside is that if you were already logged in to the old bot, you will need to /login again." - ), - "importance": "Information", - }, - { - "date_published": "2023-01-18", - "newspiece": ( - "The prompts now support weights! Use them like so `(sub prompt:1.1)` where 1.1 corresponds to +10% weight " - "You can tweak upwards more like `1.25` or downwards like `0.7`, but don't go above +=30%" - ), - "importance": "Information", - }, - { - "date_published": "2023-01-12", - "newspiece": ( - "We plan to be replacing our official discord bot with " - "[new a new codebase](https://github.com/ZeldaFan0225/Stable_Horde_Discord) based on the work of Zelda_Fan#0225. " - "Once we do, be aware that the controls will be slightly different " - "and you will have to log-in again with your API key." - ), - "importance": "Upcoming", - }, - { - "date_published": "2023-01-11", - "newspiece": ( - "The Stable Horde has its first browser extension! " - "[GenAlt](https://chrome.google.com/webstore/detail/genalt-generated-alt-text/ekbmkapnmnhhgfmjdnchgmcfggibebnn) " - "is an accessibility plugin to help people with bad eyesight always find alt text for images." - "The extension relies on the Stable Horde's newly added image interrogation " - "capabilities to generate captions which are then serves as the image's alt text." - ), - "importance": "Information", - }, - { - "date_published": "2023-01-04", - "newspiece": ( - "We are proud to announce that we have " - "[initiated a collaboration with LAION](https://dbzer0.com/blog/a-collaboration-begins-between-stable-horde-and-laion/) " - "to help them improve their dataset!" - ), - "importance": "Information", - }, - { - "date_published": "2023-01-06", - "newspiece": ( - "The amount of kudos consumed when generating images " - "[has been slightly adjusted](https://dbzer0.com/blog/sharing-is-caring/). " - "To simulate the resource costs of the horde, " - "each image generation request will now burn +3 kudos. Those will not go to the generating worker! " - "However we also have a new opt-in feature: You can choose to share your " - "text2img generations with [LAION](https://laion.ai/). " - "If you do, this added cost will be just +1 kudos. " - "We have also updated our Terms of Service to make this more obvious." - ), - "importance": "Information", - }, - { - "date_published": "2023-01-05", - "newspiece": ( - "[Worker now have a WebUI](https://dbzer0.com/blog/the-ai-horde-worker-has-a-control-ui/) " - "which they can use to configure themselves. Use it by running `worker-webui.sh/cmd`" - ), - "importance": "Workers", - }, - { - "date_published": "2023-01-04", - "newspiece": ( - "[You can now interrogate images]" - "(https://dbzer0.com/blog/image-interrogations-are-now-available-on-the-stable-horde/) " - "(AKA img2txt) to retrieve information about them such as captions and whether they are NSFW. " - "Check the api/v2/interrogate endpoint documentation." - ), - "importance": "Information", - }, - { - "date_published": "2023-01-01", - "newspiece": ( - "Stable Horde can now be used on the automatic1111 Web UI via " - "[an external script](https://github.com/natanjunges/stable-diffusion-webui-stable-horde)" - ), - "importance": "Information", - }, - { - "date_published": "2022-12-30", - "newspiece": ( - "Stable Horde now supports depth2img! " - "To use it you need to send a source image and select the `Stable Difffusion 2 Depth` model" - ), - "importance": "Information", - }, - { - "date_published": "2022-12-28", - "newspiece": ( - "Stable Horde workers can now opt-in to loading post-processors. " - "Check your bridge_data.py for options. This should help workers who started being " - "more unstable due to the PP requirements." - ), - "importance": "Workers", - }, - { - "date_published": "2022-12-24", - "newspiece": ( - "Stable Horde has now support for " - "[CodeFormer](https://shangchenzhou.com/projects/CodeFormer/). " - "Simply use 'CodeFormers' for your postprocessor (case sensitive). " - "This will fix any faces in the image. Be aware that due to the processing cost of this model, " - "the kudos requirement will be 50% higher! Note: The inbuilt upscaler has been disabled" - ), - "importance": "Information", - }, - { - "date_published": "2022-12-08", - "newspiece": ( - "The Stable Horde workers now support dynamically swapping models. " - "This means that models will always switch to support the most in demand models every minute, " - "allowing us to support demand much better!" - ), - "importance": "Information", - }, - { - "date_published": "2022-11-28", - "newspiece": ( - "The Horde has undertaken a massive code refactoring to allow me to move to a proper SQL DB. " - "This will finally allow me to scale the frontend systems horizontally and allow for way more capacity!" - ), - "importance": "Information", - }, - { - "date_published": "2022-11-24", - "newspiece": ( - "Due to the massive increase in demand from the Horde, we have to limit the amount of concurrent anonymous " - "requests we can serve. We will revert this once our infrastructure can scale better." - ), - "importance": "Crisis", - }, - { - "date_published": "2022-11-24", - "newspiece": "Stable Diffusion 2.0 has been released and now it is available on the Horde as well.", - "importance": "Information", - }, - { - "date_published": "2022-11-22", - "newspiece": ( - "A new Stable Horde Bot has been deployed, this time for Mastodon. " - "You can find [the stablehorde_generator}(https://sigmoid.social/@stablehorde_generator) as well as our " - "[official Stable Horde account](https://sigmoid.social/@stablehorde) on sigmoid.social" - ), - "importance": "Information", - }, - { - "date_published": "2022-11-22", - "newspiece": ( - "We now have [support for the Unreal Engine]" - "(https://github.com/Mystfit/Unreal-StableDiffusionTools/releases/tag/v0.5.0) via a community-provided plugin" - ), - "importance": "Information", - }, - { - "date_published": "2022-11-18", - "newspiece": ( - "The stable horde [now supports post-processing](https://www.patreon.com/posts/post-processing-74815675) " - "on images automatically" - ), - "importance": "Information", - }, - { - "date_published": "2022-11-05", - "newspiece": ( - "Due to suddenly increased demand, we have adjusted how much requests accounts " - "can request before needing to have the kudos upfront. " - "More than 50 steps will require kudos and the max resolution will be adjusted based on the current horde demand." - ), - "importance": "Information", - }, - { - "date_published": "2022-11-05", - "newspiece": "Workers can now [join teams](https://www.patreon.com/posts/teams-74247978) to get aggregated stats.", - "importance": "Information", - }, - { - "date_published": "2022-11-02", - "newspiece": ( - "The horde can now generate images up to 3072x3072 and 500 steps! " - "However you need to already have the kudos to burn to do so!" - ), - "importance": "Information", - }, - { - "date_published": "2022-10-29", - "newspiece": ( - "Inpainting is now available on the stable horde! " - "Many kudos to [blueturtle](https://github.com/blueturtleai) for the support!" - ), - "importance": "Information", - }, - { - "date_published": "2022-10-25", - "newspiece": ( - "Another [Discord Bot for Stable Horde integration](https://github.com/ZeldaFan0225/Stable_Horde_Discord) " "has appeared!" - ), - "importance": "Information", - }, - { - "date_published": "2022-10-24", - "newspiece": ( - "The Stable Horde Client has been renamed to [Lucid Creations](https://dbzer0.itch.io/lucid-creations) " - "and has a new version and UI out which supports multiple models and img2img!" - ), - "importance": "Information", - }, - { - "date_published": "2022-10-22", - "newspiece": "We have [a new npm SDK](https://github.com/ZeldaFan0225/stable_horde) for integrating into the Stable Horde.", - "importance": "Information", - }, - { - "date_published": "2022-10-22", - "newspiece": "Krita and GIMP plugins now support img2img", - "importance": "Information", - }, - { - "date_published": "2022-10-21", - "newspiece": "Image 2 Image is now available for everyone!", - "importance": "Information", - }, - { - "date_published": "2022-10-20", - "newspiece": "Stable Diffusion 1.5 is now available!", - "importance": "Information", - }, - { - "date_published": "2022-10-17", - "newspiece": "We now have [a Krita plugin](https://github.com/blueturtleai/krita-stable-diffusion).", - "importance": "Information", - }, - { - "date_published": "2022-10-17", - "newspiece": "Img2img on the horde is now on pilot for trusted users.", - "importance": "Information", - }, - { - "date_published": "2022-10-16", - "newspiece": "Yet [another Web UI](https://tinybots.net/artbot) has appeared.", - "importance": "Information", - }, - { - "date_published": "2022-10-11", - "newspiece": "A [new dedicated Web UI](https://aqualxx.github.io/stable-ui/) has entered the scene!", - "importance": "Information", - }, - { - "date_published": "2022-10-10", - "newspiece": ( - "You can now contribute a worker to the horde " - "[via google colab](https://colab.research.google.com/github/harrisonvanderbyl/ravenbot-ai/blob/master/Horde.ipynb). " - "Just fill-in your API key and run!" - ), - "importance": "Information", - }, - { - "date_published": "2022-10-06", - "newspiece": ( - "We have a [new installation video](https://youtu.be/wJrp5lpByCc) " - "for both the Stable Horde Client and the Stable horde worker." - ), - "importance": "Information", - }, - { - "date_published": "2023-01-23", - "newspiece": "All workers must start sending the `bridge_agent` key in their job pop payloads. See API documentation.", - "importance": "Workers", - }, - { - "date_published": "2022-10-10", - "newspiece": ( - "The [discord rewards bot](https://www.patreon.com/posts/new-kind-of-73097166) " - "has been unleashed. Reward good contributions to the horde directly from the chat!" - ), - "importance": "Information", - }, - { - "date_published": "2022-10-13", - "newspiece": "KoboldAI Has been upgraded to the new countermeasures", - "tags": ["countermeasures", "ai horde"], - "importance": "Information", - }, - { - "date_published": "2022-10-09", - "newspiece": "The horde now includes News functionality. Also [In the API!](/api/v2/status/news)", - "importance": "Information", - }, - ] + def __init__(self): + import json + import os + + # The news.json file is located at ../../data/news.json + path = os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "..", "data", "news.json")) + + if os.path.exists(path): + with open(path) as file: + try: + self.HORDE_NEWS = json.load(file) + except json.JSONDecodeError: + self.HORDE_NEWS = [] + logger.error(f"File {path} is not a valid JSON file. No news will be available.") + except Exception as e: + self.HORDE_NEWS = [] + logger.exception(f"An error occurred while reading the news file: {e}") + else: + self.HORDE_NEWS = [] + logger.error(f"File {path} not found. No news will be available.") def get_news(self): """extensible function from gathering nodes from extensing classes""" diff --git a/horde/data/news.json b/horde/data/news.json new file mode 100644 index 00000000..d97f2efd --- /dev/null +++ b/horde/data/news.json @@ -0,0 +1,825 @@ +[ + { + "date_published": "2024-05-20", + "newspiece": "You can now generate QR Codes on the AI Horde! Currently this functionality is only available for Stable Diffusion 1.5. To use this functionality, your frontend needs to support it so that you can type the text you wish to be made into a QR code and to specify the specific qr_code workflow.", + "tags": [ + "db0", + "nlnet", + "text2img" + ], + "importance": "Information", + "more_info_urls": [], + "title": "Generate QR Codes" + }, + { + "date_published": "2024-05-12", + "newspiece": "The AI Horde now supports Stable Cascade 2passSimply switch hires_fix to True to use. Note that this has double the cost of a normal Stable Cascade.", + "tags": [ + "Stable Cascade", + "db0", + "nlnet" + ], + "importance": "Information", + "more_info_urls": [], + "title": "Stable Cascade 2pass support" + }, + { + "date_published": "2024-03-24", + "newspiece": "The AI Horde now supports [Stable Cascade](https://stability.ai/news/introducing-stable-cascade) along with its [image variations / remix](https://comfyanonymous.github.io/ComfyUI_examples/stable_cascade/#image-variations) capabilities!", + "tags": [ + "Stable Cascade", + "db0", + "nlnet" + ], + "importance": "Information", + "more_info_urls": [ + "https://stability.ai/news/introducing-stable-cascade", + "https://comfyanonymous.github.io/ComfyUI_examples/stable_cascade/#image-variations" + ], + "title": "Supports image variations" + }, + { + "date_published": "2024-02-13", + "newspiece": "The AI Horde now supports [custom error return codes](https://github.com/Haidra-Org/AI-Horde/blob/main/README_return_codes.md) You can use this to better machine parse the various errors returned from the AI horde or to provide error translations.", + "tags": [ + "errors", + "db0", + "nlnet" + ], + "importance": "Information", + "more_info_urls": [ + "https://github.com/Haidra-Org/AI-Horde/blob/main/README_return_codes.md" + ], + "title": "Custom error codes" + }, + { + "date_published": "2024-02-03", + "newspiece": "Webhooks are here. You can [now specify a webhook URL](https://github.com/Haidra-Org/AI-Horde/blob/main/README_integration.md#webhooks) which the horde will POST to when your generations are ready", + "tags": [ + "webhooks", + "db0", + "nlnet" + ], + "importance": "Information", + "more_info_urls": [ + "https://github.com/Haidra-Org/AI-Horde/blob/main/README_integration.md#webhooks" + ], + "title": "Webhook support" + }, + { + "date_published": "2024-01-13", + "newspiece": "We have now [added batching](https://dbzer0.com/blog/ludicrous-speed/) to the AI Horde!This means that if your frontend is handling this properly, sending requests for multiple images should fulfill much faster overall. However this can have an impact on the resulting seed. If you need to have an accurate seed, for now you can use disable_batching.", + "tags": [ + "dreamer", + "db0", + "batching", + "seed", + "nlnet" + ], + "importance": "Information", + "more_info_urls": [ + "https://dbzer0.com/blog/ludicrous-speed/" + ], + "title": "Batching added" + }, + { + "date_published": "2024-01-07", + "newspiece": "The new generation of the AI Horde worker is out. The [Horde Worker reGen](https://github.com/Haidra-Org/horde-worker-reGen)! It should have always the latest version of comfyUI, which allows us access to all the latest features of Stable Diffusion. Every worker should work on switching ASAP, as the new worker can support SDXL models as well as LCM payloads!", + "tags": [ + "dreamer", + "tazlin" + ], + "importance": "Workers", + "more_info_urls": [ + "https://github.com/Haidra-Org/horde-worker-reGen" + ], + "title": "New Horde Worker reGen" + }, + { + "date_published": "2023-11-26", + "newspiece": "The AI Horde now supports different LoRa versions from each LoRa. Happy Winter Solstice!", + "tags": [ + "lora", + "nlnet" + ], + "importance": "Information", + "more_info_urls": [], + "title": "Supports different LoRa versions" + }, + { + "date_published": "2023-11-23", + "newspiece": "The AI Horde will receive [an NLNet Grant!](https://dbzer0.com/blog/ai-horde-to-receive-nlnet-grant/)", + "tags": [ + "devlog", + "funding", + "nlnet" + ], + "importance": "Information", + "more_info_urls": [ + "https://dbzer0.com/blog/ai-horde-to-receive-nlnet-grant/" + ], + "title": "NLNet Grant" + }, + { + "date_published": "2023-09-03", + "newspiece": "The AI Horde is officially [one year old!](https://dbzer0.com/blog/year-one-of-the-ai-horde/)", + "tags": [ + "devlog" + ], + "importance": "Information", + "more_info_urls": [ + "https://dbzer0.com/blog/year-one-of-the-ai-horde/" + ], + "title": "One year anniversary" + }, + { + "date_published": "2023-08-30", + "newspiece": "Textual Inversions support has now been merged into the main worker branch! Read the [devlog](https://dbzer0.com/blog/the-ai-horde-now-seamlessly-provides-all-civitai-textual-inversions/)", + "tags": [ + "devlog", + "TI", + "text2img" + ], + "importance": "Information", + "more_info_urls": [ + "https://dbzer0.com/blog/the-ai-horde-now-seamlessly-provides-all-civitai-textual-inversions/" + ], + "title": "Textual Inversions support" + }, + { + "date_published": "2023-07-23", + "newspiece": "Join our [Lemmy Community](https://lemmy.dbzer0.com/c/aihorde).", + "tags": [ + "lemmy" + ], + "importance": "Information", + "more_info_urls": [ + "https://lemmy.dbzer0.com/c/aihorde" + ], + "title": "Join Lemmy Community" + }, + { + "date_published": "2023-07-04", + "newspiece": "New [State of the AI Horde](https://dbzer0.com/blog/state-of-the-ai-horde-july-2023/) is out!", + "tags": [ + "state of the ai horde" + ], + "importance": "Information", + "more_info_urls": [ + "https://dbzer0.com/blog/state-of-the-ai-horde-july-2023/" + ], + "title": "New AI Horde update" + }, + { + "date_published": "2023-07-04", + "newspiece": "New [State of the AI Horde](https://dbzer0.com/blog/state-of-the-ai-horde-july-2023/) is out!", + "tags": [ + "state of the ai horde" + ], + "importance": "Information", + "more_info_urls": [ + "https://dbzer0.com/blog/state-of-the-ai-horde-july-2023/" + ], + "title": "New AI Horde update" + }, + { + "date_published": "2023-06-01", + "newspiece": "LoRas support has now been merged into the main worker branch! All kudos to [Jug](https://github.com/jug-dev/) and [Tazlin](https://github.com/tazlin/) for their invaluable efforts! Read the [devlog](https://dbzer0.com/blog/the-ai-horde-now-seamlessly-provides-all-civitai-loras/)", + "tags": [ + "devlog", + "lora", + "text2img" + ], + "importance": "Workers", + "more_info_urls": [ + "https://github.com/jug-dev/", + "https://github.com/tazlin/", + "https://dbzer0.com/blog/the-ai-horde-now-seamlessly-provides-all-civitai-loras/" + ], + "title": "LoRas support merged" + }, + { + "date_published": "2023-05-30", + "newspiece": "Early support for LoRa has been added to the AI Horde with a few workers providing it. UIs are still adding it, with [Lucid Creations](https://dbzer0.itch.io/lucid-creations/devlog/537949/1170-loras), ArtBot and the Krita plugin already supporting it.Try it out and let us know how it works for you.", + "tags": [ + "UI", + "lora", + "text2img" + ], + "importance": "Information", + "more_info_urls": [ + "https://dbzer0.itch.io/lucid-creations/devlog/537949/1170-loras" + ], + "title": "Early LoRa support" + }, + { + "date_published": "2023-05-25", + "newspiece": "I wanted to point out a very cool voice-2-text-2-voice AI Horde integration: [ProtoReplicant](https://github.com/OpenReplicant/ProtoReplicant). It converts your voice into text which it then sends to an LLM model, and finally converts the resulting text into voice and plays it back. Here's the new [Discord integration channel](https://discordapp.com/channels/781145214752129095/1111189841120596008)", + "tags": [ + "UI", + "voice", + "llm" + ], + "importance": "Integration", + "more_info_urls": [ + "https://github.com/OpenReplicant/ProtoReplicant", + "https://discordapp.com/channels/781145214752129095/1111189841120596008" + ], + "title": "ProtoReplicant integration" + }, + { + "date_published": "2023-05-22", + "newspiece": "A new AI Horde integration has been created. A Telegram bot by the name of [Imaginarium](https://t.me/ImaginariumAIbot). Here's the new [Discord integration channel](https://discordapp.com/channels/781145214752129095/1109825249933000714)", + "tags": [ + "bot", + "telegram" + ], + "importance": "Integration", + "more_info_urls": [ + "https://t.me/ImaginariumAIbot", + "https://discordapp.com/channels/781145214752129095/1109825249933000714" + ], + "title": "Telegram bot Imaginarium" + }, + { + "date_published": "2023-05-14", + "newspiece": "The AI Horde has finally moved to the [hordelib](https://pypi.org/project/hordelib/) library. Which is powered by the [ComfyUI](https://github.com/comfyanonymous/ComfyUI) inference backend. [Read the Devlog](https://dbzer0.com/blog/the-ai-horde-worker-moves-to-a-completely-new-inference-backend/)!", + "tags": [ + "devlog", + "backend", + "Jug", + "Tazlin", + "dreamer", + "alchemist" + ], + "importance": "Information", + "more_info_urls": [ + "https://pypi.org/project/hordelib/", + "https://github.com/comfyanonymous/ComfyUI", + "https://dbzer0.com/blog/the-ai-horde-worker-moves-to-a-completely-new-inference-backend/" + ], + "title": "Moved to hordelib library" + }, + { + "date_published": "2023-05-11", + "newspiece": "With the upcoming deployment of the [hordelib](https://pypi.org/project/hordelib/)-based worker. [Jug](https://github.com/jug-dev/) has looked into creating a more efficient model to determine generation kudos instead of reusing the numbers I hallucinated one day. He used what we know best and we trained an explicit model to calculate kudos, based on the performance of his own GPU on the comfy branch This new calculation should be much more accurate in terms of things like controlnet and resolution impact. The good news is that the new comfy branch this seems to reduce kudos costs for high resolutions accross the board. Note: Due to the current worker (based on nataili) being slightly lower quality at the benefit of speed, and thus getting a boost due to the new kudos model, we have implemented a 25% reduction for its rewards to bring it up to line with its actual performance.", + "tags": [ + "kudos", + "dreamer", + "Jug" + ], + "importance": "Workers", + "more_info_urls": [ + "https://pypi.org/project/hordelib/", + "https://github.com/jug-dev/" + ], + "title": "Efficient kudos model" + }, + { + "date_published": "2023-05-09", + "newspiece": "A new feature appeared on the Horde. You can now create [API keys you can share with others](https://dbzer0.com/blog/key-sharing/) to use your own priority.", + "tags": [ + "apikey", + "shared key" + ], + "importance": "Information", + "more_info_urls": [ + "https://dbzer0.com/blog/key-sharing/" + ], + "title": "Shareable API keys" + }, + { + "date_published": "2023-05-05", + "newspiece": "You can now run an AI Horde worker inside a docker container. http://ghcr.io/db0/ai-horde-worker:main Our README [contains information on how to configure it](https://github.com/db0/AI-Horde-Worker/blob/main/README.md#docker) All kudos to [Gus Puffy#8887](https://github.com/guspuffygit)", + "tags": [ + "docker", + "dreamer" + ], + "importance": "Workers", + "more_info_urls": [ + "https://github.com/db0/AI-Horde-Worker/blob/main/README.md#docker", + "https://github.com/guspuffygit" + ], + "title": "Docker container support" + }, + { + "date_published": "2023-04-23", + "newspiece": "The Command Line Interface for the AI Horde has now been extended to support Image Generation, Text Generation and Image Alchemy. It has been split into three files and is now available in its own repository: https://github.com/db0/AI-Horde-CLI", + "tags": [ + "cli" + ], + "importance": "Information", + "more_info_urls": [], + "title": "CLI extended features" + }, + { + "date_published": "2023-04-16", + "newspiece": "The AI Horde has received its first patreon sponsorship Many thanks to [pawkygame VR](https://discord.gg/Zbe63QTU9X) for their support!", + "tags": [ + "sponsor", + "patreon" + ], + "importance": "Information", + "more_info_urls": [ + "https://discord.gg/Zbe63QTU9X" + ], + "title": "First Patreon sponsorship" + }, + { + "date_published": "2023-03-23", + "newspiece": "Inpainting is re-enabled that to the work of [ResidentChief](https://github.com/ResidentChief)! Now also have support for multiple inpainting models.", + "tags": [ + "inpainting", + "ResidentChief" + ], + "importance": "Information", + "more_info_urls": [ + "https://github.com/ResidentChief" + ], + "title": "Inpainting re-enabled" + }, + { + "date_published": "2023-03-19", + "newspiece": "The AI Horde Interrogator Worker has now been renamed to 'Alchemist' The Horde alchemist can now run all the post-processors, along with all the interrogation forms. This means that if you have an existing image you wish to face-fix or upscale, you can just do that by requesting it via alchemy. For now, the alchemist does not support extracting ControlNet intermediate images, but this will be coming soon. The endpoints remain as `api/v2interrogation/` for now but I plan to rename them in v3.", + "tags": [ + "upscale", + "post-processing", + "alchemy" + ], + "importance": "Information", + "more_info_urls": [], + "title": "Interrogator renamed Alchemist" + }, + { + "date_published": "2023-03-15", + "newspiece": "the AI Horde now supports the DDIM sampler and the RealESRGAN_x4plus_anime_6B upscaler! Keep in mind that you cannot use two upscalers at the same time. All kudos to [ResidentChief](https://github.com/ResidentChief)!", + "tags": [ + "upscale", + "post-processing", + "ResidentChief", + "samplers" + ], + "importance": "Information", + "more_info_urls": [ + "https://github.com/ResidentChief" + ], + "title": "Supports DDIM sampler" + }, + { + "date_published": "2023-03-13", + "newspiece": "A new option `replacement_filter` is available for image generations. When set to True and a potential CSAM prompt is detected, all underage context will be transparently replaced or removed and some extra negative prompts will be added to the negative prompt.When set to False (default) or the prompt size is over 500 chars The previous behaviour will be used, where the prompt is rejected and an IP timeout will be put in place. This feature should make sending text generations to be turned into images a less frustrating experience.", + "tags": [ + "csam", + "text2text", + "text2img" + ], + "importance": "Information", + "more_info_urls": [], + "title": "Replacement filter option" + }, + { + "date_published": "2023-03-10", + "newspiece": "We now have an AI-driven anti-CSAM filter as well. Read about it on [the main developer's blog](https://dbzer0.com/blog/ai-powered-anti-csam-filter-for-stable-diffusion/).", + "tags": [ + "csam" + ], + "importance": "Information", + "more_info_urls": [ + "https://dbzer0.com/blog/ai-powered-anti-csam-filter-for-stable-diffusion/" + ], + "title": "AI-driven anti-CSAM filter" + }, + { + "date_published": "2023-03-03", + "newspiece": "The Horde Ratings are back in action. Go to your typical UI and rate away!", + "tags": [ + "ratings" + ], + "importance": "Information", + "more_info_urls": [], + "title": "Ratings back" + }, + { + "date_published": "2023-02-23", + "newspiece": "KoboldAI Horde has been merged into Stable Horde as a unified AI Horde!", + "tags": [ + "text2text", + "ai horde" + ], + "importance": "Information", + "more_info_urls": [], + "title": "KoboldAI merged" + }, + { + "date_published": "2023-02-21", + "newspiece": "The Horde now supports ControlNet on all models! All kudos go to [hlky](https://github.com/hlky) who again weaved the dark magic!", + "tags": [ + "controlnet", + "img2img", + "hlky" + ], + "importance": "Information", + "more_info_urls": [ + "https://github.com/hlky" + ], + "title": "ControlNet support" + }, + { + "date_published": "2023-02-14", + "newspiece": "You can now use an almost unlimited prompt size thanks to the work of ResidentChief!", + "tags": [ + "text2img", + "img2img", + "ResidentChief" + ], + "importance": "Information", + "more_info_urls": [], + "title": "Unlimited prompt size" + }, + { + "date_published": "2023-02-09", + "newspiece": "You can now select to generate a higher-sized image using hires_fix, which uses the composition of stable diffusion at 512x512 which tends to be more consistent.", + "tags": [ + "text2img", + "img2img", + "ResidentChief" + ], + "importance": "Information", + "more_info_urls": [], + "title": "Higher-sized images" + }, + { + "date_published": "2023-02-03", + "newspiece": "The horde now supports pix2pix. All you have to do is use img2img as normal and select the pix2pix model!", + "tags": [ + "img2img", + "ResidentChief" + ], + "importance": "Information", + "more_info_urls": [], + "title": "Supports pix2pix" + }, + { + "date_published": "2023-01-24", + "newspiece": "We now support sending tiling requests! Send `\"tiling\":true\"` into your payload params to request an image that seamlessly tiles.", + "tags": [ + "text2img", + "img2img", + "ResidentChief" + ], + "importance": "Information", + "more_info_urls": [], + "title": "Tiling requests support" + }, + { + "date_published": "2023-01-23", + "newspiece": "I have tightened the rules around NSFW models. As they seem to be straying into 'unethical' territory even when not explicitly prompted, I am forced to tighten the safety controls around them. From now on, otherwise generic terms for young people like `girl` ,`boy` etc Cannot be used on those models. Please either use terms like `woman` or `man` or switch to a non-NSFW model instead.", + "tags": [ + "countermeasures", + "nsfw" + ], + "importance": "Information", + "more_info_urls": [], + "title": "Tightened NSFW rules" + }, + { + "date_published": "2023-01-23", + "newspiece": "The horde now has a [Blender Plugin](https://github.com/benrugg/AI-Render)!", + "tags": [ + "plugin", + "blender" + ], + "importance": "Information", + "more_info_urls": [ + "https://github.com/benrugg/AI-Render" + ], + "title": "Blender plugin" + }, + { + "date_published": "2023-01-23", + "newspiece": "All workers must start sending the `bridge_agent` key in their job pop payloads. See API documentation.", + "importance": "Workers", + "more_info_urls": [], + "title": "Bridge agent key" + }, + { + "date_published": "2023-01-18", + "newspiece": "We now have a [New Discord Bot](https://github.com/ZeldaFan0225/Stable_Horde_Discord), courtesy of Zelda_Fan#0225. Check out [their other bot](https://slashbot.de/) as well! Only downside is that if you were already logged in to the old bot, you will need to /login again.", + "importance": "Information", + "more_info_urls": [ + "https://github.com/ZeldaFan0225/Stable_Horde_Discord", + "https://slashbot.de/" + ], + "title": "New Discord bot" + }, + { + "date_published": "2023-01-18", + "newspiece": "The prompts now support weights! Use them like so `(sub prompt:1.1)` where 1.1 corresponds to +10% weight You can tweak upwards more like `1.25` or downwards like `0.7`, but don't go above +=30%", + "importance": "Information", + "more_info_urls": [], + "title": "Prompt weights" + }, + { + "date_published": "2023-01-12", + "newspiece": "We plan to be replacing our official discord bot with [new a new codebase](https://github.com/ZeldaFan0225/Stable_Horde_Discord) based on the work of Zelda_Fan#0225. Once we do, be aware that the controls will be slightly different and you will have to log-in again with your API key.", + "importance": "Upcoming", + "more_info_urls": [ + "https://github.com/ZeldaFan0225/Stable_Horde_Discord" + ], + "title": "New Discord bot codebase" + }, + { + "date_published": "2023-01-11", + "newspiece": "The Stable Horde has its first browser extension! [GenAlt](https://chrome.google.com/webstore/detail/genalt-generated-alt-text/ekbmkapnmnhhgfmjdnchgmcfggibebnn) is an accessibility plugin to help people with bad eyesight always find alt text for images.The extension relies on the Stable Horde's newly added image interrogation capabilities to generate captions which are then serves as the image's alt text.", + "importance": "Information", + "more_info_urls": [ + "https://chrome.google.com/webstore/detail/genalt-generated-alt-text/ekbmkapnmnhhgfmjdnchgmcfggibebnn" + ], + "title": "First browser extension" + }, + { + "date_published": "2023-01-06", + "newspiece": "The amount of kudos consumed when generating images [has been slightly adjusted](https://dbzer0.com/blog/sharing-is-caring/). To simulate the resource costs of the horde, each image generation request will now burn +3 kudos. Those will not go to the generating worker! However we also have a new opt-in feature: You can choose to share your text2img generations with [LAION](https://laion.ai/). If you do, this added cost will be just +1 kudos. We have also updated our Terms of Service to make this more obvious.", + "importance": "Information", + "more_info_urls": [ + "https://dbzer0.com/blog/sharing-is-caring/", + "https://laion.ai/" + ], + "title": "Kudos cost adjustment" + }, + { + "date_published": "2023-01-05", + "newspiece": "[Worker now have a WebUI](https://dbzer0.com/blog/the-ai-horde-worker-has-a-control-ui/) which they can use to configure themselves. Use it by running `worker-webui.sh/cmd`", + "importance": "Workers", + "more_info_urls": [ + "https://dbzer0.com/blog/the-ai-horde-worker-has-a-control-ui/" + ], + "title": "WebUI for worker configuration" + }, + { + "date_published": "2023-01-04", + "newspiece": "We are proud to announce that we have [initiated a collaboration with LAION](https://dbzer0.com/blog/a-collaboration-begins-between-stable-horde-and-laion/) to help them improve their dataset!", + "importance": "Information", + "more_info_urls": [ + "https://dbzer0.com/blog/a-collaboration-begins-between-stable-horde-and-laion/" + ], + "title": "Collaboration with LAION" + }, + { + "date_published": "2023-01-04", + "newspiece": "[You can now interrogate images](https://dbzer0.com/blog/image-interrogations-are-now-available-on-the-stable-horde/) (AKA img2txt) to retrieve information about them such as captions and whether they are NSFW. Check the api/v2/interrogate endpoint documentation.", + "importance": "Information", + "more_info_urls": [ + "https://dbzer0.com/blog/image-interrogations-are-now-available-on-the-stable-horde/" + ], + "title": "Image interrogation support" + }, + { + "date_published": "2023-01-01", + "newspiece": "Stable Horde can now be used on the automatic1111 Web UI via [an external script](https://github.com/natanjunges/stable-diffusion-webui-stable-horde)", + "importance": "Information", + "more_info_urls": [ + "https://github.com/natanjunges/stable-diffusion-webui-stable-horde" + ], + "title": "Support for automatic1111 Web UI" + }, + { + "date_published": "2022-12-30", + "newspiece": "Stable Horde now supports depth2img! To use it you need to send a source image and select the `Stable Difffusion 2 Depth` model", + "importance": "Information", + "more_info_urls": [], + "title": "Supports depth2img" + }, + { + "date_published": "2022-12-28", + "newspiece": "Stable Horde workers can now opt-in to loading post-processors. Check your bridge_data.py for options. This should help workers who started being more unstable due to the PP requirements.", + "importance": "Workers", + "more_info_urls": [], + "title": "Opt-in post-processors" + }, + { + "date_published": "2022-12-24", + "newspiece": "Stable Horde has now support for [CodeFormer](https://shangchenzhou.com/projects/CodeFormer/). Simply use 'CodeFormers' for your postprocessor (case sensitive). This will fix any faces in the image. Be aware that due to the processing cost of this model, the kudos requirement will be 50% higher! Note: The inbuilt upscaler has been disabled", + "importance": "Information", + "more_info_urls": [ + "https://shangchenzhou.com/projects/CodeFormer/" + ], + "title": "Supports CodeFormer" + }, + { + "date_published": "2022-12-08", + "newspiece": "The Stable Horde workers now support dynamically swapping models. This means that models will always switch to support the most in demand models every minute, allowing us to support demand much better!", + "importance": "Information", + "more_info_urls": [], + "title": "Dynamic model swapping" + }, + { + "date_published": "2022-11-28", + "newspiece": "The Horde has undertaken a massive code refactoring to allow me to move to a proper SQL DB. This will finally allow me to scale the frontend systems horizontally and allow for way more capacity!", + "importance": "Information", + "more_info_urls": [], + "title": "Code refactoring for SQL DB" + }, + { + "date_published": "2022-11-24", + "newspiece": "Due to the massive increase in demand from the Horde, we have to limit the amount of concurrent anonymous requests we can serve. We will revert this once our infrastructure can scale better.", + "importance": "Crisis", + "more_info_urls": [], + "title": "Limit on anonymous requests" + }, + { + "date_published": "2022-11-24", + "newspiece": "Stable Diffusion 2.0 has been released and now it is available on the Horde as well.", + "importance": "Information", + "more_info_urls": [], + "title": "Stable Diffusion 2.0 available" + }, + { + "date_published": "2022-11-22", + "newspiece": "A new Stable Horde Bot has been deployed, this time for Mastodon. You can find [the stablehorde_generator}(https://sigmoid.social/@stablehorde_generator) as well as our [official Stable Horde account](https://sigmoid.social/@stablehorde) on sigmoid.social", + "importance": "Information", + "more_info_urls": [ + "https://sigmoid.social/@stablehorde" + ], + "title": "Mastodon bot deployed" + }, + { + "date_published": "2022-11-22", + "newspiece": "We now have [support for the Unreal Engine](https://github.com/Mystfit/Unreal-StableDiffusionTools/releases/tag/v0.5.0) via a community-provided plugin", + "importance": "Information", + "more_info_urls": [ + "https://github.com/Mystfit/Unreal-StableDiffusionTools/releases/tag/v0.5.0" + ], + "title": "Unreal Engine support" + }, + { + "date_published": "2022-11-18", + "newspiece": "The stable horde [now supports post-processing](https://www.patreon.com/posts/post-processing-74815675) on images automatically", + "importance": "Information", + "more_info_urls": [ + "https://www.patreon.com/posts/post-processing-74815675" + ], + "title": "Automatic post-processing" + }, + { + "date_published": "2022-11-05", + "newspiece": "Due to suddenly increased demand, we have adjusted how much requests accounts can request before needing to have the kudos upfront. More than 50 steps will require kudos and the max resolution will be adjusted based on the current horde demand.", + "importance": "Information", + "more_info_urls": [], + "title": "Adjusted request limits" + }, + { + "date_published": "2022-11-05", + "newspiece": "Workers can now [join teams](https://www.patreon.com/posts/teams-74247978) to get aggregated stats.", + "importance": "Information", + "more_info_urls": [ + "https://www.patreon.com/posts/teams-74247978" + ], + "title": "Teams for workers" + }, + { + "date_published": "2022-11-02", + "newspiece": "The horde can now generate images up to 3072x3072 and 500 steps! However you need to already have the kudos to burn to do so!", + "importance": "Information", + "more_info_urls": [], + "title": "High-res image generation" + }, + { + "date_published": "2022-10-29", + "newspiece": "Inpainting is now available on the stable horde! Many kudos to [blueturtle](https://github.com/blueturtleai) for the support!", + "importance": "Information", + "more_info_urls": [ + "https://github.com/blueturtleai" + ], + "title": "Inpainting available" + }, + { + "date_published": "2022-10-25", + "newspiece": "Another [Discord Bot for Stable Horde integration](https://github.com/ZeldaFan0225/Stable_Horde_Discord) has appeared!", + "importance": "Information", + "more_info_urls": [ + "https://github.com/ZeldaFan0225/Stable_Horde_Discord" + ], + "title": "New Discord bot" + }, + { + "date_published": "2022-10-24", + "newspiece": "The Stable Horde Client has been renamed to [Lucid Creations](https://dbzer0.itch.io/lucid-creations) and has a new version and UI out which supports multiple models and img2img!", + "importance": "Information", + "more_info_urls": [ + "https://dbzer0.itch.io/lucid-creations" + ], + "title": "Client renamed Lucid Creations" + }, + { + "date_published": "2022-10-22", + "newspiece": "We have [a new npm SDK](https://github.com/ZeldaFan0225/stable_horde) for integrating into the Stable Horde.", + "importance": "Information", + "more_info_urls": [ + "https://github.com/ZeldaFan0225/stable_horde" + ], + "title": "New npm SDK" + }, + { + "date_published": "2022-10-22", + "newspiece": "Krita and GIMP plugins now support img2img", + "importance": "Information", + "more_info_urls": [], + "title": "Krita and GIMP img2img" + }, + { + "date_published": "2022-10-21", + "newspiece": "Image 2 Image is now available for everyone!", + "importance": "Information", + "more_info_urls": [], + "title": "Img2img for everyone" + }, + { + "date_published": "2022-10-20", + "newspiece": "Stable Diffusion 1.5 is now available!", + "importance": "Information", + "more_info_urls": [], + "title": "Stable Diffusion 1.5" + }, + { + "date_published": "2022-10-17", + "newspiece": "We now have [a Krita plugin](https://github.com/blueturtleai/krita-stable-diffusion).", + "importance": "Information", + "more_info_urls": [ + "https://github.com/blueturtleai/krita-stable-diffusion" + ], + "title": "Krita plugin" + }, + { + "date_published": "2022-10-17", + "newspiece": "Img2img on the horde is now on pilot for trusted users.", + "importance": "Information", + "more_info_urls": [], + "title": "Img2img pilot" + }, + { + "date_published": "2022-10-16", + "newspiece": "Yet [another Web UI](https://tinybots.net/artbot) has appeared.", + "importance": "Information", + "more_info_urls": [ + "https://tinybots.net/artbot" + ], + "title": "New Web UI" + }, + { + "date_published": "2022-10-13", + "newspiece": "KoboldAI Has been upgraded to the new countermeasures", + "tags": [ + "countermeasures", + "ai horde" + ], + "importance": "Information", + "more_info_urls": [], + "title": "KoboldAI upgraded" + }, + { + "date_published": "2022-10-11", + "newspiece": "A [new dedicated Web UI](https://aqualxx.github.io/stable-ui/) has entered the scene!", + "importance": "Information", + "more_info_urls": [ + "https://aqualxx.github.io/stable-ui/" + ], + "title": "New dedicated Web UI" + }, + { + "date_published": "2022-10-10", + "newspiece": "You can now contribute a worker to the horde [via google colab](https://colab.research.google.com/github/harrisonvanderbyl/ravenbot-ai/blob/master/Horde.ipynb). Just fill-in your API key and run!", + "importance": "Information", + "more_info_urls": [ + "https://colab.research.google.com/github/harrisonvanderbyl/ravenbot-ai/blob/master/Horde.ipynb" + ], + "title": "Google Colab worker" + }, + { + "date_published": "2022-10-10", + "newspiece": "The [discord rewards bot](https://www.patreon.com/posts/new-kind-of-73097166) has been unleashed. Reward good contributions to the horde directly from the chat!", + "importance": "Information", + "more_info_urls": [ + "https://www.patreon.com/posts/new-kind-of-73097166" + ], + "title": "Discord rewards bot" + }, + { + "date_published": "2022-10-09", + "newspiece": "The horde now includes News functionality. Also [In the API!](/api/v2/status/news)", + "importance": "Information", + "more_info_urls": [ + "/api/v2/status/news" + ], + "title": "News functionality" + }, + { + "date_published": "2022-10-06", + "newspiece": "We have a [new installation video](https://youtu.be/wJrp5lpByCc) for both the Stable Horde Client and the Stable horde worker.", + "importance": "Information", + "more_info_urls": [ + "https://youtu.be/wJrp5lpByCc" + ], + "title": "New installation video" + } +] \ No newline at end of file diff --git a/requirements.dev.txt b/requirements.dev.txt index bea94d2d..893da15d 100644 --- a/requirements.dev.txt +++ b/requirements.dev.txt @@ -1,6 +1,6 @@ pytest==8.0.2 -black==24.2.0 -ruff==0.3.1 +black==24.4.2 +ruff==0.4.2 tox~=4.14.1 horde_sdk>=0.7.29 diff --git a/tests/conftest.py b/tests/conftest.py index c449802d..5944e788 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -4,17 +4,17 @@ import requests -@pytest.fixture +@pytest.fixture(scope="session") def CIVERSION() -> str: return "0.1.1" -@pytest.fixture +@pytest.fixture(scope="session") def HORDE_URL() -> str: return "localhost:7001" -@pytest.fixture +@pytest.fixture(scope="session") def api_key() -> str: key_file = pathlib.Path(__file__).parent / "apikey.txt" if key_file.exists(): @@ -23,7 +23,7 @@ def api_key() -> str: raise ValueError("No api key file found") -@pytest.fixture(autouse=True) +@pytest.fixture(autouse=True, scope="session") def increase_kudos(api_key: str, HORDE_URL: str, CIVERSION: str) -> None: headers = {"apikey": api_key, "Client-Agent": f"aihorde_ci_client:{CIVERSION}:(discord)db0#1625", "user_id": "1"} diff --git a/tests/test_image.py b/tests/test_image.py index 6d6018e4..a464d155 100644 --- a/tests/test_image.py +++ b/tests/test_image.py @@ -1,3 +1,5 @@ +import json + import requests TEST_MODELS = ["Fustercluck", "AlbedoBase XL (SDXL)"] @@ -31,10 +33,12 @@ def test_simple_image_gen(api_key: str, HORDE_URL: str, CIVERSION: str) -> None: async_results = async_req.json() req_id = async_results["id"] # print(async_results) + print(async_results) pop_dict = { "name": "CICD Fake Dreamer", "models": TEST_MODELS, - "bridge_agent": "AI Horde Worker reGen:4.1.0-citests:https://github.com/Haidra-Org/horde-worker-reGen", + "bridge_agent": "AI Horde Worker reGen:8.0.1-citests:https://github.com/Haidra-Org/horde-worker-reGen", + "nsfw": True, "amount": 10, "max_pixels": 4194304, "allow_img2img": True, @@ -47,13 +51,14 @@ def test_simple_image_gen(api_key: str, HORDE_URL: str, CIVERSION: str) -> None: } pop_req = requests.post(f"{protocol}://{HORDE_URL}/api/v2/generate/pop", json=pop_dict, headers=headers) try: + print(pop_req.text) assert pop_req.ok, pop_req.text except AssertionError as err: requests.delete(f"{protocol}://{HORDE_URL}/api/v2/generate/status/{req_id}", headers=headers) print("Request cancelled") raise err pop_results = pop_req.json() - # print(json.dumps(pop_results, indent=4)) + print(json.dumps(pop_results, indent=4)) job_id = pop_results["id"] try: @@ -75,7 +80,7 @@ def test_simple_image_gen(api_key: str, HORDE_URL: str, CIVERSION: str) -> None: retrieve_req = requests.get(f"{protocol}://{HORDE_URL}/api/v2/generate/status/{req_id}", headers=headers) assert retrieve_req.ok, retrieve_req.text retrieve_results = retrieve_req.json() - # print(json.dumps(retrieve_results,indent=4)) + print(json.dumps(retrieve_results, indent=4)) assert len(retrieve_results["generations"]) == 1 gen = retrieve_results["generations"][0] assert len(gen["gen_metadata"]) == 0 diff --git a/tests/test_image_extra_sources.py b/tests/test_image_extra_sources.py index b6f0431a..75ccabd4 100644 --- a/tests/test_image_extra_sources.py +++ b/tests/test_image_extra_sources.py @@ -55,7 +55,8 @@ def test_simple_image_gen(api_key: str, HORDE_URL: str, CIVERSION: str) -> None: pop_dict = { "name": "CICD Fake Dreamer", "models": TEST_MODELS, - "bridge_agent": "AI Horde Worker reGen:5.3.0-citests:https://github.com/Haidra-Org/horde-worker-reGen", + "bridge_agent": "AI Horde Worker reGen:8.0.1-citests:https://github.com/Haidra-Org/horde-worker-reGen", + "nsfw": True, "amount": 10, "max_pixels": 4194304, "allow_img2img": True,