perchance

joined 2 years ago
MODERATOR OF
[–] perchance 1 points 19 hours ago

Can you try in Chrome guest mode? By clicking the profile pic circle in the top right (next to the 3 vertical dots) and clicking "Open Guest Profile"? @[email protected] was seemingly able to get it working in Guest mode (actually @someone_random you checked https://perchance.org/a5lshnqjrq in guest mode and it worked, but could you also check https://perchance.org/ai-character-chat ?)

If it works in guest mode then it's almost certainly something to do with browser extensions or broken browser caching. The latter could actually be related to a Windows 11 update, but it is definitely not the first thing I'd guess, especially since incognito mode definitely shouldn't be using the same cache.

Also, @someone_random, you mentioned that incognito is the closest thing OperaGX has to guest mode, but note that some browser extensions may still be enabled in that case, so testing in incognito mode doesn't necessarily rule out browser extensions being the cause.

[–] perchance 1 points 19 hours ago (2 children)

Okay this time I've done a much more comprehensive fix, so it should patch ~all the functionality that older browsers don't yet have.

if i stay too long it’s crashed

I'm not sure what's causing this, but let me know if it still occurs after checking the above fix and we can debug further.

[–] perchance 1 points 21 hours ago (1 children)

Hmm so it's working on Chrome guest profile which confirms that it's not your network - can you see if your OperaGX browser has a similar "guest mode" and test with that?

Since you mentioned that it has the same error in Edge and Chrome (when in 'normal'/non-guest mode) - is there a browser extension that you have for all 3 browsers? You can try temporarily disabling your browser extensions one by one on the extensions manager page of your browser.

This error from your earlier screenshot is not coming from Perchance code, so it might be from a browser extension that's causing an issue:

If you do manage to find the culprit, please do share it here so we can more easily help others with similar issues in the future.

[–] perchance 1 points 1 day ago (3 children)

Can you try visiting this: https://user-uploads.perchance.org/file/4cc84b2c503aad595e5c6e9fffe24602.js and let me know if there's error or if you see the script (a bunch of code stuff like (function (global, factory) { ...)

If you do see code at the above URL (i.e. no error), then can you use Chrome in guest mode (click profile pic thing in top-right corner, next to 3 vertical dots, and click the item at the bottom "Open Guest Profile") and screenshot this: https://perchance.org/a5lshnqjrq

Also, is this only a problem on your university wifi? Do you have access to any other internet connection to test, so we can determine whether it's specifically the network that's the cause?

[–] perchance 1 points 1 day ago (5 children)

Sorry about that I think I had a bug - can you please try again? https://perchance.org/a5lshnqjrq

Also, if you happen to have another browser installed, can you try with that too, so we can cross-check against e.g. network issues vs browser extension issues, etc.

Testing your OperaGX browser in "guest" mode (i.e. without any extensions enabled), would also be useful info for me.

If it still doesn't work in other browsers, then, if possible (it's fine if not - just ignore this part), can you tell me the company name of your ISP? I.e. "Internet Service Provider" - the company that provides your wifi/mobile data. There were some malicious uploads to user-uploads.perchance.org which caused some ISPs to temporarily ban the subdomain, but it seems that some ISPs have "permabanned" it, so I'd need to reach out to them to ask them to lift the ban I think.

[–] perchance 1 points 1 day ago (4 children)

Sorry about that, I think that was a bug from a different change I made. I think I've fixed it now. Can you please try again?

[–] perchance 2 points 2 days ago

I've just added deletionUrl to the returned values of the upload plugin:https://perchance.org/upload-plugin-deletion-example#edit And I've added a button in the t2i framework which uses it in the "share link" popup.

@[email protected] Despite file upload URLs being unguessable (in a cryptographic sense), I think it's a very fair point that there should it should be obvious to the user when they're about to initiate an upload, or it should be easy to easily undo. I considered adding an auto-expiry (which the upload plugin already supports), but I figure this "deletion button" approach is probably the most intuitive one for most users, who may not read the "this link expires in N days" message, and be surprised/dismayed when their character link gets randomly deleted after a few days.

Another option would be to use the URL hash to store data (i.e. massively long link where the data, including the character image, is embedded within it), so no upload is required. This wouldn't solve your browser history thing, but tbh I think that's not really something that Perchance can solve for you - browser history is more something for you to manage, especially since web pages (like many on Perchance) can use localStorage, so it's not just about the URL of the page. So in general I think you ought to be in incognito when you don't want your browsing history to be recorded by your browser.

In any case, thanks for the good feedback - let me know if you have any thoughts on the new design.

[–] perchance 2 points 2 days ago* (last edited 2 days ago) (6 children)

Can you try again now? I think it's because you're using an old browser version, but I've just added something that should work around the issue.

@[email protected] I've actually fixed this by adding the polyfill at the 'platform' level - i.e. with code like this in the iframe, before the generator code runs:

if(!window.structuredClone) await import("https://cdn.jsdelivr.net/npm/[email protected]/web/structured-clone.js/+esm");

If there are any more platform-level polyfills that you think should be added from https://github.com/zloirock/core-js (or elsewhere) let me know. Easy for me to add, and saves every dev from having to add their own polyfills for the longtail of old browsers.

