Single image [grid] works in preview but not in cooked


I’ve figured it out. The Bot is putting all images into a grid, but if there is only one image nothing is displayed.

The image is successfully generated, but it does not display. Editing the post and previewing it shows the image, but it doesn’t actually show in the PM.

Try clicking on the “generate image” dropdown.

That just shows the prompt for the image.

Sometimes the API will timeout, and no images will appear. You can check your logs for the specific message. :+1:

The API is working, and the images are uploaded. If I click edit on the bot’s post the post preview shows the image. It just doesn’t display in the PM.

Actually, I’ve figured it out. The Bot is putting all images into a grid, but if there is only one image nothing is displayed.

No repro here… A grid with 1 image works just fine:

1 Like

I will try updating to see if that fixes the issue. Is it possible that I have a configuration problem?

I have updated to the latest version, but the single images in grids still do not display.

As an example, this is the post and it’s actual HTML that is displayed in the browser:

  <summary>Generate image</summary>
    Isometric TARDIS

![Isometric TARDIS|512x512, 50%](upload://hzFPyqAeEQOZS5JROeSqfakzXzJ.jpeg)

And the HTML:

<div class="topic-post clearfix regular"><div class="post-user-tip-shim">    
<!---->    </div>
</div><article id="post_8" aria-label="post #8 by @gpt3.5_bot" role="region" data-post-id="475" data-topic-id="268" data-user-id="-111" class="boxed onscreen-post"><span aria-hidden="true" tabindex="-1" class="tabLoc"></span><div class="row"><div class="topic-avatar"><div class="post-avatar"><a class="trigger-user-card main-avatar " href="/u/gpt3.5_bot" data-user-card="gpt3.5_bot" aria-hidden="true" tabindex="-1"><img alt="" width="48" height="48" src="/letter_avatar_proxy/v4/letter/g/ee59a6/48.png" aria-hidden="true" loading="lazy" tabindex="-1" class="avatar"></a></div></div><div class="topic-body clearfix"><div role="heading" aria-level="2" class="topic-meta-data"><div class="names trigger-user-card"><span class="first username staff admin moderator"><a href="/u/gpt3.5_bot" data-user-card="gpt3.5_bot" class="">gpt3.5_bot</a><span title="This user is a moderator" class="svg-icon-title"><svg class="fa d-icon d-icon-shield-alt svg-icon svg-node" aria-hidden="true"><use xlink:href="#shield-alt"></use></svg></span></span><span class="persona-flair">    Artist
</span></div><div class="post-infos"><div class="post-info edits"><button class="widget-button btn-flat heatmap-high btn-icon-text" title="post last edited on Nov 17, 2023 7:30 pm" aria-label="post edit history"><svg class="fa d-icon d-icon-pencil-alt svg-icon svg-node" aria-hidden="true"><use xlink:href="#pencil-alt"></use></svg><span class="d-button-label">1</span></button></div><div class="post-info post-date"><a class="widget-link post-date" href="/t/trumps-magical-transformation-from-businessman-to-wizard/268/8?u=jimmy" title="Post date"><span title="Nov 17, 2023 5:03 am" data-time="1700197421867" data-format="tiny" class="relative-date">15h</span></a></div><div class="read-state read" title="Post is unread"><svg class="fa d-icon d-icon-circle svg-icon svg-node" aria-hidden="true"><use xlink:href="#circle"></use></svg></div></div></div><div class="regular contents"><div class="cooked"><details>
  <summary>Generate image</summary>
    Isometric TARDIS
<div class="d-image-grid" data-disabled="true">
</div></div><section class="post-menu-area clearfix"><nav class="post-controls collapsed"><div class="discourse-reactions-actions can-toggle-reaction" id="discourse-reactions-actions-475-left" data-click-outside="true"><div class="discourse-reactions-picker"></div><div id="discourse-reactions-counter-475-left" data-click-outside="true"></div></div><div class="actions"><span class="extra-buttons"><button class="widget-button btn-flat btn btn-default cancel-streaming no-text btn-icon" title="Stop reply"><svg class="fa d-icon d-icon-pause svg-icon svg-node" aria-hidden="true"><use xlink:href="#pause"></use></svg></button></span><div class="discourse-reactions-actions can-toggle-reaction" id="discourse-reactions-actions-475-right" data-click-outside="true"><div class="discourse-reactions-picker" style="position: absolute; inset: auto auto 0px 0px; margin: 0px; transform: translate(512px, -28px);" data-popper-placement="top"></div><div title="Like this post" class="discourse-reactions-reaction-button"><button title="Like this post" class="btn-toggle-reaction-like btn-icon no-text reaction-button"><svg class="fa d-icon d-icon-far-heart svg-icon svg-node" aria-hidden="true"><use xlink:href="#far-heart"></use></svg></button></div></div><button class="widget-button btn-flat share no-text btn-icon" title="share a link to this post"><svg class="fa d-icon d-icon-d-post-share svg-icon svg-node" aria-hidden="true"><use xlink:href="#link"></use></svg></button><button class="widget-button btn-flat show-more-actions no-text btn-icon" title="show more"><svg class="fa d-icon d-icon-ellipsis-h svg-icon svg-node" aria-hidden="true"><use xlink:href="#ellipsis-h"></use></svg></button><button class="widget-button btn-flat reply create fade-out btn-icon-text" title="begin composing a reply to this post" aria-label="Reply to post #8 by @gpt3.5_bot"><svg class="fa d-icon d-icon-reply svg-icon svg-node" aria-hidden="true"><use xlink:href="#reply"></use></svg><span class="d-button-label">Reply</span></button></div></nav></section></div><section class="post-actions">
  </section><div class="post-links-container"></div></div></div></article><div class="widget-connector">    <!---->

As you can see, no actual image is in the generated HTML.

What happens when you re cook the post, add a letter to the bots post

Nothing happens even after a rebake or an edit.

I can’t give you guys any help but telling that I get nothing too when there is just one single image generated.

  <summary>Luo kuva</summary>
    A photograph of a cup of coffee
<div class="d-image-grid">
<p><img src="" alt="A photograph of a cup of coffee" data-base62-sha1="1zF5fyN9IUn8LDKGq0cQV79IIVH" width="256" height="256"></p>

Yours has an image tag in the HTML, although mine doesn’t.

That’s true. But yet I have to generate two images to get those visible. That’s why I believe the issue is same.

It definitely seems similar. For now I just forked the plugin and removed the grid tag. I’m hoping for a permanent solution though, perhaps the bot could only use the grid for multiple images.

Does that div come from the plugin or Stability? But Discourse is handling d-image-grid, right?

The plugin just makes a post with a grid tag and Discourse generates the HTML as far as I know. I’m not sure about the specifics behind the scenes.

What if you edit out the grid tag?

Then it works. For me anyway.