openfree commited on
Commit
1fd6876
ยท
verified ยท
1 Parent(s): 66d08f3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +39 -288
app.py CHANGED
@@ -30,7 +30,6 @@ except Exception as e:
30
  device = "cuda" if torch.cuda.is_available() else "cpu"
31
 
32
  dtype = torch.bfloat16 if device == "cuda" else torch.float32
33
-
34
  print(f"Using device: {device}, dtype: {dtype}")
35
 
36
  ##############################################################################
@@ -42,18 +41,15 @@ try:
42
  model="Helsinki-NLP/opus-mt-ko-en",
43
  device=0 if device == "cuda" else -1
44
  )
45
-
46
  pipe = DiffusionPipeline.from_pretrained(
47
  "black-forest-labs/FLUX.1-schnell",
48
  torch_dtype=dtype
49
  ).to(device)
50
-
51
  print("Models loaded successfully")
52
  except Exception as e:
53
  print(f"Error loading models: {e}")
54
  def dummy_translator(text):
55
  return [{'translation_text': text}]
56
-
57
  class DummyPipe:
58
  def __call__(self, **kwargs):
59
  from PIL import Image
@@ -63,7 +59,6 @@ except Exception as e:
63
  def __init__(self, img):
64
  self.images = [img]
65
  return DummyResult(dummy_img)
66
-
67
  translator = dummy_translator
68
  pipe = DummyPipe()
69
 
@@ -102,25 +97,19 @@ def log_unexpected_characters(text):
102
  def generate_design_image(prompt, seed=42, randomize_seed=True, width=1024, height=1024, num_inference_steps=4):
103
  original_prompt = prompt
104
  translated = False
105
-
106
  # Clean the input text
107
  prompt = clean_input_text(prompt)
108
-
109
  # Pre-process: if input is too long, trim to 1000 characters
110
  if len(prompt) > 1000:
111
  prompt = prompt[:1000]
112
-
113
  if contains_korean(prompt):
114
  # When calling translation, add max_length and truncation options to avoid length issues
115
  translation = translator(prompt, max_length=400, truncation=True)
116
  prompt = translation[0]['translation_text']
117
  translated = True
118
-
119
  if randomize_seed:
120
  seed = random.randint(0, MAX_SEED)
121
-
122
  generator = torch.Generator(device=device).manual_seed(seed)