[–] perchance 1 points 2 days ago

Hmm, the code/logs that you've pasted isn't actually from perchance - looks like it's coming from a browser extension or something.

Can you tell me what you see when you visit this page? https://perchance.org/dl0tvy489b#edit If it's working you should just see function(e){return t(e)} appear in the middle of the page.

[–] perchance 1 points 2 days ago (8 children)

Can you please try visiting this page and telling/screenshotting what you see? --> https://perchance.org/a5lshnqjrq

For some reason the CBOR library doesn't seem to be loading in your browser. It could be a browser extension causing an issue, or maybe due to an old browser version, or weird browser. Can you let me know the browser name and version?

[–] perchance 1 points 4 days ago

Sorry about this, and sorry for the delayed response - I think it was a rate limiting bug/oversight (that I've just fixed). Could you try again and let me know if it's still not working?

Aside: It is weird that you tried on phone data and it still didn't work though - if rate limiting is/was the issue, then testing using your mobile should have worked. Are you sure you had your wifi turned off on your phone when you tested? If not, then your phone was probably automatically using your wifi connection instead of your mobile data.

[–] perchance 1 points 3 weeks ago

Ah thank you! Fixed. It shouldn't save as new gen when you're using a collab link anymore, even if you're logged in and not the gen's owner.

 

You can now click the gear icon in the text editor and create a "collab link" for your generator. If you share that link with others, they'll be able to edit/save the generator, and you'll be able to see each others text cursors/carets.

You can disable/invalidate the link, and regenerate a new one.

Please let me know if there are any issues! I may be able to improve the performance/latency of it after some more work on the server.

9
submitted 1 month ago* (last edited 1 month ago) by perchance to c/perchance
 

Several months ago I said new image generation quality would be coming soon. Then flux came out and I was like "oh cool, i'll just wait a month or so for community finetunes", and once again informed people that an image gen upgrade was not far off. But it turns out flux is really hard to finetune in its current form.

Aside: There have been attempts to fix this issue, but we're not quite there. I've been helping some people who are working on this (mainly dataset stuff, I'm no ML researcher), and progress is being made, but we're still at least a month away from 'serious' flux finetunes.

So base flux still doesn't know 'basic' stuff (e.g. doesn't even know most pokemon), and illustrious (another new model) requires a very specific prompting format.

While helping with the eventual open source flux finetune, I have also been attempting to put together a system that would intelligently route to the best model based on prompt content, and also generate tags for illustrious based on a natural language prompt, but it's still not good enough.

So Perchance images are atrociously bad at this point, and I considered just upgrading to SDXL, but this would likely mean two upgrades in a short period of time, both of which would require prompt engineering adjustments on the part of perchance generator devs. That would be annoying, and maybe more painful than just dealing with bad generation quality for another month or two.

In hindsight, I should have just upgraded to SDXL midway through 2024 (or even earlier). We may actually get another text gen upgrade before the image gen one at this rate. We're also getting close on video gen now with models like HunyuanVideo, which seems to be finetunable, and is quite fast with FastVideo.

Tangentially, I've been spending a lot of time on behind the scenes server stuff recently. For example, I've had to add filters to prevent people from uploading literal CSAM to perchance.org/upload - a problem that I naively did not consider when first creating the upload feature. This sort of work is annoying because it doesn't result in fun new features or plugins, but spending time on automating this sort of thing is important, because it ensures that e.g. using features like /upload doesn't require logging in, and doesn't e.g. require employing people for moderation. I'd much rather move a bit slower, and ensure perchance's sustainability and complete independence.

And tangential to that: One thing that I want to publicly promise, just so I can say "I told you so" in 20 years, is that Perchance will never "sell out" or "rug pull" in any sense of either phrase. It'll always be a bit weird. It'll never get investors, I'll never sell it, never require login, never send you emails (except e.g. password reset), never put ads on generators (unless it imports an AI/server-GPU-powered plugin), never add user-hostile social mechanics that try to increase 'engagement metrics', and so on. The OG devs here know this I hope, but there are newbies and non-devs here who think perchance is just another "AI site" that is burning investor money to keep it free, in preparation for a rugpull once they have market share. Perchance is a different kind of website. It's a public good that I maintain, not a "startup". The price you pay for this as someone who uses perchance is slower development, which I think is worth it, especially considering that it's always been like this, and people seem to like perchance (though I'm sure many wish I could fix/improve things faster).

So anyway, this was (supposed to be) just a quick post about what's been happening recently on the dev side of things. Apologies for the huge delay on the image gen side of things. Also sorry for the lack of response to a lot of posts and messages - I have a large backlog of stuff to get to (as usual, please feel free to ping me again and/or repost weekly).

12
submitted 3 months ago* (last edited 3 months ago) by perchance to c/perchance
 

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.

 

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
 

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

 

See plugin page for details and examples:

https://perchance.org/favicon-plugin

 

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.)

 

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.

 

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.

5
submitted 9 months ago* (last edited 9 months ago) by perchance to c/perchance
 

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.

 

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!

 

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'"

view more: next ›