[-] perchance@lemmy.world 1 points 4 hours ago

My bad, sorry about that! Should be fixed now. Let me know if you still have issues.

[-] perchance@lemmy.world 2 points 3 days ago

This is a good point. I should be creating more "high-level config" layered on top of the examples that I create, so people can change a line here and there, and see how easy it is to create something new, and then maybe dive deeper from there. The ai chat/rpg/etc. generators that I've made aren't very "configurable" in the same sense as the t2i framework thing.

[-] perchance@lemmy.world 2 points 3 days ago

Thanks! create-instance-plugin problem is fixed. Not sure about the ai-character-chat problem. It's possibly a browser-cache-related issue where for some reason Cloudflare cache returned a faulty response at some point (for a scipt tag in ai-character-chat), but then it was cached by a bunch of users before the issue resolved itself.

I've just tried adding a quick fix to work around the issue in the meantime, so hopefully it's solved now.

[-] perchance@lemmy.world 1 points 3 days ago

Hmm, I'm not sure what is causing this, but I've just tried to add a fallback/workaround in case of this type of error. Can you please try again and let me know if there's still an issue?

(I'm assuming this bug report is referring to perchance.org/ai-character-chat - please check the URL exactly matches that)

[-] perchance@lemmy.world 1 points 3 days ago

If you refresh the page, does it fix the issue? I think it might have been a temporary problem related to caching. Let me know if it's still a problem for you.

[-] perchance@lemmy.world 2 points 3 days ago* (last edited 3 days ago)

VPNs are not blocked on Perchance - you should be able to access the site and create/edit/view/use generators (including AI-based ones) regardless of whether or not you're using a VPN.

Are you perhaps talking specifically about the comments plugin? If so, yeah it's unfortunate. I had to disallow VPNs from posting comments because they allow you to switch IPs instantly, which removes any ability for moderation, user-blocking and spam prevention.

I have ideas about how to remove this constraint (at least partially), but for now my todo list is too long to get to it any time soon.

Note: If you want to allow comments from VPNs on your own generators, then "one weird trick" (which I should formalize into an actual feature) is to put "feedback" in the channel names. Another trick is to embed Disqus, or some other comments system (or of course create your own comments plugin if you know how to code).

[-] perchance@lemmy.world 2 points 3 days ago

Thank you!! I did a bit of refactoring on the engine recently and introduced a bug. Fixed.

[-] perchance@lemmy.world 2 points 6 days ago

Thank you pestering me on this, this was a bug with how customCode was being handled on /ai-character-chat

It's all fixed now, and I've updated the rentry doc with the Python example, and also created an example character for you to test here:

https://perchance.org/ai-character-chat?data=Python_Helper~986c80bf8a26a3b156a5be6c34805540.gz

Thanks! Also ty @VioneT@lemmy.world for looking into this, and for the ping 🙏

[-] perchance@lemmy.world 1 points 6 days ago* (last edited 6 days ago)

Thanks! I've just fixed a bug in the be-plugin which was the cause of this. But it looks like there's a bug in the have-plugin, and that's not mine. Whoever owns it needs to change this:

let thisNode = document.querySelector(`.${elementId}`);

to this:

let thisNode = document.querySelector(`.${elementId}`);
if(!thisNode) return;

I.e. just add if(!thisNode) return; below it.

10
submitted 2 weeks ago* (last edited 2 weeks ago) by perchance@lemmy.world to c/perchance@lemmy.world

I've received a few messages from experienced developers asking how they might be able to help improve Perchance. I typed out a decently long (but somewhat rambling and incomplete) response to a message just now and figured I might as well post it publicly for the benefit of others who are interested.

The TL;DR is probably: The most impactful thing that devs can do for the perchance community is to just have fun building things (generators/plugins/etc) that are interesting/useful to you, and then share your creations with friends or communities that might enjoy them. This is very helpful!

Message response below:


The Perchance site itself is really just a code editor with a sandboxed iframe (that the code is thrown into), and a mongodb server for accounts/generators, so not a lot of my dev time goes into that level of the platform. And the DSL/engine doesn't change much at this point (though an overhaul will likely come at some point), so most of my time is spent on creating plugins, examples/applications, and stuff like that.

I could add a bunch more features to the site, but I prefer to keep the foundation very simple, which is why I create plugins like perchance.org/upload-plugin and perchance.org/comments-plugin and so on. I.e. instead of adding comments as a "native" feature, I just add it as a plugin, which allows me to be more nimble and experimental.

There are limits to this, of course. One native feature that is sorely needed imo is collaborative editing - akin to Google Docs, so you can just share a link to start working on stuff with others. Another is optional AI-assisted code auto-completion. For both of those I need to upgrade to CodeMirror 6, but the Lezer stuff is kinda gnarly. If someone managed to get the Perchance DSL highlighted with CodeMirror 6 that would be very handy, but this is definitely not a "good first issue". I did spend one day on it, thinking that's all it'd take, but I now realize that it's something which I'll need to set aside several days for, and I've been putting it off.

Here's the basic setup for CodeMirror 6: https://perchance.org/codemirror6-basic-html#edit

And I originally thought I'd use the same mixed parsing approach that @codemirror/lang-html uses, except instead of the HTML script tags triggering the transition from non-JS text to JS-highlighted text, it'd be square brackets (and function headers), but I think the problem with that is that the HTML parser has the advantage that the closing script tag in HTML code always means "end of JS" (even if it's e.g. in the middle of a JS string! this can be somewhat surprising to many web devs), whereas closing square brackets can 'validly' occur in JS code without necessarily indicating the end of a square block. Someone here seems to have come to the conclusion that Lezer might not be a good fit for this sort of thing, and so a stream parser might be the way to go, but I'm not so sure, because IIUC, @codemirror/lang-javascript manages to do it with template strings. I.e. ${ to indicate start of JS, and } to indicate end. That's almost identical to what is needed for the Perchance DSL, so it seems like Lezer can do this. But maybe @codemirror/lang-javascript is doing some non-Lezer stuff, since IIRC there are some proprocessing/tokenization things you can do before it gets passed to Lezer. Either way, using the official JavaScript (or html/markdown/etc - which includes it as a sub-module) parser, with some minimal modifications, is probably the way to go, since I don't want to have to maintain a from-scratch lib of that level of complexity.

So that's one thing that comes to mind right now, but that said, probably the most helpful thing that community members can to do to help Perchance is to create generators/plugins/games/etc. An interesting one that I noticed a few days ago, as an example: https://perchance.org/ai-roguelike and another: https://perchance.org/infinitecraft-but-its-a-trading-card-game

The advantage of helping in this way is: 1) it's fun and you can just build stuff that's interesting to you, and 2) it doesn't require any coordination with me or anyone else. The latter point is pretty important because I'm a pretty solitary/hermit type of person, so it may be hard to get in contact with me for several weeks at a time.

