Midjourney Prompt Open Source
Midjourney AI Image Generation Prompt Engineering Subject Style Details Parameters Open Source Contribution GitHub Pull Request Code Review Community
| Parameter | ค่า | ผล | ตัวอย่าง |
|---|---|---|---|
| --ar | W:H | Aspect Ratio | --ar 16:9 |
| --v | 1-6 | Model Version | --v 6 |
| --q | 0.25-2 | Quality | --q 2 |
| --s | 0-1000 | Stylize | --s 750 |
| --c | 0-100 | Chaos | --c 50 |
| --no | text | Negative | --no text watermark |
| --seed | number | Reproducibility | --seed 12345 |
Prompt Engineering
# prompt_engineering.py — Midjourney Prompt Builder
from dataclasses import dataclass, field
from typing import List, Optional, Dict
@dataclass
class MidjourneyPrompt:
subject: str
style: str = ""
details: List[str] = field(default_factory=list)
lighting: str = ""
camera: str = ""
aspect_ratio: str = "1:1"
version: int = 6
quality: float = 1.0
stylize: int = 100
chaos: int = 0
negative: List[str] = field(default_factory=list)
seed: Optional[int] = None
def build(self) -> str:
parts = [self.subject]
if self.style:
parts.append(self.style)
parts.extend(self.details)
if self.lighting:
parts.append(self.lighting)
if self.camera:
parts.append(self.camera)
prompt = ", ".join(parts)
params = []
params.append(f"--ar {self.aspect_ratio}")
params.append(f"--v {self.version}")
if self.quality != 1.0:
params.append(f"--q {self.quality}")
if self.stylize != 100:
params.append(f"--s {self.stylize}")
if self.chaos > 0:
params.append(f"--c {self.chaos}")
if self.negative:
params.append(f"--no {' '.join(self.negative)}")
if self.seed:
params.append(f"--seed {self.seed}")
return f"{prompt} {' '.join(params)}"
# ตัวอย่าง Prompts
prompts = [
MidjourneyPrompt(
subject="a futuristic cyberpunk city at night",
style="neon lights, rain-soaked streets",
details=["flying cars", "holographic billboards", "dense fog"],
lighting="volumetric lighting, neon glow",
camera="wide angle, cinematic",
aspect_ratio="16:9",
stylize=750,
negative=["text", "watermark"],
),
MidjourneyPrompt(
subject="a cozy coffee shop interior",
style="warm tones, studio ghibli style",
details=["wooden furniture", "plants", "morning sunlight"],
lighting="golden hour, soft shadows",
camera="35mm lens, shallow depth of field",
aspect_ratio="3:2",
quality=2.0,
),
MidjourneyPrompt(
subject="abstract geometric pattern",
style="minimalist, bauhaus",
details=["bold colors", "clean lines", "symmetrical"],
aspect_ratio="1:1",
stylize=250,
chaos=30,
),
]
print("=== Midjourney Prompts ===\n")
for i, p in enumerate(prompts, 1):
print(f" Prompt {i}:")
print(f" /imagine {p.build()}\n")
# Prompt Categories
categories = {
"Photography": "realistic photo, 85mm lens, f/1.8, bokeh, natural light",
"Illustration": "digital art, detailed illustration, concept art",
"Anime": "anime style, studio ghibli, makoto shinkai",
"3D Render": "3D render, octane render, unreal engine 5",
"Watercolor": "watercolor painting, soft edges, paper texture",
"Pixel Art": "pixel art, 16-bit, retro game style",
"Logo": "logo design, vector, minimal, clean background",
}
print("Prompt Style Categories:")
for cat, desc in categories.items():
print(f" [{cat}]: {desc}")
Open Source Contribution
# open_source.py — Open Source Contribution Guide
from dataclasses import dataclass, field
from typing import List
@dataclass
class ContributionStep:
step: int
title: str
commands: List[str]
description: str
git_workflow = [
ContributionStep(1, "Fork Repository",
["# Click Fork button on GitHub"],
"สร้าง Fork ของ Repository มาที่ Account ตัวเอง"),
ContributionStep(2, "Clone Fork",
["git clone https://github.com/YOUR_USER/project.git",
"cd project",
"git remote add upstream https://github.com/ORIGINAL/project.git"],
"Clone Fork และเพิ่ม Upstream Remote"),
ContributionStep(3, "Create Branch",
["git checkout -b fix/issue-123-login-bug",
"# Branch naming: fix/, feat/, docs/, refactor/"],
"สร้าง Branch ใหม่จาก main"),
ContributionStep(4, "Make Changes",
["# แก้ไขโค้ด",
"npm test",
"npm run lint"],
"แก้ไขโค้ด รัน Tests และ Lint"),
ContributionStep(5, "Commit",
["git add .",
"git commit -m 'fix: resolve login redirect bug (#123)'",
"# Conventional Commits: feat:, fix:, docs:, chore:"],
"Commit ด้วย Conventional Commits format"),
ContributionStep(6, "Push & PR",
["git push origin fix/issue-123-login-bug",
"# สร้าง Pull Request บน GitHub",
"# อธิบาย What, Why, How"],
"Push และสร้าง Pull Request"),
ContributionStep(7, "Review & Merge",
["# รอ Maintainer Review",
"# แก้ไขตาม Feedback",
"git pull upstream main",
"git push origin fix/issue-123-login-bug"],
"ตอบ Review Comments แก้ไขตาม Feedback"),
]
print("=== Open Source Git Workflow ===\n")
for step in git_workflow:
print(f" Step {step.step}: {step.title}")
print(f" {step.description}")
for cmd in step.commands:
print(f" $ {cmd}")
print()
# Good First Issues
good_first = {
"Documentation": "แก้ Typo, เพิ่ม Examples, แปลภาษา",
"Bug Fix": "แก้ Bug เล็กๆ ที่มี Reproduce Steps ชัดเจน",
"Test Coverage": "เพิ่ม Unit Test สำหรับ Function ที่ไม่มี Test",
"Refactoring": "ปรับปรุงโค้ดให้อ่านง่ายขึ้น",
"Dependency Update": "อัปเดต Dependencies ที่ล้าสมัย",
"CI/CD": "ปรับปรุง GitHub Actions Pipeline",
}
print("Good First Issues:")
for type_, desc in good_first.items():
print(f" [{type_}]: {desc}")
PR Template
# pr_template.py — Pull Request Template
pr_template = """
## Description
[อธิบายสิ่งที่เปลี่ยนแปลง]
## Related Issue
Fixes #123
## Type of Change
- [ ] Bug fix
- [ ] New feature
- [ ] Documentation update
- [ ] Refactoring
- [ ] Performance improvement
## How to Test
1. [ขั้นตอนทดสอบ]
2. [ผลลัพธ์ที่คาดหวัง]
## Checklist
- [ ] Code follows project style guidelines
- [ ] Tests added/updated
- [ ] Documentation updated
- [ ] No breaking changes
- [ ] Self-reviewed the code
## Screenshots (if applicable)
[แนบ screenshot]
"""
print("=== Pull Request Template ===")
print(pr_template)
# Commit Message Convention
conventions = {
"feat:": "เพิ่ม Feature ใหม่",
"fix:": "แก้ Bug",
"docs:": "แก้ไข Documentation",
"style:": "แก้ไข Formatting (ไม่เปลี่ยน Logic)",
"refactor:": "Refactor โค้ด (ไม่เปลี่ยน Behavior)",
"test:": "เพิ่มหรือแก้ Tests",
"chore:": "งาน Maintenance (Dependencies, CI)",
"perf:": "ปรับปรุง Performance",
}
print("Conventional Commits:")
for prefix, desc in conventions.items():
print(f" {prefix} {desc}")
# Open Source Benefits
benefits = [
"GitHub Profile เป็น Portfolio ที่ดีที่สุด",
"เรียนรู้จากโค้ดคุณภาพสูง Best Practices",
"ได้ Code Review จาก Maintainers ระดับโลก",
"สร้าง Network กับ Developer ทั่วโลก",
"บริษัทชั้นนำดู GitHub ตอนสัมภาษณ์",
"พัฒนาทักษะ Git, Testing, CI/CD, Communication",
]
print(f"\n\nOpen Source Benefits for Career:")
for i, b in enumerate(benefits, 1):
print(f" {i}. {b}")
เคล็ดลับ
- Prompt: เฉพาะเจาะจง ใช้คำอธิบายชัดเจน หลีกเลี่ยงคำคลุมเครือ
- Parameters: --s สูงสำหรับภาพศิลปะ --s ต่ำสำหรับภาพตรง Prompt
- Good First Issue: เริ่มจาก Docs Typo แก้ Bug เล็กๆ เพิ่ม Tests
- Conventional Commits: ใช้ format มาตรฐาน feat: fix: docs:
- Communication: อธิบาย PR ให้ชัดเจน ตอบ Review ด้วยความเคารพ
Midjourney Prompt คืออะไร
ข้อความสั่ง AI สร้างภาพ Subject Style Details Parameters --ar --v --q --s Prompt เฉพาะเจาะจง ชัดเจน
Open Source Contribution เริ่มต้นอย่างไร
เลือก Project GitHub good first issue Fork Branch แก้โค้ด Tests Pull Request Review Feedback เริ่มจาก Docs Typo
Midjourney Parameters สำคัญมีอะไรบ้าง
--ar Aspect Ratio --v Version --q Quality --s Stylize --c Chaos --no Negative --seed Reproducibility --tile Pattern
ทำไม Open Source สำคัญสำหรับ Career
GitHub Portfolio โค้ดคุณภาพ Code Review Maintainers Network Developer บริษัทดู GitHub สัมภาษณ์ Job Offer
สรุป
Midjourney Prompt Engineering Subject Style Parameters --ar --v --s --c Open Source Contribution GitHub Fork Branch PR Conventional Commits Good First Issue Career Portfolio Code Review