cocoat commited on
Commit
8617d28
·
verified ·
1 Parent(s): dc02229

履歴の修正。

Browse files
Files changed (1) hide show
  1. app.py +2 -6
app.py CHANGED
@@ -82,7 +82,7 @@ def upload_image_to_hub(image_pil, prompt_text):
82
  # 通常、画像保存には "dataset" タイプのリポジトリが適しています
83
  )
84
  # アップロードされたファイルのURLを構築する
85
- uploaded_file_url = f"https://huggingface.co/datasets/{HF_REPO_ID}/blob/main/{path_in_repo}"
86
  print(f"Uploaded {filepath} to {uploaded_file_url}")
87
  return uploaded_file_url # 構築したURLを返す
88
  except Exception as e:
@@ -151,11 +151,7 @@ def infer(prompt, neg, seed, rand, w, h, cfg, steps, scheduler_type,
151
  f"Steps: {steps}\n"
152
  f"Scheduler: {scheduler_type}"
153
  )
154
- uploaded_image_url = upload_image_to_hub(img, prompt)
155
- if uploaded_image_url:
156
- history.insert(0, (uploaded_image_url, caption_text))
157
- else:
158
- history.insert(0, (create_dummy_image(alpha=0), "failed"))
159
 
160
  history_max_items = 10
161
  if len(history) > history_max_items:
 
82
  # 通常、画像保存には "dataset" タイプのリポジトリが適しています
83
  )
84
  # アップロードされたファイルのURLを構築する
85
+ uploaded_file_url = f"https://huggingface.co/datasets/{HF_REPO_ID}/resolve/main/{path_in_repo}"
86
  print(f"Uploaded {filepath} to {uploaded_file_url}")
87
  return uploaded_file_url # 構築したURLを返す
88
  except Exception as e:
 
151
  f"Steps: {steps}\n"
152
  f"Scheduler: {scheduler_type}"
153
  )
154
+ history.insert(0, (img, caption_text))
 
 
 
 
155
 
156
  history_max_items = 10
157
  if len(history) > history_max_items: