見出し画像

AI-gpt-4-visionでimage-to-promptして、DALL-Eにprompt-to-imageさせる実験-2

gpt-4-visionでimage-to-promptして、DALL-Eにprompt-to-imageさせる実験-2

画像ファイルをgpt-4-visionに突っ込んでpromptを生成してもらい、そのpromptを使ってDALL-Eで画像を生成する実験。その2。

その1はこちら

元の画像

gpt-4-visionのコード

Google Colabで動かしました。
今回は、プロンプトを「Generate prompts to generate images with more aesthetic abstraction. What does this image contain?」にしています。

client = OpenAI()

response = client.chat.completions.create(
  model="gpt-4-vision-preview",
  messages=[
    {
      "role": "user",
      "content": [
        {"type": "text", "text": "Generate prompts to generate images with more aesthetic abstraction. What does this image contain?"},
        {
          "type": "image_url",
          "image_url": {
            "url": "https://assets.st-note.com/img/1700271170910-dTlNVsbeDv.png",
          },
        },
      ],
    }
  ],
  max_tokens=300,
)

print(response.choices[0])

出力

Choice(finish_reason=None, index=0, message=ChatCompletionMessage(content='The image contains an illustration of a woman and a young child. The woman appears to be reading a book to the child. She has a gentle, caring expression, short dark hair with light highlights, and is wearing a light sweater. Her smile is soft and warm. The child, whose head is the only part visible, is engaged in the book, suggesting a close bond and a shared moment of learning or storytelling.\n\nIf you\'re looking to generate images with aesthetic abstraction, consider using these prompts:\n\n1. "Create a cubist interpretation of a mother reading to her child, focusing on geometric shapes and vibrant colors."\n2. "Illustrate a mother and child immersed in a story using a watercolor technique with light washes and dreamy, flowing lines."\n3. "Design an abstract representation of a reading moment between a parent and child, using bold brush strokes and a monochrome palette to convey emotion."\n4. "Develop an image with a stained glass effect, showing a mother and child reading together, with light shining through segmented, colorful glass shapes."\n5. "Construct a simplified, minimalistic line art drawing of a woman and child, focusing on the essence of their silhouettes and the intimate space they share."\n\nRemember to focus on the shapes, colors, and overall mood you want to convey when directing the creation of aesthetically abstract images.', role='assistant', function_call=None, tool_calls=None), finish_details={'type': 'stop', 'stop': '<|fim_suffix|>'})

DALL-Eで出力

繰り返す

client = OpenAI()

response = client.chat.completions.create(
  model="gpt-4-vision-preview",
  messages=[
    {
      "role": "user",
      "content": [
        {"type": "text", "text": "Generate prompts to generate images with more aesthetic abstraction. What does this image contain?"},
        {
          "type": "image_url",
          "image_url": {
            "url": "https://assets.st-note.com/img/1700274706259-tkIoGHnQKs.png",
          },
        },
      ],
    }
  ],
  max_tokens=300,
)

print(response.choices[0])

出力

Choice(finish_reason=None, index=0, message=ChatCompletionMessage(content="The image depicts a pleasantly minimalist illustration of an adult, likely a mother, alongside a younger child, possibly her son. The two figures are portrayed in a tender moment, as the adult is reading to the child, who appears to be attentive and happy. They are drawn with soft lines and subtle shading, using a pastel-like color palette that evokes warmth and gentleness. The book in the adult's hands features a simple design of a tree, hinting at a story about nature or growth. Both characters are wearing comfortable, casual clothing and their facial expressions suggest a close and loving relationship.\n\nIf you are looking for prompts to generate images with more aesthetic abstraction based on this image, here are some suggestions:\n\n1. Abstract representation of maternal love, using sweeping curves and a warm color palette.\n2. Stylized form of a parent and child engaged in reading, with emphasis on flowing lines and patterns.\n3. Minimalist design of a storytelling moment, blending soft tones with geometric shapes.\n4. Ethereal interpretation of a family bond, using watercolor effects and light brush strokes.\n5. Modern abstract art capturing the essence of childhood learning, with bold color splashes and dynamic forms.\n6. Simplified contour drawing of a nurturing scene, playing with negative space and monochromatic shades.\n7. Cubist-inspired illustration of a reading session, focusing on fragmented shapes and a muted color scheme.", role='assistant', function_call=None, tool_calls=None), finish_details={'type': 'stop', 'stop': '<|fim_suffix|>'})

