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:
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.
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
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.
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?
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?
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.
Hello, I built an agent, but when I get to Generate Asset to PDF, I can’t seem to get the margins to work properly, so in the PDF the margins are way too wide and the font becomes really tiny. I’ve been troubleshooting this from the HTML template side to try to fix it, but nothing works. My settings are set to PDF, Letter, Portrait. Please help.
You should be using the Gen. Asset block in custom mode. That way you can vibe code via the chat window what you’d like. You will also need to provide some test data so the Model can get an idea of what you’re looking for.
the generate asset HTML is pretty involved and generates fine. The problem is the margins are way too wide and I’ve been vibecoding to test and debug but nothing is working. Is the recommendation to set custom parameters to force the changes. Here’s what I mean. When I go to Generate Asset block, Source Type HTML, Output PDF, Page size Letter, Portrait, trivial HTML with @page{size:Letter; margin:0}, and the output comes back at ~13.3 x 17.3 inches instead of 8.5 x 11, a uniform ~1.57x scale. Should I try to force a custom setting?
I don’t think it would hurt to try. You could also try uploading a PDF that is formatted the way you’d prefer and tell the AGENT to style the output as such. DO NOT FORGET to make a copy of the block you’re working on in the event things go south, and they do sometimes, so you can rollback ifyou have to. Just leave the copy unattached on the stage.
The CSS you’ve set gets skipped during PDF generation. Setting custom dimensions in the Generate Asset block should fix the scaling.
If you’d like to have more control over margins and layout, Custom Interface is more flexible for this kind of thing. You can select any model to generate the code, then make manual changes in the Code tab. Here’s a prompt you can use to add a Download PDF button to a custom interface:
Ensure the Download PDF button uses @react-pdf/renderer to generate a PDF with selectable text. Do NOT use window.print(). Use only @react-pdf/renderer’s built-in fonts. Prevent awkward page breaks on sections. Keep clean margins.
Hi @Avocet, that’s right, that reply was meant for @hrollo, who posted about a PDF margin issue further up in the thread. Appreciate you trying to help too!
I can’t seem to resolve my wonky PDF rendering. I switch to Custom Dimensions but then I don’t get any margin at the top or bottom of the page and I can’t add a footer.
Claude is asking me : 1) Does the scorer output reach the component as a JavaScript object I receive as props, or is there still an interpolation step? 2) Can I register my real fonts or do I have to only use the default fonts (Helvetica)?
It’s asking me to verify: Where does react-pdf code run in a MindStudio agent, given that Generate Asset only accepts html, markdown, spa, raw, or dynamic.
I’ve sent you an invite to our Slack community, and you’re welcome to post in #03-questions channel.
As for the PDF margins, I apologize for the inconvenience. I’ve already flagged this to our engineers. In the meantime, I’d recommend switching to the Custom Interface option instead, as it’s much more flexible. Here’s a sample agent I put together that displays a report and lets you download it as a PDF: https://app.mindstudio.ai/agents/financial-report-generator-1ca31b30/remix