Chuyển đến nội dung
Skillpedia
Hình ảnh và biểu tượng6.1k · #14433

cowart-image-gen

Skill này làm gì

Skill này tạo một ảnh AI từ mô tả của bạn và đưa nó lên canvas Cowart. Skill dành cho người muốn thêm ảnh vào canvas mà không phải rời khỏi quy trình làm việc.

Khi nào nên dùng

  • ✓Khi bạn muốn thêm một ảnh AI mới vào canvas Cowart.
  • ✓Khi bạn đã chọn một khung ảnh và muốn bức ảnh lấp đầy khung đó.
  • ✓Khi bạn muốn đặt một bức ảnh lên trang hiện tại của canvas.

Liên kết skill

https://github.com/zhongerxin/Cowart/blob/main/skills/cowart-image-gen/SKILL.md

Sao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.

Cách dùng

Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.

Tin nhắn có sẵn để dán

Hãy dùng skill này để giúp tôi: https://github.com/zhongerxin/Cowart/blob/main/skills/cowart-image-gen/SKILL.md Đọc tệp SKILL.md tại liên kết đó và làm theo hướng dẫn cho việc của tôi.
Bạn muốn AI tự tìm những skill như thế này?Cài MCP Skillpedia miễn phí: chỉ một dòng, và AI sẽ tìm trong 15.000+ skill trước mỗi việc.Cài đặt trong 1 phút →

Ví dụ cách nhờ AI

“Tạo một ảnh AI về hồ núi yên tĩnh lúc bình minh và đặt nó vào khung tôi đã chọn.”

5 skill mới mỗi tuần. Đọc chỉ 1 phút.

Cách hoạt động

Agent đọc khung đã chọn để lấy kích thước và vị trí, tạo ảnh, rồi đặt ảnh vào đúng chỗ của khung đó. Nếu không có khung, ảnh được thêm vào trang hiện tại.

Nội dung kỹ thuật (SKILL.md gốc)

Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.

Cowart Image Gen

Use this skill when the user wants an AI-generated image placed onto the Cowart canvas. A selected AI 图片 holder gives a precise size and placement target, but it is not required. By default, a selected holder is a temporary target and should be replaced by the generated image.

Preconditions

Ensure the cowart_mcp tools required by this workflow are available. Do not call render_cowart_canvas_widget as a routine prerequisite: requests sent from the Cowart widget already have an open canvas, and the existing widget synchronizes inserted images from MCP-backed storage. If the user separately asks to open, reopen, or explicitly refresh the canvas, handle that request once with the canvas-opening workflow.

Cowart state is read and written through Cowart MCP tools, not through a localhost browser service.

New holders are tldraw frame shapes with:

{
  "type": "frame",
  "meta": {
    "cowartAiImageHolder": true
  }
}

Older canvases may still contain legacy geo rectangle holders with the same meta flag. Support both shapes.

Workflow

For a follow-up from Cowart's sidebar canvas, use the exact projectDir and canvasDir in the Cowart context/message for all Cowart tools. These paths can differ from the conversation working directory. In ordinary project conversations, keep using the active user project as before.

  1. Read the selected shape from Cowart with the MCP get_cowart_selection tool. Pass the active user project directory as projectDir.

  2. Check whether exactly one selected shape is an AI image holder. A holder is any selected shape with either:

    isAiImageHolder: true
    

    or:

    meta.cowartAiImageHolder: true
    

    If yes, use the holder replacement workflow below. If not, do not ask the user to select a holder; use the standalone workflow below and insert the generated image into the current Cowart page.

  3. Choose the placement workflow.

    Holder replacement workflow: use the selected holder's props.w and props.h as the size contract for both generation and placement. Before generating, derive and keep these values:

    • targetWidth: selected holder props.w
    • targetHeight: selected holder props.h
    • targetAspectRatio: the reduced targetWidth:targetHeight ratio when it maps cleanly, plus the decimal targetWidth / targetHeight

    If the selected holder matches a Cowart ratio preset such as 1:1, 3:2, 2:3, 4:3, 3:4, 16:9, or 9:16, use that preset label as the human-readable aspect ratio. The generated image should be composed for this target size and aspect ratio, and should not rely on later stretching or cropping to fit the holder.

    The generated image should replace the selected holder as a normal tldraw image shape:

    • parentId: same parent as the holder
    • x, y, rotation: same as the holder
    • props.w, props.h: same as the holder

    This leaves the final canvas with an image shape at the holder's position, not an AI holder that contains an image. Only preserve the holder when the user explicitly asks to keep the reusable slot.

    Standalone workflow: when no AI holder is selected, generate the image anyway and insert it as a normal image shape on the current page. Prefer the current page from Cowart view state; if there is a selected non-holder shape and it is useful as context, place the image beside it, otherwise place it in a clear page area. If the user requested a size or aspect ratio, pass that size and ratio into generation and use it for display. Otherwise, use the generated bitmap's natural aspect ratio and a practical display width such as 512 canvas units.

  4. Generate the bitmap with the built-in imagegen skill unless the user explicitly requests another image path. If the requested asset needs visible copy, labels, poster text, ad text, UI text, or typography, include that text directly in the image generation prompt and let the image model produce the final bitmap. Do not default to generating a text-free background and then adding text locally unless the user explicitly asks for local typography, deterministic text overlay, SVG/vector output, or another non-imagegen layout step.

    For the holder workflow, the image generation request must explicitly include the selected holder's target size and aspect ratio. Add this information to the model prompt, for example:

    Target canvas slot: 512 x 683 canvas units.
    Target aspec
    
Câu hỏi thường gặp

Ảnh được tạo có thay thế khung tôi đã chọn không?

Mặc định là có. Khung được xem như chỗ tạm để đặt ảnh và sẽ được thay bằng ảnh cuối cùng.

Nếu tôi chưa chọn khung thì sao?

Ảnh sẽ được thêm vào trang hiện tại của canvas.

Tôi có cần tự mở canvas không?

Không. Các yêu cầu gửi từ canvas Cowart đang mở đã có sẵn canvas để dùng.

Chi tiết

Mô tả gốc của tác giả

Generate and place a final AI bitmap on the Cowart canvas, replacing a selected AI 图片 holder or inserting the image into the current page.

repo: zhongerxin/Cowart

Độ phổ biến

Sao GitHub
6.1k
Vị trí xếp hạng
#14433
Giấy phép
MIT
Cập nhật
8/10/2026

Skill này có hữu ích không?

0

Đăng nhập để bình chọn.

Bình luận

  • …

Thêm skill từ kho mã này

Skill tương tự