Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: 109 isometric building workflow #156

Merged
merged 59 commits into from
Jun 7, 2024

Conversation

TheLLspectre
Copy link
Contributor

Adding isometric workflow:
Main features:

  • Select Base and also custom base

  • select model

  • define and select prompt to generate assets

  • Select generated asset to convert as sprite, as a tile to tile palette, customize in webapp

  • Regenerate an inference

  • Restart workflow

  • closes: Isometric Building Workflow #109

Morgan-6Freedom and others added 22 commits February 15, 2024 16:16
to cache the models & thumbnails
Add convert tile.
Add convert sprite.
Add independant behaviour on each inference.
Tile Creator Generic
Manage some errors
Inactive button when any image is selected.
Icons were unavailable at the launching of unity, so we need to wait the disponibility of the asset.
/// </summary>
/// <param name="_texture"></param>
/// <param name="_onAction"></param>
public static void DlAsTexture(Texture2D _texture, Action _onAction)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I prefer full wording "DownloadAsTexture" + it miss the summary

/// <param name="_texture"></param>
/// <param name="_selectedImageId"></param>
/// <param name="_onAction"></param>
public static void DlAsSprite(Texture2D _texture, string _selectedImageId, Action _onSuccessAction, Action _onDownloadingAction)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same as "DlAsTexture"

@@ -162,5 +163,91 @@ public static Texture2D GetTextureByImageId(string _id)
return imageData.texture;
}

/// <summary>
///
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it miss the summary here

}

/// <summary>
/// Call the prompt window to generate one image per asset in the assetlist
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's not one image, but 4. the comment is incorrect

string tempName = assetName;
bool useBaseTexture = baseTexture != null;
string modelName = settings.isometricModels.Find(x => x.style == selectedModel).modelData.name;
PromptWindow.GenerateImage(modelName, useBaseTexture, useBaseTexture, useBaseTexture ? baseTexture : null, 4, $"isometric, solo, centered, solid color background, {selectedTheme}, {assetName}", 30, 1024, 1024, 6, "-1", useBaseTexture, 0.8f,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should make the prompt value "isometric, solo, centered, solid color background" as a variable so we can change it easily

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now it's fix in a variable and that's mean in the futur we can have a custom prompt on it ?

@@ -9,6 +9,14 @@ namespace Scenario.Editor
{
public class TileCreator
{
#region Public Fields

public static TileCreator instance = null;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you call this variable "Instance" with a capitalized i ?

@@ -1,3 +1,4 @@
using Codice.CM.Common;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is this namespace for ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My visual loves to add namespace ......

{
promptinputText = SerializeTags(tags);
negativepromptinputText = SerializeTags(negativeTags);

EditorPrefs.SetString("postedModelName", DataCache.instance.SelectedModelId);

PromptFetcher.IsWorkflow = false;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is this used for ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's probably an anticipation to workflows and futur one. This is used to say "It's workflow" so i have mutliple windows with a specific behaviour and with that we can avoid classic behaviours, like to the isometric workflow --> openning the Image window when generate inference, thanks to that we avoiding the Image Window because we have inference directly inside the isometric workflow.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you change the name accordingly ? Something like "silentFetch" or "silenceMode" or something in this flavor ?

{
if (string.IsNullOrEmpty(teamIdKey))
{
teamIdKey = EditorPrefs.GetString("TeamIdKey");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you save the string in "scenario/teamIdKey" like the other editor prefs plz ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh ! I miss this !

Copy link
Contributor Author

@TheLLspectre TheLLspectre Mar 15, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you save the string in "scenario/teamIdKey" like the other editor prefs plz ?

That mean I changed other one ??

image

Copy link
Contributor

@Morgan-6Freedom Morgan-6Freedom Mar 15, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you do it, it will break for everyone, everywhere. So I'm not a big fan of deleting saved settings of the users.
=> Don't change the old ones.

@qvaleroo
Copy link
Collaborator

We should not need the user to fill Workspace ID in settings. If you want the ID, you can have it with /teams endpoint
image

@qvaleroo
Copy link
Collaborator

Is it possible to center the text and icon for custom isometric choice?
image

@qvaleroo
Copy link
Collaborator

Some icons are empty
image

@qvaleroo
Copy link
Collaborator

image Maybe replace "This consume Credits" by the actual cost value. You can obtain it sending the request with parameter dryRun = true (check with frontend team or backend team if help is needed)

@qvaleroo
Copy link
Collaborator

We should also handle Parallel inferences limit. Creator plan is limited to 5 inferences in // for example but I can send more than 5 ifnerences.
You should queue the request when receiving a 429 error, and relaunch it once a request is finished for example.
You have the max number of allowed parallel inferences using /team/{teamId}/limits endpoint

image

@TheLLspectre
Copy link
Contributor Author

Some icons are empty image

Some models are not available on download, when you're not on isometric workspace :/

@qvaleroo qvaleroo merged commit 7851fec into develop Jun 7, 2024
1 check passed
@qvaleroo qvaleroo deleted the 109-isometric-building-workflow branch June 7, 2024 09:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants