Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -130,11 +130,18 @@ def image_to_3d(trial_id: str, seed: int, randomize_seed: bool, ss_guidance_stre
|
|
| 130 |
|
| 131 |
@spaces.GPU
|
| 132 |
def generate_image_from_text(prompt, height, width, guidance_scale, num_steps):
|
|
|
|
|
|
|
|
|
|
|
|
|
| 133 |
translated_prompt = translate_if_korean(prompt)
|
| 134 |
|
|
|
|
|
|
|
|
|
|
| 135 |
with torch.inference_mode():
|
| 136 |
image = flux_pipe(
|
| 137 |
-
prompt=[
|
| 138 |
height=height,
|
| 139 |
width=width,
|
| 140 |
guidance_scale=guidance_scale,
|
|
|
|
| 130 |
|
| 131 |
@spaces.GPU
|
| 132 |
def generate_image_from_text(prompt, height, width, guidance_scale, num_steps):
|
| 133 |
+
# 기본 프롬프트를 추가
|
| 134 |
+
base_prompt = "wbgmsst, 3D, white background"
|
| 135 |
+
|
| 136 |
+
# 사용자 프롬프트를 번역 (한국어인 경우)
|
| 137 |
translated_prompt = translate_if_korean(prompt)
|
| 138 |
|
| 139 |
+
# 최종 프롬프트 조합
|
| 140 |
+
final_prompt = f"{translated_prompt}, {base_prompt}"
|
| 141 |
+
|
| 142 |
with torch.inference_mode():
|
| 143 |
image = flux_pipe(
|
| 144 |
+
prompt=[final_prompt],
|
| 145 |
height=height,
|
| 146 |
width=width,
|
| 147 |
guidance_scale=guidance_scale,
|