[-] dannooppo@lemmy.world 2 points 1 week ago

@Jack_Fosset@lemmy.world @Koto@lemmy.world @enthusiasm_headquarters@lemmy.world

This is a bit hard to find in the Perchance Hub and by now it's SD tips are a bit obsolete, but still enlightening. Search on the page for the 'BREAK keyword'.

This reddit post might come in handy too: Let's make some realistic humans: Now with SDXL [Tutorial] (again SD, but much is still relevant).

[-] dannooppo@lemmy.world 2 points 1 week ago* (last edited 1 week ago)

Hi!

I'm using either Chrome or Firefox on Windows PC, straightforward, no VPN/Sandbox, or any other tool (maybe stupid Windows notepad to save snippets). Both browsers ran into the same issue, however, in the version I just tested, the chat responses seem to work now. FYI, I've never heard of either Thorium or Brave browser. I use Chrome, Edge, Firefox and for very old stuff Palemoon, on occasion Vivaldi (which is Chromium). So, no Linux.

Regarding 'what is $root?', it is a global variable inside Perchance, just like $meta. As you can see, Perchance AI-text-plugin understood perfectly what I meant. This is what your AI helper has to say about it (and I have no better explanation myself):

Hello! In the context of Perchance.org, $root is a special variable that represents the root scope of your Perchance script. The root scope is the global context in which all of your code runs, and it's where you define the core settings, functions, and data structures that are accessible throughout your script. Here's a simple example of how you might use $root to define a global variable: javascript // Define a global variable using $root $root.myGlobalVariable = "Hello, Perchance!"; // Now you can access this variable anywhere in your script console.log($root.myGlobalVariable); // Outputs: Hello, Perchance! When you create functions or objects that you want to be available globally, you can assign them to properties of $root. This way, you can avoid conflicts with other variables and ensure they are easily accessible from any part of your script. javascript // Define a global function $root.myGlobalFunction = function() { console.log("This is a global function!"); }; // Call the global function from anywhere in your script myGlobalFunction(); // Outputs: This is a global function! In Perchance, $root is also used to define custom functions and settings that are available in the story editor's interface. For example, you might define a function to manipulate story elements or set up a custom configuration for your story: javascript // Define a custom function that's available in the story editor $root.myCustomFunction = function(args) { // Your custom logic here }; // Use the custom function in the story editor { "type": "choice", "text": "What's your favorite color?", "choices": [ { "text": "Red", "value": "red" }, { "text": "Green", "value": "green" }, { "text": "Blue", "value": "blue" } ], "onChoose": [ { "name": "myCustomFunction", "args": ["green"] } ] } In this code snippet, myCustomFunction is a custom function defined on $root. When the user makes a choice in the story editor, the onChoose event triggers, and the specified name function is called with the provided args. The custom function can then perform an action based on the choice made. Remember, while $root is powerful, it's important to use it judiciously to avoid cluttering the global namespace and potentially causing conflicts with other code. Keep your global declarations to a minimum and use them only when necessary.

