generate_code_block.py

 

실행 프로그램으로 완성되었으나 테스트 해보니 인증되지 않은 악성 파일로 간주되어 사용되지 않는 것으로 파악되어서

실행 파일은 업로드 하지 않고 파이썬 코드를 사용 하실줄 아시는 분들은 마음껏 사용하시면 됩니다.

 

파이썬과 마이크로소프트의 비주얼 스튜디오 CODE 프로그램을 사용하여 AI 모델 COPILOT의 도움 받을 수 있는 기능이 있으니 아래 링크로 확인 하시면 됩니다.

 

https://www.sdexample.com/2025/03/copilot.html

 

3.파이썬 프로그래밍 Copilot 연동 가능한 비주얼 스튜디오 코드 다운로드해서 설치하기

파이썬을 공부하기

www.sdexample.com

 

프롬프트 각 속성에 20개의 속성을 배치 하였으니 로또 확률 보다 많은 조합입니다. 

사용하실때 잘 모르시거나 파이썬 설치방법 모르거나 오류있으면 댓글 다시면 알려드립니다.

 

 

generate_code_block.py

import tkinter as tk
from tkinter import ttk
import textwrap

# Define the elements and their options (20 options per element)
elements = {
    "Quality": ["High Quality", "8K", "4K", "HDR", "Realistic", "Low Quality", "Blurry", "Sharp", "Digital", "Analog", "Vintage", "Modern", "Futuristic", "Dreamy", "Hyperrealistic", "Impressionistic", "Pop Art", "Surreal", "Oil Painting", "Watercolor"],
    "Gender": ["Male", "Female"],  # Only Male and Female for Gender
    "Number of People": ["1 person", "2 people", "3 people", "4 people", "5 people", "6 people", "7 people", "8 people", "9 people", "10 people", "Group", "Crowd", "Family", "Friends", "Lovers", "Team", "Organization", "Squad", "Club", "Community"],
    "Age": ["Infant", "Toddler", "Child", "Teenager", "20s", "30s", "40s", "50s", "60s", "70s", "80s", "Elderly", "Young", "Old", "Minor", "Adult", "Middle-aged", "Senior", "Very Old", "Baby"],
    "Appearance": ["Beautiful", "Handsome", "Cute", "Attractive", "Unique", "Ordinary", "Stylish", "Vibrant", "Elegant", "Intense", "Mysterious", "Pure", "Individual", "Neat", "Glamorous", "Simple", "Modest", "Bold", "Gentle", "Cold"],
    "Ethnicity": ["Korean", "American", "European", "African", "Asian", "Latin American", "Mixed", "Indigenous", "Middle Eastern", "Australian", "Russian", "Chinese", "Japanese", "Indian", "Brazilian", "Canadian", "Mexican", "German", "French", "Italian"],
    "Expression": ["Happy", "Sad", "Angry", "Surprised", "Serious", "Smiling", "Neutral", "Confused", "Excited", "Worried", "Scared", "Calm", "Thoughtful", "Determined", "Playful", "Sarcastic", "Annoyed", "Disappointed", "Hopeful", "Pessimistic"],
    "Pose": ["Standing", "Sitting", "Walking", "Running", "Dancing", "Thinking", "Relaxing", "Fighting", "Meditating", "Sleeping", "Reading", "Writing", "Painting", "Cooking", "Playing", "Working", "Traveling", "Exploring", "Observing", "Contemplating"],
    "Clothing": ["Suit", "Casual", "Dress", "Uniform", "Traditional", "Sportswear", "Swimsuit", "Cape", "Armor", "Robe", "Jeans", "T-shirt", "Skirt", "Coat", "Hat", "Gloves", "Shoes", "Boots", "Socks", "Underwear"],
    "Location": ["City", "Countryside", "Forest", "Beach", "Mountain", "Sky", "Indoor", "Cafe", "School", "Space", "Desert", "Jungle", "Ocean", "River", "Lake", "Park", "Garden", "Museum", "Library", "Temple"],
    "Time of Day": ["Day", "Night", "Dawn", "Dusk", "Morning", "Afternoon", "Evening", "Midnight", "Sunrise", "Sunset", "Golden Hour", "Blue Hour", "Twilight", "Noon", "Early Morning", "Late Night", "Rush Hour", "Quiet Time", "High Noon", "Darkness"],
    "Weather": ["Sunny", "Cloudy", "Rainy", "Snowy", "Windy", "Stormy", "Foggy", "Rainbow", "Clear", "Overcast", "Drizzling", "Hail", "Blizzard", "Heatwave", "Cold Snap", "Monsoon", "Hurricane", "Typhoon", "Tornado", "Mild"],
    "Mood": ["Peaceful", "Energetic", "Dark", "Bright", "Mysterious", "Dreamy", "Quiet", "Tense", "Happy", "Sad", "Romantic", "Scary", "Exciting", "Calm", "Chaotic", "Serene", "Gloomy", "Optimistic", "Pessimistic", "Melancholy"],
    "Style": ["Oil Painting", "Watercolor", "Pop Art", "Surrealism", "Impressionism", "Pixel Art", "Cartoon", "Anime", "Realistic", "3D Rendering", "Photorealistic", "Abstract", "Minimalist", "Vintage", "Modern", "Cyberpunk", "Steampunk", "Fantasy", "Sci-Fi", "Gothic"],
    "Color": ["Bright", "Dark", "Pastel", "Monochrome", "Red", "Blue", "Green", "Yellow", "Purple", "Gold", "Silver", "Orange", "Pink", "Brown", "Black", "White", "Gray", "Teal", "Magenta", "Cyan"],
    "Lighting": ["Soft", "Hard", "Natural", "Artificial", "Backlight", "Sidelight", "Dramatic", "Ambient", "Rim Lighting", "Volumetric Lighting", "Global Illumination", "Ray Tracing", "Studio Lighting", "Candlelight", "Firelight", "Moonlight", "Sunlight", "Neon", "Fluorescent", "Spotlight"],
    "Composition": ["Close-up", "Wide Shot", "Panorama", "Symmetry", "Asymmetry", "Eye-level", "High Angle", "Low Angle", "Rule of Thirds", "Leading Lines", "Golden Ratio", "Dutch Angle", "Bird's Eye View", "Worm's Eye View", "Framing", "Depth of Field", "Negative Space", "Dynamic Composition", "Static Composition", "Balanced"],
    "Special Effects": ["Light", "Shadow", "Fog", "Dust", "Reflection", "Blur", "Particles", "Lightning", "Glow", "Bloom", "Lens Flare", "Chromatic Aberration", "Vignette", "Distortion", "Glitch", "Noise", "Smoke", "Fire", "Water", "Ice"],
    "Entity Type": ["Human", "Animal", "Robot", "Alien", "Virtual Person", "Doll", "Hero", "Villain", "Noble", "Commoner", "Creature", "Monster", "Mythical Being", "Spirit", "Ghost", "Demon", "Angel", "Golem", "Construct", "Automaton"]
}