I've spent quite a bit of time recently building generators to try and provide examples of games/experiences/tools that can be created with the AI plugins. The more people there are doing this, the more I can move down to the lower levels of Perchance. My bottleneck is currently at the higher "application" level, rather than the platform level, if that makes sense.

11
submitted 2 months ago* (last edited 2 months ago) by perchance@lemmy.world to c/perchance@lemmy.world

By "hide" I mean it shows a button in the top-right, which when clicked, shows the full header bar.

Examples:

Please let me know if you run into any issues or have feedback 🙏

Edit: Also, for people who know some JavaScript, you can use the public generator list API to get generators with specific tags like this:

let data = await fetch(`https://perchance.org/api/getGeneratorList?tags=foo`).then(r => r.json()); // returns generators tagged 'foo'
let data = await fetch(`https://perchance.org/api/getGeneratorList?tags=foo,bar`).then(r => r.json()); // foo AND bar
5

I think I got to the root of what was causing this. If anyone is still having issues signing up, please comment here.

5
submitted 3 months ago* (last edited 3 months ago) by perchance@lemmy.world to c/perchance@lemmy.world

See plugin page for details and examples:

https://perchance.org/favicon-plugin

8
submitted 3 months ago* (last edited 3 months ago) by perchance@lemmy.world to c/perchance@lemmy.world

