Perchance - Create a Random Text Generator

331 readers
26 users here now

โš„๏ธŽ Perchance

This is a Lemmy Community for perchance.org, a platform for sharing and creating random text generators.

Feel free to ask for help, share your generators, and start friendly discussions at your leisure :)

This community is mainly for discussions between those who are building generators. For discussions about using generators, especially the popular AI ones, the community-led Casual Perchance forum is likely a more appropriate venue.

See this post for the Complete Guide to Posting Here on the Community!

Rules

1. Please follow the Lemmy.World instance rules.

2. Be kind and friendly.

  • Please be kind to others on this community (and also in general), and remember that for many people Perchance is their first experience with coding. We have members for whom English is not their first language, so please be take that into account too :)

3. Be thankful to those who try to help you.

  • If you ask a question and someone has made a effort to help you out, please remember to be thankful! Even if they don't manage to help you solve your problem - remember that they're spending time out of their day to try to help a stranger :)

4. Only post about stuff related to perchance.

  • Please only post about perchance related stuff like generators on it, bugs, and the site.

5. Refrain from requesting Prompts for the AI Tools.

  • We would like to ask to refrain from posting here needing help specifically with prompting/achieving certain results with the AI plugins (text-to-image-plugin and ai-text-plugin) e.g. "What is the good prompt for X?", "How to achieve X with Y generator?"
  • See Perchance AI FAQ for FAQ about the AI tools.
  • You can ask for help with prompting at the 'sister' community Casual Perchance, which is for more casual discussions.
  • We will still be helping/answering questions about the plugins as long as it is related to building generators with them.

6. Search through the Community Before Posting.

  • Please Search through the Community Posts here (and on Reddit) before posting to see if what you will post has similar post/already been posted.

founded 1 year ago
MODERATORS
1
 
 

Edit #2: This is now a bug-report. I changed the "reply as" option back to the default user, exported the thread, and it imported correctly.

Because I'm paranoid, I export my data frequently, but when testing to see how easy it was to re-import data, I keep running into this error.

I've tried exporting the thread multiple times, but it will not import properly. The imported thread appears and is interactable, but if you click on it, it starts an infinite loading screen that locks up the tab.

Considering the amount of time I've spent on some of these stories, it makes me uneasy that the official method of saving them just...doesn't work.

Windows 11, Chrome on desktop.

Anything I can do to save the thread aside from the soulless text export? (which I'm grateful for, don't get me wrong!)

Edit I tried a couple other threads that work, so it's only the current one I'm on that's messed up somehow. The only differences I can think of between it and the other threads are that I had added some styling in the character sheet, like a background and opacity to the text boxes. I also set user responses to respond as an imported character, instead of the default "user".

2
 
 

I created a community specifically for NSFW perchance creations. If you are interested, hop over and discuss and share your favourite creations or finds.

3
4
 
 

