Free, open-source 3D sculpting for Linux, macOS and Windows: dense meshes, remeshing, painting, built-in AI (image/text to 3D), Send to Unreal, game-ready LODs, Gaussian splats and OpenUSD.
C++ 3d3d-sculptingcppdear-imguidigital-sculptingfbxgame-developmentgaussian-splattinggltfimage-to-3dmcpopenglopenusdsculptingtext-to-3dunreal-engine
Generate 3D: TRELLIS.2 (MIT) is the default Hugging Face model; picking a Hunyuan3D model shows its licence's territory note
islandmeda041a5110268
diff --git a/docs/guide/generate-3d.md b/docs/guide/generate-3d.mdindex 3f58eca0..77aefb98 100644--- a/docs/guide/generate-3d.md+++ b/docs/guide/generate-3d.md@@ -91,10 +91,14 @@ This runs each model author's own public demo on Hugging Face's shared ZeroGPU h| Model | Notes ||---|---|-| Hunyuan3D 2.1 (Tencent) | The default. Detailed shapes, about 20 seconds |-| TRELLIS.2 (Microsoft) | The most detail. Needs a Hugging Face token |+| TRELLIS.2 (Microsoft) | The default. The most detail, MIT licence. Needs a free Hugging Face token |+| Hunyuan3D 2.1 (Tencent) | Detailed shapes, about 20 seconds, no token needed || Hunyuan3D 2 mini Turbo (Tencent) | The fastest, about 6 seconds || Hunyuan3D 2 (Tencent) | |++The Hunyuan3D models' licence doesn't cover use in the European Union, the United Kingdom or South Korea; the+panel says so when one is picked. See [AI services](https://github.com/islandmed/SculptForge/blob/main/docs/ai-services.md)+for each model's licence.| Stable Fast 3D (Stability AI) | Quick and simple, removes the background itself |GPU time is rationed per person per day, there can be a queue at busy times, and a demo can be paused ordiff --git a/src/ai/BrushAssistant.h b/src/ai/BrushAssistant.hindex 55908c42..01c2aa2c 100644--- a/src/ai/BrushAssistant.h+++ b/src/ai/BrushAssistant.h@@ -29,7 +29,7 @@ struct AiSettings {// {input}/{output}) or "inflate" (offline).std::string generatorService = "huggingface";std::string hfToken; // empty = HF_TOKEN from the environment (optional; raises the free quota)- std::string hfModel = "hunyuan3d-2.1";+ std::string hfModel = "trellis-2"; // MIT; the default (hfPresets()[0])std::string generatorCommand;std::string falKey; // empty = FAL_KEY from the environmentstd::string falModel = "fal-ai/trellis-2";diff --git a/src/ai/ImageTo3DService.cpp b/src/ai/ImageTo3DService.cppindex 789886e5..d8eb1254 100644--- a/src/ai/ImageTo3DService.cpp+++ b/src/ai/ImageTo3DService.cpp@@ -364,6 +364,19 @@ const std::vector<ServiceModel>& falModels() {return models;}+bool hunyuanModel(std::string_view id) {+ for (size_t i = 0; i + 7 <= id.size(); ++i) {+ std::string word(id.substr(i, 7));+ for (auto& c : word) c = char(std::tolower(static_cast<unsigned char>(c)));+ if (word == "hunyuan") return true;+ }+ return false;+}++const char* kHunyuanLicenceNote =+ "Hunyuan3D's licence (Tencent Hunyuan Community License) doesn't cover use in the European Union, the United "+ "Kingdom or South Korea. There, pick TRELLIS.2 or another model.";+std::string base64Encode(const uint8_t* data, size_t size) {static const char* chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";std::string out;@@ -415,10 +428,11 @@ const std::vector<HfPreset>& hfTextPresets() {const std::vector<HfPreset>& hfPresets() {static const std::vector<HfPreset> presets = {+ // TRELLIS.2 first: the default, under the MIT licence.+ {"trellis-2", "TRELLIS.2 (Microsoft, MIT) - free, best detail, needs an HF token", "https://microsoft-trellis-2.hf.space",+ {{"start_session", {}}, {"preprocess_image", {"$IMG"}}, {"image_to_3d", {"$OUT1"}}, {"extract_glb", {}}}},{"hunyuan3d-2.1", "Hunyuan3D 2.1 (Tencent) - free, detailed shape", "https://tencent-hunyuan3d-2-1.hf.space",{{"shape_generation", {"$IMG"}}}},- {"trellis-2", "TRELLIS.2 (Microsoft) - free, best detail, needs an HF token", "https://microsoft-trellis-2.hf.space",- {{"start_session", {}}, {"preprocess_image", {"$IMG"}}, {"image_to_3d", {"$OUT1"}}, {"extract_glb", {}}}},{"hunyuan3d-2-turbo", "Hunyuan3D 2 mini Turbo (Tencent) - free, fastest", "https://tencent-hunyuan3d-2mini-turbo.hf.space",{{"shape_generation", {"\"\"", "$IMG"}}}},{"hunyuan3d-2", "Hunyuan3D 2 (Tencent) - free", "https://tencent-hunyuan3d-2.hf.space",diff --git a/src/ai/ImageTo3DService.h b/src/ai/ImageTo3DService.hindex 5ee60429..fa1f46c0 100644--- a/src/ai/ImageTo3DService.h+++ b/src/ai/ImageTo3DService.h@@ -23,6 +23,7 @@#include <atomic>#include <mutex>#include <string>+#include <string_view>#include <vector>namespace sf::ai {@@ -64,6 +65,9 @@ struct HfPreset {std::vector<HfStep> steps;};const std::vector<HfPreset>& hfPresets();+// A Hunyuan3D model (Hugging Face preset or fal.ai id): its licence's territory note is shown where it's chosen.+bool hunyuanModel(std::string_view id);+extern const char* kHunyuanLicenceNote;// Free text-to-3D models ("$PROMPT" in step args is the description).const std::vector<HfPreset>& hfTextPresets();diff --git a/src/app/App.cpp b/src/app/App.cppindex 8331c061..172b7788 100644--- a/src/app/App.cpp+++ b/src/app/App.cpp@@ -2832,6 +2832,7 @@ void App::drawImageTo3D() {if (ImGui::Selectable(p.label, aiSettings_.hfModel == p.id)) aiSettings_.hfModel = p.id;ImGui::EndCombo();}+ if (ai::hunyuanModel(aiSettings_.hfModel)) hint(ai::kHunyuanLicenceNote);ImGui::InputText("HF token", hfToken_, sizeof hfToken_, ImGuiInputTextFlags_Password);hint(hfToken_[0] || std::getenv("HF_TOKEN")? "Runs on Hugging Face's shared GPUs with your account's free daily allowance."@@ -2849,6 +2850,7 @@ void App::drawImageTo3D() {ImGui::EndCombo();}ImGui::InputText("Model id", falModel_, sizeof falModel_);+ if (ai::hunyuanModel(falModel_)) hint(ai::kHunyuanLicenceNote);ImGui::InputText("API key", falKey_, sizeof falKey_, ImGuiInputTextFlags_Password);if (!falKey_[0]) hint(std::getenv("FAL_KEY") ? "Using FAL_KEY from the environment." : "Get a key at fal.ai/dashboard/keys");} else if (serviceId == "meshy") {diff --git a/tests/test_core.cpp b/tests/test_core.cppindex 365a4b62..3ecd4d2f 100644--- a/tests/test_core.cpp+++ b/tests/test_core.cpp@@ -1344,10 +1344,12 @@ TEST(free_huggingface_models) {CHECK(wellFormed && usesImage);ai::AiSettings defaults;CHECK(defaults.generatorService == "huggingface" && defaults.hfModel == presets[0].id);- defaults.hfModel = "trellis-2";+ CHECK(defaults.hfModel == "trellis-2"); // MIT, the default; Hunyuan3D carries its licence note+ CHECK(!ai::hunyuanModel(defaults.hfModel) && ai::hunyuanModel("hunyuan3d-2.1") && ai::hunyuanModel("fal-ai/hunyuan-3d/v3.1/pro/image-to-3d"));+ defaults.hfModel = "hunyuan3d-2.1";defaults.hfToken = "hf_test";ai::AiSettings loaded = ai::AiSettings::fromJson(defaults.toJson());- CHECK(loaded.hfModel == "trellis-2" && loaded.resolvedHfToken() == "hf_test");+ CHECK(loaded.hfModel == "hunyuan3d-2.1" && loaded.resolvedHfToken() == "hf_test");CHECK(ai::friendlyGradioError("You have exceeded your ZeroGPU quota (120s requested vs. 0s left).").find("free GPU time") !=std::string::npos);CHECK(ai::friendlyGradioError("some other failure") == "some other failure");