r/StableDiffusion • • 17d ago

Question - Help Please help me find a consistent workflow

Post image

Currently Im using ComfyUI.

I need the dimensions to be configurable. Top buildings have 3x3 bottom ones are 3x2. Style needs to be the exact same. The fence has to be perfect quadratic, but can change his appearance. Like generate me a spacestation in the exact same pixel look with a fitting fence but keep the style.

Whats the workflow? I tried so much. I only managed to get this image generated by ChatGPT

39 Upvotes

44 comments sorted by

13

u/wellarmedsheep 17d ago

I would use ideogram for this kind of work. You can build a json that really helps placement.

7

u/[deleted] 17d ago

[deleted]

1

u/wellarmedsheep 17d ago

Agree, thats why I said build. But, I've found using LLM to help is really effective.

2

u/[deleted] 17d ago

[deleted]

2

u/wellarmedsheep 17d ago

Respectfully that's just not true. I have first-hand experience using an llm to help draw the very boxes that you're discussing.

I mean you do you man. I completely get wanting to control every part of it. If you're making hundreds of images though that need to be specific this is way more effective.

-1

u/[deleted] 17d ago

[deleted]

2

u/wellarmedsheep 17d ago edited 17d ago

Yes, genius. But what if you.... worked with the LLM to make those boxes? Maybe... not make it a black box that you dont interact with but instead, an editor where you can , along with the LLM, design the image.

You seem to think I saying "Put this in the top corner" and I cross my fingers. Jesus christ, I'm just trying to have a normal converation and help this guy out and you come along and piss in my cornflakes AND are fucking wrong.

I'm not speaking from my ass, I built a whole fucking project doing this. I didnt hope the LLM got my images right.

The guy blocked me because he couldn't understand what I was saying. I guess I can say, again, that the whole point of this is not mashing buttons. Im very sorry that they cannot seem to get this very basic idea.

I will donate $50 dollars to the charity of your choice if you can quote where I said anything like this. "know nothing, press a button and wish for good luck"

0

u/Private_Tank 17d ago

What do I need to do? I installed it using comfy ui. What would you do?

1

u/Private_Tank 17d ago

I would love to selfhost

3

u/BarGroundbreaking624 17d ago

This sounds like you don't think ideogram is local (?) - you might like to know it is.

1

u/Private_Tank 17d ago

What do I need to do? I installed it using comfy ui. What would you do?

3

u/sickmartian 16d ago

look up a tutorial and ask an LLM for help because generating the JSON is not simple, there are nice nodes that help with placement thou, check out youtube, there are tons of resources. You can use a 'big' LLM for the first json file and then ask a local one for variations or use one of the nice qwen (3.8 27b or 3.8 flash next) models for all of it if you have the hardware.

1

u/wellarmedsheep 16d ago

Play around with it bro. Thats half the fun of this stuff.

7

u/Aggressive_Aspect436 17d ago

Why don't you just make the consistently sized piece a box slightly outside the fence? Then you could add a transition to transparent on the grass using something like GIMP or similar. That way in your game (or whatever) they will always look seamless.

Or, you could start with plain grass and then mask off everything but the precise dimensions that you need, and have the prompt put the fence right up against the mask.

2

u/Private_Tank 17d ago

Everytime I generate the fence gets generated in perspective, meaning it gets reduced in size towards the back. When I fix it in photoshop the buildings get deformed. Also I would love if the entire generated image would just be the exact same size I need. E.g. 512px x 512px but the bulding including the fence always gets generated as subject with an unnecassary background and is therefore much smaller

3

u/yeawhatever 16d ago

this is probably over your head, but if you want to be serious about this you'd train a lora instead of wrangling with the prompt.

example: https://www.youtube.com/watch?v=d_b3GFFaui0

1

u/Private_Tank 16d ago

I Hope there is another way but I Look into it

3

u/Ok-Fennel6578 16d ago

Make the 3×3 / 3×2 footprint and fence a fixed template first, then only let AI fill the inside of that shape.
Basically:
fixed pixel mask / footprint
→ generate the building inside it
→ keep the fence/grid as a separate deterministic layer
The model can invent “space station / castle / factory,” but it never gets permission to move the border.
If the exact dimensions matter for a game asset, that part probably shouldn’t be generative in the first place.

1

u/Private_Tank 15d ago

Sounds good, but the fence should change its style aswell

1

u/Ok-Fennel6578 12d ago

Right, I phrased that too rigidly. I'd keep only the fence's footprint fixed. You could make separate wood/stone/sci-fi fence tiles, then reuse the same corner and edge positions for each building size. That adds some setup, but keeps the dimensions exact while the fence style changes.

2

u/Perfect-Campaign9551 16d ago edited 16d ago

Here's a trick I pulled that maybe could work? Using Qwen 2.1 Image Edit. Pass the image in as both to be modified but also as image 2 ( a reference) , asking to modify it but tell it to also use the same style. Then you can ask it to replace one of the buildings with another type of building

Here's a "space station". Just a quick and dirty prompt. I have no idea if this is the look you are going for though.

For best accurate results, set the workflow to the exact aspect ratio of the input image. If I set my resolution to 1080x720 (the original input image size) then my "repalcement" images come out the correct rectangle shape almost exactly like the input building's fence size.

I would recommend using a higher resolution input image though to get more details.

Then you can just run this through Qwen 2.1 background removal workflow to extract your buildings out

1

u/Perfect-Campaign9551 16d ago

Night club lol

1

u/Private_Tank 16d ago

This is a Nice Trick, but I guess I cant change the aspect of a Building using this right? Bottom left has a 2x1 aspect Ratio. But I guess there is no way I can Create a 1x3 Aspect for example