DALL-Eで出力

繰り返す

client = OpenAI()

response = client.chat.completions.create(
  model="gpt-4-vision-preview",
  messages=[
    {
      "role": "user",
      "content": [
        {"type": "text", "text": "Generate prompts to generate images with more aesthetic abstraction. What does this image contain?"},
        {
          "type": "image_url",
          "image_url": {
            "url": "https://assets.st-note.com/img/1700274951493-8F5Medh9MK.png",
          },
        },
      ],
    }
  ],
  max_tokens=300,
)

print(response.choices[0])

出力

Choice(finish_reason=None, index=0, message=ChatCompletionMessage(content='This image depicts a tender and cozy scene featuring two stylized characters—an adult woman and a young child—who appear to be engaging in the intimate act of reading a book together. The woman has a gentle smile and her hair is styled in soft waves, while the child looks content, with attention directed towards the book. The book has an illustration of a tree on the visible page, suggesting it might be a story or educational book about nature. The illustration style is soft with minimal shading, favoring pastel-like colors that add to the warmth and affectionate atmosphere of the scene.\n\nFor generating images with more aesthetic abstraction, here are some prompts that could be used to inspire such creations:\n\n1. "Create an abstract rendering of a mother and child reading together, using watercolor washes and splashes to represent their bond and the magic of storytelling."\n2. "Illustrate a familial scene where the figures are composed entirely of geometric shapes and vibrant colors, expressing emotions through composition and hue rather than detail."\n3. "Design an image of a parent-child reading moment using only silhouettes and negative space, surrounded by patterns and shapes that evoke a feeling of imagination and wonder."\n4. "Generate a digitally abstracted portrait of a reading nook, where the figures are suggested by overlapping translucent textures and the suggestion of light and shadow."\n5. "Produce an artwork of a story time scene with a fragmented cubist style, where the narrative is told through distorted perspectives and symbolic elements." \n', role='assistant', function_call=None, tool_calls=None), finish_details={'type': 'max_tokens'})

Choice(finish_reason=None, index=0, message=ChatCompletionMessage(content='This image depicts a tender and cozy scene featuring two stylized characters—an adult woman and a young child—who appear to be engaging in the intimate act of reading a book together. The woman has a gentle smile and her hair is styled in soft waves, while the child looks content, with attention directed towards the book. The book has an illustration of a tree on the visible page, suggesting it might be a story or educational book about nature. The illustration style is soft with minimal shading, favoring pastel-like colors that add to the warmth and affectionate atmosphere of the scene.\n\nFor generating images with more aesthetic abstraction, here are some prompts that could be used to inspire such creations:\n\n1. "Create an abstract rendering of a mother and child reading together, using watercolor washes and splashes to represent their bond and the magic of storytelling."\n2. "Illustrate a familial scene where the figures are composed entirely of geometric shapes and vibrant colors, expressing emotions through composition and hue rather than detail."\n3. "Design an image of a parent-child reading moment using only silhouettes and negative space, surrounded by patterns and shapes that evoke a feeling of imagination and wonder."\n4. "Generate a digitally abstracted portrait of a reading nook, where the figures are suggested by overlapping translucent textures and the suggestion of light and shadow."\n5. "Produce an artwork of a story time scene with a fragmented cubist style, where the narrative is told through distorted perspectives and symbolic elements." \n', role='assistant', function_call=None, tool_calls=None), finish_details={'type': 'max_tokens'})

DALL-Eで出力

ふりかえり

やはりあまり変化は見られず。

この記事が参加している募集

AIとやってみた

この記事が気に入ったらサポートをしてみませんか?