dannooppo

joined 5 months ago
[–] dannooppo@lemmy.world 1 points 1 day 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 1 points 1 day ago* (last edited 1 day 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 2 days ago (1 children)

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 1 points 2 days ago

It's beyond me for now, but maybe this helps: DIY Perchance API. The link is at 2/3rd of the Perchance welcome page.

When it does work, let me know as I am in the process of getting myself new hardware esp. for LLM and the works. Any info on what and why will be highly appreciated.

[–] dannooppo@lemmy.world 2 points 2 days ago (2 children)

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 1 points 2 days ago

Perchance does not support image2image generations, text2image support only.

[–] dannooppo@lemmy.world 3 points 2 days ago* (last edited 2 days ago) (4 children)

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 1 points 2 days ago

Language! If you want a mature reply, act accordingly.

[–] dannooppo@lemmy.world 1 points 3 days ago (1 children)

The easiest way to get a contorted, twisted body is to define a woman's chest and genitals in the prompt combined with a 'backside view'. As humans we instantly understand the front side of the woman will probably not be visible, AI not as much and tries to show both front and backside.

(All tests with 6 images and 'no style')

Try this one, just for fun: A {|candid|professional} photo of an ugly {woman|female|girl}

Options 'blank' or 'candid' will mostly yield wrinkly females in their late 40s/50s regardless of the type, while 'professional' mostly yields (freckled) plastic fantastic with age depending on type. AI definitely thinks ugly females are old and wrinkly. With 'Professional' the AI just cannot believe ugly old people want a picture of themselves and smoothens their faces and keeps them relatively young.

Another one: A photo of an old girl <= notice the missing period at the end

Who said I wanted an old 1920s photo capturing a young female with a weathered face? Now add a period '.' at the end of the prompt. A completely different age category.

When I casually mention 'whow, that old girl still has a nice rack', we all know what I mean. Why can't AI?

Okay, let's go for that: A photo of an old girl with a nice rack. Oh my, that was unexpected.... (most certainly NSFW at any age, definitely, regardless of a '.' at the end).

A photo of an old girl with a nice rack and a supermodel body. NSFW again, some improvements, but where did I mention 'nekkid'? Granted, I did say 'body'...

A photo of an old girl with a nice rack and a supermodel body wearing a dress. Totally different attitute (and thanks to the heavens for the dress). With or without '.' makes quite a difference. Without seems to yield better quality.

Closing, let's add 'professional' again: A professional photo of an old girl with a nice rack and a supermodel body wearing a dress. Ahh, here's my goodlooking granny... Wrinkled, true, but will still turn heads (one way or another anyway). Here too without '.' seems to yield (somewhat) better quality, more close up portrait style.

Lesson: know what you want and be specific.

But, dang, who said she had to be in her late 70s? When I'm 6yo, 25 is old already...

[–] dannooppo@lemmy.world 2 points 1 week ago (3 children)

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 1 week ago (5 children)

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

 

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
 

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 ›