As was noted on the plugin page, this was on the roadmap, but not yet supported. I've added support now thanks to a prod from @wthit56 so you can treat it just like you would a normal 'static' import.

One nice use case that this properly/robustly unlocks is the situation where you e.g. have a plugin that you've made, and you want to import the comments plugin so people can chat about your plugin and ask questions, but you don't want to cause all importers of your plugin to automatically get the comments plugin as a dependency.

If you just dynamically import the plugin in your HTML panel, then importers of your plugin won't get the comments plugin as a dependency. Example:

https://perchance.org/import-only-in-html-panel-no-dependency-example#edit

(Reminder that, as mentioned on the dynamic import plugin page, you should only use the dynamic import plugin in very particular scenarios, like this one, or e.g. when you have hundreds of imports but only a subset of those imports tend to get used by any particular user of your generator. Regular imports will generally allow for much faster generator loading, since all the data is preloaded.)

6
submitted 3 months ago* (last edited 3 months ago) by perchance@lemmy.world to c/perchance@lemmy.world

As usual, the Chrome team is leading the charge on some exciting new web platform tech. The goal is to release some prototypes and eventually write up the feature as a browser standard that would make its way into all browsers (i.e. not just Chrome).

The point is, it'd run completely on-device (no cloud access, works offline), so it'd be a very small model, but would likely still be smart enough for a lot of tasks - e.g. summarizing text, converting a list of words into a grammatically correct sentence/description, guessing an appropriate emotion based on some character dialogue, etc.

Article: https://developer.chrome.com/docs/ai/built-in

The key problem with these text generation models is how massive they are. They're so big that they could literally fill your entire device (for smart phones and cheap laptops, at least), and would bloat the initial browser download time from a few minutes to a few days for a lot of people.

Still, smaller models are getting surprisingly smart, and while they're still several times the size of the actual browser download itself, this download can be done in the background.

Either way, I'm excited about this new direction, because there are lots of tasks that don't require an extremely smart model, and so it's overkill to use /ai-text-plugin, especially since it means ads will be shown for non-logged-in users.

One problem that I do anticipate, is that the models will be extremely "safety-oriented", meaning refusal to even generate stuff like violence in a DnD fantasy adventure, and stuff like that. I know from experience that Google's Gemini models have false-positive-refusal rates that almost make them unusable even for many sfw tasks. There is a mention of LoRA fine-tuning in the article, which is very exciting and might help with that. If you're a web dev, you can use the links on the page to test their prototypes and give constructive+professional feedback on them. It'd be good for the health of the web platform to have some of the feedback be for use-cases like Perchance, and not just e.g. business applications.

Tangentially, builders here may also be interested in Transformers.js which allows you to run AI models in your browser. Ad-free AI plugins could already be created using this project, although for a lot of models the download times are a bit too long, and processing times also a bit too long (for mobile devices especially). Still, the situation is improving quite rapidly. /ai-character-chat already uses Transformers.js for text embedding.

8
submitted 5 months ago* (last edited 5 months ago) by perchance@lemmy.world to c/perchance@lemmy.world

It basically allows you to specify to different colors - one for if the user's device is in light mode, and the other if they're in dark mode. Here's an example gen showing how to use it:

https://perchance.org/css-light-dark-test#edit

<style>
  html { color-scheme: light dark; } /* this line is important! otherwise the code below won't work */
  
  body {
    background: light-dark(lightgrey, black);
  }
</style>

<p style=" color:light-dark(blue,lime); ">this text will be blue in light mode and lime in dark mode</p>

Note that this is a very new browser feature, and a lot of people are on older browser versions, so for at least the next few months you should probably still add a default color before your light-dark color like color:blue; color:light-dark(blue,lime);. That way the older browsers will still get the right colors, but in the newer browsers the light-dark color will override the default color.

