Synthetic Data Generation using Stable Diffusion
Last updated
Was this helpful?
Last updated
Was this helpful?
The example shows how to run Stable Diffusion model via Apolo platform and generate images for your synthetic dataset.
Synthetic image data refers to computer-generated visuals that simulate real-world scenes, rather than capturing them from physical environments. Unlike traditional photographs, synthetic images do not depict a real-world moment in time but are designed based on real-world concepts. They retain the semantic essence of objects such as cars, tables, or houses, making them valuable for computer vision applications.
In essence synthetic images are pictures generated using computer graphics, simulation methods and artificial intelligence (AI), to represent reality with high fidelity.
There are plenty of applications of synthetic data in modern computer vision pipelines.
Expands Variability: AI-generated images introduce variations in lighting, angles, and environments that may be missing in real-world datasets.
Reducing Bias: If a dataset lacks diversity (e.g., images of cars mostly in daylight), synthetic data can balance the distribution by adding night-time, foggy, or rainy conditions.
Enhances Generalization: Helps models perform better in unseen scenarios by providing edge cases not commonly found in real-world data.
The example show HOWTO run Stable Diffusion 3 using WebUI, Cli, and API.
Log in to your Apolo account
Find Stable Diffusion in your Apps tab
Deploy Stable Diffusion version, if you want to minimize the size, specify only weights
Now, check your App url at the details -> Outputs
Stable Diffusion is often used to generate imaginative and playful images, such as a penguin skateboarding through a neon city or a cat wearing a top hat, sipping tea in a Victorian parlor. While these highlight its creative potential, this demo focuses on showcasing its practical applications for real-world business use cases, demonstrating how it can drive impactful solutions across various industries.
Imagine you're developing an instance segmentation or object detection model specifically for identifying and segmenting different rooms inside a house or detecting objects in the . While you already have some 2D drawings to work with, the dataset is insufficient for training an effective model. To address this limitation, generating synthetic data could be a valuable solution, helping to supplement your existing dataset and improve the model's performance by providing diverse and varied examples for training.
So by the time you have
Lack of Real-World Data for 2d drawings.
Data Collection is not possible.
Here synthetic data can be handy.
We will simply define a prompt Simple 2D architectural floorplan with clean, black lines on a white background. The layout should include walls, rooms, and basic features like doors and windows, all drawn with clear black lines. The floorplan should be minimalistic and easy to understand, resembling the style of technical drawings or blueprints.
Also, it is very important to define a negative prompt colors, textures, shading, and any 3D elements. furniture, patterns, or decorative designs. Exclude any details like landscapes, people, or non-architectural elements. Keep the drawing simple, with just black lines and a white background. Round shapes
Generated example:
We can tune the prompt further, so it does not make blurry lines, and fits our needs for the detection/segmentation model.
Now Check the API
Now you can run the script and review manually the generated images.
You can adjust image size, batch_number, steps, see https://vladmandic.github.io/sdnext-docs/
Swagger documentation for the text2img parameters is here: <APP_URL>/docs
Stability AI website