# Create the main window
root = tk.Tk()
root.title("Image Prompt Generator")

# Dictionary to store selected options
selected_options = {}

# Create a frame for the input fields
frame = ttk.Frame(root, padding=10)
frame.pack()

# Create input fields for each element
for element, options in elements.items():
    label = ttk.Label(frame, text=element + ":")
    label.grid(row=len(selected_options), column=0, sticky=tk.W)

    # Create a Combobox (dropdown menu)
    selected_option = tk.StringVar()
    combobox = ttk.Combobox(frame, textvariable=selected_option, values=options, state="readonly")
    combobox.grid(row=len(selected_options), column=1, sticky=tk.W)
    combobox.set(options[0])  # Set a default value

    # Create an Entry (text input field) with larger width
    entry = ttk.Entry(frame, textvariable=selected_option, width=30)
    entry.grid(row=len(selected_options), column=2, sticky=tk.W)

    selected_options[element] = selected_option

# Function to generate the prompt
def generate_prompt():
    prompt_parts = []
    for key, option in selected_options.items():
        prompt_parts.append(f"{key}: {option.get()}")

    prompt = ", ".join(prompt_parts)

    # Wrap the prompt for better readability
    wrapped_prompt = textwrap.fill(prompt, width=80)  # Adjust width as needed

    # Display the prompt in the text box
    prompt_text.delete("1.0", tk.END)  # Clear the text box
    prompt_text.insert(tk.END, wrapped_prompt)

# Create a button to generate the prompt
generate_button = ttk.Button(root, text="Generate Prompt", command=generate_prompt)
generate_button.pack(pady=10)

# Create a text box to display the generated prompt
prompt_text = tk.Text(root, height=10, width=80)
prompt_text.pack()

# Run the main loop
root.mainloop()

 

 

 

반응형
LIST

 

AI Kissing Video Generator

 

여자
여자
남자
남자
여자 & 남자
여자 & 남자

반응형
LIST

AI 생성이미지 프롬프트 제조(?)를 돕기 위해서 개인 제작 프로그램을 무료 배포 하겠습니다.

파이썬으로 제작하였으며 본래 이 프로그램을 사용 하려면 파이썬이 설치 되어있어야 하는데

초보자를 위하여 즉시 실행 되도록 만들었습니다. 혹시 안되시는 분들은 오류사항 문의 부탁드립니다.

 

prompt_generator.exe
8.09MB
자체제작 Prompt generator.exe

 

왼쪽에서 슬라이드 메뉴로 선택하시고 혹시 원하는 속성에 메뉴가 없으시면 오른쪽에다가 직접 입력하시면 됩니다.

그리고 Generate Prompt를 누르시면 아래 빈칸에 프롬프트가 완성 됩니다.

 

혹시 파이썬 버전을 설치 하시려면 3.10.6 버전 입니다. 

 

생성된 프롬프트는 Midjourney, Stable Diffusion, and DALL-E 2 에서 최적합하고 대부분에 AI 모델에서 적용 가능하실꺼라 생각 됩니다. 우선은 스테이블 디퓨전 기준 입니다.

 

각 속성에는 20개의 속성을 배치 해놨습니다. 로또 확률 보다도 많은 조합이니 충분히 유용하리라 생각됩니다.

업그레이드가 필요하시면 요청해 주십시오.

 

많이 사용해주시고 오류 사항 보고 부탁드립니다.

반응형
LIST

+ Recent posts