6
submitted 5 months ago* (last edited 5 months ago) by perchance@lemmy.world to c/perchance@lemmy.world

I know there are a few people here who enjoy archiving - e.g. https://perchance.org/vionet20-abulafia-conversions

So I figured I'd mention this which I just stumbled across - from this post:

https://www.stevensavage.com/blog/2023/09/seventh-sanctum-next.html

I’m going to start making my generator notes and data available to you. The data is pretty easy to just bundle up, but I also want to make some notes on how to use it. I’ll make this very visible on the site so you can just download it and go do your own thing.

Replicate my generators. Enhance them. Build your own. Learn from them. Whatever works for you.

I know I can’t maintain the site forever – if nothing else, I won’t be around forever.

Perchance, on the other hand is going to be around until the heat death of the universe, so if anyone wants to help Steven preserve his work via Perchance versions of his gens, here's the data:

https://www.seventhsanctum.com/archive/sanctumdata.zip

If you work out the conversion rules, I or someone else can write the JavaScript code for a mostly-automated converter.

7
submitted 5 months ago* (last edited 5 months ago) by perchance@lemmy.world to c/perchance@lemmy.world

First, some context:

When you call list.evaluateItem, it evaluates the square and curly blocks of course, but it also removes backslashes that were before any square or curly blocks. Backslashes are used to tell the Perchance engine that a square or curly bracket should be interpreted 'literally' - i.e. not as a character with a special meaning.

So, for example if we call evaluateItem on a list item like this: {1|2|3} \[cool\] the output will be something like 2 [cool]. If we didn't put the backslash before the square bracket, the Perchance engine would look for a variable/list called "cool" and if it didn't find one, you'd get an error. The backslash says "treat this as a normal/literal square bracket - not a fancy Perchance thing".

Now to the point of this post:

Notice how in the above example of using evaluateItem on a list, the output (2 [cool]) has the backslashes removed? As previously mentioned, that is the correct/desired behavior. But I just found a bug where if you call evaluateItem on a string like {1|2|3} \[cool\] it would output 2 \[cool\] instead of 2 [cool].

I've just fixed this bug - so the backslashes are now removed (just like when using evaluateItem on lists and list items), but I've made it so the bugfix is only applied when you next save your generator - just in case there are any issues with the fix. So please go ahead and save your generator, and if you run into any issues, even if you fixed them, please let me know in the comments. Any examples of issues will help me build an understanding of the effect of this change.

Thanks!

9

This likely won't be relevant to a lot of devs here, because the remember plugin does the job fine in most cases, but:

Here's a normal text input (id is not needed for this example, but is almost always needed so adding it here):

<input id="thingyInput">

And here's one which remembers what you type into it even after page refresh:

<input id="thingyInput" oninput="localStorage.thingy=this.value" value="[localStorage.thingy || '']">

Of course, the remember-plugin can do this for you, but I often find myself reaching for the above pattern for its simplicity.

localStorage is what the remember-plugin uses behind the scenes - whatever you store in it will be persisted even after page refresh. It's a built-in browser/JavaScript feature - not something that's specific to Perchance.

The || '' in [localStorage.thingy || ''] means or ''. In other words, it means or output nothing. If you want a default value for when the user loads the page for the first time, you could write [localStorage.thingy || 'blah'] which means "use whatever is in localStorage.thingy if it exists, otherwise use 'blah'"

7
submitted 6 months ago* (last edited 6 months ago) by perchance@lemmy.world to c/perchance@lemmy.world

(To be clear, since I realized just now that to non-devs the title might be misleading: This feature does not add AI bots to your comments plugin by default! The comments plugin and the AI plugins are completely distinct. But plugins can of course interact with one another, and this new feature of the comments plugin allows for some interesting interactions - the title just gives one of those as a fun example.)

You can now "programmatically" submit comments on behalf of the user, and you can also get/set the contents of the input text box.

If a comment was programmatically submitted, then a little icon is shown on the comment to indicate that the user didn't personally click the submit button.