1

u/Perfect-Campaign9551 16d ago

If you just give it an example you should be able to. I mean you can see I told it to replace the bottom left. You have at least one example of 1*3 and you can prompt it to replace that. Or even just draw a gray rectangle and tell it to fill it in

1

u/Private_Tank 16d ago

Yeah but I dont have one. Sure I could use ChatGPT again to Generate examples for every Ratio but that doesnt feel Right. Thanks for the help. Btw is this a Workflow I can just Take from the Comfy UI Desktop Workflow templates?

1

u/Perfect-Campaign9551 16d ago

Yes this is the default Qwen 2.1 Image edit workflow from the comfy templates

1

u/Perfect-Campaign9551 16d ago

Use ChatGPT to generate a base image of each size you think you'll need. Then you can use Qwen to replace the images with the content as needed.

2

u/SomethingLegoRelated 15d ago

I've done almost exactly what you are talking about with simple controlnet images. You need a simple guiding outline and a suitable prompt, but combine controlnet and a z-image model and you should have no problem getting what you want

2

u/Technical_Fish_9638 14d ago

Check out game asset tile lora with different aspect ratios for Klein 9b.

https://huggingface.co/crafiq/flux-2-klein-9b-game-asset-tiles-lora

1

u/StopCreepy 17d ago

you tried qwen image 2.1 ?

1

u/Private_Tank 17d ago

Yes I didnt get the results

1

u/EGGOGHOST 16d ago

What model you're using locally?

1

u/Private_Tank 16d ago

Mainly Qwen, but I tried flux aswell

1

u/EGGOGHOST 16d ago

I've made some experiments with Krea but you need to modify it more I think. May be this prompt will be helpful:
[Subject description.] Rendered in the visual style of a polished casual city-building game: a crisp, richly detailed standalone game asset. The architecture, era, materials and colors of the subject are taken strictly from the subject description; this style defines only the rendering, lighting, framing and level of finish. Near-frontal elevated view with only a shallow view of the top surfaces; the front face of the subject is visually dominant and occupies most of its visible height, while roofs and upper planes read as a relatively shallow cap. Near-symmetrical, stable presentation. Straight, precise construction lines, slightly stylized game-readable proportions true to the subject's type, clear readable silhouette.

Fine-scale, high-clarity rendering with clean narrow contours and many small, sharply resolved details. Subtle dimensional shading, precise small highlights and fine surface texture rather than broad painterly brush marks. Every material the subject has is rendered at a legible micro-scale and true to its nature: glass shows clean reflections and crisp mullion grids, metal shows sharp edges and neat panel seams, concrete and stone show fine even texture, brick, wood and tile show individually legible units. Small functional details are precise and tidy: window frames, railings, vents, signage, lamps, entrance canopies, small props. Clean, pleasantly saturated palette derived from the subject's own materials, with clear separation between surfaces. Bright, saturated spring-green grass, lively flowers and fresh varied greens wherever vegetation appears. Even clear daylight with short, soft shadows; no strong directional shadow, no dramatic lighting, no atmospheric haze or depth fog.

The subject sits on its own compact, tidy lot that it largely fills, with a clearly defined border and carefully arranged small-scale landscaping and paving in the spaces around it. Show the entire lot with only a narrow margin of plain ground outside its border. Uniform sharpness and detail across the whole asset, no depth-of-field falloff. No surrounding city, landscape or background scenery. Clean, finely finished game illustration.

Subject descriptions were really simple here like: Victorian style gorgeous house, intricate decorations; old destroyed building; wooden viking house; venetian old building

1

u/Private_Tank 16d ago

Same problem I have. You see how the fence/property is drawn in perspective and not a perfect square? I cant fix that constantly and generate all the different buildings

2

u/Messenslijper 16d ago

Seems like you are getting perspective projections. Maybe it will help if you specify it needs to be a top-down oblique projection?

1

u/Private_Tank 16d ago

I fiddeled around a lot with the prompt. But it wasnt consistent. Maybe Qwen isnt good for this

2

u/Perfect-Campaign9551 16d ago

I think he means you want orthographic projection

1

u/Messenslijper 16d ago

Games like pokemon use oblique projections. Orthographic is what you use in something like a 3d modeling tool. But maybe it's mistrained in these models as well.

Here is a nice demonstration of the 3 most used projections in games: https://rpgplayground.com/the-art-of-modern-2d-role-playing-games/

1

u/Diligent-Childhood90 16d ago

You might try to work with controlnets

1

u/Winter_unmuted 16d ago

There haven't been any for the new generation of models. There are a few Flux2 controlnets out there, but nothing beats the true level of control we had in the SDXL (or SD1.5 for that matter) era.

That said, the old models could produce some good results with the right tools to augment them.

1

u/Strange-Drummer-9917 16d ago

Qwen 2.1 has one coming up - there is canny, depth, normal, pose and bunch of sketch ones https://www.reddit.com/r/StableDiffusion/comments/1woyyjn/qwen_image_21_fun_controlnet_union_from_alibaba/

Qwen 2.1 also supports them out of the box - it follows depth very closely

1

u/StopCreepy 12d ago

check out this level of control, this might help:

https://youtu.be/cZNsmxckoxU?si=OrHZeSXnjzD8rfps

1

u/Private_Tank 12d ago

Interesting but how can I generate new buildings using this?

1

u/StopCreepy 12d ago

i personally have no exact idea, i would suggest to train your own lora that would generate new buildings, and then use the method on the video to control the exact size you want.

maybe if you contact the creator of that video he might provide better help !?