Generate Asset: Dynamic HTML Rendering

I use a generate text block to create an image prompt. I then pass that prompt to the Generate Image block which works fine (using most modes). However, the model intermittently breaks the image URL when the Gen. Assett block renders its html. See below:

Here’s the correct URL the Generate Image block returned:

https://images.mindstudio-cdn.com/a6113351-a6dc-4b49-8a30-07b13ce6185a/generated-images/c8a493bf-ee46-4fa0-8a75-ee8d7a889c86.png

When the model generates the HTML, it omits part of the link, which is why the image doesn’t display:

https://images.mindstudio-cdn.com/a6113351-a6dc-4b49-8a30-07b13ce8a/generated-images/c8a493bf-ee46-4fa0-8a75-ee8d7a889c86.png

The section of the broken url 07b13ce8a should be 07b13ce6185a , thus a damaged inline url. This breakage is intermittent.

NOTE: I am using the Dynamic HTML setting. Changing the Generate Asset block to Custom solves this url issue but undermines copius amounts of prompting in other blocks.

Hi @Avocet,

Thanks for sharing all these details!

Please note that this is not a bug on the MindStudio side. When you use the Dynamic HTML Source Type in the Generate Asset block, the HTML is generated entirely by the model you’ve selected, so consistency depends on that model’s output.

If you’re aiming for reliable, consistent output, the Custom Interface Source Type is usually a better fit. It generates the code once and then updates images and text dynamically using variables.

If you do need fully custom HTML generated on every run, Dynamic HTML would be the right option. However, please keep in mind that LLMs might occasionally output incorrect links or break parts of the code. There’s no way to guarantee perfect output every time with this option, but a few tweaks in the Generate Asset block can help reduce issues when using Dynamic HTML:

  • Try different models: some are more consistent with structured output
  • Lower the temperature: higher values increase creativity but also the chance of hallucinations or broken links
  • Keep the prompt concise and focused, and reference variables separately from the main instructions
  • Explicitly state that links must not be altered

Hope this helps!

Thanks much Alex! I will mess with models some more. Note that when I change to custom, and load a sucessful run from the debugger as test data, the work flows merely repeat the data from the test data load and the dynamism from my prompting is not there. Each run has the same (wrong) details. Otherwise, I would enjoy the freedom the custom interface would supply. I was told this had something to do with the test data submitted. Am I looking at reprompting the entire agent? Boo.

Hi @Avocet,

Could you share a remix link to the Agent where the Generate Asset block with a Custom Interface is always outputting test data instead of resolving variables?

Sure here it is … let me know if you want a debug copy also …

https://app.mindstudio.ai/agents/skitinerary-usa-v3-8e6caf25/remix

Just changed the Source type from Dynamic HTML to Custom as it has kept the test data I applied earlier.

Hi @Avocet,

Thanks for sharing the link!

It looks like the model chose to use the static test data when generating the HTML. If you run into such an issue when vibe coding, make sure to prompt the model to use the variables provided in the test data, so they’re resolved dynamically at runtime to have the text and media update correctly.

Alex .. I’m not seeing any variables (excet globals) in the test data. It is mostly the result of the model responses. What am I missing? Do you we vars in there? Thanks … The model butchers the respnose content with minimal data fro a saved run. The dynamic HTML creates beautiful text reponses. Do I have to get rid of the picture?

Hi @Avocet,

As we discussed earlier, if you want the UI from the Generate Asset block to change based on each run’s data, you’ll need to use the Dynamic HTML Source Type. That option regenerates the HTML from scratch on every run, which allows the UI to be completely different each time. The tradeoff is that LLMs can make mistakes when outputting larger or more complex HTML, so it’s worth testing different models, temperatures, and prompt wording.

My previous reply was addressing why assets generated with the Custom Interface Source Type were always showing the same data from the Test Data tab. In some cases, the model will hardcode static values into the HTML instead of referencing variables. To avoid that, the vibe-coding prompt needs to clearly instruct the model to rely on variables so the output stays dynamic and reflects the data from each run.

Right now, the Custom Interface Designer in your block has access to variables like itin, level, resort, skiers, and others. Make sure to prompt the Designer to instruct it to pull text and media from those variables so they update dynamically.

One other thing to flag, the itin variable currently contains a large chunk of unstructured text. If you want the Interface Designer to reference specific pieces of that content, I’d recommend switching the upstream Generate Text blocks that populate itin to use a JSON output schema. That way, the interface can reference individual fields instead of working with the full text blob.

Hope this helps!