However, the chat-reply shows the three back-ticks of the MD code, not a marked down snippet like here in Lemmy. What's your intention with the markup of the code snippets? Show the code examples properly marked down or have the user copy the code and paste it to get a better view? It's not clear to me, something like the below is not really workable, esp. on smartphones (which I personally don't use to code):

A 'regular Perchance user' (none-programmer, that is) has no clue that they are about to use a 'bare-bones' generator when reading the below intro-message, heck as a developer I didn't:

Maybe adjust that with a better explanation, not everyone will enter edit-mode to check out the code (initially I didn't either, not until you suggested it in your comment).

Closing, I am not sure what this is about, the error occurs when the chat-reply finishes:

[-] dannooppo@lemmy.world 2 points 1 week ago

They are (seem to be) universal

  • I know BREAK is and works like advertised.
  • The parentheses can be used to add more weight to a (piece) of a prompt. Given that no parentheses is a weight of 1, then a single () is 1.1 * 1 weight, (()) is 1.1 * 1.1 * 1 weight and so on. Or they can be used like: (some really important piece of prompt):1.21, adding a certain weight directly. Don't overdo the decimal, something between 1.1 and 1.7 will usually do the trick.
  • The colon : is often used like a sum-up, e.g. the female is wearing: ..., ..., ... and ... ending with a dot or a semi-colon.
  • The semi-colon ; is used to split part of a scene like they are dancing; optimal lighting, low camera angle; leisure time concept.

It's not an exact sciene, but it will help.

[-] dannooppo@lemmy.world 2 points 1 week ago

Hi! Seems promising, however....

I went to your site (PC Firefox, Windows, 1920x1200, not logged in, advert bar at the bottom. PC Chrome logged in, no advert bar) and entered 'what is $root?' in the chat-input.

It starts to come up with an explanation, but when the output field fills the chat-messages, it removes the explanation and displays 'Sorry, I encountered an error. Please try again.', seemingly when finalizing the explanation. I tried it 3 times with 3 times the same result in both browsers.

  • Tried 'what is $meta?', same result.
  • Dito with 'what are nested lists?'

Furthermore:

  • The markdown of the code/chat output does not work, making code examples quite hard to read.
  • Are you using a timer outputting the text? It is really slow at posting the the text character by character. On average people do read a lot faster than that.

Love the idea, so don't get discouraged, as I think something like this will be a great help!!

[-] dannooppo@lemmy.world 3 points 1 week ago* (last edited 1 week ago)

The keyword BREAK, parenthesis () colon : semi-colon ; and dot . go a long way. While parenthesis are used for emphasis and weight, you can also use them to bundle parts of prompts. Colon to start a list, semi-colon to terminate. Won't always work as expected, but who doesn't like to fiddle.

Use BREAK to signal a new 'layer' in your image, essentially defining a new image within the image.

E.g. using art style 'casual photo' or 'professional photo' with prompt professional portrait of a female in a colorful dress BREAK a psychedelic black and white background will yield exactly that.

Below prompt, with 'professional photo' worked for me, consistently (okay, fairly), also with more than 1 image in one run:

professional full body photo of three slender lithe females BREAK one girl is a Caucasian redhead, casual wear BREAK one girl is African in a red dress, barefoot BREAK one girl is Japanse with white hair and big boots BREAK a psychedelic black and white background

The same run, 3 images:

As you can see, you will still need to be very specific between BREAKs to prevent spilling, but I think you will get the gist...

[-] dannooppo@lemmy.world 2 points 2 weeks ago

Depending on the age of a person you require, some obvious choices:

  • newborn, baby, toddler, x-th grader, middle/high-schooler, (pre) adolescent, teen(ager), tween, x-something, middle-aged, elderly, ancient, etc., optionally combined with early/late (though 'late ancient' must be minutes before death).
  • x aged girl/woman/female, be careful though, as 'aged' also means 'grown old'.
  • use old/young only if you're out of options (or just don't care).
  • don't mix human speech/slang/street-talk with proper grammar/spelling.
  • assume AI is stupid, just an algo traversing statistics and weight values.

Yah, the perks of the English language disambiguity will require you to be quite specific in your prompts. Using a dash (-) between words worked for SD, but Flux can be quite quirky (using the '-' as a negatory?).

Additionally, the t2i-framework-plugin-v2 [brain] button (, which uses the ai-text-plugin) does wonders for none-native English people like me.

FYI: use 'guy' for male versions as 'man' usually yields a hairy body builder with a 'wishful-thinking' reproductive organ.

[-] dannooppo@lemmy.world 2 points 2 weeks ago

I picked a random text2image generator from the generator list

Art Style: No Style No Negative, Guidance Scale 7

With the prompts you really need to be aware that an x year old woman can yield quite older looking females than an x year young woman. The same can be said of woman vs. girl vs. female. Depending on the run the differences can be quite distinct.

And A professional casual photo... vs. A casual photo... will definitely yield different results. The same goes for professional casual and casual professional.

...old woman

Prompt: A casual photo of a genuine {23|24|25|26|27}-year old woman, she has an {aquiline|up-turned|celestial|button} nose, and is of {German|Dutch|Belgian|French|Welsh} ancestry.

...young woman

Prompt: A casual photo of a genuine {23|24|25|26|27}-year young woman, she has an {aquiline|up-turned|celestial|button} nose, and is of {German|Dutch|Belgian|French|Welsh} ancestry.

...young female

Prompt: A casual photo of a genuine {23|24|25|26|27}-year young female, she has an {aquiline|up-turned|celestial|button} nose, and is of {German|Dutch|Belgian|French|Welsh} ancestry.

[-] dannooppo@lemmy.world 2 points 3 weeks ago

Yah, me too, and it will probably rid the 'recently added/updated generators' list from a lot of straightforward 'I wonder what the [save] button does' copies.

[-] dannooppo@lemmy.world 2 points 1 month ago

Shoot, LOL. I've been following your progress since version 4.0 or something. I like the way you are thinking and the solutions you have come up with. I've forked version 4.6b (so I'm far behind now), trying to build some responsive design into your generator. Been meaning to contact you as soon I have something worth looking at. I'ma retired software engineer and wanted a fun challenge...

[-] dannooppo@lemmy.world 2 points 1 month ago

You might want to have a look at the code of Imageconstructor by Koto. That generator has a nice solution. But, it's a lot of work too...

[-] dannooppo@lemmy.world 2 points 3 months ago

Thanks for the input, but this is a Javascript coding issue inside the plugin(s), not directly related to Perchance syntax for creating generator lists.

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

remember = true is not related to the remember-plugin but part of t2i-framework-plugin-v2. Basically both plugins save the value of a select to localStorage when activated and it can happen that one of the plugins has updated localStorage while the other hasn't (just yet). Especially when you close a generator before image/text generation has finished localStorage can (or may) contain two different values of the same select causing your issue. Depending on how you created the generator AND the order values get retrieved from localStorage it may SEEM that your generator suffers from dementia. You can (probably) resolve this by using either one, just not both 'remember' methods. I am still on the learning track, so don't ask me how to solve your specific problem. I need to figure out a lot more before ever being any use in that respect...

Off the bat I'd say don't use remember = true when you're using the remember-plugin.

3

Hi Perchance!

Trying to understand the inner workings of Perchance t2i-framework-plugin-v2 I cloned this plugin and added a few console.info() lines.

Especially in and around function updateInputVisibilities() (line 145+) to learn how userInputs[name] was set up.

Using my version of the t2i-framework plugin in a generator I saw in the console that on Generator pageload the function updateInputVisibilities() gets triggered by ___pageLoadHandler746291937() (which is to be expected, we need the elements set up), but also that ___selectElChangeEvent746291937() gets triggered for each <input>/<select>/<textarea> in the generated HTML.

In my case updateInputVisibilities() got triggered 21 times on Generator pageload instead of just once. The function gets triggered for each list/input used in the generator.

After some searching I found out that this is caused by the remember-plugin.

On Generator startup remember-plugin retrieves values from localStorage and updates the various input elements in the HTML, as to be expected. However, in doing so, it changes the element.value which in turn triggers the element.onchange event triggering ___selectElChangeEvent746291937(). While true, something has indeed changed, it is unwanted behaviour on pageload.

This little bug also unveiles that t2i-framework-plugin-v2 executes updateInputVisibilities() for each change in a single <select> updating all other selects as well.

I am still working my way into these two plugins, so I cannot exactly pinpoint what code needs to be changed. With just a few remembered inputs in localStorage it does little harm, but with large amounts of inputs, pageload time gets unnecessarily long.

My versions (for testing):

Be aware: when loading the generator for the first time with an empty localStorage nothing special will be noticed, however:

  • Change a few selects to fill localStorage
  • Clear the DevTools console to get rid of clutter
  • reload the generator => [Ctrl-F5]
  • Check the console info
  • Check if 'Danno Count' is >1
  • Filter console with 'trigger' to see the amount of ___selectElChangeEvent746291937() getting triggered
3

Hey everyone!! I'm a retired software engineer and the last few years I have gained a lot of knowledge about HTML/CSS automatic element scaling and responsive design in general. Been pretty busy on Stackoverflow and Codepen in that respect. I just love the perChance philosophy and what you people did with the place and I want to share my knowledge and start to maintain elaborate HTML/CSS/JS files on perChance (with all simple trickery) for everyone to use, starting with generic CSS and some JS convenient oneliner functions. MY QUESTION: what is the best way to store, import and access generic CSS (as well as HTML/JS) on perChance without having to copy content for each generator over and over again.

(I know and/or @import will work just fine, but I want to do it the 'proper perChance' way. I've been here for just a week, so gimme time to dive into the whole list and plugin sharing mechanism....)

view more: next ›

dannooppo

joined 6 months ago