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()