DEV Community

Cathy Lai
Cathy Lai

Posted on

Garden Visualizer - Would Results Improve Using Example Images? (Screenshots Included)

Perfect Prompts Needed?

In creating a garden visualizer to help home owners with their landscape decisions, I assumed that I needed to "program" the text prompt perfectly in order to give good results. So spending time tweaking the text descriptions seems natural.

However, after a few days learning about context engineering, I realised I could just send example images and describe what I like or dislike about them. That makes it a lot easier!! Both for me and for GPT!

"Before" Image

Text prompt

Could you give me an idea of how I could transform this area of the property to have a nicer garden?
Please don't change any of the layout and proportions nor points of view.
Please don't add extra buildings or structures either.

Result

Messy Garden

Conclusion: it looks very nice, but quite unrealistic... home owners probably won't be able to know where to start to achieve it!

Prompt with 2 Images as Positive and Negative Examples

Positive example image

Positive training image

Use it as a style guide, eg the realism style, the lawns (restricted and tidy), the sunlight, the homeliness, and simple yet elegant furniture. Not expensive. And not gardening magazine fantasy.

Negative example image

Negative example image

Do not match its unrealistic look, expensive furniture, perfect edges, storybook-like texture.

With 2 images as part of the parameters, I got a more achievable, yet still inspiring image:

More realistic garden after example images

I think it has picked up from the positive example: lawns, lighting, realism, and the simple furniture. From the negative, it got rid of the large qualities of flowers, and exclude expensive furniture.

Reference

To easily test different variations, I have a test script

test-image-edit.mjs

// And run it like so:
npm run test:image-edit -- -i public/images/messy_garden2.png --positive public/images/positive.jpeg --negative public/images/too_perfect.jpg -o scripts/output/test_output
Enter fullscreen mode Exit fullscreen mode

This enables me to add images as parameters, so in the future I can play with different variations easily, without changing the source code constantly!

Top comments (1)

Collapse
 
cathylai profile image
Cathy Lai • Edited

Which image would you prefer?? The fantasy garden or the realistic one? Comment and let me know!