This feature, used alongside the onComment/onLoad feature can e.g. be used to create an AI bot that "lives in" your comments box, or create a multiplayer game of chess, or maybe add an auto-error-report log using window.onerror, and so on.

Edit: Also, you can now use c.comments to get an array/list of the comments - but make sure to do that only after onLoad has triggered, since c.comments only returns loaded comments - so if comments box hasn't loaded yet, you'll get an empty array.

Let me know if you find any bugs/issues!

https://perchance.org/programmatic-get-set-submit-comments-plugin-example#edit

I'll probably create a little AI bot example at some point, but you're welcome to beat me to it! (Please post it here on lemmy if you do)

7
submitted 6 months ago* (last edited 6 months ago) by perchance@lemmy.world to c/perchance@lemmy.world

The comments plugin has a new feature that allows you to access the "stream" of comments as they are submitted to your comments box. So now you can "do stuff" on your page in response to comments that people make.

Title is (mostly) a joke, but it wouldn't be toooo hard to create simple multiplayer games like chess or little point-and-click worlds that people can play on your page via the comments (just need to ignore invalid user moves/inputs based on the rules of the game you're making).

I expect a few perchance devs to play around with some "mad science" along those lines, but for most people, probably the most useful thing here is that it allows you to completely customize the way comments are displayed. Including e.g. adding avatar pics to comments, changing the background image of every comment based on the keywords in it, making confetti fly across the page (for everyone) when someone says a secret/"easter egg" keyword, and so on.

Examples:

[-] perchance@lemmy.world 6 points 6 months ago

Yep, just waiting for a consensus to be reached on some solid open source finetunes so I don't have to test a million models

[-] perchance@lemmy.world 5 points 7 months ago* (last edited 7 months ago)

The best way to help pay for the AI plugins is actually to start playing around and building cool/fun things with them. And of course sharing those things with fandoms/communities/etc. that would likely find them useful.

Some people create an account just to not see ads, which is fine, but it does add a little burden. Luckily there are a bunch of perchance builders who are creating cool stuff using the AI plugins and sharing that stuff with the 'outside' world -- they are the ones that make the AI plugin 'economics' work. Without them, all the people who using the GPU resources would be (mostly logged-in) Perchance users, and so there'd be no ad views to fund the AI plugins.

But don't stress if you aren't a builder (yet!). Ads don't fully cover the cost of AI plugins still, but it's manageable because I have personal income to help pay, and GPU cloud prices will eventually come down (in terms of perf/$), so at this point I'm not concerned at all about financial sustainability of the AI plugins.

[-] perchance@lemmy.world 6 points 11 months ago* (last edited 1 month ago)

Prompts and responses are not stored - i.e. once the server sends back the response, the text you sent and the generated response text should exist on your computer only. However note that, as @april@lemmy.world says, it is a bad idea to put sensitive personal info (i.e. more than perhaps your first name) into any online service like this, even if you fully trust the person/company running it and they've assured you that it's 100% private.

If you want to run AI text models ("LLMs") completely privately, this is probably the best place right now to learn more: https://www.reddit.com/r/LocalLLaMA