promptOptions.context Send in a JS object or a list as a context the prompt has access to. Perhaps options to overload the window (falls through to the window if a name isn't found within the context), or completely contained (only things within the context can be accessed: avoids any name clashing issues).

image({ plain_object }) Allow a normal JS object to be used. Currently the plugin relies on list properties here and there, which means it breaks when a simple JS object is sent even if it has the same exact used properties.

As JS is used to create these images in a lot of generators, this would cut out the need for the engine to get involved and generate the promptOptions object at all. And the creator doesn't have to worry about how the lists work to be able to use the image generator.

promptOptions.select() When a button is clicked to "select" a particular generated image's settings... if there's a .select() function available, call it with everything to do with that generation: prompt object, etc. Maybe if there is no such function, don't show that button.

This could be used to set up the generator's textarea and other options in whatever way the creator sees fit. Or even to use this function for any other thing.

We can sort of half do this by giving each generation an id, and adding our own button next to it. And I think we can get some sort of info about a generation from its iframe? Maybe? Not sure.

But anyway, this would be a simple way of reaching in and out of the generation iframes.

Show prompt while loading: and just an idea to show the text prompt/negative prompt while the image is loading. It's useful as a creator/user to see what the prompt is that's actually generated--and nip it in the bud if we can see it's malformed or bugged in some way. Just an idea.

5
1
submitted 3 months ago* (last edited 3 months ago) by [email protected] to c/[email protected]
 
 

I have 100+ characters i actively use on perchance but i never made a account. So, if i make a account now will all my characters stay? or will they be deleted? T>T i have no clue so i turned to the community for help :') plz help-

6
 
 

This would allow things like linking to a specific heading in the tutorial, for example.

You could also make the hash accessible to the generator app. (I don't know if the url is already available.)

7
1
submitted 3 months ago* (last edited 3 months ago) by [email protected] to c/[email protected]
 
 

Whenever I try to make something of my own with the Terminal template OR try to view / use someone elses, it's just black. I can't input any text or anything. Is it maybe something on my end? Any help would be great. Thanks!

Edit: I've also tried using a different wifi / internet and it still doesn't work.

8
1
submitted 3 months ago* (last edited 3 months ago) by [email protected] to c/[email protected]
 
 

do lorebook's not work on guest character's or am i just doing something wrong because every time i pull a character in they just seem to not work, if not is there someway to get them to work?

is there anywhere to see some long lorebook's for referance, i would like to see the way others write it makes things easier, or can someone post there's?

does the Generate Expression Images after Every Chat code still work, because i copied and pasted the code from https://rentry.org/i7usm into the character java script box and all that happens is it says running code then just does nothing?

is there a example for how the Generate Expression Images after Every Chat is supose to work?

9
1
submitted 3 months ago* (last edited 3 months ago) by [email protected] to c/[email protected]
 
 

Time for another trailer about the big Generator Manager 2.0.20.1 update! I have just started planning and getting to work on building the changes for the big update very soon, from the latest Preview update, and I hope that this goes well enough so that I could finish it in basically a few days from now. But there are three more off-Preview changes I want to mention here: new backgrounds and accent colors (of course), new sidebar items, and finally, the introduction of dark mode for the very first time ever!

And there's just so many more coming out for the huge update...

10
 
 

If I'm working on more UI-type stuff, things can fail silently in quite confusing ways... because I don't have dev tools open, because I'm essentially already using an IDE. But that IDE isn't showing me some errors--I think because they are happening in event handlers and such, and so aren't directly run by the engine.

So I was thinking if window.onerror was monitored those could be caught too.

...

On a related note, I noticed that if you throw "a message" (I'm lazy and it's usually absolutely fine with dev tools)... instead of throw new Error("a message"), the engine itself errors-out and doesn't even show that actual message.

I think this is because it assumes it is an Error object, when it may not be. A check for that, and handling of any thrown value would just make it more rock-solid when it comes to showing users their errors.

...

On another related note, I saw this in the code:

// The following line is a hack to make it so "pause on caught errors" works for perchance errors in devtools.
// Click the function names in the "call stack" to go "back in time" and find more details about your error (ask for help on the forum if needed)

And I feel seen! ๐Ÿ˜œ

11
 
 

Does this actually do anything? I notice that no one uses this feature but it's there in text-to-image-plugin.

I've set up a little test, and... it generates images. Here. Unclear if they are affected by the referenceImage I've given it though. Perhaps there is a particular kind of test I could try to see it in action? Or if you could let me know what I'm doing wrong?

12
 
 

Since the new backups feature was released, which adds an ability to create restore points of generators in a case I accidentally closed a tab while the generator isn't saved yet. But I sometimes work on updating generators through a logged-out session or, when creating a new generator (hitting the new button in the navigation bar and it opens up the minimal template), which is in an unowned generators session (only save and account buttons in the top-right).

And so, I'd need that feature to work on these kinds of environments, so I don't ever have to worry losing all the work there, especially when creating new generators.

13
 
 

I cant do anything to perchance at the moment, I am wanting to remove and add a few features to the ai girl lab template, but every time it happens I get this error. The funny thing is that the code that it wants you to change or edit doesn't exist on the HTML code whatsoever. it is so god damn annoying. any fixes?

14
 
 

This is a pretty interesting topic to talk about. Whenever I feel want to bring a generator to the top of the generators page, hoping for a few people to click on them through the page, I always feel like the only way is to save the generator and made some tiny changes if possible. But, what if I don't want to actually change any of the content in a generator, and still be able to save it?

Well, I know there's now a system where if you edit a generator and then undo/edit it back to its exact original/saved state (basically reverting it) Perchance will auto-detect that and the save button will go back to the saved state. This is a great feature honestly, but it's still possible to do the trick but the generator's content needs to be different from the original state, at least a character off. For example, adding an unobtrusive space around the lists code, or moving the list items up or down (Ctrl+Shift+Up/Ctrl+Shift+Down) and then saving right away.

But what do you think about this?

15
 
 

I know there's some code in there about default values if it's just a string... but it doesn't seem to be working right. When I use that, it's super tall and skinny on the page.

16
 
 

(Sorry if this wasn't the right way of posting this bug. Just let me know how it should be done and I'll remember for next time.)

It appears that it interprets a prompt that is a number as being a number value. I have no idea why. This breaks because it's trying to do some .replace() on the prompt to make a tooltip it seems.

This doesn't just happen in my own app. If you use No Style on AI Image Generator, it errors too.

Numbers this happens for are integers 123, floats 1.23, with or without a negative sign -123. If it's got anything but the above in the prompt, even a space, or a leading zero, it does not bug out. But of course ideally, people wouldn't have to find this workaround to make sure their generator doesn't error-out. (Though I'm sure most people haven't found this problem, so the problem likely would happen to most or all image generators.)

17
 
 

Seeing this appear on your page with no actual error message has got to be the bane of perchance users across the world ๐Ÿ˜…

It's really opaque, and gives you nothing to go on. So you resort to commenting out whole sections of code trying to get any clue as to what the problem is.

It would really improve the experience of developing apps if there was a real message somewhere for us to see.

18
 
 

Currently to go through each match, I have to use ctrl+f, enter over and over which is awkward and tedious. Would be great if that line at the top stayed and let us press enter over and over to get to the next match. Perhaps shift+enter to go to the previous match. And little buttons in there to do the same.

Right now, finding stuff in my code is a pretty annoying process.

19
1
[Request] Logging (lemmy.world)
submitted 3 months ago* (last edited 3 months ago) by [email protected] to c/[email protected]
 
 

Logging is a key thing to have for simpler debugging of code. Normally console.log would be used for this, when developing with JS.

It seems we cannot use console.log within code--at least I have not been able to get it to work. Even if it worked, it would be a bit messy having the whole dev tools pane open on top of all the existing frames in the editor.

So some sort of logging out functionality and view would be useful I think--just the stuff logged by the user's code. Even in the little REPL in the corner maybe? Or a tab within that? Whatever is fine.

Just something to help people debug with this simple method. For now, I've made my own which just logs to the page itself.

log(msg) => document.body.appendChild(document.createElement("div")).innerText = msg;
20
 
 

I'm not sure if this is a bug or what, but there's something unexpected going on.

I've set up a test for you to see here: https://perchance.org/sxvghvl53i#edit

I've got an $output that creates HTML, which contains the code [a.html], but escaped so that it's not processed. So: \[a.html\].

This is then injected into the page, and actually processed correctly, replacing the contents with the a.html value. But then calling update() on that element either does nothing or throws an error of one kind or another.

It says that a_elem is undefined, when it should have already been injected into the page.

Honestly, I've been fiddling with this test for a while now and I can't quite pin down exactly how it works or what this works and that doesn't or what order things are being processed in... But some sort of shenanigans is going on.

If this is all working as expected, I'd love to learn how it works. But if not, consider this a bug report ๐Ÿ˜…

21
 
 

I prefer to leave "auto" off while coding, as I do a lot of stuff before I want anything to run, want to avoid running half-written code and getting errors, etc. But then I have to go and click on the "reload" button all the time to test.

Saving reloads the app too, but I don't really want to save all those versions just when testing. It would be great to have a shortcut to reload. Perhaps CTRL+R can be overriden? Or some other shortcut--it's all good.

22
 
 

It would be so useful to be able to search the current gallery by text--including the title, prompt (and whatever else there might be). That's about all I have to say about that I guess ๐Ÿ˜…

23
 
 

There's some very strange behaviour that happens when you use CTRL+F to search for text on a page.

For example:

The first "image" text on the page is in the "images & sprites" heading. But before that, it finds 4 instances of "image" which... seemingly don't exist? Are hidden or something? Looking at the code of that generator I have no idea. Only then does it find any of the real instances of "image" that are on the page--three of them.

This problem happens all over the site on all sorts of generators by the way, it's not unique to that one. It's just an easy example.

For me personally this has been troublesome when trying to search on a documentation page for some particular function name--things like that. Or when there's a very complex generator with a ton of buttons I want to find one that does the thing I want to do--but instead I have to read through every one of them, because the page search doesn't work correctly.

By the way I'm using Chrome 126.0.6478.132 (Official Build) (64-bit). I haven't tested on other browsers, but as a lot of the big browsers are Chromium-based I'm guess at least those will have the issue.

24
 
 

We can put CSS in our generators that works with the user's dark mode setting on their device. But it would be great if that was built-in to the default styles. Doesn't have to be anything fancy, this would do for a start:

@media (prefers-color-scheme: dark) {
  body {
    background-color: #000;
    color: #aaa;
  }
}

It seems some of the templates may override such styles and make the body white and such anyway. So maybe that's something to look into as well.

25
 
 

If you set it to allow permanently, there is no way for the user to turn the block on again without fiddling with code. Even if they set it to an hour or whatever, they may want to turn it on again early, which they also cannot do.

I was thinking maybe if it detects it was an nsfw image, it shows an extra button which lets you block nsfw images.

I talked about this on Reddit, and found a solution with some help.

I made the following (somewhat) easier solution that less technical people can use. It uses a bookmarklet.

Make a bookmark, call it what you want. Set its address to: javascript:url="http's://image-generation.perchance.org/embed"; if (location.href!==url) { alert("Opening to correct page. Run this again."); open(url); } else { localStorage.okayToShowNsfwUntil="0"; alert("NSFW setting reset."); }

(I would put a link you can drag into your bookmarks, but this forum doesn't recognise "javascript:" addresses.)

Note that this will run JS code in your current page. though you can see what it's doing if you're worried about that and decide if you want to use it or not.

With the code formatted more clearly:

url="https://image-generation.perchance.org/embed";
if (location.href !== url) {
  alert("Opening correct page. Run this again.");
  open(url);
}
else {
  localStorage.okayToShowNsfwUntil="0";
  alert("NSFW setting reset.");
}

If you're not in the right place it opens a window to image-generation. And if you are in the right place, it resets the okayToShowNsfwUntil flag for you.

I hope this helps people in the meantime. But it would be great if there was something built-in to image-generation so people don't have to find this page and make the bookmarklet and all that.

view more: next โ€บ