123
-
124
  image = pipe(
125
  prompt=prompt,
126
  width=width,
@@ -129,7 +118,6 @@ def generate_design_image(prompt, seed=42, randomize_seed=True, width=1024, heig
129
  generator=generator,
130
  guidance_scale=0.0
131
  ).images[0]
132
-
133
  return image
134
 
135
  ##############################################################################
@@ -257,257 +245,6 @@ physical_transformation_categories = {
257
  "๊ด‘๋„ ๋ณ€ํ™”"
258
  ],
259
  "์†Œ๋ฆฌ์™€ ์ง„๋™ ํšจ๊ณผ": [
260
- "์†Œ๋ฆฌ ๋ฐœ์ƒ/์†Œ๋ฉธ", "์†Œ๋ฆฌ ๋†’๋‚ฎ์ด ๋ณ€ํ™”", "์†Œ๋ฆฌ ํฌ๊ธฐ ๋ณ€ํ™”", "์Œ์ƒ‰ ๋ณ€ํ™”",
261
- "๊ณต๋ช…/๋ฐ˜๊ณต๋ช…", "์Œํ–ฅ ์ง„๋™", "์ดˆ์ŒํŒŒ/์ €์ŒํŒŒ ๋ฐœ์ƒ", "์Œํ–ฅ ์ง‘์ค‘/๋ถ„์‚ฐ",
262
- "์Œํ–ฅ ๋ฐ˜์‚ฌ/ํก์ˆ˜", "์Œํ–ฅ ๋„ํ”Œ๋Ÿฌ ํšจ๊ณผ", "์ŒํŒŒ ๊ฐ„์„ญ", "์Œํ–ฅ ๊ณต์ง„",
263
- "์ง„๋™ ํŒจํ„ด ๋ณ€ํ™”", "ํƒ€์•… ํšจ๊ณผ", "์Œํ–ฅ ํ”ผ๋“œ๋ฐฑ", "์Œํ–ฅ ์ฐจํ/์ฆํญ",
264
- "์†Œ๋ฆฌ ์ง€ํ–ฅ์„ฑ", "์Œํ–ฅ ์™œ๊ณก", "๋น„ํŠธ ์ƒ์„ฑ", "ํ•˜๋ชจ๋‹‰์Šค ์ƒ์„ฑ", "์ฃผํŒŒ์ˆ˜ ๋ณ€์กฐ",
265
- "์Œํ–ฅ ์ถฉ๊ฒฉํŒŒ", "์Œํ–ฅ ํ•„ํ„ฐ๋ง"
266
- ],
267
- "์†Œ๋ฆฌ์™€ ์ง„๋™ ํšจ๊ณผ": [
268
- "์†Œ๋ฆฌ ๋ฐœ์ƒ/์†Œ๋ฉธ",
269
- "์Œ ๋†’๋‚ฎ์ด ๋ณ€ํ™”",
270
- "์Œ๋Ÿ‰ ๋ณ€ํ™”",
271
- "์Œ์ƒ‰ ๋ณ€ํ™”",
272
- "๊ณต๋ช…/๋ฐ˜๊ณต๋ช…",
273
- "์Œํ–ฅ ์ง„๋™",
274
- "์ดˆ์ŒํŒŒ/์ €์ŒํŒŒ ๋ฐœ์ƒ",
275
- "์†Œ๋ฆฌ ์ง‘์ค‘/๋ถ„์‚ฐ",
276
- "์Œํ–ฅ ๋ฐ˜์‚ฌ/ํก์ˆ˜",
277
- "์Œํ–ฅ ๋„ํ”Œ๋Ÿฌ ํšจ๊ณผ",
278
- "์ŒํŒŒ ๊ฐ„์„ญ",
279
- "์Œํ–ฅ ๊ณต์ง„",
280
- "์ง„๋™ ํŒจํ„ด ๋ณ€ํ™”",
281
- "ํƒ€์•… ํšจ๊ณผ",
282
- "์Œํ–ฅ ํ”ผ๋“œ๋ฐฑ",
283
- "์Œํ–ฅ ์ฐจํ/์ฆํญ",
284
- "์†Œ๋ฆฌ ์ง€ํ–ฅ์„ฑ",
285
- "์†Œ๋ฆฌ ์™œ๊ณก",
286
- "๋น„ํŠธ ์ƒ์„ฑ",
287
- "๋ฐฐ์Œ ์ƒ์„ฑ",
288
- "์ฃผํŒŒ์ˆ˜ ๋ณ€์กฐ",
289
- "์Œํ–ฅ ์ถฉ๊ฒฉํŒŒ",
290
- "์Œํ–ฅ ํ•„ํ„ฐ๋ง"
291
- ],
292
- "์—ด ๊ด€๋ จ ๋ณ€ํ™”": [
293
- "์˜จ๋„ ์ƒ์Šน/ํ•˜๊ฐ•",
294
- "์—ด ํŒฝ์ฐฝ/์ˆ˜์ถ•",
295
- "์—ด ์ „๋‹ฌ/์ฐจ๋‹จ",
296
- "์••๋ ฅ ์ƒ์Šน/ํ•˜๊ฐ•",
297
- "์—ด ๋ณ€ํ™”์— ๋”ฐ๋ฅธ ์žํ™”",
298
- "์—”ํŠธ๋กœํ”ผ ๋ณ€ํ™”",
299
- "์—ด์ „๊ธฐ ํšจ๊ณผ",
300
- "์ž๊ธฐ์žฅ์— ์˜ํ•œ ์—ด ๋ณ€ํ™”",
301
- "์ƒํƒœ ๋ณ€ํ™” ์ค‘ ์—ด ์ €์žฅ/๋ฐฉ์ถœ",
302
- "์—ด ์ŠคํŠธ๋ ˆ์Šค ๋ฐœ์ƒ/ํ•ด์†Œ",
303
- "๊ธ‰๊ฒฉํ•œ ์˜จ๋„ ๋ณ€ํ™” ์˜ํ–ฅ",
304
- "๋ณต์‚ฌ ๋ƒ‰๊ฐ/๊ฐ€์—ด",
305
- "๋ฐœ์—ด/ํก์—ด",
306
- "์—ด ๋ถ„ํฌ ๋ณ€ํ™”",
307
- "์—ด ๋ฐ˜์‚ฌ/ํก์ˆ˜",
308
- "๋ƒ‰๊ฐ ์‘์ถ•",
309
- "์—ด ํ™œ์„ฑํ™”",
310
- "์—ด ๋ณ€์ƒ‰",
311
- "์—ด ํŒฝ์ฐฝ ๊ณ„์ˆ˜ ๋ณ€ํ™”",
312
- "์—ด ์•ˆ์ •์„ฑ ๋ณ€ํ™”",
313
- "๋‚ด์—ด์„ฑ/๋‚ดํ•œ์„ฑ",
314
- "์ž๊ฐ€ ๋ฐœ์—ด",
315
- "์—ด์  ํ‰ํ˜•/๋ถˆ๊ท ํ˜•",
316
- "์—ด์  ๋ณ€ํ˜•",
317
- "์—ด ๋ถ„์‚ฐ/์ง‘์ค‘"
318
- ],
319
- "์ „๊ธฐ ๋ฐ ์ž๊ธฐ ๋ณ€ํ™”": [
320
- "์ž์„ฑ ์ƒ์„ฑ/์†Œ๋ฉธ",
321
- "์ „ํ•˜๋Ÿ‰ ์ฆ๊ฐ€/๊ฐ์†Œ",
322
- "์ „๊ธฐ์žฅ ์ƒ์„ฑ/์†Œ๋ฉธ",
323
- "์ž๊ธฐ์žฅ ์ƒ์„ฑ/์†Œ๋ฉธ",
324
- "์ดˆ์ „๋„ ์ƒํƒœ ์ „ํ™˜",
325
- "๊ฐ•์œ ์ „์ฒด ํŠน์„ฑ ๋ณ€ํ™”",
326
- "์–‘์ž ์ƒํƒœ ๋ณ€ํ™”",
327
- "ํ”Œ๋ผ์ฆˆ๋งˆ ํ˜•์„ฑ/์†Œ๋ฉธ",
328
- "์Šคํ•€ํŒŒ ์ „๋‹ฌ",
329
- "๋น›์— ์˜ํ•œ ์ „๊ธฐ ๋ฐœ์ƒ",
330
- "์••๋ ฅ์— ์˜ํ•œ ์ „๊ธฐ ๋ฐœ์ƒ",
331
- "์ž๊ธฐ์žฅ ๋‚ด ์ „๋ฅ˜ ๋ณ€ํ™”",
332
- "์ „๊ธฐ ์ €ํ•ญ ๋ณ€ํ™”",
333
- "์ „๊ธฐ ์ „๋„์„ฑ ๋ณ€ํ™”",
334
- "์ •๏ฟฝ๏ฟฝ๊ธฐ ๋ฐœ์ƒ/๋ฐฉ์ „",
335
- "์ „์ž๊ธฐ ์œ ๋„",
336
- "์ „์ž๊ธฐํŒŒ ๋ฐฉ์ถœ/ํก์ˆ˜",
337
- "์ „๊ธฐ ์šฉ๋Ÿ‰ ๋ณ€ํ™”",
338
- "์ž๊ธฐ ์ด๋ ฅ ํ˜„์ƒ",
339
- "์ „๊ธฐ์  ๋ถ„๊ทน",
340
- "์ „์ž ํ๋ฆ„ ๋ฐฉํ–ฅ ๋ณ€ํ™”",
341
- "์ „๊ธฐ์  ๊ณต๋ช…",
342
- "์ „๊ธฐ์  ์ฐจํ/๋…ธ์ถœ",
343
- "์ž๊ธฐ ์ฐจํ/๋…ธ์ถœ",
344
- "์ž๊ธฐ์žฅ ์ •๋ ฌ"
345
- ],
346
- "ํ™”ํ•™์  ๋ณ€ํ™”": [
347
- "ํ‘œ๋ฉด ์ฝ”ํŒ… ๋ณ€ํ™”",
348
- "๋ฌผ์งˆ ์„ฑ๋ถ„ ๋ณ€ํ™”",
349
- "ํ™”ํ•™ ๋ฐ˜์‘ ๋ณ€ํ™”",
350
- "์ด‰๋งค ์ž‘์šฉ ์‹œ์ž‘/์ค‘๋‹จ",
351
- "๋น›์— ์˜ํ•œ ํ™”ํ•™ ๋ฐ˜์‘",
352
- "์ „๊ธฐ์— ์˜ํ•œ ํ™”ํ•™ ๋ฐ˜์‘",
353
- "๋‹จ๋ถ„์ž๋ง‰ ํ˜•์„ฑ",
354
- "๋ถ„์ž ์ˆ˜์ค€ ๊ตฌ์กฐ ๋ณ€ํ™”",
355
- "์ƒ์ฒด ๋ชจ๋ฐฉ ํ‘œ๋ฉด ๋ณ€ํ™”",
356
- "ํ™˜๊ฒฝ ๋ฐ˜์‘ํ˜• ๋ฌผ์งˆ ๋ณ€ํ™”",
357
- "์ฃผ๊ธฐ์  ํ™”ํ•™ ๋ฐ˜์‘",
358
- "์‚ฐํ™”",
359
- "ํ™˜์›",
360
- "๊ณ ๋ถ„์žํ™”",
361
- "๋ฌผ ๋ถ„ํ•ด",
362
- "ํ™”ํ•ฉ",
363
- "๋ฐฉ์‚ฌ์„  ์˜ํ–ฅ",
364
- "์‚ฐ-์—ผ๊ธฐ ๋ฐ˜์‘",
365
- "์ค‘ํ™” ๋ฐ˜์‘",
366
- "์ด์˜จํ™”",
367
- "ํ™”ํ•™์  ํก์ฐฉ/ํƒˆ์ฐฉ",
368
- "์ด‰๋งค ํšจ์œจ ๋ณ€ํ™”",
369
- "ํšจ์†Œ ํ™œ์„ฑ ๋ณ€ํ™”",
370
- "๋ฐœ์ƒ‰ ๋ฐ˜์‘",
371
- "pH ๋ณ€ํ™”",
372
- "ํ™”ํ•™์  ํ‰ํ˜• ์ด๋™",
373
- "๊ฒฐํ•ฉ ํ˜•์„ฑ/๋ถ„ํ•ด",
374
- "์šฉํ•ด๋„ ๋ณ€ํ™”"
375
- ],
376
- "์ƒ๋ฌผํ•™์  ๋ณ€ํ™”": [
377
- "์„ฑ์žฅ/์œ„์ถ•",
378
- "์„ธํฌ ๋ถ„์—ด/์‚ฌ๋ฉธ",
379
- "์ƒ๋ฌผ ๋ฐœ๊ด‘",
380
- "์‹ ์ง„๋Œ€์‚ฌ ๋ณ€ํ™”",
381
- "๋ฉด์—ญ ๋ฐ˜์‘",
382
- "ํ˜ธ๋ฅด๋ชฌ ๋ถ„๋น„",
383
- "์‹ ๊ฒฝ ๋ฐ˜์‘",
384
- "์œ ์ „์  ๋ฐœํ˜„",
385
- "์ ์‘/์ง„ํ™”",
386
- "์ƒ์ฒด๋ฆฌ๋“ฌ ๋ณ€ํ™”",
387
- "์žฌ์ƒ/์น˜์œ ",
388
- "๋…ธํ™”/์„ฑ์ˆ™",
389
- "์ƒ์ฒด ๋ชจ๋ฐฉ ๋ณ€ํ™”",
390
- "๋ฐ”์ด์˜คํ•„๋ฆ„ ํ˜•์„ฑ",
391
- "์ƒ๋ฌผํ•™์  ๋ถ„ํ•ด",
392
- "ํšจ์†Œ ํ™œ์„ฑํ™”/๋น„ํ™œ์„ฑํ™”",
393
- "์ƒ๋ฌผํ•™์  ์‹ ํ˜ธ ์ „๋‹ฌ",
394
- "์ŠคํŠธ๋ ˆ์Šค ๋ฐ˜์‘",
395
- "์ฒด์˜จ ์กฐ์ ˆ",
396
- "์ƒ๋ฌผํ•™์  ์‹œ๊ณ„ ๋ณ€ํ™”",
397
- "์„ธํฌ์™ธ ๊ธฐ์งˆ ๋ณ€ํ™”",
398
- "์ƒ์ฒด ์—ญํ•™์  ๋ฐ˜์‘",
399
- "์„ธํฌ ์šด๋™์„ฑ",
400
- "์„ธํฌ ๊ทน์„ฑ ๋ณ€ํ™”",
401
- "์˜์–‘ ์ƒํƒœ ๋ณ€ํ™”"
402
- ],
403
- "ํ™˜๊ฒฝ ์ƒํ˜ธ์ž‘์šฉ": [
404
- "์˜จ๋„ ๋ฐ˜์‘",
405
- "์Šต๋„ ๋ฐ˜์‘",
406
- "๊ธฐ์•• ๋ฐ˜์‘",
407
- "์ค‘๋ ฅ ๋ฐ˜์‘",
408
- "์ž๊ธฐ์žฅ ๋ฐ˜์‘",
409
- "๋น› ๋ฐ˜์‘",
410
- "์†Œ๋ฆฌ ๋ฐ˜์‘",
411
- "ํ™”ํ•™ ๋ฌผ์งˆ ๊ฐ์ง€",
412
- "๊ธฐ๊ณ„์  ์ž๊ทน ๊ฐ์ง€",
413
- "์ „๊ธฐ ์ž๊ทน ๋ฐ˜์‘",
414
- "๋ฐฉ์‚ฌ์„  ๋ฐ˜์‘",
415
- "์ง„๋™ ๊ฐ์ง€",
416
- "pH ๋ฐ˜์‘",
417
- "์šฉ๋งค ๋ฐ˜์‘",
418
- "๊ธฐ์ฒด ๊ตํ™˜",
419
- "ํ™˜๊ฒฝ ์˜ค์—ผ ๋ฐ˜์‘",
420
- "๋‚ ์”จ ๋ฐ˜์‘",
421
- "๊ณ„์ ˆ ๋ฐ˜์‘",
422
- "์ผ์ฃผ๊ธฐ ๋ฐ˜์‘",
423
- "์ƒํƒœ๊ณ„ ์ƒํ˜ธ์ž‘์šฉ",
424
- "๊ณต์ƒ/๊ฒฝ์Ÿ ๋ฐ˜์‘",
425
- "ํฌ์‹/ํ”ผ์‹ ๊ด€๊ณ„",
426
- "๊ตฐ์ง‘ ํ˜•์„ฑ",
427
- "์˜์—ญ ์„ค์ •",
428
- "์ด์ฃผ/์ •์ฐฉ ํŒจํ„ด"
429
- ]
430
- }
431
-
432
- # English version
433
- physical_transformation_categories_en = {
434
- "Sensor Functions": [
435
- "Visual sensor/detection", "Auditory sensor/detection", "Tactile sensor/detection", "Taste sensor/detection", "Olfactory sensor/detection",
436
- "Temperature sensor/detection", "Humidity sensor/detection", "Pressure sensor/detection", "Acceleration sensor/detection", "Rotational sensor/detection",
437
- "Proximity sensor/detection", "Position sensor/detection", "Motion sensor/detection", "Gas sensor/detection", "Infrared sensor/detection",
438
- "Ultraviolet sensor/detection", "Radiation sensor/detection", "Magnetic sensor/detection", "Electric field sensor/detection", "Chemical sensor/detection",
439
- "Biosignal sensor/detection", "Vibration sensor/detection", "Noise sensor/detection", "Light intensity sensor/detection", "Light wavelength sensor/detection",
440
- "Tilt sensor/detection", "pH sensor/detection", "Current sensor/detection", "Voltage sensor/detection", "Image sensor/detection",
441
- "Distance sensor/detection", "Depth sensor/detection", "Gravity sensor/detection", "Speed sensor/detection", "Flow sensor/detection",
442
- "Water level sensor/detection", "Turbidity sensor/detection", "Salinity sensor/detection", "Metal detection", "Piezoelectric sensor/detection",
443
- "Photovoltaic sensor/detection", "Thermocouple sensor/detection", "Hall effect sensor/detection", "Ultrasonic sensor/detection", "Radar sensor/detection",
444
- "Lidar sensor/detection", "Touch sensor/detection", "Gesture sensor/detection", "Heart rate sensor/detection", "Blood pressure sensor/detection"
445
- ],
446
- "Size and Shape Change": [
447
- "Volume increase/decrease", "Length increase/decrease", "Width increase/decrease", "Height increase/decrease",
448
- "Density change", "Weight increase/decrease", "Shape deformation", "State change", "Uneven deformation",
449
- "Complex shape deformation", "Twisting/entwining", "Non-uniform expansion/contraction", "Rounded/sharpened edges",
450
- "Cracking/splitting", "Fragmentation", "Water resistance", "Dust resistance", "Denting/recovery",
451
- "Folding/unfolding", "Compression/expansion", "Stretching/contraction", "Wrinkling/flattening", "Crushing/hardening",
452
- "Rolling/unrolling", "Bending/curving"
453
- ],
454
- "Surface and Appearance Change": [
455
- "Color change", "Texture change", "Transparency change", "Glossy/matte change",
456
- "Light reflection variation", "Pattern change", "Angle-dependent color change", "Light-induced color change",
457
- "Temperature-dependent color change", "Holographic effect", "Angle-specific light reflection", "Surface shape alteration",
458
- "Nano-scale surface structure change", "Self-cleaning effect", "Stain/pattern formation", "Blurriness/clarity change",
459
- "Luster/shine change", "Hue/saturation change", "Luminescence/fluorescence", "Light scattering effect",
460
- "Light absorption change", "Translucency effect", "Shadow effect change", "UV response change",
461
- "Glow effect"
462
- ],
463
- "Material State Change": [
464
- "Solid/liquid/gas transition", "Crystallization/dissolution", "Oxidation/corrosion", "Hardening/softening",
465
- "Special state transition", "Amorphous/crystalline transition", "Component separation", "Particle formation/disintegration",
466
- "Gel formation/dissolution", "Metastable state change", "Molecular self-assembly/disintegration", "Delayed state change",
467
- "Melting", "Solidification", "Evaporation/condensation", "Sublimation/deposition", "Precipitation/suspension", "Dispersion/aggregation",
468
- "Drying/moistening", "Swelling/shrinkage", "Freezing/thawing", "Weathering/erosion", "Charging/discharging",
469
- "Bonding/separation", "Fermentation/decay"
470
- ],
471
- "Movement Characteristics Change": [
472
- "Acceleration/deceleration", "Maintaining constant speed", "Vibration/vibration reduction", "Collision/bouncing",
473
- "Increase/decrease in rotational speed", "Change in rotational direction", "Irregular movement", "Stop-and-slide phenomenon",
474
- "Resonance/anti-resonance", "Resistance/lift change in fluid", "Change in movement resistance", "Complex vibrational movement",
475
- "Movement in special fluid", "Rotational-translational movement", "Inertial stoppage", "Shock absorption",
476
- "Shock transfer", "Conservation of momentum", "Friction change", "Overcoming inertia", "Unstable equilibrium",
477
- "Dynamic stability", "Damping of oscillation", "Path predictability", "Evasive movement"
478
- ],
479
- "Structural Change": [
480
- "Addition/removal of components", "Assembly/disassembly", "Folding/unfolding", "Deformation/recovery", "Optimal structural change",
481
- "Self-rearrangement", "Natural pattern formation/disappearance", "Regular pattern change", "Modular transformation",
482
- "Increased structural complexity", "Memory of original shape effect", "Shape change over time", "Partial removal",
483
- "Partial replacement", "Bonding", "Separation", "Division/integration", "Overlaying", "Internal structure change",
484
- "External structure change", "Shift of center axis", "Balance point change", "Hierarchical structure change", "Support structure change",
485
- "Stress distribution structure", "Shock absorption structure", "Grid/matrix structure change", "Interconnectivity change"
486
- ],
487
- "Spatial Movement": [
488
- "Forward/backward movement", "Left/right movement", "Up/down movement", "Vertical axis rotation (nodding)",
489
- "Horizontal axis rotation (shaking head)", "Longitudinal axis rotation (tilting sideways)", "Circular motion", "Spiral movement",
490
- "Slipping due to inertia", "Change of rotation axis", "Irregular rotation", "Shaking movement", "Parabolic motion",
491
- "Zero-gravity floating", "Floating on water surface", "Jump/leap", "Sliding", "Rolling", "Free fall",
492
- "Reciprocating motion", "Elastic bouncing", "Penetration", "Evasive movement", "Zigzag movement", "Swinging movement"
493
- ],
494
- "Time-Related Change": [
495
- "Aging/weathering", "Wear/corrosion", "Fading/discoloration", "Damage/recovery", "Lifecycle change",
496
- "Adaptation through user interaction", "Learning-based shape optimization", "Property change over time",
497
- "Collective memory effect", "Cultural significance change", "Delayed response", "History-dependent change",
498
- "Gradual time change", "Evolutionary change", "Periodic regeneration", "Seasonal adaptation",
499
- "Circadian rhythm change", "Lifecycle stage", "Growth/decline", "Self-repair/regeneration",
500
- "Natural cycle adaptation", "Persistence/transience", "Memory effect", "Delayed effect", "Cumulative effect"
501
- ],
502
- "Light and Visual Effects": [
503
- "Illumination/shutdown", "Light transmission/blocking", "Light scattering/concentration", "Color spectrum change", "Light diffraction",
504
- "Light interference", "Hologram creation", "Laser effect", "Light polarization", "Fluorescence/phosphorescence",
505
- "UV/IR emission", "Optical illusion", "Light refraction", "Shadow creation/removal",
506
- "Chromatic aberration", "Rainbow effect", "Glow effect", "Flash effect", "Lighting pattern",
507
- "Beam effect", "Light filter effect", "Change in light direction", "Projection effect", "Light detection/response",
508
- "Luminance change"
509
- ],
510
- "Sound and Vibration Effects": [
511
  "Sound generation/cessation", "Pitch change", "Volume change", "Timbre change",
512
  "Resonance/antiresonance", "Acoustic vibration", "Ultrasonic/infrasonic emission", "Sound concentration/distribution",
513
  "Sound reflection/absorption", "Acoustic Doppler effect", "Sound wave interference", "Acoustic resonance",
@@ -696,10 +433,8 @@ def process_inputs_lang(text1, text2, text3, selected_category, categories_dict,
696
  text1 = text1.strip() if text1 else None
697
  text2 = text2.strip() if text2 else None
698
  text3 = text3.strip() if text3 else None
699
-
700
  if not text1:
701
  return "์˜ค๋ฅ˜: ์ตœ์†Œ ํ•˜๋‚˜์˜ ํ‚ค์›Œ๋“œ๋ฅผ ์ž…๋ ฅํ•ด์ฃผ์„ธ์š”." if lang=="ko" else "Error: Please enter at least one keyword."
702
-
703
  if lang == "ko":
704
  progress(0.05, desc="์•„์ด๋””์–ด ์ƒ์„ฑ ์ค€๋น„ ์ค‘...")
705
  time.sleep(0.3)
@@ -708,9 +443,7 @@ def process_inputs_lang(text1, text2, text3, selected_category, categories_dict,
708
  progress(0.05, desc="Preparing idea generation...")
709
  time.sleep(0.3)
710
  progress(0.1, desc="Generating creative idea...")
711
-
712
  results = generate_transformations_lang(text1, text2, text3, selected_category, categories_dict, lang)
713
-
714
  if lang == "ko":
715
  progress(0.8, desc="๊ฒฐ๊ณผ ํฌ๋งทํŒ… ์ค‘...")
716
  formatted = format_results_lang(results, lang)
@@ -741,6 +474,41 @@ def get_warning_message_lang(lang="ko"):
741
  return "โš ๏ธ ํ™˜๊ฒฝ ๋ณ€์ˆ˜ GEMINI_API_KEY๊ฐ€ ์„ค์ •๋˜์ง€ ์•Š์•˜์Šต๋‹ˆ๋‹ค. Gemini API ํ‚ค๋ฅผ ์„ค์ •ํ•˜์„ธ์š”." if lang=="ko" else "โš ๏ธ The GEMINI_API_KEY environment variable is not set. Please set your Gemini API key."
742
  return ""
743
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
744
 
745
  ##############################################################################
746
  # Gradio UI with Two Tabs: English (Main Home) and Korean
@@ -749,7 +517,6 @@ with gr.Blocks(
749
  title="Idea Transformer",
750
  theme=gr.themes.Soft(primary_hue="teal", secondary_hue="slate", neutral_hue="neutral")
751
  ) as demo:
752
-
753
  gr.HTML("""
754
  <style>
755
  body {
@@ -792,9 +559,7 @@ with gr.Blocks(
792
  with gr.Tab(label="English"):
793
  gr.Markdown("# ๐Ÿš€ Idea Transformer")
794
  gr.Markdown("Based on up to **three keywords** and a **selected category**, this tool generates a creative transformation idea and a design image using the expanded idea as a prompt. https://discord.gg/openfreeai")
795
-
796
  warning_en = gr.Markdown(get_warning_message_lang("en"))
797
-
798
  with gr.Row():
799
  with gr.Column(scale=1):
800
  text_input1_en = gr.Textbox(label="Keyword 1 (required)", placeholder="e.g., Smartphone")
@@ -807,7 +572,6 @@ with gr.Blocks(
807
  info="Select a category."
808
  )
809
  status_msg_en = gr.Markdown("๐Ÿ’ก Click the 'Generate Idea' button to create an idea and design image based on the selected category.")
810
-
811
  processing_indicator_en = gr.HTML("""
812
  <div style="display: flex; justify-content: center; align-items: center; margin: 10px 0;">
813
  <div style="border: 5px solid #f3f3f3; border-top: 5px solid #3498db; border-radius: 50%; width: 30px; height: 30px; animation: spin 2s linear infinite;"></div>
@@ -820,13 +584,10 @@ with gr.Blocks(
820
  }
821
  </style>
822
  """, visible=False)
823
-
824
  submit_button_en = gr.Button("Generate Idea", variant="primary")
825
-
826
  with gr.Column(scale=2):
827
  idea_output_en = gr.Markdown(label="Idea Output")
828
  generated_image_en = gr.Image(label="Generated Design Image", type="pil")
829
-
830
  gr.Examples(
831
  examples=[
832
  ["Smartphone", "", "", "Sensor Functions"],
@@ -836,14 +597,14 @@ with gr.Blocks(
836
  ["Sneakers", "Wearable", "Health", "Structural Change"],
837
  ],
838
  inputs=[text_input1_en, text_input2_en, text_input3_en, category_radio_en],
 
 
 
839
  )
840
-
841
  def show_processing_indicator_en():
842
  return gr.update(visible=True)
843
-
844
  def hide_processing_indicator_en():
845
  return gr.update(visible=False)
846
-
847
  submit_button_en.click(
848
  fn=show_processing_indicator_en,
849
  inputs=None,
@@ -857,13 +618,10 @@ with gr.Blocks(
857
  inputs=None,
858
  outputs=processing_indicator_en
859
  )
860
-
861
  with gr.Tab(label="ํ•œ๊ตญ์–ด"):
862
  gr.Markdown("# ๐Ÿš€ ์•„์ด๋””์–ด ํŠธ๋žœ์Šคํฌ๋จธ")
863
  gr.Markdown("์ž…๋ ฅํ•œ **ํ‚ค์›Œ๋“œ**(์ตœ๋Œ€ 3๊ฐœ)์™€ **์นดํ…Œ๊ณ ๋ฆฌ**๋ฅผ ๋ฐ”ํƒ•์œผ๋กœ, ์ฐฝ์˜์ ์ธ ๋ชจ๋ธ/์ปจ์…‰/ํ˜•์ƒ ๋ณ€ํ™” ์•„์ด๋””์–ด๋ฅผ ์ƒ์„ฑํ•˜๊ณ , ํ•ด๋‹น ํ™•์žฅ ์•„์ด๋””์–ด๋ฅผ ํ”„๋กฌํ”„ํŠธ๋กœ ํ•˜์—ฌ ๋””์ž์ธ ์ด๋ฏธ์ง€๋ฅผ ์ƒ์„ฑํ•ฉ๋‹ˆ๋‹ค. https://discord.gg/openfreeai")
864
-
865
  warning_ko = gr.Markdown(get_warning_message_lang("ko"))
866
-
867
  with gr.Row():
868
  with gr.Column(scale=1):
869
  text_input1_ko = gr.Textbox(label="ํ‚ค์›Œ๋“œ 1 (ํ•„์ˆ˜)", placeholder="์˜ˆ: ์Šค๋งˆํŠธํฐ")
@@ -876,7 +634,6 @@ with gr.Blocks(
876
  info="์ถœ๋ ฅํ•  ์นดํ…Œ๊ณ ๋ฆฌ๋ฅผ ์„ ํƒํ•˜์„ธ์š”."
877
  )
878
  status_msg_ko = gr.Markdown("๐Ÿ’ก '์•„์ด๋””์–ด ์ƒ์„ฑํ•˜๊ธฐ' ๋ฒ„ํŠผ์„ ํด๋ฆญํ•˜๋ฉด ์„ ํƒํ•œ ์นดํ…Œ๊ณ ๋ฆฌ์— ํ•ด๋‹นํ•˜๋Š” ์•„์ด๋””์–ด์™€ ๋””์ž์ธ ์ด๋ฏธ์ง€๊ฐ€ ์ƒ์„ฑ๋ฉ๋‹ˆ๋‹ค.")
879
-
880
  processing_indicator_ko = gr.HTML("""
881
  <div style="display: flex; justify-content: center; align-items: center; margin: 10px 0;">
882
  <div style="border: 5px solid #f3f3f3; border-top: 5px solid #3498db; border-radius: 50%; width: 30px; height: 30px; animation: spin 2s linear infinite;"></div>
@@ -889,13 +646,10 @@ with gr.Blocks(
889
  }
890
  </style>
891
  """, visible=False)
892
-
893
  submit_button_ko = gr.Button("์•„์ด๋””์–ด ์ƒ์„ฑํ•˜๊ธฐ", variant="primary")
894
-
895
  with gr.Column(scale=2):
896
  idea_output_ko = gr.Markdown(label="์•„์ด๋””์–ด ๊ฒฐ๊ณผ")
897
  generated_image_ko = gr.Image(label="์ƒ์„ฑ๋œ ๋””์ž์ธ ์ด๋ฏธ์ง€", type="pil")
898
-
899
  gr.Examples(
900
  examples=[
901
  ["์Šค๋งˆํŠธํฐ", "", "", "์„ผ์„œ ๊ธฐ๋Šฅ"],
@@ -904,15 +658,12 @@ with gr.Blocks(
904
  ["๋“œ๋ก ", "์ธ๊ณต์ง€๋Šฅ", "", "๋ฌผ์งˆ์˜ ์ƒํƒœ ๋ณ€ํ™”"],
905
  ["์šด๋™ํ™”", "์›จ์–ด๋Ÿฌ๋ธ”", "๊ฑด๊ฐ•", "๊ตฌ์กฐ์  ๋ณ€ํ™”"],
906
  ],
907
- inputs=[text_input1_ko, text_input2_ko, text_input3_ko, category_radio_ko],
908
  )
909
-
910
  def show_processing_indicator_ko():
911
  return gr.update(visible=True)
912
-
913
  def hide_processing_indicator_ko():
914
  return gr.update(visible=False)
915
-
916
  submit_button_ko.click(
917
  fn=show_processing_indicator_ko,
918
  inputs=None,
 
30
  device = "cuda" if torch.cuda.is_available() else "cpu"
31
 
32
  dtype = torch.bfloat16 if device == "cuda" else torch.float32
 
33
  print(f"Using device: {device}, dtype: {dtype}")
34
 
35
  ##############################################################################
 
41
  model="Helsinki-NLP/opus-mt-ko-en",
42
  device=0 if device == "cuda" else -1
43
  )
 
44
  pipe = DiffusionPipeline.from_pretrained(
45
  "black-forest-labs/FLUX.1-schnell",
46
  torch_dtype=dtype
47
  ).to(device)
 
48
  print("Models loaded successfully")
49
  except Exception as e:
50
  print(f"Error loading models: {e}")
51
  def dummy_translator(text):
52
  return [{'translation_text': text}]
 
53
  class DummyPipe:
54
  def __call__(self, **kwargs):
55
  from PIL import Image
 
59
  def __init__(self, img):
60
  self.images = [img]
61
  return DummyResult(dummy_img)
 
62
  translator = dummy_translator
63
  pipe = DummyPipe()
64
 
 
97
  def generate_design_image(prompt, seed=42, randomize_seed=True, width=1024, height=1024, num_inference_steps=4):
98
  original_prompt = prompt
99
  translated = False
 
100
  # Clean the input text
101
  prompt = clean_input_text(prompt)
 
102
  # Pre-process: if input is too long, trim to 1000 characters
103
  if len(prompt) > 1000:
104
  prompt = prompt[:1000]
 
105
  if contains_korean(prompt):
106
  # When calling translation, add max_length and truncation options to avoid length issues
107
  translation = translator(prompt, max_length=400, truncation=True)
108
  prompt = translation[0]['translation_text']
109
  translated = True
 
110
  if randomize_seed:
111
  seed = random.randint(0, MAX_SEED)
 
112
  generator = torch.Generator(device=device).manual_seed(seed)
 
113
  image = pipe(
114
  prompt=prompt,
115
  width=width,
 
118
  generator=generator,
119
  guidance_scale=0.0
120
  ).images[0]
 
121
  return image
122
 
123
  ##############################################################################
 
245
  "๊ด‘๋„ ๋ณ€ํ™”"
246
  ],
247
  "์†Œ๋ฆฌ์™€ ์ง„๋™ ํšจ๊ณผ": [
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
248
  "Sound generation/cessation", "Pitch change", "Volume change", "Timbre change",
249
  "Resonance/antiresonance", "Acoustic vibration", "Ultrasonic/infrasonic emission", "Sound concentration/distribution",
250
  "Sound reflection/absorption", "Acoustic Doppler effect", "Sound wave interference", "Acoustic resonance",
 
433
  text1 = text1.strip() if text1 else None
434
  text2 = text2.strip() if text2 else None
435
  text3 = text3.strip() if text3 else None
 
436
  if not text1:
437
  return "์˜ค๋ฅ˜: ์ตœ์†Œ ํ•˜๋‚˜์˜ ํ‚ค์›Œ๋“œ๋ฅผ ์ž…๋ ฅํ•ด์ฃผ์„ธ์š”." if lang=="ko" else "Error: Please enter at least one keyword."
 
438
  if lang == "ko":
439
  progress(0.05, desc="์•„์ด๋””์–ด ์ƒ์„ฑ ์ค€๋น„ ์ค‘...")
440
  time.sleep(0.3)
 
443
  progress(0.05, desc="Preparing idea generation...")
444
  time.sleep(0.3)
445
  progress(0.1, desc="Generating creative idea...")
 
446
  results = generate_transformations_lang(text1, text2, text3, selected_category, categories_dict, lang)
 
447
  if lang == "ko":
448
  progress(0.8, desc="๊ฒฐ๊ณผ ํฌ๋งทํŒ… ์ค‘...")
449
  formatted = format_results_lang(results, lang)
 
474
  return "โš ๏ธ ํ™˜๊ฒฝ ๋ณ€์ˆ˜ GEMINI_API_KEY๊ฐ€ ์„ค์ •๋˜์ง€ ์•Š์•˜์Šต๋‹ˆ๋‹ค. Gemini API ํ‚ค๋ฅผ ์„ค์ •ํ•˜์„ธ์š”." if lang=="ko" else "โš ๏ธ The GEMINI_API_KEY environment variable is not set. Please set your Gemini API key."
475
  return ""
476
 
477
+ ##############################################################################
478
+ # Add "Business Ideas" category to each dictionary
479
+ ##############################################################################
480
+ physical_transformation_categories["๋น„์ฆˆ๋‹ˆ์Šค ์•„์ด๋””์–ด"] = [
481
+ "์‹œ์žฅ ์žฌ์ •์˜/์‹ ๊ทœ ์‹œ์žฅ ๊ฐœ์ฒ™",
482
+ "๋น„์ฆˆ๋‹ˆ์Šค ๋ชจ๋ธ ํ˜์‹ /๋””์ง€ํ„ธ ์ „ํ™˜",
483
+ "๊ณ ๊ฐ ๊ฒฝํ—˜ ํ˜์‹ /์„œ๋น„์Šค ํ˜์‹ ",
484
+ "ํ˜‘๋ ฅ ๋ฐ ํŒŒํŠธ๋„ˆ์‹ญ ๊ฐ•ํ™”/์ƒํƒœ๊ณ„ ๊ตฌ์ถ•",
485
+ "๊ธ€๋กœ๋ฒŒ ํ™•์žฅ/์ง€์—ญํ™” ์ „๋žต",
486
+ "์šด์˜ ํšจ์œจ์„ฑ ์ฆ๋Œ€/์›๊ฐ€ ์ ˆ๊ฐ",
487
+ "๋ธŒ๋žœ๋“œ ๋ฆฌํฌ์ง€์…”๋‹/์ด๋ฏธ์ง€ ์ „ํ™˜",
488
+ "์ง€์† ๊ฐ€๋Šฅํ•œ ์„ฑ์žฅ/์‚ฌํšŒ์  ๊ฐ€์น˜ ์ฐฝ์ถœ",
489
+ "๋ฐ์ดํ„ฐ ๊ธฐ๋ฐ˜ ์˜์‚ฌ๊ฒฐ์ •/AI ๋„์ž…",
490
+ "์‹ ๊ธฐ์ˆ  ์œตํ•ฉ/ํ˜์‹  ํˆฌ์ž"
491
+ ]
492
+
493
+ physical_transformation_categories_en["Business Ideas"] = [
494
+ "Market redefinition/new market creation",
495
+ "Business model innovation/digital transformation",
496
+ "Customer experience and service innovation",
497
+ "Enhanced partnerships and ecosystem building",
498
+ "Global expansion and localization strategy",
499
+ "Operational efficiency improvement/cost reduction",
500
+ "Brand repositioning/image transformation",
501
+ "Sustainable growth and social value creation",
502
+ "Data-driven decision making/AI adoption",
503
+ "Convergence of new technologies/innovative investments"
504
+ ]
505
+
506
+ ##############################################################################
507
+ # Helper function for caching examples in the English tab
508
+ ##############################################################################
509
+ def process_all_lang_example(text1, text2, text3, selected_category):
510
+ # ๊ณ ์ •๋œ state๊ฐ’(physical_transformation_categories_en, "en")์œผ๋กœ ํ˜ธ์ถœ
511
+ return process_all_lang(text1, text2, text3, selected_category, physical_transformation_categories_en, "en")
512
 
513
  ##############################################################################
514
  # Gradio UI with Two Tabs: English (Main Home) and Korean
 
517
  title="Idea Transformer",
518
  theme=gr.themes.Soft(primary_hue="teal", secondary_hue="slate", neutral_hue="neutral")
519
  ) as demo:
 
520
  gr.HTML("""
521
  <style>
522
  body {
 
559
  with gr.Tab(label="English"):
560
  gr.Markdown("# ๐Ÿš€ Idea Transformer")
561
  gr.Markdown("Based on up to **three keywords** and a **selected category**, this tool generates a creative transformation idea and a design image using the expanded idea as a prompt. https://discord.gg/openfreeai")
 
562
  warning_en = gr.Markdown(get_warning_message_lang("en"))
 
563
  with gr.Row():
564
  with gr.Column(scale=1):
565
  text_input1_en = gr.Textbox(label="Keyword 1 (required)", placeholder="e.g., Smartphone")
 
572
  info="Select a category."
573
  )
574
  status_msg_en = gr.Markdown("๐Ÿ’ก Click the 'Generate Idea' button to create an idea and design image based on the selected category.")
 
575
  processing_indicator_en = gr.HTML("""
576
  <div style="display: flex; justify-content: center; align-items: center; margin: 10px 0;">
577
  <div style="border: 5px solid #f3f3f3; border-top: 5px solid #3498db; border-radius: 50%; width: 30px; height: 30px; animation: spin 2s linear infinite;"></div>
 
584
  }
585
  </style>
586
  """, visible=False)
 
587
  submit_button_en = gr.Button("Generate Idea", variant="primary")
 
588
  with gr.Column(scale=2):
589
  idea_output_en = gr.Markdown(label="Idea Output")
590
  generated_image_en = gr.Image(label="Generated Design Image", type="pil")
 
591
  gr.Examples(
592
  examples=[
593
  ["Smartphone", "", "", "Sensor Functions"],
 
597
  ["Sneakers", "Wearable", "Health", "Structural Change"],
598
  ],
599
  inputs=[text_input1_en, text_input2_en, text_input3_en, category_radio_en],
600
+ fn=process_all_lang_example,
601
+ outputs=[idea_output_en, generated_image_en],
602
+ cache_examples=True
603
  )
 
604
  def show_processing_indicator_en():
605
  return gr.update(visible=True)
 
606
  def hide_processing_indicator_en():
607
  return gr.update(visible=False)
 
608
  submit_button_en.click(
609
  fn=show_processing_indicator_en,
610
  inputs=None,
 
618
  inputs=None,
619
  outputs=processing_indicator_en
620
  )
 
621
  with gr.Tab(label="ํ•œ๊ตญ์–ด"):
622
  gr.Markdown("# ๐Ÿš€ ์•„์ด๋””์–ด ํŠธ๋žœ์Šคํฌ๋จธ")
623
  gr.Markdown("์ž…๋ ฅํ•œ **ํ‚ค์›Œ๋“œ**(์ตœ๋Œ€ 3๊ฐœ)์™€ **์นดํ…Œ๊ณ ๋ฆฌ**๋ฅผ ๋ฐ”ํƒ•์œผ๋กœ, ์ฐฝ์˜์ ์ธ ๋ชจ๋ธ/์ปจ์…‰/ํ˜•์ƒ ๋ณ€ํ™” ์•„์ด๋””์–ด๋ฅผ ์ƒ์„ฑํ•˜๊ณ , ํ•ด๋‹น ํ™•์žฅ ์•„์ด๋””์–ด๋ฅผ ํ”„๋กฌํ”„ํŠธ๋กœ ํ•˜์—ฌ ๋””์ž์ธ ์ด๋ฏธ์ง€๋ฅผ ์ƒ์„ฑํ•ฉ๋‹ˆ๋‹ค. https://discord.gg/openfreeai")
 
624
  warning_ko = gr.Markdown(get_warning_message_lang("ko"))
 
625
  with gr.Row():
626
  with gr.Column(scale=1):
627
  text_input1_ko = gr.Textbox(label="ํ‚ค์›Œ๋“œ 1 (ํ•„์ˆ˜)", placeholder="์˜ˆ: ์Šค๋งˆํŠธํฐ")
 
634
  info="์ถœ๋ ฅํ•  ์นดํ…Œ๊ณ ๋ฆฌ๋ฅผ ์„ ํƒํ•˜์„ธ์š”."
635
  )
636
  status_msg_ko = gr.Markdown("๐Ÿ’ก '์•„์ด๋””์–ด ์ƒ์„ฑํ•˜๊ธฐ' ๋ฒ„ํŠผ์„ ํด๋ฆญํ•˜๋ฉด ์„ ํƒํ•œ ์นดํ…Œ๊ณ ๋ฆฌ์— ํ•ด๋‹นํ•˜๋Š” ์•„์ด๋””์–ด์™€ ๋””์ž์ธ ์ด๋ฏธ์ง€๊ฐ€ ์ƒ์„ฑ๋ฉ๋‹ˆ๋‹ค.")
 
637
  processing_indicator_ko = gr.HTML("""
638
  <div style="display: flex; justify-content: center; align-items: center; margin: 10px 0;">
639
  <div style="border: 5px solid #f3f3f3; border-top: 5px solid #3498db; border-radius: 50%; width: 30px; height: 30px; animation: spin 2s linear infinite;"></div>
 
646
  }
647
  </style>
648
  """, visible=False)
 
649
  submit_button_ko = gr.Button("์•„์ด๋””์–ด ์ƒ์„ฑํ•˜๊ธฐ", variant="primary")
 
650
  with gr.Column(scale=2):
651
  idea_output_ko = gr.Markdown(label="์•„์ด๋””์–ด ๊ฒฐ๊ณผ")
652
  generated_image_ko = gr.Image(label="์ƒ์„ฑ๋œ ๋””์ž์ธ ์ด๋ฏธ์ง€", type="pil")
 
653
  gr.Examples(
654
  examples=[
655
  ["์Šค๋งˆํŠธํฐ", "", "", "์„ผ์„œ ๊ธฐ๋Šฅ"],
 
658
  ["๋“œ๋ก ", "์ธ๊ณต์ง€๋Šฅ", "", "๋ฌผ์งˆ์˜ ์ƒํƒœ ๋ณ€ํ™”"],
659
  ["์šด๋™ํ™”", "์›จ์–ด๋Ÿฌ๋ธ”", "๊ฑด๊ฐ•", "๊ตฌ์กฐ์  ๋ณ€ํ™”"],
660
  ],
661
+ inputs=[text_input1_ko, text_input2_ko, text_input3_ko, category_radio_ko]
662
  )
 
663
  def show_processing_indicator_ko():
664
  return gr.update(visible=True)
 
665
  def hide_processing_indicator_ko():
666
  return gr.update(visible=False)
 
667
  submit_button_ko.click(
668
  fn=show_processing_indicator_ko,
669
  inputs=None,