You can stop reading now if the point is taken, but if not, here is (what accidentally became) a wall of text to scare you:

  • I recently realised that if there happens to be an error during inference, then the server "leaks" the prompt into the (temporary) server logs (this was actually fixed a few hours ago: https://github.com/huggingface/text-generation-inference/releases/tag/v1.2.0 ). This particular issue is basically harmless because the server logs themselves obviously aren't public, and they're not saved to a persistent drive, but it gives you an idea of the sort of thing that can occur even if you fully trust the provider and they're acting benevolently.
  • If there's a bug where e.g. someone's requests are bringing down the server (e.g. tokenizer issue and stop sequence stuff have caused problems in the past) either accidentally or maliciously, investigating it often requires temporarily logging of the problematic requests. It's impossible for a provider to claim with 100% certainty that your data will never be seen by a human. This is just the nature of building a complex platform, debugging it, fending off malicious users, etc.
  • If you're using a generator on Perchance that someone else made (i.e. not one that you have coded yourself), then note that generator authors can code up arbitrary interfaces with arbitrary logic, so they could send your inputs off to their own server. This is of course the same as any other page on the internet that accepts user input, although Perchance does have the slight advantage that all generators have publicly-viewable and non-obfuscated code (via the edit button in the top-right of the page), so it's not as simple for a coder on Perchance to get away with this, especially if the generator has become decently popular - someone would notice. Either way, you're running some random person's code - by default you should assume it is unfriendly.
  • Services can get hacked, and the more popular they become, the bigger the target painted on them. If a service has user accounts associated with the user chat data then if someone gets access to the database, they have a list of emails (or phone numbers, or whatever), with all the associated user data. All the benevolence in the world won't make you immune from this. To be clear, Perchance does not associate user accounts with AI plugin requests - Perchance accounts are purely for people who want to build generators on Perchance - i.e. the only data that's associated with a Perchance user account is the generators/pages that they've created. All requests to the AI plugin servers are anonymous, regardless of whether you're logged in or not. But if you embed your personal info within those AI requests (i.e. in the text prompt) then nothing can save you, since a compromised server would mean the attacker could see all the data flowing through the server - i.e. prompts that include your sensitive personal info.

TL;DR: You should limit the personal info that you put into web pages/apps on the internet, regardless of any assurances given, even if you trust the dev/company. Swap out personal info for fake stuff, and if that's not possible, then it's time to save up for a second-hand RTX 3090.


While I'm here, @VioneT@lemmy.world, IIRC someone asked a similar question (here or maybe on the /hub) about the text-to-image-plugin and I think you answered it, but just to be clear, the answer is the same as above: Images are only stored if they save it to the gallery, otherwise it's gone forever. I'll link this comment on both the image and text AI plugins.


Some minor notes:

  • The (currently undocumented) responseObj.submitUserRating feature of the ai-text-plugin allows users to rate a response to help improve the AI. If you submit a rating on a generator that uses this feature (like the thumbs up/down on perchance.org/ai-chat), then the response that you're rating is temporarily stored as part of a scoring process to determine which of several "candidate variations" of an LLM is best (varying settings, model, etc.). The generator author should make it clear that ratings should not be submitted for text that contains personal data - I may make the plugin automatically show an informational message about this in a future update.
  • Some aggregate statistics are collected about prompts that are flowing through the manager server - e.g. I started collecting the ratio of PG-13 vs not on the image generation server so that I'd know if I accidentally broke my detection algorithm (such that e.g. it was flagging everything as nsfw, which happened once due to a regex error). Nothing in these aggregate statistics is even remotely private/personal. Just extremely high-level numerical statistics aggregated from literally millions of requests.
  • There's also a script which tracks how many requests each IP has made in the past 2 days, which allows me to do rate limiting, and track abusive IPs. Again, prompts are not stored so there's no association between IPs and prompts - it's literally just a counter that says this IP made this many requests, and it's cleared every 2 days.
  • As you probably know, the AI plugin servers are funded by ads. Perchance in general doesn't have any ads, and has always been completely free, but the AI plugins are way too expensive to fund out of my own bank account. So if you're not logged in, you'll see ads on generators that use AI plugins. I figured it's worth mentioning here that unlike basically every other ad-funded site on the internet, Perchance does not trust ads. Perchance has a sand-boxed separation between the actual generator/page contents (which live in a "iframe" - it's basically like a separate browser tab embedded within the page), and the place where ad code runs -- so ads cannot look at your chat/text/image/etc. data in order to guess at more relevant ads. Perchance uses a very reputable advertising company (same one used by Reuters and Aljazeera and several other large companies) so the likelihood of shady ad tech is already extremely low, but there's no need for any trust here, thanks to the sand-boxing that Perchance has. So, in terms of showing you more relevant ads, all they can possibly see is the URL of the page that you're on. That's the only thing that's exposed to ad serving algorithms by visiting a Perchance page, no matter how much information you input into a Perchance generator/page.
view more: next ›

perchance

joined 1 year ago
MODERATOR OF