Using the text-to-image plugin I generate a bunch of [output]'s in the <div> container. How do I access the <img> tag that the output object creates, for example if I want to get the title to get nseed from it using java script, or there’s an easier way to do that? I’m trying to make a button over the image to perfect that seed easier. Also, how do I access the button with id “heartBtn” that [output] creates?

  • Koto@lemmy.worldOP
    link
    fedilink
    English
    arrow-up
    0
    ·
    23 days ago

    thanks! I tried that and was super clunky to copy paste that. I tried to make the object clickable by doing like this <button id=“nseed” onClick="toUserPromp([seed])>[output]</button> but it’s a layer on top and the image itself isn’t clickable. is there any way to interact with the output to make it clickable or creating a button that is on top of the image just like the heartBtn and flagBtn?

    • VioneT@lemmy.worldM
      link
      fedilink
      English
      arrow-up
      0
      ·
      23 days ago

      Maybe something like this:

      output
        $output = [this.getRawListText.split('\n').slice(2).join('\n')]
        [s = seed.selectOne, ''] 
        <div style="position:relative;">
          <button style="position: absolute; left: 50%; bottom: 0%; transform: translate(-50%, -25%);" onclick="seeds.innerHTML += '[s]\r', this.disabled = true">Add to Seed History</button>
          [image(prompt)]
        </div>
        [s]<br>
        [lastTextToImagePrompt]<br>