VioneT

Doing Perchance.org things…

Links

  • 60 Posts
  • 815 Comments
Joined 2 years ago
cake
Cake day: June 21st, 2023

help-circle
  • There is no “Image to Image” or “AI Image Editor” working in Perchance.

    Looking at the code, it is generated through the AI code helper in which there are these sections:

      // AI Remove Object
      removeBtn.addEventListener('click', async function() {
        showLoading('Removing objects with AI...');
        
        // Simulate AI processing
        setTimeout(() => {
          if (selectedArea.isActive && selectedArea.width !== 0 && selectedArea.height !== 0) {
            // For demo: fill selection with a gradient (simulating AI inpainting)
            const gradient = ctx.createLinearGradient(
              selectedArea.x, selectedArea.y, 
              selectedArea.x + selectedArea.width, selectedArea.y + selectedArea.height
            );
      ...
      // Simulate AI object extraction
        setTimeout(() => {
          const img = new Image();
          img.onload = function() {
            // Scale the image
    

    Which is why it doesn’t work.


  • You can set the href through your code, not directly on the HTML e.g.:

    // function generateMisquote()
      ...
      // Select quote from array if necessary
      const original = selectQuote(quoteEntry.original);
      const misquoted = selectQuote(quoteEntry.misquoted);
      const source = selectQuote(quoteEntry.source);
      const url = quoteEntry.url // get the url link
      ...
      // Update after a short delay for the fade-out effect
      setTimeout(function() {
        // Display the misquoted quote and source
        quoteTextEl.textContent = misquoted.text;
        quoteSourceEl.textContent = `— ${source.text}`;
        quoteSourceEl.href = url; // set the href based on the url link
      ...
    


  • Having the generator ‘private’ only delists them from the /generators page. If someone else knows what the URL is (or has saved the URL before you’ve privated the generator), they can access it. The gallery is also quite buggy in which some images aren’t saved, and some images just pop up of nowhere. Can’t really tell what problem is occurring there.





  • On the edit generator screen, you can click the ‘settings’ on the top right, and you can change the URL. Images are bound to the URL of the page, meaning if you change the URL, then those images are also gone, but you can revert the URL back to get back the images.

    By private gallery do you mean the gallery below the generator (I’m assuming that you are using a generator using the t2i-framework-plugin-v2 based generator like ai-text-to-image-generator), then it isn’t a private gallery, it is the public gallery. If you changed the gallery destination, into a different name (other than public), there might be a case in which other people are also using the same gallery e.g. even if you changed the gallery name into private it wouldn’t be private, it would just be sent to the gallery named private.

    You cannot perma delete images from the gallery by yourself, you need to block and have other people block that specific poster for their images to not display on the public gallery (see this related thread).

    I would recommend using the actual ‘private’ gallery option that saves the data in your local storage. This is enabled with by adding the following on your settings (assuming you are using the t2i-framework):

    settings // This is the main settings list that is passed to `t2i-framework-plugin-v2` to generate the interface.
      ...
      imageButtons
        personality = true
        privateSave = true // Make sure to have this line.
    

    Then you can click the 🛡️💾 to save it locally on your browser.


  • You can have each of the suits into a single list, then control that parent list. E.g.

    Uniform
      https://user.uploads.dev/file/53321b33603b8f9f386fb870db73ad65.png
      [Top] ^[camera.includes("top") && actor != "dryad"]
      [Mid] ^[camera.includes("mid") && actor != "angel"]
      [Low] ^[camera.includes("low") && !["mermaid", "minotaur"].includes(actor)]
      [Rear] ^[camera.includes("rear") && actor != "angel"]
      [TopMidLow] ^[["top", "mid", "low"].some(a => camera.includes(a))]
    
    
    Top
      batman mask ^[specificCostume == "batman"]
      ...
    
    Mid
      batman suit with batman logo on the chest, batman gloves, batman belt ^[specificCostume == "batman"]
      ...
    

  • If you are using HTML inputs, you can easily access their values like checkbox.checked for checkboxes and radio buttons, textinput.value for input values and select dropdowns, in which you can also set their default values for each one natively, unless the function that you’ve made is for ‘resetting’ to default values.

    I would also go with the way that you have a single global object for all of your variables, just for organizing and ease of access.



  • I think I see the idea you have. What is the scope of the variable you are trying to set it to? You currently have it as:

      for (const [key, value] of Object.entries(variablesMapping)) {
        if (this[key] === undefined || this[key] === null) {
          this[key] = value;
        }
      }
    

    You are using this, which refers to the function. It should probably be set into what you have your initial variables, e.g. if you have your variables as properties in a variable called inputs, then it should be:

      for (const [key, value] of Object.entries(variablesMapping)) {
        if (inputs[key] === undefined || inputs[key] === null) {
          inputs[key] = value;
        }
      }
    

    So that if you use it like inputs.charNum, it would be set to the default that you have set with the defining() method.



  • On how you have your data, you can probably just add a url property for each instance of the source e.g.:

       {
          name: "original",
          label: "Original",
          placeholder: "Click the button below to generate an original quote.",
          data: [
            {
              quote: "Happiness beckons you once you forget you were looking for it.",
              source: "Eleanor Trent, 'Where's Joy?'",
              url: "link here"
            },
            {
              quote: "Memory is just the past asking for a permanent residence permit.",
              source: "Dr. Selim Farouk, 'The Mind's Archive'",
              url: "another link here"
            },
            {
              quote: "No one knows how Sentience is born, but we sure know how to kill it.",
              source: "Dr. Marcus Webb, 'The Philosophy of Consciousness'",
              url: "link here"
            },
            ...
    

    Then you can access it with .url (quoteEntry.url) and set it as the href of the quoteSourceEl.




  • There should be no problem with linking the defaultCommentOptions on JavaScript, it would be on this part of your code on the HTML:

        ...
        let othersChatDiv = document.createElement('div');
        othersChatDiv.id = 'others-chat-container';
        othersChatDiv.style.display = 'none'; // Hide others chat by default
        
        let mainChatOptions = defaultCommentOptions.createClone;
        mainChatOptions.channel = "qine-main-chat";
        mainChatOptions.commentPlaceholderText = "Casual talk, memes, fun — all here!";
        mainChatOptions.onComment = function (comment) {
          // Handle new comments in Main Chat
          console.log("New comment in Main Chat:", comment);
        }
        let mainChatPlugin = commentsPlugin(mainChatOptions);
        ...
    

    The problem is bannedUsersList is not in the generator, so it gives errors. Removing that from the defaultCommentOptions makes it work.




  • Best way I would think is use the default comment options that you have on the Perchance lists:

    defaultCommentOptions // for comments plugin: https://perchance.org/comments-plugin
      width = 100%
      height = 350
      commentPlaceholderText = Leave friendly comments..
      submitButtonText = submit comment
      bannedUsers = [bannedUsersList]
      customEmojis = {import:huge-emoji-list}
      adminFlair = 👑 Creator
      adminPasswordHash = 4b7a8a671d949baf24756f731091d13018de5c2ab4dd2cc1c1612a6643986933
    

    As the base options like so:

    let mainChatOptions = defaultCommentOptions.createClone;
    mainChatOptions.channel = "qine-main-chat";
    mainChatOptions.commentPlaceholderText = "Casual talk, memes, fun — all here!";
    mainChatOptions.onComment = function (comment) {
      // Handle new comments in Main Chat
      console.log("New comment in Main Chat:", comment);
    }
    let mainChatPlugin = commentsPlugin(mainChatOptions);