首页 / 资讯中心 / 文章详情

AI Prompting for Everyone 课程笔记 - P17 图像生成 Imaging Generation

AI Prompting for Everyone 课程笔记 - P17 图像生成 Imaging Generation ★ FEATURED ARTICLE
文章目录一、课程核心思想二、重点知识点2.1 什么是 Image Generation2.2 Text-to-Image文生图2.3 Image-to-Image图生图2.4 Image Editing图像编辑2.5 Iterative Image Generation迭代式图像生成2.6 Image Generation 与 Context 的关系三、课程案例与应用分析3.1 案例一生成产品宣传图片3.2 案例二利用草图生成设计概念3.3 案例三修改已有图片四、如何写出更好的 Image Generation Prompt4.1 普通 Prompt4.2 改进后的 Prompt4.3 为什么第二个 Prompt 更好五、Image Generation 的局限性5.1 Prompt Following Errors指令遵循错误5.2 Visual Inconsistency视觉不一致5.3 Editing Drift编辑漂移5.4 Image Generation 不等于精确设计工具5.5 Copyright and Privacy版权与隐私六、重要英文术语七、实践练习八、复习问题九、一页速记版Quick Review参考资源课程 SlidesThe AI Novice and the AI Power User如何成为 AI 高阶用户Pretrained KnowledgeAI 已经掌握哪些知识Web Search如何获取外部信息Web Search Sources如何选择和验证信息来源Using Deep Research如何开展复杂研究Lab Overview如何通过实验比较不同 AI 使用方式Brainstorming with AI使用 AI 进行头脑风暴Context上下文AI Desktop AppsAI 桌面应用Reasoning with AIAI 推理Sycophancy谄媚Writing with AI用 AI 写作AI CritiqueAI 评价与批判性反馈Lab Overview: Brainstorming and Critique实验介绍AI 头脑风暴与批判性评价Working with Multimedia Data处理多媒体数据Imaging Understanding图像理解一、课程核心思想上一节 P16 介绍了 Image Understanding图像理解。我们已经知道多模态 AI 可以分析图片中的物体、文字、结构和视觉关系。但 AI 不仅能够理解图片还能够根据用户的要求创造新的图片。例如根据文字描述生成插画。为产品设计宣传图片。为演示文稿制作配图。根据草图生成更完整的设计。修改已有图片中的颜色、背景或物体。根据用户反馈不断调整图像效果。因此本节介绍Image Generation图像生成。核心结论Image Generation 让用户能够通过自然语言表达视觉创意并利用 AI 快速生成和修改图片。高阶用户不需要一次性写出完美的 Prompt而是可以通过明确需求、提供参考图片和反复迭代逐步获得符合目标的视觉成果。二、重点知识点2.1 什么是 Image GenerationImage Generation图像生成 是指 AI 根据文字、图片或其他条件生成新的图像内容。最常见的形式是Text-to-Image文生图。即用户输入一段文字描述AI 根据描述生成图片。例如Generate an illustration of a small robot studying in a university library. Style: modern digital illustration. Lighting: warm and soft. Composition: the robot sits at a desk with books and a laptop.AI 可以根据这些要求生成相应的画面。Image Understanding vs. Image Generation对比维度Image UnderstandingImage Generation中文图像理解图像生成主要输入已有图片文字、参考图片核心任务分析视觉信息创造视觉内容典型问题这张图片展示了什么帮我生成一张图片主要输出文字分析新图片常见应用图片识别、图表分析插画、海报、设计主要局限可能识别错误可能不符合要求或产生视觉错误知识点Image Understanding 主要是从图片中提取信息而 Image Generation 主要是根据用户要求创造视觉内容。2.2 Text-to-Image文生图Text-to-Image 是最常见的图像生成方式。用户通过 Prompt 描述希望得到的画面。例如Create a realistic image of a modern university classroom. Include: - Students using laptops - A professor presenting AI concepts - A large digital display - Natural daylight Style: professional photography.一个有效的 Image Generation Prompt 可以包含什么通常可以从以下维度描述Subject主体图片中最重要的对象。Scene场景主体所处的环境。Style风格图片的视觉表现方式。Composition构图主体在画面中的位置。Lighting光照光线方向、强度和氛围。Color Palette配色整体色彩倾向。Aspect Ratio宽高比图片的形状。Constraints约束需要避免或特别注意的内容。示例 PromptGenerate an image of a futuristic AI research laboratory. Subject: A researcher working with an AI system. Scene: A modern laboratory with large screens and scientific equipment. Style: Photorealistic. Composition: Wide-angle view with the researcher in the foreground. Lighting: Soft blue ambient lighting. Aspect Ratio: 16:9. Constraints: No logos or watermarks.Prompt 结构总结Prompt 要素作用Subject确定画面主体Scene确定背景环境Style控制视觉风格Composition控制画面布局Lighting控制光照与氛围Color Palette控制色彩Aspect Ratio控制画面比例Constraints明确限制条件学习启示图像 Prompt 不需要机械地包含所有要素。应根据实际需求优先说明对最终画面影响最大的条件。2.3 Image-to-Image图生图除了根据文字生成图片AI 还可以使用已有图片作为参考。这种方式通常称为Image-to-Image图生图例如用户上传一张简单的房间照片希望将其改造成现代风格。可以提出Use the uploaded room image as the starting point. Redesign the room in a modern minimalist style. Requirements: - Preserve the room layout. - Keep the windows in their original positions. - Replace the furniture. - Use neutral colors. - Add warm lighting.为什么需要参考图片因为图片可以提供文字难以完整表达的信息。例如房间的空间结构。物体之间的位置关系。原有颜色。具体形状。视觉细节。Text-to-Image vs. Image-to-Image对比维度Text-to-ImageImage-to-Image中文文生图图生图主要输入文字描述图片与文字指令是否有原始画面通常没有有主要用途创造新画面修改或参考已有画面控制重点描述目标图像保留与修改哪些部分常见问题画面不符合想象不应修改的部分发生变化知识点当你已经拥有接近目标的图片时使用参考图片进行修改通常比从零开始重新描述整个画面更加方便。2.4 Image Editing图像编辑Image Editing图像编辑 指利用 AI 修改已有图片。例如更换背景。删除物体。添加物体。修改颜色。调整视觉风格。扩展图片边界。示例一更换背景Replace the background with a modern university campus. Keep the main subject unchanged. Preserve realistic lighting and natural shadows.示例二删除物体Remove the unwanted objects from the background. Keep the main subject and overall composition unchanged. Fill the removed areas naturally.示例三修改风格Transform this image into a watercolor illustration. Preserve the main composition and recognizable objects. Use soft colors and natural watercolor textures.常见编辑任务英文中文作用Background Replacement背景替换更换图片背景Object Removal物体移除删除不需要的对象Object Addition添加物体在图片中增加内容Style Transfer风格迁移改变图片视觉风格Inpainting局部重绘修改图片的指定区域Outpainting画面扩展扩展图片原有边界学习启示图像编辑 Prompt 应明确说明哪些内容需要改变以及哪些内容必须保留。2.5 Iterative Image Generation迭代式图像生成这与 P12 的 Iterative Writing迭代式写作 有相似之处。第一次生成的图片不一定完全符合预期。例如用户希望制作一张 AI 课程宣传图。Step 1生成初始图片Create a promotional image for a university AI course. Style: modern and professional. Include students and AI-related visual elements.Step 2评价结果假设第一次生成的图片存在问题主体不够突出。背景过于复杂。色彩不协调。没有为标题留出空间。Step 3提出具体修改要求Revise the previous image. Changes: 1. Make the student the main subject. 2. Simplify the background. 3. Use a blue and white color palette. 4. Leave empty space on the left for a course title. Preserve the overall visual style.Step 4继续迭代Keep the current composition. Make the lighting softer and increase the contrast between the subject and background. Do not add any text.完整流程Describe Visual Goal 描述视觉目标 ↓ Generate Initial Image 生成初始图片 ↓ Evaluate the Result 评价生成结果 ↓ Identify Problems 识别问题 ↓ Provide Specific Feedback 提出具体修改要求 ↓ Regenerate or Edit 重新生成或编辑 ↓ Final Image 获得最终图片核心知识点图像生成可以通过多轮交互逐步完善。与其反复从零开始生成不如在已有结果的基础上提出明确修改要求。2.6 Image Generation 与 Context 的关系P08 已经介绍过 Context 的重要性。在图像生成任务中Context 同样可以提高结果的针对性。例如用户希望生成一张网站首页图片。如果只说Generate a website hero image.AI 不知道网站属于什么行业。面向哪些用户。品牌的视觉风格。图片将放在什么位置。是否需要为文字留白。改进后的 PromptCreate a hero image for an AI education platform. Context: The platform helps university students learn machine learning. Target Audience: University students aged 18–25. Visual Style: Modern, clean, and academic. Color Palette: Blue, white, and light gray. Composition: Place the main visual elements on the right side. Leave negative space on the left for a headline and button. Aspect Ratio: 16:9.Context 的作用Context 类型具体内容对图片的影响Brand Identity品牌定位视觉风格Target Audience目标用户设计语言Usage Scenario使用场景图片尺寸与布局Color Palette配色要求色彩一致性Reference Image参考图片视觉方向Constraints限制条件减少不符合要求的内容学习启示好的图像生成 Prompt 不只是描述图片中有什么还应该说明图片为什么被创建、将用于哪里。三、课程案例与应用分析核实说明以下案例是根据 Image Generation 主题设计的教学补充。目前没有足够依据确认它们是吴恩达在 P17 中实际演示的案例。3.1 案例一生成产品宣传图片假设你正在开发一款 AI 学习助手希望制作产品宣传图。普通 PromptGenerate an image for my AI app.这个 Prompt 缺少具体要求。改进后的 PromptCreate a promotional image for an AI-powered learning assistant. Scene: A university student studying at a desk with a laptop. Visual Elements: - Digital learning interface - Books and study materials - Subtle AI-inspired graphics Style: Modern digital illustration. Composition: Place the student on the right. Leave empty space on the left for marketing text. Color Palette: Blue, white, and soft purple. Aspect Ratio: 16:9. Do not include text or logos.为什么第二个 Prompt 更好因为它明确了图片用途。目标用户。主要主体。视觉风格。构图。配色。图片比例。知识点当图片需要用于具体产品或商业场景时应明确最终用途而不是只描述一个抽象主题。3.2 案例二利用草图生成设计概念假设你手绘了一个移动应用界面。可以上传草图并提出Use the uploaded sketch as a reference. Create a polished mobile app interface concept. Requirements: 1. Preserve the main layout. 2. Use a modern visual style. 3. Improve spacing and alignment. 4. Use a consistent color palette. 5. Maintain clear visual hierarchy. Do not introduce major features that are not present in the sketch.为什么这个案例有价值因为用户不需要具备专业绘画能力也可以通过简单草图表达设计意图。AI 可以帮助将初步视觉概念转化为更完整的效果图。但需要注意生成的 UI 图片不等于可运行的软件界面。如果需要真正可点击、可编辑或可运行的界面还需要进一步使用设计或编程工具。3.3 案例三修改已有图片假设你有一张产品照片希望修改背景用于宣传。Step 1上传原始图片图片中包含产品和原始背景。Step 2提出修改要求Edit the uploaded product photo. Replace the background with a clean studio environment. Requirements: - Keep the product unchanged. - Preserve the products proportions. - Use soft professional lighting. - Add a natural shadow. - Do not add text or logos.Step 3检查结果重点检查产品形状是否发生变化是否出现不自然的边缘光照与阴影是否一致是否修改了不应该改变的细节知识点图像编辑不仅需要检查新内容是否符合要求还需要检查原始内容是否被意外改变。四、如何写出更好的 Image Generation Prompt4.1 普通 PromptGenerate a futuristic city.这个 Prompt 可以生成图片但视觉方向比较宽泛。4.2 改进后的 PromptGenerate a futuristic city at sunset. Scene: A modern city with elevated transportation systems and sustainable architecture. Subject: A pedestrian walking through a futuristic urban plaza. Style: Cinematic science-fiction concept art. Composition: Wide-angle view with strong depth. Lighting: Warm sunset light combined with subtle blue ambient lighting. Color Palette: Orange, blue, and dark gray. Aspect Ratio: 16:9. Constraints: - No text - No logos - No watermarks4.3 为什么第二个 Prompt 更好Prompt 要素具体内容Subject城市广场中的行人Scene未来城市Style电影感科幻概念艺术Composition广角、纵深Lighting日落光线与蓝色环境光Color Palette橙、蓝、深灰Aspect Ratio16:9Constraints不添加文字和标志通用 Image Generation Prompt 模板Create an image for [PURPOSE]. Subject: [Describe the main subject.] Scene: [Describe the environment.] Style: [Specify the visual style.] Composition: [Describe framing and placement.] Lighting: [Specify lighting conditions.] Color Palette: [Specify preferred colors.] Aspect Ratio: [Specify image dimensions or ratio.] Constraints: [List important requirements and things to avoid.]重要提醒更长的 Prompt 不一定产生更好的图片。过多互相冲突的要求反而可能降低结果质量。五、Image Generation 的局限性5.1 Prompt Following Errors指令遵循错误AI 可能无法准确满足所有要求。例如用户要求图片中出现五个人模型却生成了四个人或六个人。因此对于精确数量、空间位置和复杂关系需要仔细检查。5.2 Visual Inconsistency视觉不一致生成图片可能出现物体结构不合理。人物手部细节异常。文字拼写错误。光照和阴影不一致。物体之间的空间关系错误。不同图像模型在这些方面的表现有所不同。5.3 Editing Drift编辑漂移在多轮修改中AI 可能意外改变用户希望保留的内容。例如用户只要求修改背景但模型同时改变了产品形状。因此可以明确要求Only modify the background. Preserve the subject, pose, proportions, and composition.但即使这样也不能保证所有细节完全不变。5.4 Image Generation 不等于精确设计工具生成式 AI 很适合创意探索。视觉概念设计。初步插画。宣传素材。设计灵感。但对于需要精确尺寸、可编辑图层、工程结构或真实交互的任务通常还需要专业工具。例如FigmaPhotoshopIllustratorCAD 软件编程开发工具5.5 Copyright and Privacy版权与隐私使用 AI 生成或编辑图片时还应考虑是否有权使用上传的参考图片。是否涉及未经授权的个人肖像。是否可能误导他人相信生成内容是真实照片。商业使用是否符合所用工具的条款。学习启示AI 图像生成是创作辅助工具仍然需要用户负责内容审查和合理使用。六、重要英文术语English中文解释Image Generation图像生成使用 AI 创建图像Text-to-Image文生图根据文字生成图片Image-to-Image图生图利用参考图片生成新图像Image Editing图像编辑修改已有图片Generative AI生成式人工智能能够生成新内容的 AISubject主体图片中的主要对象Scene场景图片中的环境Style风格图片的视觉表现方式Composition构图画面元素的布局Lighting光照图片中的光线效果Color Palette配色方案图片使用的主要颜色Aspect Ratio宽高比图片宽度与高度的比例Reference Image参考图片用于指导生成的已有图片Style Transfer风格迁移改变图片的视觉风格Inpainting局部重绘修改指定区域Outpainting画面扩展扩展图片边界Iterative Generation迭代式生成多轮修改生成结果Visual Consistency视觉一致性不同视觉元素保持协调Editing Drift编辑漂移修改时意外改变其他内容Negative Space留白为文字或其他元素预留空间七、实践练习Exercise 1比较简单与详细 Prompt首先使用Generate an image of a university library.然后使用Generate a modern university library with students studying at wooden desks. Style: Photorealistic. Lighting: Warm afternoon sunlight. Composition: Wide-angle interior view. Color Palette: Warm brown, cream, and soft green. Aspect Ratio: 16:9.比较两次生成的图片有什么区别哪张图片更符合你的预期哪些 Prompt 要素影响最明显是否出现不符合要求的细节练习目标理解视觉描述如何影响图像生成结果。Exercise 2练习 Iterative Image Generation首先生成一张 AI 课程宣传图片。然后分三轮修改调整构图。修改配色和光照。简化背景并增加留白。每轮只修改少量要求。观察图片是否逐渐接近目标哪些内容被意外改变AI 是否保留了原始主体哪些修改指令最有效练习目标掌握通过多轮反馈完善图像的方法。Exercise 3使用参考图片进行编辑选择一张自己拥有使用权的图片。上传后使用Use the uploaded image as a reference. Change the visual style to a clean digital illustration. Preserve: 1. Main subject 2. Composition 3. Important objects 4. Spatial relationships Modify: 1. Color palette 2. Lighting 3. Background style Do not add new objects.比较修改前后的结果。练习目标理解 Image-to-Image 与 Image Editing 的实际应用。以上练习为根据课程主题设计的教学补充尚未确认是 P17 的官方实验内容。八、复习问题Q1什么是 Image Generation答利用 AI 根据文字、图片或其他条件生成新的视觉内容。Q2Text-to-Image 与 Image-to-Image 有什么区别答Text-to-Image 主要根据文字生成图片Image-to-Image 则利用已有图片作为参考进行生成或修改。Q3一个好的 Image Generation Prompt 通常包含哪些信息答可以包含主体、场景、风格、构图、光照、配色、宽高比和重要约束。Q4为什么需要 Iterative Image Generation答因为初次生成的结果可能不符合预期通过多轮反馈可以逐步调整画面。Q5什么是 Editing Drift答在编辑图片时AI 意外修改了用户原本希望保留的内容。Q6为什么 AI 生成的界面图片不能直接当作可运行的软件答因为图片只是视觉呈现不具备真实的代码结构、数据逻辑和交互功能。九、一页速记版Quick Review核心思想Image Generation 让用户能够通过自然语言和参考图片创建、编辑视觉内容。高阶用户需要学会明确视觉目标、提供合适的 Context并通过多轮迭代完善结果。三个重要能力Text-to-Image根据文字描述生成图片。Image-to-Image利用参考图片指导生成。Image Editing修改已有图片中的内容。三个核心原则Describe the visual goal clearly.清楚描述希望生成的视觉效果。Use reference images when appropriate.在合适的情况下使用参考图片。Iterate and refine instead of expecting perfection immediately.通过多轮修改逐步完善结果而不是期待第一次生成就完全符合要求。P15 → P17 的知识逻辑P15 — Working with Multimedia Data ↓ AI 如何处理多媒体数据 ↓ P16 — Image Understanding ↓ AI 如何理解已有图片 ↓ P17 — Image Generation ↓ AI 如何生成和编辑图片 ↓ 后续课程 如何将多模态能力与实际应用结合最终总结Image Generation 的核心价值不只是让 AI 快速生成一张图片而是让用户能够通过自然语言表达创意并利用多轮反馈控制视觉结果。真正的 AI 高阶用户会将 AI 图像生成融入设计和创作流程同时检查输出质量、保持必要的视觉一致性并了解生成式图像的局限。参考资源吴恩达《给所有人的人工智能提示词课程|AI Prompting for Everyone》DeepSeek-v4-pro翻译DeepLearning.AI — AI Prompting for Everyone 官方课程Full AI Prompting Course with Andrew Ng — 公开英文转写稿课程 Slides
阅读完成 · 觉得有帮助?
咨询建站