# How to Create Design Patent Disclosures with Appearance Line-Art Generation: A Complete Automation Guide

> Automate design patent disclosures with AI line-art generation. Transform product photos into compliant drawings using Python tools and a simple YAML config. Streamline your patent application process.

- Repository: [handsomestWei/patent-disclosure-skill](https://github.com/handsomestWei/patent-disclosure-skill)
- Tags: how-to-guide
- Published: 2026-09-06

---

**You can fully automate the creation of design-patent disclosures by configuring a [`design_lineart_brief.yaml`](https://github.com/handsomestWei/patent-disclosure-skill/blob/main/design_lineart_brief.yaml) and running the [`design_lineart_gate.py`](https://github.com/handsomestWei/patent-disclosure-skill/blob/main/design_lineart_gate.py) tool to generate compliant black-and-white line-art drawings from product photos.**

The `handsomestWei/patent-disclosure-skill` repository provides an end-to-end pipeline for creating design-patent disclosures with appearance line-art generation. By orchestrating YAML schemas, validation gates, and image-generation jobs, the system transforms raw product assets into patent-ready drawings that satisfy Chinese Patent Office requirements for dual photo-and-line-art submissions.

## Prerequisites: Project Structure and Schema Dependencies

Before executing the pipeline, your case directory must contain the **appearance schema** ([`appearance_schema.yaml`](https://github.com/handsomestWei/patent-disclosure-skill/blob/main/appearance_schema.yaml)) and a **figure plan** ([`figure_plan.yaml`](https://github.com/handsomestWei/patent-disclosure-skill/blob/main/figure_plan.yaml)). These files define the product’s shape, design points, and existing visual assets according to the schemas defined in [[`figure_plan.schema.yaml`](https://github.com/handsomestWei/patent-disclosure-skill/blob/main/figure_plan.schema.yaml)](https://github.com/handsomestWei/patent-disclosure-skill/blob/main/skills/patent-disclosure/references/schemas/figure_plan.schema.yaml). The pipeline specifically excludes CAD projections from line-art eligibility; the gate logic enforces this via the `SKIP_ENV` validation rule to ensure only photographic references or generated art are processed.

## Step 1: Gather Source Assets and Initialize the Figure Plan

Place all reference materials—product photos, CAD exports, or sketches—into the `<case-dir>/assets` folder. Run the **image-gen** tool to catalog existing line-art and initialize the [`figure_plan.yaml`](https://github.com/handsomestWei/patent-disclosure-skill/blob/main/figure_plan.yaml):

```bash
python skills/patent-disclosure/tools/image_gen.py \
    --case-dir "outputs/my_case"

```

The [[`image_gen.py`](https://github.com/handsomestWei/patent-disclosure-skill/blob/main/image_gen.py)](https://github.com/handsomestWei/patent-disclosure-skill/blob/main/skills/patent-disclosure/tools/image_gen.py) script scans the assets directory, identifies any pre-existing line drawings, and generates a preliminary figure plan that maps photographs to their corresponding views (front, top, side, etc.). This establishes the baseline configuration that the line-art gate will later update.

## Step 2: Author the Design Line-Art Brief

Create a [`design_lineart_brief.yaml`](https://github.com/handsomestWei/patent-disclosure-skill/blob/main/design_lineart_brief.yaml) in your case root to instruct the gate on which views require generated line-art. The file must conform to [[`design_lineart_brief.schema.yaml`](https://github.com/handsomestWei/patent-disclosure-skill/blob/main/design_lineart_brief.schema.yaml)](https://github.com/handsomestWei/patent-disclosure-skill/blob/main/skills/patent-disclosure/references/schemas/design_lineart_brief.schema.yaml) and include the following fields:

- `enabled: true` – Activates the line-art generation workflow.
- `patent_type: design` – Specifies that this is a design patent (distinct from utility patents).
- `overall_shape` – A text description of the product’s general form.
- `design_points` – A list of distinctive visual features that must be emphasized in the drawings.
- `views` – An array of view objects, each containing:
  - `view_name` – Standard orientation (e.g., "front", "top").
  - `source_paths` – Optional array of reference image paths for **img2img** generation.
  - `gen_prompt` – Optional text prompt for **txt2img** generation when no source images exist.

Follow the workflow rules documented in [[`design_lineart_assist.md`](https://github.com/handsomestWei/patent-disclosure-skill/blob/main/design_lineart_assist.md)](https://github.com/handsomestWei/patent-disclosure-skill/blob/main/skills/patent-disclosure/prompts/design_lineart_assist.md) to ensure your brief satisfies the patent office’s requirement that both the actual product photo and the schematic line-art appear in the final disclosure.

Example brief configuration:

```yaml
enabled: true
patent_type: design
overall_shape: "Ergonomic wireless mouse with curved palm rest"
design_points:
  - "Raised scroll wheel with tactile ridges"
  - "Asymmetric left-click button"
views:
  - view_name: "perspective"
    source_paths: ["assets/mouse_angle.jpg"]
    gen_prompt: ""
  - view_name: "bottom"
    source_paths: []
    gen_prompt: "Bottom view of computer mouse showing battery compartment and optical sensor"

```

## Step 3: Validate Configuration and Prepare Generation Jobs

Invoke the **design-line-art gate** to validate the brief against the appearance schema and generate a machine-readable job list:

```bash
python skills/patent-disclosure/tools/design_lineart_gate.py \
    --case-dir "outputs/my_case" \
    --prepare-jobs

```

The [[`design_lineart_gate.py`](https://github.com/handsomestWei/patent-disclosure-skill/blob/main/design_lineart_gate.py)](https://github.com/handsomestWei/patent-disclosure-skill/blob/main/skills/patent-disclosure/tools/design_lineart_gate.py) performs three critical functions:

1. **Schema Validation** – Verifies that [`design_lineart_brief.yaml`](https://github.com/handsomestWei/patent-disclosure-skill/blob/main/design_lineart_brief.yaml) matches the expected structure and that all referenced `source_paths` exist.
2. **Policy Enforcement** – Confirms that CAD-derived images are marked `use_in_disclosure: false`, ensuring only authentic photographs or newly generated line-art are approved.
3. **Job Generation** – Writes [`design_lineart_jobs.json`](https://github.com/handsomestWei/patent-disclosure-skill/blob/main/design_lineart_jobs.json) to `outputs/my_case/lineart_assist/`, containing one entry per view with generation parameters (`mode`, `output_path`, `reference_images`, and fallback strategy).

If validation fails, the gate exits with detailed error messages referencing the specific schema violations, allowing you to correct the brief before proceeding.

## Step 4: Generate Patent-Style Line-Art Drawings

Feed the generated job file to your image-generation host (e.g., a Stable Diffusion service or specialized patent-drawing API). The pipeline supports two primary generation modes:

- **img2img** – Used when `source_paths` are provided in the brief. The host transforms the reference photograph into a clean, black-and-white line drawing while preserving proportions and design points.
- **txt2img** – Used when `source_paths` is empty. The host generates the drawing purely from the `gen_prompt` text and the `overall_shape` description.

Each job includes a `describe_then_txt2img` fallback mode. If the primary generation fails or produces insufficient detail, the system automatically switches to text-to-image generation using an enhanced prompt derived from the design points listed in the brief.

Output PNG files are written to the paths specified in the `output_path` fields of [`design_lineart_jobs.json`](https://github.com/handsomestWei/patent-disclosure-skill/blob/main/design_lineart_jobs.json), typically organized under `outputs/my_case/lineart_assist/generated/`.

## Step 5: Update the Figure Plan and Finalize Disclosure

After the line-art PNGs are generated, run the gate again (or allow your orchestration tool to trigger the update) to merge the new drawings into [`figure_plan.yaml`](https://github.com/handsomestWei/patent-disclosure-skill/blob/main/figure_plan.yaml). The system creates paired entries for each view: one node for the clean photograph and one for the generated line-art, both flagged with `use_in_disclosure: true`.

Finally, compile the disclosure documents using the **md-to-docx** converter:

```bash
python skills/patent-application/tools/md_to_docx.py \
    --case-dir "outputs/my_case" \
    --output "outputs/my_case/design_disclosure.docx"

```

The [[`md_to_docx.py`](https://github.com/handsomestWei/patent-disclosure-skill/blob/main/md_to_docx.py)](https://github.com/handsomestWei/patent-disclosure-skill/blob/main/skills/patent-application/tools/md_to_docx.py) tool embeds both the original photographs and the generated line-art into the Word document, ensuring compliance with the requirement that design patent disclosures present both the real-world appearance and the schematic representation.

## Summary

- **Schema-driven configuration** – The pipeline relies on [`design_lineart_brief.yaml`](https://github.com/handsomestWei/patent-disclosure-skill/blob/main/design_lineart_brief.yaml) (validated against [[`design_lineart_brief.schema.yaml`](https://github.com/handsomestWei/patent-disclosure-skill/blob/main/design_lineart_brief.schema.yaml)](https://github.com/handsomestWei/patent-disclosure-skill/blob/main/skills/patent-disclosure/references/schemas/design_lineart_brief.schema.yaml)) to define generation requirements.
- **Automated job creation** – [[`design_lineart_gate.py`](https://github.com/handsomestWei/patent-disclosure-skill/blob/main/design_lineart_gate.py)](https://github.com/handsomestWei/patent-disclosure-skill/blob/main/skills/patent-disclosure/tools/design_lineart_gate.py) validates inputs and emits [`design_lineart_jobs.json`](https://github.com/handsomestWei/patent-disclosure-skill/blob/main/design_lineart_jobs.json) for batch processing.
- **Dual-mode generation** – Supports both **img2img** (photo-to-line-art) and **txt2img** (prompt-to-line-art) with automatic fallback handling.
- **Compliance assurance** – Enforces the exclusion of CAD projections and ensures both photos and line-art appear in the final output via [[`md_to_docx.py`](https://github.com/handsomestWei/patent-disclosure-skill/blob/main/md_to_docx.py)](https://github.com/handsomestWei/patent-disclosure-skill/blob/main/skills/patent-application/tools/md_to_docx.py).

## Frequently Asked Questions

### What is the difference between img2img and txt2img generation modes in the pipeline?

**img2img** is selected when the `source_paths` field in the brief contains valid reference photographs; the image-generation host uses these as structural guides to produce proportionally accurate line-art. **txt2img** is invoked when `source_paths` is empty, relying solely on the `gen_prompt` and `overall_shape` description to synthesize the drawing from text. The pipeline automatically handles mode selection based on the presence of source assets.

### Why does the gate exclude CAD projections from line-art generation?

According to the validation logic in [[`design_lineart_gate.py`](https://github.com/handsomestWei/patent-disclosure-skill/blob/main/design_lineart_gate.py)](https://github.com/handsomestWei/patent-disclosure-skill/blob/main/skills/patent-disclosure/tools/design_lineart_gate.py), CAD projections are marked with `use_in_disclosure: false` and filtered out via the `SKIP_ENV` policy. This prevents technical engineering drawings from being mistaken for the required "appearance" line-art, ensuring the final disclosure contains only stylized black-and-white drawings that depict the product’s ornamental design rather than its functional geometry.

### How does the system handle missing reference images when generating line-art?

If a view in [`design_lineart_brief.yaml`](https://github.com/handsomestWei/patent-disclosure-skill/blob/main/design_lineart_brief.yaml) specifies empty `source_paths`, the gate creates a job entry with mode set to **txt2img**. The generation host then uses the `gen_prompt` combined with the `overall_shape` and `design_points` from the brief to create the drawing. Additionally, the job configuration includes a `describe_then_txt2img` fallback; if the initial generation produces low-quality results, the system retries with an enriched prompt derived from the design points.

### What schema validates the design line-art brief configuration?

The brief must conform to [[`design_lineart_brief.schema.yaml`](https://github.com/handsomestWei/patent-disclosure-skill/blob/main/design_lineart_brief.schema.yaml)](https://github.com/handsomestWei/patent-disclosure-skill/blob/main/skills/patent-disclosure/references/schemas/design_lineart_brief.schema.yaml), which mandates fields for `enabled`, `patent_type`, `overall_shape`, `design_points`, and a `views` array. The gate performs strict validation against this schema before generating jobs, ensuring that every required view has either valid `source_paths` or a non-empty `gen_prompt`, and that the patent type is explicitly set to "design".